mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: remove global RELATIVE_PATH
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
"socket": true,
|
||||
"ajaxify": true,
|
||||
"config": true,
|
||||
"RELATIVE_PATH": true,
|
||||
"utils": true,
|
||||
"overrides": true,
|
||||
"componentHandler": true,
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
"socket": true,
|
||||
"ajaxify": true,
|
||||
"config": true,
|
||||
"RELATIVE_PATH": true,
|
||||
"utils": true,
|
||||
"overrides": true,
|
||||
"componentHandler": true,
|
||||
|
||||
@@ -521,12 +521,14 @@ define('admin/dashboard', ['semver', 'Chart', 'translator', 'benchpress'], funct
|
||||
function buildTopicsLegend() {
|
||||
var legend = $('#topics-legend').html('');
|
||||
var html = '';
|
||||
topics.forEach(function (topic, i) {
|
||||
var label = topic.count === '0' ? topic.title : '<a title="' + topic.title + '"href="' + RELATIVE_PATH + '/topic/' + topic.tid + '" target="_blank"> ' + topic.title + '</a>';
|
||||
topics.forEach(function (t, i) {
|
||||
var label = t.count === '0' ?
|
||||
t.title :
|
||||
'<a title="' + t.title + '"href="' + config.relative_path + '/topic/' + t.tid + '" target="_blank"> ' + t.title + '</a>';
|
||||
|
||||
html += '<li>' +
|
||||
'<div style="background-color: ' + topicColors[i] + ';"></div>' +
|
||||
'<span> (' + topic.count + ') ' + label + '</span>' +
|
||||
'<span> (' + t.count + ') ' + label + '</span>' +
|
||||
'</li>';
|
||||
});
|
||||
legend.translateHtml(html);
|
||||
|
||||
@@ -203,7 +203,7 @@ define('admin/extend/widgets', ['jqueryui'], function () {
|
||||
return widget;
|
||||
}
|
||||
|
||||
$.get(RELATIVE_PATH + '/api/admin/extend/widgets', function (data) {
|
||||
$.get(config.relative_path + '/api/admin/extend/widgets', function (data) {
|
||||
var areas = data.areas;
|
||||
|
||||
for (var i = 0; i < areas.length; i += 1) {
|
||||
|
||||
@@ -235,7 +235,7 @@ define('forum/topic', [
|
||||
|
||||
history.replaceState({
|
||||
url: newUrl + search,
|
||||
}, null, window.location.protocol + '//' + window.location.host + RELATIVE_PATH + '/' + newUrl + search);
|
||||
}, null, window.location.protocol + '//' + window.location.host + config.relative_path + '/' + newUrl + search);
|
||||
}
|
||||
currentUrl = newUrl;
|
||||
}, 500);
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
|
||||
<script>
|
||||
var RELATIVE_PATH = "{relative_path}";
|
||||
var config = JSON.parse('{{configJSON}}');
|
||||
var app = {
|
||||
template: "{template.name}",
|
||||
user: JSON.parse('{{userJSON}}'),
|
||||
config: JSON.parse(decodeURIComponent("{{adminConfigJSON}}")),
|
||||
flags: {},
|
||||
|
||||
Reference in New Issue
Block a user