mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 22:51:06 +08:00
Support for running discourse with a prefix (i.e. as http://servername/discourse)
This commit is contained in:
@ -22,6 +22,16 @@ Discourse = Ember.Application.createWithMixins({
|
||||
// The highest seen post number by topic
|
||||
highestSeenByTopic: {},
|
||||
|
||||
rootURL: '/',
|
||||
|
||||
getURL: function(url) {
|
||||
var u = this.get('rootURL');
|
||||
if (u[u.length-1] === '/') {
|
||||
u = u.substring(0, u.length-1);
|
||||
}
|
||||
return u + url;
|
||||
},
|
||||
|
||||
titleChanged: function() {
|
||||
var title;
|
||||
title = "";
|
||||
@ -156,7 +166,7 @@ Discourse = Ember.Application.createWithMixins({
|
||||
**/
|
||||
logout: function() {
|
||||
Discourse.KeyValueStore.abandonLocal();
|
||||
return $.ajax("/session/" + this.get('currentUser.username'), {
|
||||
return $.ajax(Discourse.getURL("/session/") + this.get('currentUser.username'), {
|
||||
type: 'DELETE',
|
||||
success: function(result) {
|
||||
// To keep lots of our variables unbound, we can handle a redirect on logging out.
|
||||
|
Reference in New Issue
Block a user