mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
Merge remote-tracking branch 'origin'
This commit is contained in:
2
app.js
2
app.js
@@ -70,7 +70,7 @@ if (!nconf.get('setup') && nconf.get('base_url')) {
|
|||||||
config['ROOT_DIRECTORY'] = __dirname;
|
config['ROOT_DIRECTORY'] = __dirname;
|
||||||
|
|
||||||
templates.init([
|
templates.init([
|
||||||
'header', 'footer', 'logout', 'admin/header', 'admin/footer', 'admin/index',
|
'header', 'footer', 'logout', 'outgoing', 'admin/header', 'admin/footer', 'admin/index',
|
||||||
'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext',
|
'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext',
|
||||||
'emails/header', 'emails/footer', 'install/header', 'install/footer', 'install/redis',
|
'emails/header', 'emails/footer', 'install/header', 'install/footer', 'install/redis',
|
||||||
|
|
||||||
|
|||||||
@@ -389,7 +389,7 @@ body .navbar .nodebb-inline-block {
|
|||||||
|
|
||||||
.post-signature {
|
.post-signature {
|
||||||
color: #666;
|
color: #666;
|
||||||
font-size: 12.5px;
|
font-size: 12px;
|
||||||
border-top: 1px solid #ddd;
|
border-top: 1px solid #ddd;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
|
|||||||
11
public/templates/outgoing.tpl
Normal file
11
public/templates/outgoing.tpl
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<div class="hero-unit">
|
||||||
|
<h2 class="form-signin-heading">Now Leaving NodeBB</h2>
|
||||||
|
<p>
|
||||||
|
You are now leaving NodeBB.
|
||||||
|
</p>
|
||||||
|
<br />
|
||||||
|
<p>
|
||||||
|
<button class="btn btn-large" type="button" onclick="window.location='{url}'">Continue to {url}</button>
|
||||||
|
<button class="btn btn-large btn-inverse" type="button" onclick="history.go(-1); window.location='{home}'">Return to NodeBB</button>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
@@ -147,14 +147,24 @@ var RDB = require('./redis.js'),
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (md.length > 0) {
|
if (md.length > 0) {
|
||||||
var parsedContentDOM = cheerio.load(marked(md)),
|
var parsedContentDOM = cheerio.load(marked(md));
|
||||||
anchorText = parsedContentDOM.text();
|
var domain = global.nconf.get('url');
|
||||||
|
|
||||||
parsedContentDOM('a').each(function() {
|
parsedContentDOM('a').each(function() {
|
||||||
this.attr('rel', 'nofollow').attr('target', '_blank');
|
this.attr('rel', 'nofollow');
|
||||||
this.append(' <i class="icon-external-link"></i>');
|
var href = this.attr('href');
|
||||||
|
|
||||||
|
if (href && !href.match(domain)) {
|
||||||
|
this.attr('href', domain + 'outgoing?' + href);
|
||||||
|
this.append(' <i class="icon-external-link"></i>');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
html = parsedContentDOM.html();
|
html = parsedContentDOM.html();
|
||||||
} else html = '<p></p>';
|
} else {
|
||||||
|
html = '<p></p>';
|
||||||
|
}
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ var utils = require('./../public/src/utils.js'),
|
|||||||
|
|
||||||
User.getMultipleUserFields = function(uids, fields, callback) {
|
User.getMultipleUserFields = function(uids, fields, callback) {
|
||||||
if(uids.length === 0) {
|
if(uids.length === 0) {
|
||||||
callback([]);
|
callback({});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -278,6 +278,20 @@ var express = require('express'),
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.get('/outgoing', function(req, res) {
|
||||||
|
var url = req.url.split('?');
|
||||||
|
|
||||||
|
if (url[1]) {
|
||||||
|
res.send(app.build_header(res) + templates['outgoing'].parse({
|
||||||
|
url: url[1],
|
||||||
|
home: global.nconf.get('url')
|
||||||
|
}) + templates['footer']);
|
||||||
|
} else {
|
||||||
|
res.status(404);
|
||||||
|
res.redirect(global.nconf.get('relative_path') + '/404');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// These functions are called via ajax once the initial page is loaded to populate templates with data
|
// These functions are called via ajax once the initial page is loaded to populate templates with data
|
||||||
|
|||||||
Reference in New Issue
Block a user