diff --git a/webpack/data/common.js b/webpack/data/common.js index 70e9b69..f83fb68 100644 --- a/webpack/data/common.js +++ b/webpack/data/common.js @@ -9,19 +9,22 @@ window.gstore = new GlobalStore(); /* (1) Global data ---------------------------------------------------------*/ -/* (1) Get Full URI */ +/* (1) Get URL host */ +gstore.add('HOST', document.URL.replace(/^((?:https?:\/\/)?[^\/]+)*(?:.+)$/, '$1')); + +/* (2) Get list of URI arguments */ gstore.add('URI', document.URL.replace(/^(?:\/\/|[^\/]+)*/, '').split('/').filter(function(i){ return i.length; })); -/* (2) Get if local version or prod */ +/* (3) Get if local version or prod */ gstore.add('is_local', document.URL.replace(/^https?:\/\/([^\/:]+).*$/, '$1') == 'ptut.com'); -/* (3) API instance */ +/* (4) API instance */ window.api = new APIClient(gstore.get.is_local ? 'http://ptut.com:8080/api/v/1.0/' : 'https://ptut.xdrm.io/api/v/1.0/'); -/* (4) PopUp instance */ +/* (5) PopUp instance */ window.popup = new PopUp(); -/* (5) Create class in window */ +/* (6) Create class in window */ window.onblur = new OnBlurManager(document.body);