The Puggening: Update from Jade to Pug

1.) module dependency updated from jade 1.11.0 to pug 2.0.0-beta3
2.) All references to Jade have been changed to Pug
3.) /srv/web/jade.js is renamed to pug.js
4.) all template files renamed accordingly
5.) "mixin somename" is automatically considered a declaration, invocations must use "+somename"
6.) variable interpolation is no longer supported inside element attributes, use direct references and string concatenation instead.
7.) bumped minor version
This commit is contained in:
Xaekai 2016-07-07 01:11:56 -07:00
parent f75d40d278
commit df5c5cd54f
31 changed files with 233 additions and 233 deletions

View file

@ -2,7 +2,7 @@
"author": "Calvin Montgomery", "author": "Calvin Montgomery",
"name": "CyTube", "name": "CyTube",
"description": "Online media synchronizer and chat", "description": "Online media synchronizer and chat",
"version": "3.17.5", "version": "3.18.0",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },
@ -25,13 +25,13 @@
"express-minify": "^0.1.6", "express-minify": "^0.1.6",
"graceful-fs": "^4.1.2", "graceful-fs": "^4.1.2",
"http-errors": "^1.3.1", "http-errors": "^1.3.1",
"jade": "^1.11.0",
"json-typecheck": "^0.1.3", "json-typecheck": "^0.1.3",
"lodash": "^4.13.1", "lodash": "^4.13.1",
"morgan": "^1.6.1", "morgan": "^1.6.1",
"mysql": "^2.9.0", "mysql": "^2.9.0",
"nodemailer": "^1.4.0", "nodemailer": "^1.4.0",
"oauth": "^0.9.12", "oauth": "^0.9.12",
"pug": "^2.0.0-beta3",
"q": "^1.4.1", "q": "^1.4.1",
"redis": "^2.4.2", "redis": "^2.4.2",
"sanitize-html": "git://github.com/calzoneman/sanitize-html", "sanitize-html": "git://github.com/calzoneman/sanitize-html",

View file

