|
|
|
@ -7,17 +7,18 @@ define('search', ['navigator'], function(nav) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Search.query = function(term, callback) {
|
|
|
|
|
// Detect if a tid was specified
|
|
|
|
|
var topicSearch = term.match(/in:topic-([\d]+)/);
|
|
|
|
|
|
|
|
|
|
if (!topicSearch) {
|
|
|
|
|
term = term.replace(/^[ ?#]*/, '');
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
term = encodeURIComponent(term);
|
|
|
|
|
} catch(e) {
|
|
|
|
|
return app.alertError('[[error:invalid-search-term]]');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Detect if a tid was specified
|
|
|
|
|
var topicSearch = term.match(/in:topic-([\d]+)/);
|
|
|
|
|
|
|
|
|
|
if (!topicSearch) {
|
|
|
|
|
term = term.replace(/^[ ?#]*/, '');
|
|
|
|
|
ajaxify.go('search/' + term);
|
|
|
|
|
callback();
|
|
|
|
|
} else {
|
|
|
|
|