File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import { HTML } from "smc-webapp/r_misc";
14
14
//import ReactDOMServer from "react-dom/server";
15
15
const ReactDOMServer = require ( "react-dom/server" ) ;
16
16
import { React , Redux , redux } from "../../app-framework" ;
17
- const misc_page = require ( "../../misc_page" ) ;
17
+ import { BASE_URL } from "../../misc/base-url" ;
18
18
import { resource_links_string } from "smc-webapp/misc/resource-links" ;
19
19
20
20
let BLOCKED : boolean | undefined = undefined ;
@@ -106,8 +106,7 @@ function write_content(w, opts: PrintOptions): void {
106
106
}
107
107
108
108
function html_with_deps ( html : string , title : string ) : string {
109
- const BASE_URL = misc_page . BASE_URL ;
110
- const links = resource_links_string ( BASE_URL )
109
+ const links = resource_links_string ( BASE_URL ) ;
111
110
return `\
112
111
<html lang="en">
113
112
<head>
Original file line number Diff line number Diff line change
1
+ /*
2
+ * This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
+ * License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
4
+ */
5
+
6
+ import { DOMAIN_NAME } from "../../smc-util/theme" ;
7
+ import { join } from "path" ;
8
+
9
+ export const APP_BASE_URL =
10
+ window != null && window . app_base_url != null ? window . app_base_url : "" ;
11
+
12
+ const BASE_PATH = join ( window . location . hostname , APP_BASE_URL ) ;
13
+ export const BASE_URL =
14
+ window != null ? `${ window . location . protocol } //${ BASE_PATH } ` : DOMAIN_NAME ;
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ exports.is_enter = (e) -> e.which is 13 and not e.shiftKey
61
61
exports .is_ctrl_enter = (e ) -> e .which is 13 and e .ctrlKey
62
62
exports .is_escape = (e ) -> e .which is 27
63
63
64
- { join } = require (' path ' )
65
- exports .APP_BASE_URL = window ? . app_base_url ? ' '
66
- exports .BASE_URL = if window ? then " #{ window . location . protocol } // #{ join ( window . location . hostname , window . app_base_url ? ' ' ) } " else theme . DOMAIN_NAME
64
+ base_url_lib = require (" ./misc/base-url " )
65
+ exports .APP_BASE_URL = exports . APP_BASE_URL
66
+ exports .BASE_URL = exports . BASE_URL
67
67
68
68
local_diff = exports .local_diff = (before , after ) ->
69
69
# Return object
You can’t perform that action at this time.
0 commit comments