Skip to content

Node.js based forum software built for the modern web

fixed #3341, introduced new navigation data property, "targetBlank", deprecated "target", which was never exposed anyway, and updated default values

Julian Lam22251cb0bd73
diff --git a/install/data/navigation.json b/install/data/navigation.json
index c8fe8ee3bd..5956c6b05f 100644
--- a/install/data/navigation.json
+++ b/install/data/navigation.json
@@ -67,7 +67,7 @@
"textClass": "visible-xs-inline",
"text": "\\[\\[global:header.admin\\]\\]",
"properties": {
- "target": "_top",
+ "targetBlank": false,
"adminOnly": true
}
},
diff --git a/public/src/admin/general/navigation.js b/public/src/admin/general/navigation.js
index ed13f53a9b..9eba574732 100644
--- a/public/src/admin/general/navigation.js
+++ b/public/src/admin/general/navigation.js
@@ -62,12 +62,6 @@ define('admin/general/navigation', ['translator'], function(translator) {
data.properties = {};
- available.forEach(function(item) {
- if (item.route.match(data.route)) {
- data.properties = item.properties || {};
- }
- });
-
for (var prop in properties) {
if (properties.hasOwnProperty(prop)) {
data.properties[prop] = properties[prop];
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index decbe3ff4c..8ceb7697b0 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -80,7 +80,7 @@ $(document).ready(function() {
var isAdminRoute = url.startsWith('admin') && window.location.pathname.indexOf(RELATIVE_PATH + '/admin') !== 0;
var uploadsOrApi = url.startsWith('uploads') || url.startsWith('api');
if (isAdminRoute || uploadsOrApi) {
- window.open(RELATIVE_PATH + '/' + url, '_blank');
+ window.open(RELATIVE_PATH + '/' + url, '_top');
return true;
}
return false;
diff --git a/src/views/admin/general/navigation.tpl b/src/views/admin/general/navigation.tpl
index 7ac6ee85e9..7023f97f12 100644
--- a/src/views/admin/general/navigation.tpl
+++ b/src/views/admin/general/navigation.tpl
@@ -7,26 +7,33 @@
<!-- BEGIN enabled -->
<li class="well">
<form>
- <label>ID: <small>optional</small>
- <input class="form-control" type="text" name="id" value="{enabled.id}" />
- </label>
- <label>Route: <small>ex. /unread</small>
- <input class="form-control" type="text" name="route" value="{enabled.route}" />
- </label>
- <label>Title: <small>shown upon mouseover</small>
- <input class="form-control" type="text" name="title" value="{enabled.title}" />
- </label>
- <label>Text:
- <input class="form-control" type="text" name="text" value="{enabled.text}" />
- </label>
- <label>Icon Class: <small><a href="http://fortawesome.github.io/Font-Awesome/cheatsheet/" target="_blank">pick one</a></small>
- <input class="form-control" type="text" name="iconClass" value="{enabled.iconClass}" />
- </label>
- <label>Text Class: <small>optional</small>
- <input class="form-control" type="text" name="textClass" value="{enabled.textClass}" />
- </label>
+ <div class="row">
+ <div class="col-sm-6">
+ <label>ID: <small>optional</small>
+ <input class="form-control" type="text" name="id" value="{enabled.id}" />
+ </label>
+ <label>Title: <small>shown upon mouseover</small>
+ <input class="form-control" type="text" name="title" value="{enabled.title}" />
+ </label>
+ <label>Icon Class: <small><a href="http://fortawesome.github.io/Font-Awesome/cheatsheet/" target="_blank">pick one</a></small>
+ <input class="form-control" type="text" name="iconClass" value="{enabled.iconClass}" />
+ </label>
+ </div>
+ <div class="col-sm-6">
+ <label>Route: <small>ex. /unread</small>
+ <input class="form-control" type="text" name="route" value="{enabled.route}" />
+ </label>
+ <label>Text:
+ <input class="form-control" type="text" name="text" value="{enabled.text}" />
+ </label>
+ <label>Text Class: <small>optional</small>
+ <input class="form-control" type="text" name="textClass" value="{enabled.textClass}" />
+ </label>
+ </div>
+ </div>
<hr />
+
<strong>Properties:</strong>
<div class="checkbox">
<label>
@@ -38,6 +45,11 @@
<input type="checkbox" name="property:loggedIn" <!-- IF enabled.properties.loggedIn -->checked<!-- ENDIF enabled.properties.loggedIn -->/> <strong>Only display to logged in users</strong>
</label>
</div>
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="property:targetBlank" <!-- IF enabled.properties.targetBlank -->checked<!-- ENDIF enabled.properties.targetBlank -->/> <strong>Open in a new window</strong>
+ </label>
+ </div>
<hr />