mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
minor cleanups.
This commit is contained in:
@@ -24,7 +24,7 @@ var socket,
|
|||||||
reconnecting = false;
|
reconnecting = false;
|
||||||
|
|
||||||
// Rejoin room that was left when we disconnected
|
// Rejoin room that was left when we disconnected
|
||||||
var url_parts = document.location.pathname.slice(RELATIVE_PATH.length).split('/').slice(1);
|
var url_parts = window.location.pathname.slice(RELATIVE_PATH.length).split('/').slice(1);
|
||||||
var room;
|
var room;
|
||||||
|
|
||||||
switch(url_parts[0]) {
|
switch(url_parts[0]) {
|
||||||
@@ -513,7 +513,9 @@ var socket,
|
|||||||
$('document').ready(function () {
|
$('document').ready(function () {
|
||||||
var url = window.location.pathname.slice(1),
|
var url = window.location.pathname.slice(1),
|
||||||
search = window.location.search,
|
search = window.location.search,
|
||||||
tpl_url = ajaxify.getTemplateMapping(url);
|
hash = window.location.hash,
|
||||||
|
tpl_url = ajaxify.getTemplateMapping(url),
|
||||||
|
$window = $(window);
|
||||||
|
|
||||||
url = url.replace(/\/$/, "");
|
url = url.replace(/\/$/, "");
|
||||||
|
|
||||||
@@ -521,7 +523,7 @@ var socket,
|
|||||||
url = url.slice(RELATIVE_PATH.length);
|
url = url.slice(RELATIVE_PATH.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(window).trigger('action:ajaxify.start', {
|
$window.trigger('action:ajaxify.start', {
|
||||||
url: url
|
url: url
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -533,11 +535,11 @@ var socket,
|
|||||||
|
|
||||||
$('#logout-link').on('click', app.logout);
|
$('#logout-link').on('click', app.logout);
|
||||||
|
|
||||||
$(window).blur(function(){
|
$window.blur(function(){
|
||||||
app.isFocused = false;
|
app.isFocused = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).focus(function(){
|
$window.focus(function(){
|
||||||
app.isFocused = true;
|
app.isFocused = true;
|
||||||
app.alternatingTitle('');
|
app.alternatingTitle('');
|
||||||
});
|
});
|
||||||
@@ -550,21 +552,20 @@ var socket,
|
|||||||
ajaxify.widgets.render(tpl_url, url);
|
ajaxify.widgets.render(tpl_url, url);
|
||||||
|
|
||||||
if (window.history && window.history.replaceState) {
|
if (window.history && window.history.replaceState) {
|
||||||
var hash = window.location.hash ? window.location.hash : '';
|
|
||||||
window.history.replaceState({
|
window.history.replaceState({
|
||||||
url: url + search + hash
|
url: url + search + hash
|
||||||
}, url, RELATIVE_PATH + '/' + url + search + hash);
|
}, url, RELATIVE_PATH + '/' + url + search + hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
ajaxify.loadScript(tpl_url, function() {
|
ajaxify.loadScript(tpl_url, function() {
|
||||||
$(window).trigger('action:ajaxify.end', {
|
$window.trigger('action:ajaxify.end', {
|
||||||
url: url
|
url: url
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
showWelcomeMessage = location.href.indexOf('loggedin') !== -1;
|
showWelcomeMessage = window.location.href.indexOf('loggedin') !== -1;
|
||||||
|
|
||||||
app.loadConfig();
|
app.loadConfig();
|
||||||
app.alternatingTitle('');
|
app.alternatingTitle('');
|
||||||
|
|||||||
@@ -207,7 +207,6 @@ Controllers.register = function(req, res, next) {
|
|||||||
data.minimumPasswordLength = meta.config.minimumPasswordLength;
|
data.minimumPasswordLength = meta.config.minimumPasswordLength;
|
||||||
data.termsOfUse = meta.config.termsOfUse;
|
data.termsOfUse = meta.config.termsOfUse;
|
||||||
|
|
||||||
data.captcha = null;
|
|
||||||
plugins.fireHook('filter:register.build', req, res, data, function(err, data) {
|
plugins.fireHook('filter:register.build', req, res, data, function(err, data) {
|
||||||
if (err && process.env === 'development') {
|
if (err && process.env === 'development') {
|
||||||
winston.warn(JSON.stringify(err));
|
winston.warn(JSON.stringify(err));
|
||||||
|
|||||||
Reference in New Issue
Block a user