Skip to content

Commit 08de655

Browse files
committed
Update to support when client domain not provided will use window.location variable
1 parent 6004620 commit 08de655

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

public/js/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//common
2-
var domain = 'change this'; // domain name
2+
var domain = ''; // domain name
33
var urlpath = ''; // sub url path, like: www.example.com/<urlpath>
44
//settings
55
var debug = false;
@@ -8,7 +8,7 @@ var GOOGLE_API_KEY = 'change this';
88
var GOOGLE_CLIENT_ID = 'change this';
99

1010
var port = window.location.port;
11-
var serverurl = window.location.protocol + '//' + domain + (port ? ':' + port : '') + (urlpath ? '/' + urlpath : '');
11+
var serverurl = window.location.protocol + '//' + (domain ? domain : window.location.hostname) + (port ? ':' + port : '') + (urlpath ? '/' + urlpath : '');
1212
var noteid = urlpath ? window.location.pathname.slice(urlpath.length + 1, window.location.pathname.length).split('/')[1] : window.location.pathname.split('/')[1];
1313
var noteurl = serverurl + '/' + noteid;
1414

0 commit comments

Comments
 (0)