@ -5,7 +5,7 @@
*/ */
var webserver = require("./webserver"); var webserver = require("./webserver");
var sendJade = require("./jade").sendJade; var sendPug = require("./pug").sendPug;
var Logger = require("../logger"); var Logger = require("../logger");
var db = require("../database"); var db = require("../database");
var $util = require("../utilities"); var $util = require("../utilities");
@ -22,7 +22,7 @@ function handleAccountEditPage(req, res) {
return; return;
} }
sendJade(res, "account-edit", {}); sendPug(res, "account-edit", {});
} }
/** /**
@ -61,14 +61,14 @@ function handleChangePassword(req, res) {
} }
if (newpassword.length === 0) { if (newpassword.length === 0) {
sendJade(res, "account-edit", { sendPug(res, "account-edit", {
errorMessage: "New password must not be empty" errorMessage: "New password must not be empty"
}); });
return; return;
} }
if (!req.user) { if (!req.user) {
sendJade(res, "account-edit", { sendPug(res, "account-edit", {
errorMessage: "You must be logged in to change your password" errorMessage: "You must be logged in to change your password"
}); });
return; return;
@ -78,7 +78,7 @@ function handleChangePassword(req, res) {
db.users.verifyLogin(name, oldpassword, function (err, user) { db.users.verifyLogin(name, oldpassword, function (err, user) {
if (err) { if (err) {
sendJade(res, "account-edit", { sendPug(res, "account-edit", {
errorMessage: err errorMessage: err
}); });
return; return;
@ -86,7 +86,7 @@ function handleChangePassword(req, res) {
db.users.setPassword(name, newpassword, function (err, dbres) { db.users.setPassword(name, newpassword, function (err, dbres) {
if (err) { if (err) {
sendJade(res, "account-edit", { sendPug(res, "account-edit", {
errorMessage: err errorMessage: err
}); });
return; return;
@ -97,7 +97,7 @@ function handleChangePassword(req, res) {
db.users.getUser(name, function (err, user) { db.users.getUser(name, function (err, user) {
if (err) { if (err) {
return sendJade(res, "account-edit", { return sendPug(res, "account-edit", {
errorMessage: err errorMessage: err
}); });
} }
@ -106,7 +106,7 @@ function handleChangePassword(req, res) {
var expiration = new Date(parseInt(req.signedCookies.auth.split(":")[1])); var expiration = new Date(parseInt(req.signedCookies.auth.split(":")[1]));
session.genSession(user, expiration, function (err, auth) { session.genSession(user, expiration, function (err, auth) {
if (err) { if (err) {
return sendJade(res, "account-edit", { return sendPug(res, "account-edit", {
errorMessage: err errorMessage: err
}); });
} }
@ -126,7 +126,7 @@ function handleChangePassword(req, res) {
}); });
} }
sendJade(res, "account-edit", { sendPug(res, "account-edit", {
successMessage: "Password changed." successMessage: "Password changed."
}); });
}); });
@ -151,7 +151,7 @@ function handleChangeEmail(req, res) {
} }
if (!$util.isValidEmail(email) && email !== "") { if (!$util.isValidEmail(email) && email !== "") {
sendJade(res, "account-edit", { sendPug(res, "account-edit", {
errorMessage: "Invalid email address" errorMessage: "Invalid email address"
}); });
return; return;
@ -159,7 +159,7 @@ function handleChangeEmail(req, res) {
db.users.verifyLogin(name, password, function (err, user) { db.users.verifyLogin(name, password, function (err, user) {
if (err) { if (err) {
sendJade(res, "account-edit", { sendPug(res, "account-edit", {
errorMessage: err errorMessage: err
}); });
return; return;
@ -167,7 +167,7 @@ function handleChangeEmail(req, res) {
db.users.setEmail(name, email, function (err, dbres) { db.users.setEmail(name, email, function (err, dbres) {
if (err) { if (err) {
sendJade(res, "account-edit", { sendPug(res, "account-edit", {
errorMessage: err errorMessage: err
}); });
return; return;
@ -175,7 +175,7 @@ function handleChangeEmail(req, res) {
Logger.eventlog.log("[account] " + req.realIP + Logger.eventlog.log("[account] " + req.realIP +
" changed email for " + name + " changed email for " + name +
" to " + email); " to " + email);
sendJade(res, "account-edit", { sendPug(res, "account-edit", {
successMessage: "Email address changed." successMessage: "Email address changed."
}); });
}); });
@ -191,13 +191,13 @@ function handleAccountChannelPage(req, res) {
} }
if (!req.user) { if (!req.user) {
return sendJade(res, "account-channels", { return sendPug(res, "account-channels", {
channels: [] channels: []
}); });
} }
db.channels.listUserChannels(req.user.name, function (err, channels) { db.channels.listUserChannels(req.user.name, function (err, channels) {
sendJade(res, "account-channels", { sendPug(res, "account-channels", {
channels: channels channels: channels
}); });
}); });
@ -235,14 +235,14 @@ function handleNewChannel(req, res) {
} }
if (!req.user) { if (!req.user) {
return sendJade(res, "account-channels", { return sendPug(res, "account-channels", {
channels: [] channels: []
}); });
} }
db.channels.listUserChannels(req.user.name, function (err, channels) { db.channels.listUserChannels(req.user.name, function (err, channels) {
if (err) { if (err) {
sendJade(res, "account-channels", { sendPug(res, "account-channels", {
channels: [], channels: [],
newChannelError: err newChannelError: err
}); });
@ -250,7 +250,7 @@ function handleNewChannel(req, res) {
} }
if (name.match(Config.get("reserved-names.channels"))) { if (name.match(Config.get("reserved-names.channels"))) {
sendJade(res, "account-channels", { sendPug(res, "account-channels", {
channels: channels, channels: channels,
newChannelError: "That channel name is reserved" newChannelError: "That channel name is reserved"
}); });
@ -259,7 +259,7 @@ function handleNewChannel(req, res) {
if (channels.length >= Config.get("max-channels-per-user") && if (channels.length >= Config.get("max-channels-per-user") &&
req.user.global_rank < 255) { req.user.global_rank < 255) {
sendJade(res, "account-channels", { sendPug(res, "account-channels", {
channels: channels, channels: channels,
newChannelError: "You are not allowed to register more than " + newChannelError: "You are not allowed to register more than " +
Config.get("max-channels-per-user") + " channels." Config.get("max-channels-per-user") + " channels."
@ -290,7 +290,7 @@ function handleNewChannel(req, res) {
} }
sendJade(res, "account-channels", { sendPug(res, "account-channels", {
channels: channels, channels: channels,
newChannelError: err ? err : undefined newChannelError: err ? err : undefined
}); });
@ -309,7 +309,7 @@ function handleDeleteChannel(req, res) {
} }
if (!req.user) { if (!req.user) {
return sendJade(res, "account-channels", { return sendPug(res, "account-channels", {
channels: [], channels: [],
}); });
} }
@ -317,7 +317,7 @@ function handleDeleteChannel(req, res) {
db.channels.lookup(name, function (err, channel) { db.channels.lookup(name, function (err, channel) {
if (err) { if (err) {
sendJade(res, "account-channels", { sendPug(res, "account-channels", {
channels: [], channels: [],
deleteChannelError: err deleteChannelError: err
}); });
@ -326,7 +326,7 @@ function handleDeleteChannel(req, res) {
if (channel.owner !== req.user.name && req.user.global_rank < 255) { if (channel.owner !== req.user.name && req.user.global_rank < 255) {
db.channels.listUserChannels(req.user.name, function (err2, channels) { db.channels.listUserChannels(req.user.name, function (err2, channels) {
sendJade(res, "account-channels", { sendPug(res, "account-channels", {
channels: err2 ? [] : channels, channels: err2 ? [] : channels,
deleteChannelError: "You do not have permission to delete this channel" deleteChannelError: "You do not have permission to delete this channel"
}); });
@ -354,7 +354,7 @@ function handleDeleteChannel(req, res) {
} }
} }
db.channels.listUserChannels(req.user.name, function (err2, channels) { db.channels.listUserChannels(req.user.name, function (err2, channels) {
sendJade(res, "account-channels", { sendPug(res, "account-channels", {
channels: err2 ? [] : channels, channels: err2 ? [] : channels,
deleteChannelError: err ? err : undefined deleteChannelError: err ? err : undefined
}); });
@ -372,7 +372,7 @@ function handleAccountProfilePage(req, res) {
} }
if (!req.user) { if (!req.user) {
return sendJade(res, "account-profile", { return sendPug(res, "account-profile", {
profileImage: "", profileImage: "",
profileText: "" profileText: ""
}); });
@ -380,7 +380,7 @@ function handleAccountProfilePage(req, res) {
db.users.getProfile(req.user.name, function (err, profile) { db.users.getProfile(req.user.name, function (err, profile) {
if (err) { if (err) {
sendJade(res, "account-profile", { sendPug(res, "account-profile", {
profileError: err, profileError: err,
profileImage: "", profileImage: "",
profileText: "" profileText: ""
@ -388,7 +388,7 @@ function handleAccountProfilePage(req, res) {
return; return;
} }
sendJade(res, "account-profile", { sendPug(res, "account-profile", {
profileImage: profile.image, profileImage: profile.image,
profileText: profile.text, profileText: profile.text,
profileError: false profileError: false
@ -403,7 +403,7 @@ function handleAccountProfile(req, res) {
csrf.verify(req); csrf.verify(req);
if (!req.user) { if (!req.user) {
return sendJade(res, "account-profile", { return sendPug(res, "account-profile", {
profileImage: "", profileImage: "",
profileText: "", profileText: "",
profileError: "You must be logged in to edit your profile", profileError: "You must be logged in to edit your profile",
@ -415,7 +415,7 @@ function handleAccountProfile(req, res) {
db.users.setProfile(req.user.name, { image: image, text: text }, function (err) { db.users.setProfile(req.user.name, { image: image, text: text }, function (err) {
if (err) { if (err) {
sendJade(res, "account-profile", { sendPug(res, "account-profile", {
profileImage: "", profileImage: "",
profileText: "", profileText: "",
profileError: err profileError: err
@ -423,7 +423,7 @@ function handleAccountProfile(req, res) {
return; return;
} }
sendJade(res, "account-profile", { sendPug(res, "account-profile", {
profileImage: image, profileImage: image,
profileText: text, profileText: text,
profileError: false profileError: false
@ -439,7 +439,7 @@ function handlePasswordResetPage(req, res) {
return; return;
} }
sendJade(res, "account-passwordreset", { sendPug(res, "account-passwordreset", {
reset: false, reset: false,
resetEmail: "", resetEmail: "",
resetErr: false resetErr: false
@ -461,7 +461,7 @@ function handlePasswordReset(req, res) {
} }
if (!$util.isValidUserName(name)) { if (!$util.isValidUserName(name)) {
sendJade(res, "account-passwordreset", { sendPug(res, "account-passwordreset", {
reset: false, reset: false,
resetEmail: "", resetEmail: "",
resetErr: "Invalid username '" + name + "'" resetErr: "Invalid username '" + name + "'"
@ -471,7 +471,7 @@ function handlePasswordReset(req, res) {
db.users.getEmail(name, function (err, actualEmail) { db.users.getEmail(name, function (err, actualEmail) {
if (err) { if (err) {
sendJade(res, "account-passwordreset", { sendPug(res, "account-passwordreset", {
reset: false, reset: false,
resetEmail: "", resetEmail: "",
resetErr: err resetErr: err
@ -480,14 +480,14 @@ function handlePasswordReset(req, res) {
} }
if (actualEmail !== email.trim()) { if (actualEmail !== email.trim()) {
sendJade(res, "account-passwordreset", { sendPug(res, "account-passwordreset", {
reset: false, reset: false,
resetEmail: "", resetEmail: "",
resetErr: "Provided email does not match the email address on record for " + name resetErr: "Provided email does not match the email address on record for " + name
}); });
return; return;
} else if (actualEmail === "") { } else if (actualEmail === "") {
sendJade(res, "account-passwordreset", { sendPug(res, "account-passwordreset", {
reset: false, reset: false,
resetEmail: "", resetEmail: "",
resetErr: name + " doesn't have an email address on record. Please contact an " + resetErr: name + " doesn't have an email address on record. Please contact an " +
@ -509,7 +509,7 @@ function handlePasswordReset(req, res) {
expire: expire expire: expire
}, function (err, dbres) { }, function (err, dbres) {
if (err) { if (err) {
sendJade(res, "account-passwordreset", { sendPug(res, "account-passwordreset", {
reset: false, reset: false,
resetEmail: "", resetEmail: "",
resetErr: err resetErr: err
@ -521,7 +521,7 @@ function handlePasswordReset(req, res) {
name + " <" + email + ">"); name + " <" + email + ">");
if (!Config.get("mail.enabled")) { if (!Config.get("mail.enabled")) {
sendJade(res, "account-passwordreset", { sendPug(res, "account-passwordreset", {
reset: false, reset: false,
resetEmail: email, resetEmail: email,
resetErr: "This server does not have mail support enabled. Please " + resetErr: "This server does not have mail support enabled. Please " +
@ -548,14 +548,14 @@ function handlePasswordReset(req, res) {
Config.get("mail.nodemailer").sendMail(mail, function (err, response) { Config.get("mail.nodemailer").sendMail(mail, function (err, response) {
if (err) { if (err) {
Logger.errlog.log("mail fail: " + err); Logger.errlog.log("mail fail: " + err);
sendJade(res, "account-passwordreset", { sendPug(res, "account-passwordreset", {
reset: false, reset: false,
resetEmail: email, resetEmail: email,
resetErr: "Sending reset email failed. Please contact an " + resetErr: "Sending reset email failed. Please contact an " +
"administrator for assistance." "administrator for assistance."
}); });
} else { } else {
sendJade(res, "account-passwordreset", { sendPug(res, "account-passwordreset", {
reset: true, reset: true,
resetEmail: email, resetEmail: email,
resetErr: false resetErr: false
@ -580,7 +580,7 @@ function handlePasswordRecover(req, res) {
db.lookupPasswordReset(hash, function (err, row) { db.lookupPasswordReset(hash, function (err, row) {
if (err) { if (err) {
sendJade(res, "account-passwordrecover", { sendPug(res, "account-passwordrecover", {
recovered: false, recovered: false,
recoverErr: err recoverErr: err
}); });
@ -588,7 +588,7 @@ function handlePasswordRecover(req, res) {
} }
if (Date.now() >= row.expire) { if (Date.now() >= row.expire) {
sendJade(res, "account-passwordrecover", { sendPug(res, "account-passwordrecover", {
recovered: false, recovered: false,
recoverErr: "This password recovery link has expired. Password " + recoverErr: "This password recovery link has expired. Password " +
"recovery links are valid only for 24 hours after " + "recovery links are valid only for 24 hours after " +
@ -604,7 +604,7 @@ function handlePasswordRecover(req, res) {
} }
db.users.setPassword(row.name, newpw, function (err) { db.users.setPassword(row.name, newpw, function (err) {
if (err) { if (err) {
sendJade(res, "account-passwordrecover", { sendPug(res, "account-passwordrecover", {
recovered: false, recovered: false,
recoverErr: "Database error. Please contact an administrator if " + recoverErr: "Database error. Please contact an administrator if " +
"this persists." "this persists."
@ -616,7 +616,7 @@ function handlePasswordRecover(req, res) {
db.deletePasswordReset(hash); db.deletePasswordReset(hash);
Logger.eventlog.log("[account] " + ip + " recovered password for " + row.name); Logger.eventlog.log("[account] " + ip + " recovered password for " + row.name);
sendJade(res, "account-passwordrecover", { sendPug(res, "account-passwordrecover", {
recovered: true, recovered: true,
recoverPw: newpw recoverPw: newpw
}); });

View file

@ -1,7 +1,7 @@
var path = require("path"); var path = require("path");
var fs = require("fs"); var fs = require("fs");
var webserver = require("./webserver"); var webserver = require("./webserver");
var sendJade = require("./jade").sendJade; var sendPug = require("./pug").sendPug;
var Logger = require("../logger"); var Logger = require("../logger");
var db = require("../database"); var db = require("../database");
var Config = require("../config"); var Config = require("../config");
@ -35,7 +35,7 @@ function handleAcp(req, res, user) {
} }
sio += "/socket.io/socket.io.js"; sio += "/socket.io/socket.io.js";
sendJade(res, "acp", { sendPug(res, "acp", {
sioSource: sio sioSource: sio
}); });
} }

View file

@ -4,11 +4,11 @@
* @author Calvin Montgomery <cyzon@cyzon.us> * @author Calvin Montgomery <cyzon@cyzon.us>
*/ */
var jade = require("jade"); var pug = require("pug");
var path = require("path"); var path = require("path");
var webserver = require("./webserver"); var webserver = require("./webserver");
var cookieall = webserver.cookieall; var cookieall = webserver.cookieall;
var sendJade = require("./jade").sendJade; var sendPug = require("./pug").sendPug;
var Logger = require("../logger"); var Logger = require("../logger");
var $util = require("../utilities"); var $util = require("../utilities");
var db = require("../database"); var db = require("../database");
@ -56,7 +56,7 @@ function handleLogin(req, res) {
Logger.eventlog.log("[loginfail] Login failed (bad password): " + name Logger.eventlog.log("[loginfail] Login failed (bad password): " + name
+ "@" + req.realIP); + "@" + req.realIP);
} }
sendJade(res, "login", { sendPug(res, "login", {
loggedIn: false, loggedIn: false,
loginError: err loginError: err
}); });
@ -65,7 +65,7 @@ function handleLogin(req, res) {
session.genSession(user, expiration, function (err, auth) { session.genSession(user, expiration, function (err, auth) {
if (err) { if (err) {
sendJade(res, "login", { sendPug(res, "login", {
loggedIn: false, loggedIn: false,
loginError: err loginError: err
}); });
@ -93,7 +93,7 @@ function handleLogin(req, res) {
res.redirect(dest); res.redirect(dest);
} else { } else {
res.user = user; res.user = user;
sendJade(res, "login", {}); sendPug(res, "login", {});
} }
}); });
}); });
@ -108,12 +108,12 @@ function handleLoginPage(req, res) {
} }
if (req.user) { if (req.user) {
return sendJade(res, "login", { return sendPug(res, "login", {
wasAlreadyLoggedIn: true wasAlreadyLoggedIn: true
}); });
} }
sendJade(res, "login", { sendPug(res, "login", {
redirect: req.query.dest || req.header("referer") redirect: req.query.dest || req.header("referer")
}); });
} }
@ -138,7 +138,7 @@ function handleLogout(req, res) {
if (dest) { if (dest) {
res.redirect(dest); res.redirect(dest);
} else { } else {
sendJade(res, "logout", {}); sendPug(res, "logout", {});
} }
} }
@ -151,11 +151,11 @@ function handleRegisterPage(req, res) {
} }
if (req.user) { if (req.user) {
sendJade(res, "register", {}); sendPug(res, "register", {});
return; return;
} }
sendJade(res, "register", { sendPug(res, "register", {
registered: false, registered: false,
registerError: false registerError: false
}); });
@ -181,21 +181,21 @@ function handleRegister(req, res) {
} }
if (name.length === 0) { if (name.length === 0) {
sendJade(res, "register", { sendPug(res, "register", {
registerError: "Username must not be empty" registerError: "Username must not be empty"
}); });
return; return;
} }
if (name.match(Config.get("reserved-names.usernames"))) { if (name.match(Config.get("reserved-names.usernames"))) {
sendJade(res, "register", { sendPug(res, "register", {
registerError: "That username is reserved" registerError: "That username is reserved"
}); });
return; return;
} }
if (password.length === 0) { if (password.length === 0) {
sendJade(res, "register", { sendPug(res, "register", {
registerError: "Password must not be empty" registerError: "Password must not be empty"
}); });
return; return;
@ -204,7 +204,7 @@ function handleRegister(req, res) {
password = password.substring(0, 100); password = password.substring(0, 100);
if (email.length > 0 && !$util.isValidEmail(email)) { if (email.length > 0 && !$util.isValidEmail(email)) {
sendJade(res, "register", { sendPug(res, "register", {
registerError: "Invalid email address" registerError: "Invalid email address"
}); });
return; return;
@ -212,13 +212,13 @@ function handleRegister(req, res) {
db.users.register(name, password, email, ip, function (err) { db.users.register(name, password, email, ip, function (err) {
if (err) { if (err) {
sendJade(res, "register", { sendPug(res, "register", {
registerError: err registerError: err
}); });
} else { } else {
Logger.eventlog.log("[register] " + ip + " registered account: " + name + Logger.eventlog.log("[register] " + ip + " registered account: " + name +
(email.length > 0 ? " <" + email + ">" : "")); (email.length > 0 ? " <" + email + ">" : ""));
sendJade(res, "register", { sendPug(res, "register", {
registered: true, registered: true,
registerName: name, registerName: name,
redirect: req.body.redirect redirect: req.body.redirect

View file

@ -1,4 +1,4 @@
var jade = require("jade"); var pug = require("pug");
var fs = require("fs"); var fs = require("fs");
var path = require("path"); var path = require("path");
var Config = require("../config"); var Config = require("../config");
@ -6,7 +6,7 @@ var templates = path.join(__dirname, "..", "..", "templates");
var cache = {}; var cache = {};
/** /**
* Merges locals with globals for jade rendering * Merges locals with globals for pug rendering
*/ */
function merge(locals, res) { function merge(locals, res) {
var _locals = { var _locals = {
@ -33,14 +33,14 @@ function getBaseUrl(res) {
} }
/** /**
* Renders and serves a jade template * Renders and serves a pug template
*/ */
function sendJade(res, view, locals) { function sendPug(res, view, locals) {
locals.loggedIn = locals.loggedIn || !!res.user; locals.loggedIn = locals.loggedIn || !!res.user;
locals.loginName = locals.loginName || res.user ? res.user.name : false; locals.loginName = locals.loginName || res.user ? res.user.name : false;
if (!(view in cache) || Config.get("debug")) { if (!(view in cache) || Config.get("debug")) {
var file = path.join(templates, view + ".jade"); var file = path.join(templates, view + ".pug");
var fn = jade.compile(fs.readFileSync(file), { var fn = pug.compile(fs.readFileSync(file), {
filename: file, filename: file,
pretty: !Config.get("http.minify") pretty: !Config.get("http.minify")
}); });
@ -51,5 +51,5 @@ function sendJade(res, view, locals) {
} }
module.exports = { module.exports = {
sendJade: sendJade sendPug: sendPug
}; };

View file

@ -1,6 +1,6 @@
import CyTubeUtil from '../../utilities'; import CyTubeUtil from '../../utilities';
import { sanitizeText } from '../../xss'; import { sanitizeText } from '../../xss';
import { sendJade } from '../jade'; import { sendPug } from '../pug';
import * as HTTPStatus from '../httpstatus'; import * as HTTPStatus from '../httpstatus';
import { HTTPError } from '../../errors'; import { HTTPError } from '../../errors';
@ -17,7 +17,7 @@ export default function initialize(app, ioConfig) {
} }
const socketBaseURL = endpoints[0].url; const socketBaseURL = endpoints[0].url;
sendJade(res, 'channel', { sendPug(res, 'channel', {
channelName: req.params.channel, channelName: req.params.channel,
sioSource: `${socketBaseURL}/socket.io/socket.io.js` sioSource: `${socketBaseURL}/socket.io/socket.io.js`
}); });

View file

@ -1,5 +1,5 @@
import CyTubeUtil from '../../utilities'; import CyTubeUtil from '../../utilities';
import { sendJade } from '../jade'; import { sendPug } from '../pug';
export default function initialize(app, webConfig) { export default function initialize(app, webConfig) {
app.get('/contact', (req, res) => { app.get('/contact', (req, res) => {
@ -19,7 +19,7 @@ export default function initialize(app, webConfig) {
return contact; return contact;
}); });
return sendJade(res, 'contact', { return sendPug(res, 'contact', {
contacts: contacts contacts: contacts
}); });
}); });

View file

@ -1,4 +1,4 @@
import { sendJade } from '../jade'; import { sendPug } from '../pug';
export default function initialize(app, channelIndex, maxEntries) { export default function initialize(app, channelIndex, maxEntries) {
app.get('/', (req, res) => { app.get('/', (req, res) => {
@ -13,7 +13,7 @@ export default function initialize(app, channelIndex, maxEntries) {
channels = channels.slice(0, maxEntries); channels = channels.slice(0, maxEntries);
sendJade(res, 'index', { sendPug(res, 'index', {
channels: channels channels: channels
}); });
}); });

View file

@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path'; import path from 'path';
import net from 'net'; import net from 'net';
import express from 'express'; import express from 'express';
import { sendJade } from './jade'; import { sendPug } from './pug';
import Logger from '../logger'; import Logger from '../logger';
import Config from '../config'; import Config from '../config';
import bodyParser from 'body-parser'; import bodyParser from 'body-parser';
@ -76,7 +76,7 @@ function handleLegacySocketConfig(req, res) {
} }
function handleUserAgreement(req, res) { function handleUserAgreement(req, res) {
sendJade(res, 'tos', { sendPug(res, 'tos', {
domain: Config.get('http.domain') domain: Config.get('http.domain')
}); });
} }
@ -92,7 +92,7 @@ function initializeErrorHandlers(app) {
if (err) { if (err) {
if (err instanceof CSRFError) { if (err instanceof CSRFError) {
res.status(HTTPStatus.FORBIDDEN); res.status(HTTPStatus.FORBIDDEN);
return sendJade(res, 'csrferror', { return sendPug(res, 'csrferror', {
path: req.path, path: req.path,
referer: req.header('referer') referer: req.header('referer')
}); });
@ -104,7 +104,7 @@ function initializeErrorHandlers(app) {
} }
if (!message) { if (!message) {
message = 'An unknown error occurred.'; message = 'An unknown error occurred.';
} else if (/\.(jade|js)/.test(message)) { } else if (/\.(pug|js)/.test(message)) {
// Prevent leakage of stack traces // Prevent leakage of stack traces
message = 'An internal error occurred.'; message = 'An internal error occurred.';
} }
@ -115,7 +115,7 @@ function initializeErrorHandlers(app) {
} }
res.status(status); res.status(status);
return sendJade(res, 'httperror', { return sendPug(res, 'httperror', {
path: req.path, path: req.path,
status: status, status: status,
message: message message: message

View file

@ -2,16 +2,16 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/account/channels") +navdefaultlinks("/account/channels")
mixin navloginlogout("/account/channels") +navloginlogout("/account/channels")
section#mainpage section#mainpage
.container .container
if !loggedIn if !loggedIn
@ -38,13 +38,13 @@ html(lang="en")
for c in channels for c in channels
tr tr
th th
form.form-inline.pull-right(action="/account/channels", method="post", onsubmit="return confirm('Are you sure you want to delete #{c.name}? This cannot be undone');") form.form-inline.pull-right(action="/account/channels", method="post", onsubmit="return confirm('Are you sure you want to delete " +c.name+ "? This cannot be undone');")
input(type="hidden", name="_csrf", value=csrfToken) input(type="hidden", name="_csrf", value=csrfToken)
input(type="hidden", name="action", value="delete_channel") input(type="hidden", name="action", value="delete_channel")
input(type="hidden", name="name", value="#{c.name}") input(type="hidden", name="name", value=c.name)
button.btn.btn-xs.btn-danger(type="submit") Delete button.btn.btn-xs.btn-danger(type="submit") Delete
span.glyphicon.glyphicon-trash span.glyphicon.glyphicon-trash
a(href="/r/#{c.name}", style="margin-left: 5px")= c.name a(href="/r/"+c.name, style="margin-left: 5px")= c.name
.col-lg-6.col-md-6 .col-lg-6.col-md-6
h3 Register a new channel h3 Register a new channel
if newChannelError if newChannelError
@ -60,4 +60,4 @@ html(lang="en")
button.btn.btn-primary.btn-block(type="submit") Register button.btn.btn-primary.btn-block(type="submit") Register
include footer include footer
mixin footer() +footer()

View file

@ -2,16 +2,16 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/account/edit") +navdefaultlinks("/account/edit")
mixin navloginlogout("/account/edit") +navloginlogout("/account/edit")
section#mainpage section#mainpage
.container .container
if !loggedIn if !loggedIn
@ -60,7 +60,7 @@ html(lang="en")
input#email.form-control(type="email", name="email") input#email.form-control(type="email", name="email")
button#changeemailbtn.btn.btn-danger.btn-block(type="submit") Change Email button#changeemailbtn.btn.btn-danger.btn-block(type="submit") Change Email
include footer include footer
mixin footer() +footer()
script(type="text/javascript"). script(type="text/javascript").
function validatePasswordChange() { function validatePasswordChange() {
var pw = $("#newpassword").val(); var pw = $("#newpassword").val();

View file

@ -2,16 +2,16 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/account/passwordrecover/") +navdefaultlinks("/account/passwordrecover/")
mixin navloginlogout("/account/passwordrecover/") +navloginlogout("/account/passwordrecover/")
section#mainpage section#mainpage
.container .container
.col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3 .col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3
@ -25,4 +25,4 @@ html(lang="en")
strong Password recovery failed strong Password recovery failed
p= recoverErr p= recoverErr
include footer include footer
mixin footer() +footer()

View file

@ -2,16 +2,16 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/account/passwordreset") +navdefaultlinks("/account/passwordreset")
mixin navloginlogout("/account/passwordreset") +navloginlogout("/account/passwordreset")
section#mainpage section#mainpage
.container .container
.col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3 .col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3
@ -35,4 +35,4 @@ html(lang="en")
button.btn.btn-primary.btn-block(type="submit") Send reset request button.btn.btn-primary.btn-block(type="submit") Send reset request
include footer include footer
mixin footer() +footer()

View file

@ -2,16 +2,16 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/account/profile") +navdefaultlinks("/account/profile")
mixin navloginlogout("/account/profile") +navloginlogout("/account/profile")
section#mainpage section#mainpage
.container .container
if !loggedIn if !loggedIn
@ -42,6 +42,6 @@ html(lang="en")
button.btn.btn-primary.btn-block(type="submit") Save button.btn.btn-primary.btn-block(type="submit") Save
include footer include footer
mixin footer() +footer()
script(type="text/javascript"). script(type="text/javascript").
$("#profileimage").val("#{profileImage}"); $("#profileimage").val("#{profileImage}");

View file

@ -2,21 +2,21 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
link(rel="stylesheet", type="text/css", href="/css/acp.css") link(rel="stylesheet", type="text/css", href="/css/acp.css")
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/acp") +navdefaultlinks("/acp")
li#nav-acp-section.dropdown li#nav-acp-section.dropdown
a#nav-acp-dd-toggle.dropdown-toggle(data-toggle="dropdown", href="javascript:void(0)") Menu a#nav-acp-dd-toggle.dropdown-toggle(data-toggle="dropdown", href="javascript:void(0)") Menu
span.caret span.caret
ul.dropdown-menu ul.dropdown-menu
mixin navloginlogout("/acp") +navloginlogout("/acp")
section#mainpage section#mainpage
.container .container
.row .row
@ -125,7 +125,7 @@ html(lang="en")
canvas#stat_mem(width="1140", height="400") canvas#stat_mem(width="1140", height="400")
include footer include footer
mixin footer() +footer()
script(type="text/javascript"). script(type="text/javascript").
var USEROPTS = { secure_connection: true }; var USEROPTS = { secure_connection: true };
script(src=sioSource) script(src=sioSource)

View file

@ -2,18 +2,18 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
link(href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css", rel="stylesheet") link(href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css", rel="stylesheet")
link(rel="stylesheet", href="/css/video-js.css") link(rel="stylesheet", href="/css/video-js.css")
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
- var cname = "/r/" + channelName - var cname = "/r/" + channelName
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks(cname) +navdefaultlinks(cname)
li: a(href="javascript:void(0)", onclick="javascript:showUserOptions()") Options li: a(href="javascript:void(0)", onclick="javascript:showUserOptions()") Options
li: a#showchansettings(href="javascript:void(0)", onclick="javascript:showChannelSettings()") Channel Settings li: a#showchansettings(href="javascript:void(0)", onclick="javascript:showChannelSettings()") Channel Settings
li.dropdown li.dropdown
@ -22,7 +22,7 @@ html(lang="en")
ul.dropdown-menu ul.dropdown-menu
li: a(href="#" onclick="javascript:chatOnly()") Chat Only li: a(href="#" onclick="javascript:chatOnly()") Chat Only
li: a(href="#" onclick="javascript:removeVideo(event)") Remove Video li: a(href="#" onclick="javascript:removeVideo(event)") Remove Video
mixin navloginlogout(cname) +navloginlogout(cname)
section#mainpage section#mainpage
.container .container
#motdrow.row #motdrow.row
@ -168,11 +168,11 @@ html(lang="en")
.modal-body .modal-body
.tab-content .tab-content
include useroptions include useroptions
mixin us-general() +us-general()
mixin us-playback() +us-playback()
mixin us-chat() +us-chat()
mixin us-scripts() +us-scripts()
mixin us-mod() +us-mod()
.modal-footer .modal-footer
button.btn.btn-primary(type="button", data-dismiss="modal", onclick="javascript:saveUserOptions()") Save button.btn.btn-primary(type="button", data-dismiss="modal", onclick="javascript:saveUserOptions()") Save
button.btn.btn-default(type="button", data-dismiss="modal") Close button.btn.btn-default(type="button", data-dismiss="modal") Close
@ -219,23 +219,23 @@ html(lang="en")
.modal-body .modal-body
.tab-content .tab-content
include channeloptions include channeloptions
mixin miscoptions() +miscoptions()
mixin adminoptions() +adminoptions()
mixin motdeditor() +motdeditor()
mixin csseditor() +csseditor()
mixin jseditor() +jseditor()
mixin banlist() +banlist()
mixin recentjoins() +recentjoins()
mixin chanranks() +chanranks()
mixin chatfilters() +chatfilters()
mixin emotes() +emotes()
mixin chanlog() +chanlog()
mixin permeditor() +permeditor()
.modal-footer .modal-footer
button.btn.btn-default(type="button", data-dismiss="modal") Close button.btn.btn-default(type="button", data-dismiss="modal") Close
#pmbar #pmbar
include footer include footer
mixin footer() +footer()
script(id="socketio-js", src=sioSource) script(id="socketio-js", src=sioSource)
script(src="/js/data.js") script(src="/js/data.js")
script(src="/js/util.js") script(src="/js/util.js")

View file

@ -50,19 +50,19 @@ mixin miscoptions
#cs-miscoptions.tab-pane.active #cs-miscoptions.tab-pane.active
h4 General Settings h4 General Settings
form.form-horizontal(action="javascript:void(0)") form.form-horizontal(action="javascript:void(0)")
mixin rcheckbox-auto("cs-allow_voteskip", "Allow voteskip") +rcheckbox-auto("cs-allow_voteskip", "Allow voteskip")
mixin rcheckbox-auto("cs-allow_dupes", "Allow duplicate videos on the playlist") +rcheckbox-auto("cs-allow_dupes", "Allow duplicate videos on the playlist")
mixin textbox-auto("cs-voteskip_ratio", "Voteskip ratio", "0.5") +textbox-auto("cs-voteskip_ratio", "Voteskip ratio", "0.5")
mixin textbox-auto("cs-maxlength", "Max video length", "HH:MM:SS") +textbox-auto("cs-maxlength", "Max video length", "HH:MM:SS")
mixin textbox-auto("cs-afk_timeout", "Auto-AFK Delay", "0 (disabled)") +textbox-auto("cs-afk_timeout", "Auto-AFK Delay", "0 (disabled)")
.form-group .form-group
.col-sm-offset-4 .col-sm-offset-4
h4 Chat Settings h4 Chat Settings
form.form-horizontal(action="javascript:void(0)") form.form-horizontal(action="javascript:void(0)")
mixin rcheckbox-auto("cs-enable_link_regex", "Convert URLs in chat to links") +rcheckbox-auto("cs-enable_link_regex", "Convert URLs in chat to links")
mixin rcheckbox-auto("cs-chat_antiflood", "Throttle chat") +rcheckbox-auto("cs-chat_antiflood", "Throttle chat")
mixin textbox-auto("cs-chat_antiflood_burst", "# of messages allowed before throttling") +textbox-auto("cs-chat_antiflood_burst", "# of messages allowed before throttling")
mixin textbox-auto("cs-chat_antiflood_sustained", "# of messages (after burst) allowed per second") +textbox-auto("cs-chat_antiflood_sustained", "# of messages (after burst) allowed per second")
.form-group .form-group
.col-sm-8.col-sm-offset-4 .col-sm-8.col-sm-offset-4
span.text-info Changes are automatically saved. span.text-info Changes are automatically saved.
@ -72,14 +72,14 @@ mixin adminoptions
h4 Admin-Only Settings h4 Admin-Only Settings
form.form-horizontal(action="javascript:void(0)") form.form-horizontal(action="javascript:void(0)")
- var defname = "CyTube - /r/" + channelName - var defname = "CyTube - /r/" + channelName
mixin textbox-auto("cs-pagetitle", "Page title", defname) +textbox-auto("cs-pagetitle", "Page title", defname)
mixin textbox-auto("cs-password", "Password", "leave blank to disable") +textbox-auto("cs-password", "Password", "leave blank to disable")
mixin textbox-auto("cs-externalcss", "External CSS", "Stylesheet URL") +textbox-auto("cs-externalcss", "External CSS", "Stylesheet URL")
mixin textbox-auto("cs-externaljs", "External Javascript", "Script URL") +textbox-auto("cs-externaljs", "External Javascript", "Script URL")
mixin rcheckbox-auto("cs-show_public", "List channel publicly") +rcheckbox-auto("cs-show_public", "List channel publicly")
mixin rcheckbox-auto("cs-torbanned", "Block connections from Tor") +rcheckbox-auto("cs-torbanned", "Block connections from Tor")
mixin rcheckbox-auto("cs-allow_ascii_control", "Allow ASCII control characters (e.g. newlines)") +rcheckbox-auto("cs-allow_ascii_control", "Allow ASCII control characters (e.g. newlines)")
mixin textbox-auto("cs-playlist_max_per_user", "Maximum # of videos per user") +textbox-auto("cs-playlist_max_per_user", "Maximum # of videos per user")
.form-group .form-group
.col-sm-8.col-sm-offset-4 .col-sm-8.col-sm-offset-4
span.text-info Set to 0 for no limit span.text-info Set to 0 for no limit

View file

@ -1,20 +1,20 @@
mixin email(e, k) mixin email(e, k)
button.btn.btn-xs.btn-default(onclick="showEmail(this, '#{e}', '#{k}')") Show Email button.btn.btn-xs.btn-default(onclick="showEmail(this, '"+e+"', '"+k+"')") Show Email
doctype html doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/contact") +navdefaultlinks("/contact")
mixin navloginlogout("/contact") +navloginlogout("/contact")
section#mainpage section#mainpage
.container .container
.col-md-8.col-md-offset-2 .col-md-8.col-md-offset-2
@ -23,14 +23,14 @@ html(lang="en")
each contact in contacts each contact in contacts
strong= contact.name strong= contact.name
p.text-muted= contact.title p.text-muted= contact.title
mixin email(contact.email, contact.emkey) +email(contact.email, contact.emkey)
br br
hr hr
h3 IRC h3 IRC
p. p.
The developer and other knowledgeable people are usually available on IRC for quick questions or comments. Official support can be provided for cytu.be and synchtube.6irc.net at <a href="http://webchat.6irc.net/?channels=cytube">irc.6irc.net#cytube</a>. These people can also address general questions about the software, but cannot provide technical support for third-party websites using this code. The developer and other knowledgeable people are usually available on IRC for quick questions or comments. Official support can be provided for cytu.be and synchtube.6irc.net at <a href="http://webchat.6irc.net/?channels=cytube">irc.6irc.net#cytube</a>. These people can also address general questions about the software, but cannot provide technical support for third-party websites using this code.
include footer include footer
mixin footer() +footer()
script(type="text/javascript"). script(type="text/javascript").
function showEmail(btn, email, key) { function showEmail(btn, email, key) {
email = unescape(email); email = unescape(email);

View file

@ -2,16 +2,16 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks(path) +navdefaultlinks(path)
mixin navloginlogout(path) +navloginlogout(path)
section#mainpage.container section#mainpage.container
.col-md-12 .col-md-12
@ -28,4 +28,4 @@ html(lang="en")
a(href=referer) Return to previous page a(href=referer) Return to previous page
include footer include footer
mixin footer() +footer()

View file

@ -1,8 +1,8 @@
mixin head() mixin head()
meta(charset="utf-8") meta(charset="utf-8")
meta(name="viewport", content="width=device-width, initial-scale=1.0") meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(name="description", content="#{siteDescription}") meta(name="description", content=siteDescription)
meta(name="author", content="#{siteAuthor}") meta(name="author", content=siteAuthor)
title= siteTitle title= siteTitle
link(href="/css/sticky-footer-navbar.css", rel="stylesheet") link(href="/css/sticky-footer-navbar.css", rel="stylesheet")

View file

@ -13,26 +13,26 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks(path) +navdefaultlinks(path)
mixin navloginlogout(path) +navloginlogout(path)
section#mainpage.container section#mainpage.container
.col-md-12 .col-md-12
.alert.alert-danger .alert.alert-danger
if status == 404 if status == 404
mixin notfound() +notfound()
else if status == 403 else if status == 403
mixin forbidden() +forbidden()
else else
mixin genericerror() +genericerror()
include footer include footer
mixin footer() +footer()

View file

@ -2,16 +2,16 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/") +navdefaultlinks("/")
mixin navloginlogout("/") +navloginlogout("/")
section#mainpage section#mainpage
.container .container
.col-lg-9.col-md-9 .col-lg-9.col-md-9
@ -24,7 +24,7 @@ html(lang="en")
tbody tbody
each chan in channels each chan in channels
tr tr
td: a(href="/r/#{chan.name}") #{chan.pagetitle} (#{chan.name}) td: a(href="/r/"+chan.name) #{chan.pagetitle} (#{chan.name})
td= chan.usercount td= chan.usercount
td= chan.mediatitle td= chan.mediatitle
.col-lg-3.col-md-3 .col-lg-3.col-md-3
@ -32,7 +32,7 @@ html(lang="en")
input#channelname.form-control(type="text", placeholder="Channel Name") input#channelname.form-control(type="text", placeholder="Channel Name")
p.text-muted New channels can be registered from the <a href="/account/channels">My Channels</a> page. p.text-muted New channels can be registered from the <a href="/account/channels">My Channels</a> page.
include footer include footer
mixin footer() +footer()
script(type="text/javascript"). script(type="text/javascript").
$("#channelname").keydown(function (ev) { $("#channelname").keydown(function (ev) {
if (ev.keyCode === 13) { if (ev.keyCode === 13) {

View file

@ -2,17 +2,17 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/login") +navdefaultlinks("/login")
if loggedIn if loggedIn
mixin navlogoutform("/") +navlogoutform("/")
section#mainpage.container section#mainpage.container
if wasAlreadyLoggedIn if wasAlreadyLoggedIn
.col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3 .col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3
@ -51,4 +51,4 @@ html(lang="en")
br br
a(href=redirect) Return to previous page a(href=redirect) Return to previous page
include footer include footer
mixin footer() +footer()

View file

@ -2,16 +2,16 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/logout") +navdefaultlinks("/logout")
mixin navloginform("/") +navloginform("/")
section#mainpage.container section#mainpage.container
.col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3 .col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3
.alert.alert-info.center.messagebox .alert.alert-info.center.messagebox
@ -20,4 +20,4 @@ html(lang="en")
if redirect if redirect
a(href=redirect) Return to previous page a(href=redirect) Return to previous page
include footer include footer
mixin footer() +footer()

View file

@ -1,4 +1,4 @@
- var links = { "/": "Home" } - var links = { "/": "Home" };
mixin navlink(page, title, active) mixin navlink(page, title, active)
if active if active
@ -19,9 +19,9 @@ mixin navheader()
mixin navdefaultlinks(page) mixin navdefaultlinks(page)
each t, p in links each t, p in links
if p == page if p == page
mixin navlink(p, t, true) +navlink(p, t, true)
else else
mixin navlink(p, t, false) +navlink(p, t, false)
li.dropdown li.dropdown
a.dropdown-toggle(href="#", data-toggle="dropdown") Account a.dropdown-toggle(href="#", data-toggle="dropdown") Account
b.caret b.caret
@ -29,24 +29,24 @@ mixin navdefaultlinks(page)
if loggedIn if loggedIn
li: a(href="javascript:$('#logoutform').submit();") Log out li: a(href="javascript:$('#logoutform').submit();") Log out
li.divider li.divider
li: a(href="#{loginDomain}/account/channels") Channels li: a(href=loginDomain+"/account/channels") Channels
li: a(href="#{loginDomain}/account/profile") Profile li: a(href=loginDomain+"/account/profile") Profile
li: a(href="#{loginDomain}/account/edit") Change Password/Email li: a(href=loginDomain+"/account/edit") Change Password/Email
else else
li: a(href="#{loginDomain}/login?dest=#{encodeURIComponent(baseUrl + page)}") Login li: a(href=loginDomain+"/login?dest=" + encodeURIComponent(baseUrl + page)) Login
li: a(href="#{loginDomain}/register") Register li: a(href=loginDomain+"/register") Register
mixin navloginlogout(redirect) mixin navloginlogout(redirect)
if loggedIn if loggedIn
mixin navlogoutform(redirect) +navlogoutform(redirect)
else else
mixin navloginform(redirect) +navloginform(redirect)
mixin navloginform(redirect) mixin navloginform(redirect)
if loginDomain == null if loginDomain == null
- loginDomain = "" - loginDomain = ""
.visible-lg .visible-lg
form#loginform.navbar-form.navbar-right(action="#{loginDomain}/login", method="post") form#loginform.navbar-form.navbar-right(action=loginDomain+"/login", method="post")
input(type="hidden", name="_csrf", value=csrfToken) input(type="hidden", name="_csrf", value=csrfToken)
input(type="hidden", name="dest", value=baseUrl + redirect) input(type="hidden", name="dest", value=baseUrl + redirect)
.form-group .form-group
@ -61,7 +61,7 @@ mixin navloginform(redirect)
button#login.btn.btn-default(type="submit") Login button#login.btn.btn-default(type="submit") Login
.visible-md .visible-md
p#loginform.navbar-text.pull-right p#loginform.navbar-text.pull-right
a#login.navbar-link(href="#{loginDomain}/login?dest=#{encodeURIComponent(baseUrl + redirect)}") Log in a#login.navbar-link(href=loginDomain+"/login?dest="+encodeURIComponent(baseUrl+redirect)) Log in
span &nbsp;&middot;&nbsp; span &nbsp;&middot;&nbsp;
a#register.navbar-link(href="/register") Register a#register.navbar-link(href="/register") Register

View file

@ -2,16 +2,16 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/policies/privacy") +navdefaultlinks("/policies/privacy")
mixin navloginlogout("/policies/privacy") +navloginlogout("/policies/privacy")
section#mainpage section#mainpage
.container .container
.col-md-12 .col-md-12
@ -50,4 +50,4 @@ html(lang="en")
p p
| When you register a channel on #{siteTitle}, you may optionally provide certain information | When you register a channel on #{siteTitle}, you may optionally provide certain information
include footer include footer
mixin footer() +footer()

View file

@ -2,17 +2,17 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/register") +navdefaultlinks("/register")
if loggedIn if loggedIn
mixin navlogoutform("/register") +navlogoutform("/register")
section#mainpage.container section#mainpage.container
if loggedIn if loggedIn
.col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3 .col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3
@ -50,7 +50,7 @@ html(lang="en")
strong Registration Successful strong Registration Successful
p Thanks for registering, #{registerName}! Now you can <a href="/login">Login</a> to use your account. p Thanks for registering, #{registerName}! Now you can <a href="/login">Login</a> to use your account.
include footer include footer
mixin footer() +footer()
script(src="/js/jquery.js") script(src="/js/jquery.js")
script(type="text/javascript"). script(type="text/javascript").
function verify() { function verify() {

View file

@ -2,16 +2,16 @@ doctype html
html(lang="en") html(lang="en")
head head
include head include head
mixin head() +head()
body body
#wrap #wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav include nav
mixin navheader() +navheader()
#nav-collapsible.collapse.navbar-collapse #nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav ul.nav.navbar-nav
mixin navdefaultlinks("/useragreement") +navdefaultlinks("/useragreement")
mixin navloginlogout("/useragreement") +navloginlogout("/useragreement")
section#mainpage section#mainpage
.container .container
.col-md-12 .col-md-12
@ -38,4 +38,4 @@ html(lang="en")
li Attempting to exploit the site in order to gain unauthorized access or interrupt service is not allowed. If you believe you have found an exploit, please responsibly disclose it to an administrator. li Attempting to exploit the site in order to gain unauthorized access or interrupt service is not allowed. If you believe you have found an exploit, please responsibly disclose it to an administrator.
li Use good judgement when representing #{siteTitle} on other websites. Do not spam links to your channel. li Use good judgement when representing #{siteTitle} on other websites. Do not spam links to your channel.
include footer include footer
mixin footer() +footer()

View file

@ -47,8 +47,8 @@ mixin us-general
.col-sm-4 .col-sm-4
.col-sm-8 .col-sm-8
p.text-danger Changing layouts may require refreshing to take effect. p.text-danger Changing layouts may require refreshing to take effect.
mixin rcheckbox("us-no-channelcss", "Ignore Channel CSS") +rcheckbox("us-no-channelcss", "Ignore Channel CSS")
mixin rcheckbox("us-no-channeljs", "Ignore Channel Javascript") +rcheckbox("us-no-channeljs", "Ignore Channel Javascript")
.clear .clear
mixin us-scripts mixin us-scripts
@ -66,15 +66,15 @@ mixin us-playback
#us-playback.tab-pane #us-playback.tab-pane
h4 Playback Preferences h4 Playback Preferences
form.form-horizontal(action="javascript:void(0)") form.form-horizontal(action="javascript:void(0)")
mixin rcheckbox("us-synch", "Synchronize video playback") +rcheckbox("us-synch", "Synchronize video playback")
mixin textbox("us-synch-accuracy", "Synch threshold (seconds)", "2") +textbox("us-synch-accuracy", "Synch threshold (seconds)", "2")
mixin rcheckbox("us-wmode-transparent", "Set wmode=transparent") +rcheckbox("us-wmode-transparent", "Set wmode=transparent")
.col-sm-4 .col-sm-4
.col-sm-8 .col-sm-8
p.text-info Setting <code>wmode=transparent</code> allows objects to be displayed above the video player, but may cause performance issues on some systems. p.text-info Setting <code>wmode=transparent</code> allows objects to be displayed above the video player, but may cause performance issues on some systems.
mixin rcheckbox("us-hidevideo", "Remove the video player") +rcheckbox("us-hidevideo", "Remove the video player")
mixin rcheckbox("us-playlistbuttons", "Hide playlist buttons by default") +rcheckbox("us-playlistbuttons", "Hide playlist buttons by default")
mixin rcheckbox("us-oldbtns", "Old style playlist buttons") +rcheckbox("us-oldbtns", "Old style playlist buttons")
.form-group .form-group
label.control-label.col-sm-4(for="#us-default-quality") Quality Preference label.control-label.col-sm-4(for="#us-default-quality") Quality Preference
.col-sm-8 .col-sm-8
@ -91,9 +91,9 @@ mixin us-chat
#us-chat.tab-pane #us-chat.tab-pane
h4 Chat Preferences h4 Chat Preferences
form.form-horizontal(action="javascript:void(0)") form.form-horizontal(action="javascript:void(0)")
mixin rcheckbox("us-chat-timestamp", "Show timestamps in chat") +rcheckbox("us-chat-timestamp", "Show timestamps in chat")
mixin rcheckbox("us-sort-rank", "Sort userlist by rank") +rcheckbox("us-sort-rank", "Sort userlist by rank")
mixin rcheckbox("us-sort-afk", "Sort AFKers to bottom") +rcheckbox("us-sort-afk", "Sort AFKers to bottom")
.col-sm-4 .col-sm-4
.col-sm-8 .col-sm-8
p.text-info The following 2 options apply to how and when you will be notified if a new chat message is received while CyTube is not the active window. p.text-info The following 2 options apply to how and when you will be notified if a new chat message is received while CyTube is not the active window.
@ -111,12 +111,12 @@ mixin us-chat
option(value="never") Never option(value="never") Never
option(value="onlyping") Only when I am mentioned or PMed option(value="onlyping") Only when I am mentioned or PMed
option(value="always") Always option(value="always") Always
mixin rcheckbox("us-sendbtn", "Add a send button to chat") +rcheckbox("us-sendbtn", "Add a send button to chat")
mixin rcheckbox("us-no-emotes", "Disable chat emotes") +rcheckbox("us-no-emotes", "Disable chat emotes")
mixin us-mod mixin us-mod
#us-mod.tab-pane #us-mod.tab-pane
h4 Moderator Preferences h4 Moderator Preferences
form.form-horizontal(action="javascript:void(0)") form.form-horizontal(action="javascript:void(0)")
mixin rcheckbox("us-modflair", "Show name color") +rcheckbox("us-modflair", "Show name color")
mixin rcheckbox("us-shadowchat", "Show shadowmuted messages") +rcheckbox("us-shadowchat", "Show shadowmuted messages")