mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 23:45:45 +01:00
removed derpy + from header ill come back to that later when im more inspired... fixed ajaxify for custom routed urls, fixed recent/popular/active tab's invalid object initializer
This commit is contained in:
@@ -31,9 +31,12 @@ var ajaxify = {};
|
|||||||
app.enter_room('global');
|
app.enter_room('global');
|
||||||
|
|
||||||
var url = url.replace(/\/$/, "");
|
var url = url.replace(/\/$/, "");
|
||||||
tpl_url = templates.get_custom_map(tpl_url);
|
|
||||||
var tpl_url = (url === '' || url === '/') ? 'home' : url.split('/')[0];
|
|
||||||
|
|
||||||
|
var tpl_url = templates.get_custom_map(url);
|
||||||
|
|
||||||
|
if (tpl_url == false) {
|
||||||
|
tpl_url = (url === '' || url === '/') ? 'home' : url.split('/')[0];
|
||||||
|
}
|
||||||
|
|
||||||
if (templates[tpl_url]) {
|
if (templates[tpl_url]) {
|
||||||
window.history.pushState({}, url, "/" + url);
|
window.history.pushState({}, url, "/" + url);
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ var templates = {};
|
|||||||
templates.get_custom_map = function(tpl) {
|
templates.get_custom_map = function(tpl) {
|
||||||
if (config['custom_mapping'] && tpl) {
|
if (config['custom_mapping'] && tpl) {
|
||||||
for (var pattern in config['custom_mapping']) {
|
for (var pattern in config['custom_mapping']) {
|
||||||
console.log(pattern);
|
|
||||||
if (tpl.match(pattern)) {
|
if (tpl.match(pattern)) {
|
||||||
return (config['custom_mapping'][pattern]);
|
return (config['custom_mapping'][pattern]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="nav pull-right" id="right-menu">
|
<ul class="nav pull-right" id="right-menu">
|
||||||
<li><i class="icon-plus icon-2x" style="color:#999;"></i></li>
|
<!--<li><i class="icon-plus icon-2x" style="color:#999;"></i></li> fail. add this back later -->
|
||||||
<li><a href="/users" id="user_label"></a></li>
|
<li><a href="/users" id="user_label"></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ var RDB = require('./redis.js'),
|
|||||||
callback({
|
callback({
|
||||||
'category_name' : category_id ? category_name : 'Recent',
|
'category_name' : category_id ? category_name : 'Recent',
|
||||||
'show_topic_button' : category_id ? 'show' : 'hidden',
|
'show_topic_button' : category_id ? 'show' : 'hidden',
|
||||||
'category_id': category_id,
|
'category_id': category_id || 0,
|
||||||
'topics': topics
|
'topics': topics
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ var RDB = require('./redis.js'),
|
|||||||
callback({
|
callback({
|
||||||
'category_name' : category_id ? category_name : 'Recent',
|
'category_name' : category_id ? category_name : 'Recent',
|
||||||
'show_topic_button' : category_id ? 'show' : 'hidden',
|
'show_topic_button' : category_id ? 'show' : 'hidden',
|
||||||
'category_id': category_id,
|
'category_id': category_id || 0,
|
||||||
'topics': []
|
'topics': []
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user