Support set url path and use relative url, move raphael to bower and fixed minor issue in history

This commit is contained in:
Cheng-Han, Wu 2016-02-16 20:08:44 -08:00
parent 3f2f063e9b
commit b2b1be3dda
22 changed files with 222 additions and 198 deletions

View file

@ -1,5 +1,12 @@
//common
var domain = 'change this';
var domain = 'change this'; // domain name
var urlpath = ''; // sub url path, like: www.example.com/<urlpath>
var port = window.location.port;
var serverurl = window.location.protocol + '//' + domain + (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;
var checkAuth = false;
var profile = null;
var lastLoginState = getLoginState();
@ -53,7 +60,7 @@ function checkIfAuth(yesCallback, noCallback) {
if (checkLoginStateChanged())
checkAuth = false;
if (!checkAuth || typeof cookieLoginState == 'undefined') {
$.get('/me')
$.get(serverurl + '/me')
.done(function (data) {
if (data && data.status == 'ok') {
profile = data;