Fix Tests

v1.18.x
RoiEX 8 years ago
parent 431f5e1f0f
commit eca150f392

@ -122,7 +122,7 @@ exports.buildTargets = function (targets, callback) {
startTime = Date.now(); startTime = Date.now();
meta.osd.build(step.bind(this, startTime, target, next)); meta.osd.build(step.bind(this, startTime, target, next));
break; break;
default: default:
winston.warn('[build] Unknown build target: \'' + target + '\''); winston.warn('[build] Unknown build target: \'' + target + '\'');
setImmediate(next); setImmediate(next);

@ -7,35 +7,35 @@ var nconf = require('nconf');
var osdFilePath = path.join(__dirname, '../../build/public/osd.xml'); var osdFilePath = path.join(__dirname, '../../build/public/osd.xml');
module.exports = function(Meta){ module.exports = function (Meta) {
Meta.osd = {}; Meta.osd = {};
Meta.osd.build = function(callback){ Meta.osd.build = function (callback) {
var osdObject = { var osdObject = {
"OpenSearchDescription": [ OpenSearchDescription: [
{ {
_attr: { _attr: {
"xmlns": "http://a9.com/-/spec/opensearch/1.1/" xmlns: 'http://a9.com/-/spec/opensearch/1.1/',
} }
}, },
{ {
"ShortName": String(Meta.config.title || Meta.config.browserTitle || 'NodeBB') ShortName: String(Meta.config.title || Meta.config.browserTitle || 'NodeBB'),
}, },
{ {
"Description": String(Meta.config.description || '') Description: String(Meta.config.description || ''),
}, },
{ {
"Url": [ Url: [
{ {
_attr: { _attr: {
"type": "text/html", type: 'text/html',
"method": "get", method: 'get',
"template": nconf.get('url') + '/search?term={searchTerms}&in=titlesposts' template: nconf.get('url') + '/search?term={searchTerms}&in=titlesposts',
} }
} }
] ]
} }
] ]
}; };
fs.writeFile(osdFilePath, xml([osdObject], {declaration: true, indent: '\t'}), callback); fs.writeFile(osdFilePath, xml([osdObject], { declaration: true, indent: '\t' }), callback);
} };
}; };

@ -60,13 +60,13 @@ module.exports = function (Meta) {
rel: 'manifest', rel: 'manifest',
href: nconf.get('relative_path') + '/manifest.json', href: nconf.get('relative_path') + '/manifest.json',
}]; }];
if(plugins.hasListeners('filter:search.query')){ if (plugins.hasListeners('filter:search.query')) {
defaultLinks.push({ defaultLinks.push({
rel: 'search', rel: 'search',
type: 'application/opensearchdescription+xml', type: 'application/opensearchdescription+xml',
href: nconf.get('relative_path') + '/assets/osd.xml', href: nconf.get('relative_path') + '/assets/osd.xml',
}); });
} }
// Touch icons for mobile-devices // Touch icons for mobile-devices

Loading…
Cancel
Save