From c2a8911b9c7872ea0d085020aa17e82162130f3d Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Fri, 13 Jan 2017 22:46:38 +0800 Subject: Move config variable to lib/config --- public/js/common.js | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'public/js/common.js') diff --git a/public/js/common.js b/public/js/common.js index 6d54b450..9a60122b 100644 --- a/public/js/common.js +++ b/public/js/common.js @@ -1,21 +1,4 @@ -// import config from './config'; - -import { - domain, // domain name - urlpath, // sub url path, like: www.example.com/ - debug, - GOOGLE_API_KEY, - GOOGLE_CLIENT_ID, - DROPBOX_APP_KEY -} from './config'; - -//common -export const port = window.location.port; -window.serverurl = `${window.location.protocol}//${domain ? domain : window.location.hostname}${port ? ':' + port : ''}${urlpath ? '/' + urlpath : ''}`; -export const noteid = urlpath ? window.location.pathname.slice(urlpath.length + 1, window.location.pathname.length).split('/')[1] : window.location.pathname.split('/')[1]; -export const noteurl = `${serverurl}/${noteid}`; - -export const version = '0.5.0'; +import { serverurl } from './lib/config'; let checkAuth = false; let profile = null; @@ -101,12 +84,6 @@ export function checkIfAuth(yesCallback, noCallback) { } export default { - domain, - urlpath, - debug, - GOOGLE_API_KEY, - GOOGLE_CLIENT_ID, - DROPBOX_APP_KEY, checkAuth, profile, lastLoginState, -- cgit v1.2.3