Fix up generation of URLs with prefix.

This commit is contained in:
Graham Dumpleton
2018-08-23 13:26:16 +10:00
parent 611f2e30d6
commit db3d37f6fe
4 changed files with 12 additions and 12 deletions

View File

@@ -32,7 +32,7 @@ class url(object):
def __call__(self, cls):
if tornado.options.options.uri_root_path:
url = tornado.options.options.uri_root_path.rstrip('/') + self.url
url = '/' + tornado.options.options.uri_root_path.strip('/') + self.url
else:
url = self.url
application.add_handlers(
@@ -78,7 +78,7 @@ if hasattr(tornado.options.options, 'debug'):
template_path=os.path.join(os.path.dirname(__file__), "templates"),
debug=tornado.options.options.debug,
static_url_prefix='%s/static/' % (
'/%s' % tornado.options.options.uri_root_path
'/%s' % tornado.options.options.uri_root_path.strip('/')
if tornado.options.options.uri_root_path else '')
)

View File

@@ -70,37 +70,37 @@
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
@font-face {
font-family: "SourceCodePro";
src: url("/static/fonts/SourceCodePro-ExtraLight.otf") format("woff");
src: url("fonts/SourceCodePro-ExtraLight.otf") format("woff");
font-weight: 100; }
@font-face {
font-family: "SourceCodePro";
src: url("/static/fonts/SourceCodePro-Light.otf") format("woff");
src: url("fonts/SourceCodePro-Light.otf") format("woff");
font-weight: 300; }
@font-face {
font-family: "SourceCodePro";
src: url("/static/fonts/SourceCodePro-Regular.otf") format("woff");
src: url("fonts/SourceCodePro-Regular.otf") format("woff");
font-weight: 400; }
@font-face {
font-family: "SourceCodePro";
src: url("/static/fonts/SourceCodePro-Medium.otf") format("woff");
src: url("fonts/SourceCodePro-Medium.otf") format("woff");
font-weight: 500; }
@font-face {
font-family: "SourceCodePro";
src: url("/static/fonts/SourceCodePro-Semibold.otf") format("woff");
src: url("fonts/SourceCodePro-Semibold.otf") format("woff");
font-weight: 600; }
@font-face {
font-family: "SourceCodePro";
src: url("/static/fonts/SourceCodePro-Bold.otf") format("woff");
src: url("fonts/SourceCodePro-Bold.otf") format("woff");
font-weight: 700; }
@font-face {
font-family: "SourceCodePro";
src: url("/static/fonts/SourceCodePro-Black.otf") format("woff");
src: url("fonts/SourceCodePro-Black.otf") format("woff");
font-weight: 900; }
body {

View File

@@ -23,12 +23,12 @@
} else {
wsUrl = 'ws://';
}
rootPath = document.body.getAttribute('data-root-path');
rootPath = document.body.getAttribute('data-root-path').replace(/^\/+|\/+$/g, '');
if (rootPath.length) {
rootPath = "/" + rootPath;
}
wsUrl += document.location.host + rootPath;
path = location.pathname;
path = '/';
if (path.indexOf('/session') < 0) {
path += "session/" + (document.body.getAttribute('data-session-token'));
}

File diff suppressed because one or more lines are too long