v1.18.x
Baris Usakli 11 years ago
parent bade99d069
commit b25c3d8b67

@ -286,6 +286,8 @@ var socket,
$('span.timeago').timeago();
setTimeout(function() {
window.scrollTo(0, 1); // rehide address bar on mobile after page load completes.
}, 100);
@ -432,12 +434,14 @@ var socket,
ajaxify.go("search/" + input.val(), null, "search");
input.val('');
return false;
})
});
});
showWelcomeMessage = location.href.indexOf('loggedin') !== -1;
loadConfig();
}());

@ -94,6 +94,10 @@
right_menu.appendChild(registerEl);
right_menu.appendChild(loginEl);
}
$('#main-nav a,#right-menu a').on('click', function() {
$('.navbar-header button').click();
});
});
// Notifications dropdown

@ -12,6 +12,13 @@
$('#search-form input').val(searchQuery);
$('#mobile-search-form').off('submit').on('submit', function() {
var input = $(this).find('input');
ajaxify.go("search/" + input.val(), null, "search");
input.val('');
return false;
});
});
})();

@ -75,8 +75,10 @@
});
socket.on('api:user.isOnline', function(data) {
$('#users-container').empty();
startLoading('users:online', 0);
if(active == 'online') {
$('#users-container').empty();
startLoading('users:online', 0);
}
});
function onUsersLoaded(users) {
@ -99,12 +101,12 @@
}
if (set) {
loadingMoreUsers = true;
startLoading(set, $('#users-container').children().length);
}
}
function startLoading(set, after) {
loadingMoreUsers = true;
socket.emit('api:users.loadMore', {
set: set,
after: after

@ -54,9 +54,9 @@
<li>
<a href="/users">Users</a>
</li>
<!--Enable when /search form is completed <li class="visible-xs">
<li class="visible-xs">
<a href="/search">Search</a>
</li>-->
</li>
<li>
<a href="/"></a>
</li>

@ -3,6 +3,16 @@
<li class="active">Search</li>
</ol>
<form id="mobile-search-form" class="navbar-form navbar-right visible-xs" role="search" method="GET" action="">
<div class="" id="search-fields">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search" name="query" value="">
</div>
<button type="submit" class="btn btn-default hide">Search</button>
</div>
</form>
<div class="category search">
<div class="">
<ul id="topics-container" data-search-query="{search_query}">

@ -481,6 +481,8 @@ var express = require('express'),
});
app.get('/search', function (req, res) {
if (!req.user)
return res.redirect('/403');
app.build_header({
req: req,
res: res
@ -490,6 +492,8 @@ var express = require('express'),
});
app.get('/search/:term', function (req, res) {
if (!req.user)
return res.redirect('/403');
app.build_header({
req: req,
res: res

Loading…
Cancel
Save