well done
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
* API Request
|
||||
*/
|
||||
|
||||
const CONFIG = require('./config');
|
||||
|
||||
let spinner = null;
|
||||
let pending = 0;
|
||||
|
||||
|
18
src/web/app/common/scripts/config.js
Normal file
18
src/web/app/common/scripts/config.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const url = new URL(location.href);
|
||||
|
||||
const isRoot = url.host.split('.')[0] == 'misskey';
|
||||
|
||||
const host = isRoot ? url.host : url.host.substring(url.host.indexOf('.') + 1, url.host.length);
|
||||
const scheme = url.protocol;
|
||||
const apiUrl = `${scheme}//api.${host}`;
|
||||
const devUrl = `${scheme}//dev.${host}`;
|
||||
const aboutUrl = `${scheme}//about.${host}`;
|
||||
|
||||
module.exports = {
|
||||
host,
|
||||
scheme,
|
||||
apiUrl,
|
||||
devUrl,
|
||||
aboutUrl,
|
||||
themeColor: '#f76d6c'
|
||||
};
|
@@ -1,5 +1,6 @@
|
||||
const ReconnectingWebSocket = require('reconnecting-websocket');
|
||||
const riot = require('riot');
|
||||
const CONFIG = require('./config');
|
||||
|
||||
class Connection {
|
||||
constructor(me, otherparty) {
|
||||
|
@@ -1,3 +1,5 @@
|
||||
const CONFIG = require('./config');
|
||||
|
||||
module.exports = () => {
|
||||
localStorage.removeItem('me');
|
||||
document.cookie = `i=; domain=.${CONFIG.host}; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
const ReconnectingWebSocket = require('reconnecting-websocket');
|
||||
const riot = require('riot');
|
||||
const CONFIG = require('./config');
|
||||
|
||||
module.exports = me => {
|
||||
let state = 'initializing';
|
||||
|
@@ -1,5 +1,6 @@
|
||||
const riot = require('riot');
|
||||
const nyaize = require('nyaize').default;
|
||||
const CONFIG = require('./config');
|
||||
|
||||
const escape = function(text) {
|
||||
return text
|
||||
|
Reference in New Issue
Block a user