diff options
author | Cheng-Han, Wu | 2016-04-22 04:38:43 +0800 |
---|---|---|
committer | Cheng-Han, Wu | 2016-04-22 04:38:43 +0800 |
commit | 08de655c2b50f65f8587a663d55cb39f4327b23c (patch) | |
tree | f7974249987c2a018d1a1f9c9a0d61dafdf686bb /public/js | |
parent | 60046200f8254cec9f734ed591ffc1d68f82a7a7 (diff) |
Update to support when client domain not provided will use window.location variable
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/common.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/public/js/common.js b/public/js/common.js index 3496e3a4..c623cd24 100644 --- a/public/js/common.js +++ b/public/js/common.js @@ -1,5 +1,5 @@ //common -var domain = 'change this'; // domain name +var domain = ''; // domain name var urlpath = ''; // sub url path, like: www.example.com/<urlpath> //settings var debug = false; @@ -8,7 +8,7 @@ var GOOGLE_API_KEY = 'change this'; var GOOGLE_CLIENT_ID = 'change this'; var port = window.location.port; -var serverurl = window.location.protocol + '//' + domain + (port ? ':' + port : '') + (urlpath ? '/' + urlpath : ''); +var serverurl = window.location.protocol + '//' + (domain ? domain : window.location.hostname) + (port ? ':' + port : '') + (urlpath ? '/' + urlpath : ''); var noteid = urlpath ? window.location.pathname.slice(urlpath.length + 1, window.location.pathname.length).split('/')[1] : window.location.pathname.split('/')[1]; var noteurl = serverurl + '/' + noteid; |