From df5c5cd54f246c806a3a98d65f7f403ba93b3657 Mon Sep 17 00:00:00 2001 From: Xaekai Date: Thu, 7 Jul 2016 01:11:56 -0700 Subject: [PATCH] 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 --- package.json | 4 +- src/web/account.js | 86 +++++++++---------- src/web/acp.js | 4 +- src/web/auth.js | 32 +++---- src/web/{jade.js => pug.js} | 14 +-- src/web/routes/channel.js | 4 +- src/web/routes/contact.js | 4 +- src/web/routes/index.js | 4 +- src/web/webserver.js | 10 +-- ...unt-channels.jade => account-channels.pug} | 16 ++-- .../{account-edit.jade => account-edit.pug} | 10 +-- ...cover.jade => account-passwordrecover.pug} | 10 +-- ...rdreset.jade => account-passwordreset.pug} | 10 +-- ...count-profile.jade => account-profile.pug} | 10 +-- templates/{acp.jade => acp.pug} | 10 +-- templates/{channel.jade => channel.pug} | 44 +++++----- ...channeloptions.jade => channeloptions.pug} | 34 ++++---- templates/{contact.jade => contact.pug} | 14 +-- templates/{csrferror.jade => csrferror.pug} | 10 +-- templates/{footer.jade => footer.pug} | 0 templates/{head.jade => head.pug} | 4 +- templates/{httperror.jade => httperror.pug} | 16 ++-- templates/{index.jade => index.pug} | 12 +-- templates/{login.jade => login.pug} | 10 +-- templates/{logout.jade => logout.pug} | 10 +-- templates/{nav.jade => nav.pug} | 24 +++--- templates/{pagefooter.jade => pagefooter.pug} | 0 ...privacy-policy.jade => privacy-policy.pug} | 10 +-- templates/{register.jade => register.pug} | 10 +-- templates/{tos.jade => tos.pug} | 10 +-- .../{useroptions.jade => useroptions.pug} | 30 +++---- 31 files changed, 233 insertions(+), 233 deletions(-) rename src/web/{jade.js => pug.js} (83%) rename templates/{account-channels.jade => account-channels.pug} (87%) rename templates/{account-edit.jade => account-edit.pug} (96%) rename templates/{account-passwordrecover.jade => account-passwordrecover.pug} (83%) rename templates/{account-passwordreset.jade => account-passwordreset.pug} (87%) rename templates/{account-profile.jade => account-profile.pug} (91%) rename templates/{acp.jade => acp.pug} (97%) rename templates/{channel.jade => channel.pug} (94%) rename templates/{channeloptions.jade => channeloptions.pug} (80%) rename templates/{contact.jade => contact.pug} (83%) rename templates/{csrferror.jade => csrferror.pug} (87%) rename templates/{footer.jade => footer.pug} (100%) rename templates/{head.jade => head.pug} (83%) rename templates/{httperror.jade => httperror.pug} (77%) rename templates/{index.jade => index.pug} (83%) rename templates/{login.jade => login.pug} (93%) rename templates/{logout.jade => logout.pug} (78%) rename templates/{nav.jade => nav.pug} (72%) rename templates/{pagefooter.jade => pagefooter.pug} (100%) rename templates/{privacy-policy.jade => privacy-policy.pug} (96%) rename templates/{register.jade => register.pug} (96%) rename templates/{tos.jade => tos.pug} (94%) rename templates/{useroptions.jade => useroptions.pug} (78%) diff --git a/package.json b/package.json index 838072bd..feddf496 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.17.5", + "version": "3.18.0", "repository": { "url": "http://github.com/calzoneman/sync" }, @@ -25,13 +25,13 @@ "express-minify": "^0.1.6", "graceful-fs": "^4.1.2", "http-errors": "^1.3.1", - "jade": "^1.11.0", "json-typecheck": "^0.1.3", "lodash": "^4.13.1", "morgan": "^1.6.1", "mysql": "^2.9.0", "nodemailer": "^1.4.0", "oauth": "^0.9.12", + "pug": "^2.0.0-beta3", "q": "^1.4.1", "redis": "^2.4.2", "sanitize-html": "git://github.com/calzoneman/sanitize-html", diff --git a/src/web/account.js b/src/web/account.js index 25e57463..2073fbe6 100644 --- a/src/web/account.js +++ b/src/web/account.js @@ -5,7 +5,7 @@ */ var webserver = require("./webserver"); -var sendJade = require("./jade").sendJade; +var sendPug = require("./pug").sendPug; var Logger = require("../logger"); var db = require("../database"); var $util = require("../utilities"); @@ -22,7 +22,7 @@ function handleAccountEditPage(req, res) { return; } - sendJade(res, "account-edit", {}); + sendPug(res, "account-edit", {}); } /** @@ -61,14 +61,14 @@ function handleChangePassword(req, res) { } if (newpassword.length === 0) { - sendJade(res, "account-edit", { + sendPug(res, "account-edit", { errorMessage: "New password must not be empty" }); return; } if (!req.user) { - sendJade(res, "account-edit", { + sendPug(res, "account-edit", { errorMessage: "You must be logged in to change your password" }); return; @@ -78,7 +78,7 @@ function handleChangePassword(req, res) { db.users.verifyLogin(name, oldpassword, function (err, user) { if (err) { - sendJade(res, "account-edit", { + sendPug(res, "account-edit", { errorMessage: err }); return; @@ -86,7 +86,7 @@ function handleChangePassword(req, res) { db.users.setPassword(name, newpassword, function (err, dbres) { if (err) { - sendJade(res, "account-edit", { + sendPug(res, "account-edit", { errorMessage: err }); return; @@ -97,7 +97,7 @@ function handleChangePassword(req, res) { db.users.getUser(name, function (err, user) { if (err) { - return sendJade(res, "account-edit", { + return sendPug(res, "account-edit", { errorMessage: err }); } @@ -106,7 +106,7 @@ function handleChangePassword(req, res) { var expiration = new Date(parseInt(req.signedCookies.auth.split(":")[1])); session.genSession(user, expiration, function (err, auth) { if (err) { - return sendJade(res, "account-edit", { + return sendPug(res, "account-edit", { errorMessage: err }); } @@ -126,7 +126,7 @@ function handleChangePassword(req, res) { }); } - sendJade(res, "account-edit", { + sendPug(res, "account-edit", { successMessage: "Password changed." }); }); @@ -151,7 +151,7 @@ function handleChangeEmail(req, res) { } if (!$util.isValidEmail(email) && email !== "") { - sendJade(res, "account-edit", { + sendPug(res, "account-edit", { errorMessage: "Invalid email address" }); return; @@ -159,7 +159,7 @@ function handleChangeEmail(req, res) { db.users.verifyLogin(name, password, function (err, user) { if (err) { - sendJade(res, "account-edit", { + sendPug(res, "account-edit", { errorMessage: err }); return; @@ -167,7 +167,7 @@ function handleChangeEmail(req, res) { db.users.setEmail(name, email, function (err, dbres) { if (err) { - sendJade(res, "account-edit", { + sendPug(res, "account-edit", { errorMessage: err }); return; @@ -175,7 +175,7 @@ function handleChangeEmail(req, res) { Logger.eventlog.log("[account] " + req.realIP + " changed email for " + name + " to " + email); - sendJade(res, "account-edit", { + sendPug(res, "account-edit", { successMessage: "Email address changed." }); }); @@ -191,13 +191,13 @@ function handleAccountChannelPage(req, res) { } if (!req.user) { - return sendJade(res, "account-channels", { + return sendPug(res, "account-channels", { channels: [] }); } db.channels.listUserChannels(req.user.name, function (err, channels) { - sendJade(res, "account-channels", { + sendPug(res, "account-channels", { channels: channels }); }); @@ -235,14 +235,14 @@ function handleNewChannel(req, res) { } if (!req.user) { - return sendJade(res, "account-channels", { + return sendPug(res, "account-channels", { channels: [] }); } db.channels.listUserChannels(req.user.name, function (err, channels) { if (err) { - sendJade(res, "account-channels", { + sendPug(res, "account-channels", { channels: [], newChannelError: err }); @@ -250,7 +250,7 @@ function handleNewChannel(req, res) { } if (name.match(Config.get("reserved-names.channels"))) { - sendJade(res, "account-channels", { + sendPug(res, "account-channels", { channels: channels, newChannelError: "That channel name is reserved" }); @@ -259,7 +259,7 @@ function handleNewChannel(req, res) { if (channels.length >= Config.get("max-channels-per-user") && req.user.global_rank < 255) { - sendJade(res, "account-channels", { + sendPug(res, "account-channels", { channels: channels, newChannelError: "You are not allowed to register more than " + 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, newChannelError: err ? err : undefined }); @@ -309,7 +309,7 @@ function handleDeleteChannel(req, res) { } if (!req.user) { - return sendJade(res, "account-channels", { + return sendPug(res, "account-channels", { channels: [], }); } @@ -317,7 +317,7 @@ function handleDeleteChannel(req, res) { db.channels.lookup(name, function (err, channel) { if (err) { - sendJade(res, "account-channels", { + sendPug(res, "account-channels", { channels: [], deleteChannelError: err }); @@ -326,7 +326,7 @@ function handleDeleteChannel(req, res) { if (channel.owner !== req.user.name && req.user.global_rank < 255) { db.channels.listUserChannels(req.user.name, function (err2, channels) { - sendJade(res, "account-channels", { + sendPug(res, "account-channels", { channels: err2 ? [] : channels, 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) { - sendJade(res, "account-channels", { + sendPug(res, "account-channels", { channels: err2 ? [] : channels, deleteChannelError: err ? err : undefined }); @@ -372,7 +372,7 @@ function handleAccountProfilePage(req, res) { } if (!req.user) { - return sendJade(res, "account-profile", { + return sendPug(res, "account-profile", { profileImage: "", profileText: "" }); @@ -380,7 +380,7 @@ function handleAccountProfilePage(req, res) { db.users.getProfile(req.user.name, function (err, profile) { if (err) { - sendJade(res, "account-profile", { + sendPug(res, "account-profile", { profileError: err, profileImage: "", profileText: "" @@ -388,7 +388,7 @@ function handleAccountProfilePage(req, res) { return; } - sendJade(res, "account-profile", { + sendPug(res, "account-profile", { profileImage: profile.image, profileText: profile.text, profileError: false @@ -403,7 +403,7 @@ function handleAccountProfile(req, res) { csrf.verify(req); if (!req.user) { - return sendJade(res, "account-profile", { + return sendPug(res, "account-profile", { profileImage: "", profileText: "", 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) { if (err) { - sendJade(res, "account-profile", { + sendPug(res, "account-profile", { profileImage: "", profileText: "", profileError: err @@ -423,7 +423,7 @@ function handleAccountProfile(req, res) { return; } - sendJade(res, "account-profile", { + sendPug(res, "account-profile", { profileImage: image, profileText: text, profileError: false @@ -439,7 +439,7 @@ function handlePasswordResetPage(req, res) { return; } - sendJade(res, "account-passwordreset", { + sendPug(res, "account-passwordreset", { reset: false, resetEmail: "", resetErr: false @@ -461,7 +461,7 @@ function handlePasswordReset(req, res) { } if (!$util.isValidUserName(name)) { - sendJade(res, "account-passwordreset", { + sendPug(res, "account-passwordreset", { reset: false, resetEmail: "", resetErr: "Invalid username '" + name + "'" @@ -471,7 +471,7 @@ function handlePasswordReset(req, res) { db.users.getEmail(name, function (err, actualEmail) { if (err) { - sendJade(res, "account-passwordreset", { + sendPug(res, "account-passwordreset", { reset: false, resetEmail: "", resetErr: err @@ -480,14 +480,14 @@ function handlePasswordReset(req, res) { } if (actualEmail !== email.trim()) { - sendJade(res, "account-passwordreset", { + sendPug(res, "account-passwordreset", { reset: false, resetEmail: "", resetErr: "Provided email does not match the email address on record for " + name }); return; } else if (actualEmail === "") { - sendJade(res, "account-passwordreset", { + sendPug(res, "account-passwordreset", { reset: false, resetEmail: "", resetErr: name + " doesn't have an email address on record. Please contact an " + @@ -509,7 +509,7 @@ function handlePasswordReset(req, res) { expire: expire }, function (err, dbres) { if (err) { - sendJade(res, "account-passwordreset", { + sendPug(res, "account-passwordreset", { reset: false, resetEmail: "", resetErr: err @@ -521,7 +521,7 @@ function handlePasswordReset(req, res) { name + " <" + email + ">"); if (!Config.get("mail.enabled")) { - sendJade(res, "account-passwordreset", { + sendPug(res, "account-passwordreset", { reset: false, resetEmail: email, 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) { if (err) { Logger.errlog.log("mail fail: " + err); - sendJade(res, "account-passwordreset", { + sendPug(res, "account-passwordreset", { reset: false, resetEmail: email, resetErr: "Sending reset email failed. Please contact an " + "administrator for assistance." }); } else { - sendJade(res, "account-passwordreset", { + sendPug(res, "account-passwordreset", { reset: true, resetEmail: email, resetErr: false @@ -580,7 +580,7 @@ function handlePasswordRecover(req, res) { db.lookupPasswordReset(hash, function (err, row) { if (err) { - sendJade(res, "account-passwordrecover", { + sendPug(res, "account-passwordrecover", { recovered: false, recoverErr: err }); @@ -588,7 +588,7 @@ function handlePasswordRecover(req, res) { } if (Date.now() >= row.expire) { - sendJade(res, "account-passwordrecover", { + sendPug(res, "account-passwordrecover", { recovered: false, recoverErr: "This password recovery link has expired. Password " + "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) { if (err) { - sendJade(res, "account-passwordrecover", { + sendPug(res, "account-passwordrecover", { recovered: false, recoverErr: "Database error. Please contact an administrator if " + "this persists." @@ -616,7 +616,7 @@ function handlePasswordRecover(req, res) { db.deletePasswordReset(hash); Logger.eventlog.log("[account] " + ip + " recovered password for " + row.name); - sendJade(res, "account-passwordrecover", { + sendPug(res, "account-passwordrecover", { recovered: true, recoverPw: newpw }); diff --git a/src/web/acp.js b/src/web/acp.js index d418417b..588e9695 100644 --- a/src/web/acp.js +++ b/src/web/acp.js @@ -1,7 +1,7 @@ var path = require("path"); var fs = require("fs"); var webserver = require("./webserver"); -var sendJade = require("./jade").sendJade; +var sendPug = require("./pug").sendPug; var Logger = require("../logger"); var db = require("../database"); var Config = require("../config"); @@ -35,7 +35,7 @@ function handleAcp(req, res, user) { } sio += "/socket.io/socket.io.js"; - sendJade(res, "acp", { + sendPug(res, "acp", { sioSource: sio }); } diff --git a/src/web/auth.js b/src/web/auth.js index 5e639db8..ac3cbcc1 100644 --- a/src/web/auth.js +++ b/src/web/auth.js @@ -4,11 +4,11 @@ * @author Calvin Montgomery */ -var jade = require("jade"); +var pug = require("pug"); var path = require("path"); var webserver = require("./webserver"); var cookieall = webserver.cookieall; -var sendJade = require("./jade").sendJade; +var sendPug = require("./pug").sendPug; var Logger = require("../logger"); var $util = require("../utilities"); var db = require("../database"); @@ -56,7 +56,7 @@ function handleLogin(req, res) { Logger.eventlog.log("[loginfail] Login failed (bad password): " + name + "@" + req.realIP); } - sendJade(res, "login", { + sendPug(res, "login", { loggedIn: false, loginError: err }); @@ -65,7 +65,7 @@ function handleLogin(req, res) { session.genSession(user, expiration, function (err, auth) { if (err) { - sendJade(res, "login", { + sendPug(res, "login", { loggedIn: false, loginError: err }); @@ -93,7 +93,7 @@ function handleLogin(req, res) { res.redirect(dest); } else { res.user = user; - sendJade(res, "login", {}); + sendPug(res, "login", {}); } }); }); @@ -108,12 +108,12 @@ function handleLoginPage(req, res) { } if (req.user) { - return sendJade(res, "login", { + return sendPug(res, "login", { wasAlreadyLoggedIn: true }); } - sendJade(res, "login", { + sendPug(res, "login", { redirect: req.query.dest || req.header("referer") }); } @@ -138,7 +138,7 @@ function handleLogout(req, res) { if (dest) { res.redirect(dest); } else { - sendJade(res, "logout", {}); + sendPug(res, "logout", {}); } } @@ -151,11 +151,11 @@ function handleRegisterPage(req, res) { } if (req.user) { - sendJade(res, "register", {}); + sendPug(res, "register", {}); return; } - sendJade(res, "register", { + sendPug(res, "register", { registered: false, registerError: false }); @@ -181,21 +181,21 @@ function handleRegister(req, res) { } if (name.length === 0) { - sendJade(res, "register", { + sendPug(res, "register", { registerError: "Username must not be empty" }); return; } if (name.match(Config.get("reserved-names.usernames"))) { - sendJade(res, "register", { + sendPug(res, "register", { registerError: "That username is reserved" }); return; } if (password.length === 0) { - sendJade(res, "register", { + sendPug(res, "register", { registerError: "Password must not be empty" }); return; @@ -204,7 +204,7 @@ function handleRegister(req, res) { password = password.substring(0, 100); if (email.length > 0 && !$util.isValidEmail(email)) { - sendJade(res, "register", { + sendPug(res, "register", { registerError: "Invalid email address" }); return; @@ -212,13 +212,13 @@ function handleRegister(req, res) { db.users.register(name, password, email, ip, function (err) { if (err) { - sendJade(res, "register", { + sendPug(res, "register", { registerError: err }); } else { Logger.eventlog.log("[register] " + ip + " registered account: " + name + (email.length > 0 ? " <" + email + ">" : "")); - sendJade(res, "register", { + sendPug(res, "register", { registered: true, registerName: name, redirect: req.body.redirect diff --git a/src/web/jade.js b/src/web/pug.js similarity index 83% rename from src/web/jade.js rename to src/web/pug.js index 90a95ab9..bd735344 100644 --- a/src/web/jade.js +++ b/src/web/pug.js @@ -1,4 +1,4 @@ -var jade = require("jade"); +var pug = require("pug"); var fs = require("fs"); var path = require("path"); var Config = require("../config"); @@ -6,7 +6,7 @@ var templates = path.join(__dirname, "..", "..", "templates"); var cache = {}; /** - * Merges locals with globals for jade rendering + * Merges locals with globals for pug rendering */ function merge(locals, res) { 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.loginName = locals.loginName || res.user ? res.user.name : false; if (!(view in cache) || Config.get("debug")) { - var file = path.join(templates, view + ".jade"); - var fn = jade.compile(fs.readFileSync(file), { + var file = path.join(templates, view + ".pug"); + var fn = pug.compile(fs.readFileSync(file), { filename: file, pretty: !Config.get("http.minify") }); @@ -51,5 +51,5 @@ function sendJade(res, view, locals) { } module.exports = { - sendJade: sendJade + sendPug: sendPug }; diff --git a/src/web/routes/channel.js b/src/web/routes/channel.js index 457565d9..6be33232 100644 --- a/src/web/routes/channel.js +++ b/src/web/routes/channel.js @@ -1,6 +1,6 @@ import CyTubeUtil from '../../utilities'; import { sanitizeText } from '../../xss'; -import { sendJade } from '../jade'; +import { sendPug } from '../pug'; import * as HTTPStatus from '../httpstatus'; import { HTTPError } from '../../errors'; @@ -17,7 +17,7 @@ export default function initialize(app, ioConfig) { } const socketBaseURL = endpoints[0].url; - sendJade(res, 'channel', { + sendPug(res, 'channel', { channelName: req.params.channel, sioSource: `${socketBaseURL}/socket.io/socket.io.js` }); diff --git a/src/web/routes/contact.js b/src/web/routes/contact.js index 32907469..7e737892 100644 --- a/src/web/routes/contact.js +++ b/src/web/routes/contact.js @@ -1,5 +1,5 @@ import CyTubeUtil from '../../utilities'; -import { sendJade } from '../jade'; +import { sendPug } from '../pug'; export default function initialize(app, webConfig) { app.get('/contact', (req, res) => { @@ -19,7 +19,7 @@ export default function initialize(app, webConfig) { return contact; }); - return sendJade(res, 'contact', { + return sendPug(res, 'contact', { contacts: contacts }); }); diff --git a/src/web/routes/index.js b/src/web/routes/index.js index e416376e..dc103132 100644 --- a/src/web/routes/index.js +++ b/src/web/routes/index.js @@ -1,4 +1,4 @@ -import { sendJade } from '../jade'; +import { sendPug } from '../pug'; export default function initialize(app, channelIndex, maxEntries) { app.get('/', (req, res) => { @@ -13,7 +13,7 @@ export default function initialize(app, channelIndex, maxEntries) { channels = channels.slice(0, maxEntries); - sendJade(res, 'index', { + sendPug(res, 'index', { channels: channels }); }); diff --git a/src/web/webserver.js b/src/web/webserver.js index 30de9ea0..b428517f 100644 --- a/src/web/webserver.js +++ b/src/web/webserver.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import net from 'net'; import express from 'express'; -import { sendJade } from './jade'; +import { sendPug } from './pug'; import Logger from '../logger'; import Config from '../config'; import bodyParser from 'body-parser'; @@ -76,7 +76,7 @@ function handleLegacySocketConfig(req, res) { } function handleUserAgreement(req, res) { - sendJade(res, 'tos', { + sendPug(res, 'tos', { domain: Config.get('http.domain') }); } @@ -92,7 +92,7 @@ function initializeErrorHandlers(app) { if (err) { if (err instanceof CSRFError) { res.status(HTTPStatus.FORBIDDEN); - return sendJade(res, 'csrferror', { + return sendPug(res, 'csrferror', { path: req.path, referer: req.header('referer') }); @@ -104,7 +104,7 @@ function initializeErrorHandlers(app) { } if (!message) { message = 'An unknown error occurred.'; - } else if (/\.(jade|js)/.test(message)) { + } else if (/\.(pug|js)/.test(message)) { // Prevent leakage of stack traces message = 'An internal error occurred.'; } @@ -115,7 +115,7 @@ function initializeErrorHandlers(app) { } res.status(status); - return sendJade(res, 'httperror', { + return sendPug(res, 'httperror', { path: req.path, status: status, message: message diff --git a/templates/account-channels.jade b/templates/account-channels.pug similarity index 87% rename from templates/account-channels.jade rename to templates/account-channels.pug index dad5def5..b21a233a 100644 --- a/templates/account-channels.jade +++ b/templates/account-channels.pug @@ -2,16 +2,16 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/account/channels") - mixin navloginlogout("/account/channels") + +navdefaultlinks("/account/channels") + +navloginlogout("/account/channels") section#mainpage .container if !loggedIn @@ -38,13 +38,13 @@ html(lang="en") for c in channels tr 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="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 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 h3 Register a new channel if newChannelError @@ -60,4 +60,4 @@ html(lang="en") button.btn.btn-primary.btn-block(type="submit") Register include footer - mixin footer() + +footer() diff --git a/templates/account-edit.jade b/templates/account-edit.pug similarity index 96% rename from templates/account-edit.jade rename to templates/account-edit.pug index 55ce9f4c..53017dc1 100644 --- a/templates/account-edit.jade +++ b/templates/account-edit.pug @@ -2,16 +2,16 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/account/edit") - mixin navloginlogout("/account/edit") + +navdefaultlinks("/account/edit") + +navloginlogout("/account/edit") section#mainpage .container if !loggedIn @@ -60,7 +60,7 @@ html(lang="en") input#email.form-control(type="email", name="email") button#changeemailbtn.btn.btn-danger.btn-block(type="submit") Change Email include footer - mixin footer() + +footer() script(type="text/javascript"). function validatePasswordChange() { var pw = $("#newpassword").val(); diff --git a/templates/account-passwordrecover.jade b/templates/account-passwordrecover.pug similarity index 83% rename from templates/account-passwordrecover.jade rename to templates/account-passwordrecover.pug index 16b2d1b2..f5067651 100644 --- a/templates/account-passwordrecover.jade +++ b/templates/account-passwordrecover.pug @@ -2,16 +2,16 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/account/passwordrecover/") - mixin navloginlogout("/account/passwordrecover/") + +navdefaultlinks("/account/passwordrecover/") + +navloginlogout("/account/passwordrecover/") section#mainpage .container .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 p= recoverErr include footer - mixin footer() + +footer() diff --git a/templates/account-passwordreset.jade b/templates/account-passwordreset.pug similarity index 87% rename from templates/account-passwordreset.jade rename to templates/account-passwordreset.pug index 957dc794..6ea703fe 100644 --- a/templates/account-passwordreset.jade +++ b/templates/account-passwordreset.pug @@ -2,16 +2,16 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/account/passwordreset") - mixin navloginlogout("/account/passwordreset") + +navdefaultlinks("/account/passwordreset") + +navloginlogout("/account/passwordreset") section#mainpage .container .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 include footer - mixin footer() + +footer() diff --git a/templates/account-profile.jade b/templates/account-profile.pug similarity index 91% rename from templates/account-profile.jade rename to templates/account-profile.pug index 30e6a551..25ca1574 100644 --- a/templates/account-profile.jade +++ b/templates/account-profile.pug @@ -2,16 +2,16 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/account/profile") - mixin navloginlogout("/account/profile") + +navdefaultlinks("/account/profile") + +navloginlogout("/account/profile") section#mainpage .container if !loggedIn @@ -42,6 +42,6 @@ html(lang="en") button.btn.btn-primary.btn-block(type="submit") Save include footer - mixin footer() + +footer() script(type="text/javascript"). $("#profileimage").val("#{profileImage}"); diff --git a/templates/acp.jade b/templates/acp.pug similarity index 97% rename from templates/acp.jade rename to templates/acp.pug index a2103e35..a3ca46ad 100644 --- a/templates/acp.jade +++ b/templates/acp.pug @@ -2,21 +2,21 @@ doctype html html(lang="en") head include head - mixin head() + +head() link(rel="stylesheet", type="text/css", href="/css/acp.css") body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/acp") + +navdefaultlinks("/acp") li#nav-acp-section.dropdown a#nav-acp-dd-toggle.dropdown-toggle(data-toggle="dropdown", href="javascript:void(0)") Menu span.caret ul.dropdown-menu - mixin navloginlogout("/acp") + +navloginlogout("/acp") section#mainpage .container .row @@ -125,7 +125,7 @@ html(lang="en") canvas#stat_mem(width="1140", height="400") include footer - mixin footer() + +footer() script(type="text/javascript"). var USEROPTS = { secure_connection: true }; script(src=sioSource) diff --git a/templates/channel.jade b/templates/channel.pug similarity index 94% rename from templates/channel.jade rename to templates/channel.pug index 561a0d4c..2b4354dc 100644 --- a/templates/channel.jade +++ b/templates/channel.pug @@ -2,18 +2,18 @@ doctype html html(lang="en") head include head - mixin head() + +head() link(href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css", rel="stylesheet") link(rel="stylesheet", href="/css/video-js.css") body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse - var cname = "/r/" + channelName ul.nav.navbar-nav - mixin navdefaultlinks(cname) + +navdefaultlinks(cname) li: a(href="javascript:void(0)", onclick="javascript:showUserOptions()") Options li: a#showchansettings(href="javascript:void(0)", onclick="javascript:showChannelSettings()") Channel Settings li.dropdown @@ -22,7 +22,7 @@ html(lang="en") ul.dropdown-menu li: a(href="#" onclick="javascript:chatOnly()") Chat Only li: a(href="#" onclick="javascript:removeVideo(event)") Remove Video - mixin navloginlogout(cname) + +navloginlogout(cname) section#mainpage .container #motdrow.row @@ -168,11 +168,11 @@ html(lang="en") .modal-body .tab-content include useroptions - mixin us-general() - mixin us-playback() - mixin us-chat() - mixin us-scripts() - mixin us-mod() + +us-general() + +us-playback() + +us-chat() + +us-scripts() + +us-mod() .modal-footer button.btn.btn-primary(type="button", data-dismiss="modal", onclick="javascript:saveUserOptions()") Save button.btn.btn-default(type="button", data-dismiss="modal") Close @@ -219,23 +219,23 @@ html(lang="en") .modal-body .tab-content include channeloptions - mixin miscoptions() - mixin adminoptions() - mixin motdeditor() - mixin csseditor() - mixin jseditor() - mixin banlist() - mixin recentjoins() - mixin chanranks() - mixin chatfilters() - mixin emotes() - mixin chanlog() - mixin permeditor() + +miscoptions() + +adminoptions() + +motdeditor() + +csseditor() + +jseditor() + +banlist() + +recentjoins() + +chanranks() + +chatfilters() + +emotes() + +chanlog() + +permeditor() .modal-footer button.btn.btn-default(type="button", data-dismiss="modal") Close #pmbar include footer - mixin footer() + +footer() script(id="socketio-js", src=sioSource) script(src="/js/data.js") script(src="/js/util.js") diff --git a/templates/channeloptions.jade b/templates/channeloptions.pug similarity index 80% rename from templates/channeloptions.jade rename to templates/channeloptions.pug index 9aed37e7..3527dd87 100644 --- a/templates/channeloptions.jade +++ b/templates/channeloptions.pug @@ -50,19 +50,19 @@ mixin miscoptions #cs-miscoptions.tab-pane.active h4 General Settings form.form-horizontal(action="javascript:void(0)") - mixin rcheckbox-auto("cs-allow_voteskip", "Allow voteskip") - mixin rcheckbox-auto("cs-allow_dupes", "Allow duplicate videos on the playlist") - mixin textbox-auto("cs-voteskip_ratio", "Voteskip ratio", "0.5") - mixin textbox-auto("cs-maxlength", "Max video length", "HH:MM:SS") - mixin textbox-auto("cs-afk_timeout", "Auto-AFK Delay", "0 (disabled)") + +rcheckbox-auto("cs-allow_voteskip", "Allow voteskip") + +rcheckbox-auto("cs-allow_dupes", "Allow duplicate videos on the playlist") + +textbox-auto("cs-voteskip_ratio", "Voteskip ratio", "0.5") + +textbox-auto("cs-maxlength", "Max video length", "HH:MM:SS") + +textbox-auto("cs-afk_timeout", "Auto-AFK Delay", "0 (disabled)") .form-group .col-sm-offset-4 h4 Chat Settings form.form-horizontal(action="javascript:void(0)") - mixin rcheckbox-auto("cs-enable_link_regex", "Convert URLs in chat to links") - mixin rcheckbox-auto("cs-chat_antiflood", "Throttle chat") - mixin 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") + +rcheckbox-auto("cs-enable_link_regex", "Convert URLs in chat to links") + +rcheckbox-auto("cs-chat_antiflood", "Throttle chat") + +textbox-auto("cs-chat_antiflood_burst", "# of messages allowed before throttling") + +textbox-auto("cs-chat_antiflood_sustained", "# of messages (after burst) allowed per second") .form-group .col-sm-8.col-sm-offset-4 span.text-info Changes are automatically saved. @@ -72,14 +72,14 @@ mixin adminoptions h4 Admin-Only Settings form.form-horizontal(action="javascript:void(0)") - var defname = "CyTube - /r/" + channelName - mixin textbox-auto("cs-pagetitle", "Page title", defname) - mixin textbox-auto("cs-password", "Password", "leave blank to disable") - mixin textbox-auto("cs-externalcss", "External CSS", "Stylesheet URL") - mixin textbox-auto("cs-externaljs", "External Javascript", "Script URL") - mixin rcheckbox-auto("cs-show_public", "List channel publicly") - mixin rcheckbox-auto("cs-torbanned", "Block connections from Tor") - mixin 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-pagetitle", "Page title", defname) + +textbox-auto("cs-password", "Password", "leave blank to disable") + +textbox-auto("cs-externalcss", "External CSS", "Stylesheet URL") + +textbox-auto("cs-externaljs", "External Javascript", "Script URL") + +rcheckbox-auto("cs-show_public", "List channel publicly") + +rcheckbox-auto("cs-torbanned", "Block connections from Tor") + +rcheckbox-auto("cs-allow_ascii_control", "Allow ASCII control characters (e.g. newlines)") + +textbox-auto("cs-playlist_max_per_user", "Maximum # of videos per user") .form-group .col-sm-8.col-sm-offset-4 span.text-info Set to 0 for no limit diff --git a/templates/contact.jade b/templates/contact.pug similarity index 83% rename from templates/contact.jade rename to templates/contact.pug index b3204271..43c9246c 100644 --- a/templates/contact.jade +++ b/templates/contact.pug @@ -1,20 +1,20 @@ 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 html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/contact") - mixin navloginlogout("/contact") + +navdefaultlinks("/contact") + +navloginlogout("/contact") section#mainpage .container .col-md-8.col-md-offset-2 @@ -23,14 +23,14 @@ html(lang="en") each contact in contacts strong= contact.name p.text-muted= contact.title - mixin email(contact.email, contact.emkey) + +email(contact.email, contact.emkey) br hr h3 IRC 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 irc.6irc.net#cytube. These people can also address general questions about the software, but cannot provide technical support for third-party websites using this code. include footer - mixin footer() + +footer() script(type="text/javascript"). function showEmail(btn, email, key) { email = unescape(email); diff --git a/templates/csrferror.jade b/templates/csrferror.pug similarity index 87% rename from templates/csrferror.jade rename to templates/csrferror.pug index a3a8add3..017659c8 100644 --- a/templates/csrferror.jade +++ b/templates/csrferror.pug @@ -2,16 +2,16 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks(path) - mixin navloginlogout(path) + +navdefaultlinks(path) + +navloginlogout(path) section#mainpage.container .col-md-12 @@ -28,4 +28,4 @@ html(lang="en") a(href=referer) Return to previous page include footer - mixin footer() + +footer() diff --git a/templates/footer.jade b/templates/footer.pug similarity index 100% rename from templates/footer.jade rename to templates/footer.pug diff --git a/templates/head.jade b/templates/head.pug similarity index 83% rename from templates/head.jade rename to templates/head.pug index bc4ecc1c..f537b15e 100644 --- a/templates/head.jade +++ b/templates/head.pug @@ -1,8 +1,8 @@ mixin head() meta(charset="utf-8") meta(name="viewport", content="width=device-width, initial-scale=1.0") - meta(name="description", content="#{siteDescription}") - meta(name="author", content="#{siteAuthor}") + meta(name="description", content=siteDescription) + meta(name="author", content=siteAuthor) title= siteTitle link(href="/css/sticky-footer-navbar.css", rel="stylesheet") diff --git a/templates/httperror.jade b/templates/httperror.pug similarity index 77% rename from templates/httperror.jade rename to templates/httperror.pug index 56909bc9..97ea8e4d 100644 --- a/templates/httperror.jade +++ b/templates/httperror.pug @@ -13,26 +13,26 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks(path) - mixin navloginlogout(path) + +navdefaultlinks(path) + +navloginlogout(path) section#mainpage.container .col-md-12 .alert.alert-danger if status == 404 - mixin notfound() + +notfound() else if status == 403 - mixin forbidden() + +forbidden() else - mixin genericerror() + +genericerror() include footer - mixin footer() + +footer() diff --git a/templates/index.jade b/templates/index.pug similarity index 83% rename from templates/index.jade rename to templates/index.pug index 3fe38da3..251ed2de 100644 --- a/templates/index.jade +++ b/templates/index.pug @@ -2,16 +2,16 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/") - mixin navloginlogout("/") + +navdefaultlinks("/") + +navloginlogout("/") section#mainpage .container .col-lg-9.col-md-9 @@ -24,7 +24,7 @@ html(lang="en") tbody each chan in channels 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.mediatitle .col-lg-3.col-md-3 @@ -32,7 +32,7 @@ html(lang="en") input#channelname.form-control(type="text", placeholder="Channel Name") p.text-muted New channels can be registered from the My Channels page. include footer - mixin footer() + +footer() script(type="text/javascript"). $("#channelname").keydown(function (ev) { if (ev.keyCode === 13) { diff --git a/templates/login.jade b/templates/login.pug similarity index 93% rename from templates/login.jade rename to templates/login.pug index c077243e..f4b4955b 100644 --- a/templates/login.jade +++ b/templates/login.pug @@ -2,17 +2,17 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/login") + +navdefaultlinks("/login") if loggedIn - mixin navlogoutform("/") + +navlogoutform("/") section#mainpage.container if wasAlreadyLoggedIn .col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3 @@ -51,4 +51,4 @@ html(lang="en") br a(href=redirect) Return to previous page include footer - mixin footer() + +footer() diff --git a/templates/logout.jade b/templates/logout.pug similarity index 78% rename from templates/logout.jade rename to templates/logout.pug index 56240aeb..d19742f4 100644 --- a/templates/logout.jade +++ b/templates/logout.pug @@ -2,16 +2,16 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/logout") - mixin navloginform("/") + +navdefaultlinks("/logout") + +navloginform("/") section#mainpage.container .col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3 .alert.alert-info.center.messagebox @@ -20,4 +20,4 @@ html(lang="en") if redirect a(href=redirect) Return to previous page include footer - mixin footer() + +footer() diff --git a/templates/nav.jade b/templates/nav.pug similarity index 72% rename from templates/nav.jade rename to templates/nav.pug index 932f0c02..8cc80260 100644 --- a/templates/nav.jade +++ b/templates/nav.pug @@ -1,4 +1,4 @@ -- var links = { "/": "Home" } +- var links = { "/": "Home" }; mixin navlink(page, title, active) if active @@ -19,9 +19,9 @@ mixin navheader() mixin navdefaultlinks(page) each t, p in links if p == page - mixin navlink(p, t, true) + +navlink(p, t, true) else - mixin navlink(p, t, false) + +navlink(p, t, false) li.dropdown a.dropdown-toggle(href="#", data-toggle="dropdown") Account b.caret @@ -29,24 +29,24 @@ mixin navdefaultlinks(page) if loggedIn li: a(href="javascript:$('#logoutform').submit();") Log out li.divider - li: a(href="#{loginDomain}/account/channels") Channels - li: a(href="#{loginDomain}/account/profile") Profile - li: a(href="#{loginDomain}/account/edit") Change Password/Email + li: a(href=loginDomain+"/account/channels") Channels + li: a(href=loginDomain+"/account/profile") Profile + li: a(href=loginDomain+"/account/edit") Change Password/Email else - li: a(href="#{loginDomain}/login?dest=#{encodeURIComponent(baseUrl + page)}") Login - li: a(href="#{loginDomain}/register") Register + li: a(href=loginDomain+"/login?dest=" + encodeURIComponent(baseUrl + page)) Login + li: a(href=loginDomain+"/register") Register mixin navloginlogout(redirect) if loggedIn - mixin navlogoutform(redirect) + +navlogoutform(redirect) else - mixin navloginform(redirect) + +navloginform(redirect) mixin navloginform(redirect) if loginDomain == null - loginDomain = "" .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="dest", value=baseUrl + redirect) .form-group @@ -61,7 +61,7 @@ mixin navloginform(redirect) button#login.btn.btn-default(type="submit") Login .visible-md 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  ·  a#register.navbar-link(href="/register") Register diff --git a/templates/pagefooter.jade b/templates/pagefooter.pug similarity index 100% rename from templates/pagefooter.jade rename to templates/pagefooter.pug diff --git a/templates/privacy-policy.jade b/templates/privacy-policy.pug similarity index 96% rename from templates/privacy-policy.jade rename to templates/privacy-policy.pug index 28eb421f..a67426be 100644 --- a/templates/privacy-policy.jade +++ b/templates/privacy-policy.pug @@ -2,16 +2,16 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/policies/privacy") - mixin navloginlogout("/policies/privacy") + +navdefaultlinks("/policies/privacy") + +navloginlogout("/policies/privacy") section#mainpage .container .col-md-12 @@ -50,4 +50,4 @@ html(lang="en") p | When you register a channel on #{siteTitle}, you may optionally provide certain information include footer - mixin footer() + +footer() diff --git a/templates/register.jade b/templates/register.pug similarity index 96% rename from templates/register.jade rename to templates/register.pug index 3942ecca..8036a98e 100644 --- a/templates/register.jade +++ b/templates/register.pug @@ -2,17 +2,17 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/register") + +navdefaultlinks("/register") if loggedIn - mixin navlogoutform("/register") + +navlogoutform("/register") section#mainpage.container if loggedIn .col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3 @@ -50,7 +50,7 @@ html(lang="en") strong Registration Successful p Thanks for registering, #{registerName}! Now you can Login to use your account. include footer - mixin footer() + +footer() script(src="/js/jquery.js") script(type="text/javascript"). function verify() { diff --git a/templates/tos.jade b/templates/tos.pug similarity index 94% rename from templates/tos.jade rename to templates/tos.pug index 016ab7d2..a077bce0 100644 --- a/templates/tos.jade +++ b/templates/tos.pug @@ -2,16 +2,16 @@ doctype html html(lang="en") head include head - mixin head() + +head() body #wrap nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation") include nav - mixin navheader() + +navheader() #nav-collapsible.collapse.navbar-collapse ul.nav.navbar-nav - mixin navdefaultlinks("/useragreement") - mixin navloginlogout("/useragreement") + +navdefaultlinks("/useragreement") + +navloginlogout("/useragreement") section#mainpage .container .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 Use good judgement when representing #{siteTitle} on other websites. Do not spam links to your channel. include footer - mixin footer() + +footer() diff --git a/templates/useroptions.jade b/templates/useroptions.pug similarity index 78% rename from templates/useroptions.jade rename to templates/useroptions.pug index 4b404a95..0265c25e 100644 --- a/templates/useroptions.jade +++ b/templates/useroptions.pug @@ -47,8 +47,8 @@ mixin us-general .col-sm-4 .col-sm-8 p.text-danger Changing layouts may require refreshing to take effect. - mixin rcheckbox("us-no-channelcss", "Ignore Channel CSS") - mixin rcheckbox("us-no-channeljs", "Ignore Channel Javascript") + +rcheckbox("us-no-channelcss", "Ignore Channel CSS") + +rcheckbox("us-no-channeljs", "Ignore Channel Javascript") .clear mixin us-scripts @@ -66,15 +66,15 @@ mixin us-playback #us-playback.tab-pane h4 Playback Preferences form.form-horizontal(action="javascript:void(0)") - mixin rcheckbox("us-synch", "Synchronize video playback") - mixin textbox("us-synch-accuracy", "Synch threshold (seconds)", "2") - mixin rcheckbox("us-wmode-transparent", "Set wmode=transparent") + +rcheckbox("us-synch", "Synchronize video playback") + +textbox("us-synch-accuracy", "Synch threshold (seconds)", "2") + +rcheckbox("us-wmode-transparent", "Set wmode=transparent") .col-sm-4 .col-sm-8 p.text-info Setting wmode=transparent 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") - mixin rcheckbox("us-playlistbuttons", "Hide playlist buttons by default") - mixin rcheckbox("us-oldbtns", "Old style playlist buttons") + +rcheckbox("us-hidevideo", "Remove the video player") + +rcheckbox("us-playlistbuttons", "Hide playlist buttons by default") + +rcheckbox("us-oldbtns", "Old style playlist buttons") .form-group label.control-label.col-sm-4(for="#us-default-quality") Quality Preference .col-sm-8 @@ -91,9 +91,9 @@ mixin us-chat #us-chat.tab-pane h4 Chat Preferences form.form-horizontal(action="javascript:void(0)") - mixin rcheckbox("us-chat-timestamp", "Show timestamps in chat") - mixin rcheckbox("us-sort-rank", "Sort userlist by rank") - mixin rcheckbox("us-sort-afk", "Sort AFKers to bottom") + +rcheckbox("us-chat-timestamp", "Show timestamps in chat") + +rcheckbox("us-sort-rank", "Sort userlist by rank") + +rcheckbox("us-sort-afk", "Sort AFKers to bottom") .col-sm-4 .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. @@ -111,12 +111,12 @@ mixin us-chat option(value="never") Never option(value="onlyping") Only when I am mentioned or PMed option(value="always") Always - mixin rcheckbox("us-sendbtn", "Add a send button to chat") - mixin rcheckbox("us-no-emotes", "Disable chat emotes") + +rcheckbox("us-sendbtn", "Add a send button to chat") + +rcheckbox("us-no-emotes", "Disable chat emotes") mixin us-mod #us-mod.tab-pane h4 Moderator Preferences form.form-horizontal(action="javascript:void(0)") - mixin rcheckbox("us-modflair", "Show name color") - mixin rcheckbox("us-shadowchat", "Show shadowmuted messages") + +rcheckbox("us-modflair", "Show name color") + +rcheckbox("us-shadowchat", "Show shadowmuted messages")