mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 14:46:04 +02:00
fix: lint
This commit is contained in:
@@ -44,7 +44,8 @@ button {
|
|||||||
border: #333;
|
border: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-input-group__append, .el-input-group__prepend {
|
.el-input-group__append,
|
||||||
|
.el-input-group__prepend {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: #666;
|
background-color: #666;
|
||||||
border: #555;
|
border: #555;
|
||||||
@@ -157,11 +158,11 @@ button {
|
|||||||
background-color: #444;
|
background-color: #444;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-popper[x-placement^="bottom"] .popper__arrow::after {
|
.el-popper[x-placement^='bottom'] .popper__arrow::after {
|
||||||
border-bottom-color: #333;
|
border-bottom-color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-popper[x-placement^="bottom"] .popper__arrow {
|
.el-popper[x-placement^='bottom'] .popper__arrow {
|
||||||
border-bottom-color: #404040;
|
border-bottom-color: #404040;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,11 +231,11 @@ button {
|
|||||||
border-color: #5f5f5f;
|
border-color: #5f5f5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-popper[x-placement^="right"] .popper__arrow::after {
|
.el-popper[x-placement^='right'] .popper__arrow::after {
|
||||||
border-right-color: #5f5f5f;
|
border-right-color: #5f5f5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-popper[x-placement^="right"] .popper__arrow {
|
.el-popper[x-placement^='right'] .popper__arrow {
|
||||||
border-right-color: #5f5f5f;
|
border-right-color: #5f5f5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2185
-1130
File diff suppressed because it is too large
Load Diff
+11
-9
@@ -8,11 +8,12 @@
|
|||||||
// For a copy, see <https://opensource.org/licenses/MIT>.
|
// For a copy, see <https://opensource.org/licenses/MIT>.
|
||||||
//
|
//
|
||||||
|
|
||||||
@import "~normalize.css/normalize.css";
|
@import '~normalize.css/normalize.css';
|
||||||
@import "~animate.css/animate.min.css";
|
@import '~animate.css/animate.min.css';
|
||||||
@import "~noty/lib/noty.css";
|
@import '~noty/lib/noty.css';
|
||||||
@import "~element-ui/lib/theme-chalk/index.css";
|
@import '~element-ui/lib/theme-chalk/index.css';
|
||||||
@import "~famfamfam-flags/dist/sprite/famfamfam-flags.min.css";
|
@import '~famfamfam-flags/dist/sprite/famfamfam-flags.min.css';
|
||||||
|
@import '~vue-swatches/dist/vue-swatches.css';
|
||||||
|
|
||||||
.color-palettes {
|
.color-palettes {
|
||||||
background: #409eff;
|
background: #409eff;
|
||||||
@@ -113,7 +114,8 @@ input,
|
|||||||
textarea,
|
textarea,
|
||||||
select,
|
select,
|
||||||
button {
|
button {
|
||||||
font-family: "Noto Sans JP", "Noto Sans KR", "Meiryo UI", "Malgun Gothic", "Segoe UI", sans-serif;
|
font-family: 'Noto Sans JP', 'Noto Sans KR', 'Meiryo UI', 'Malgun Gothic',
|
||||||
|
'Segoe UI', sans-serif;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +181,7 @@ a {
|
|||||||
left: 1px;
|
left: 1px;
|
||||||
width: 2px;
|
width: 2px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
content: "";
|
content: '';
|
||||||
background: #dcdfe6;
|
background: #dcdfe6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,7 +191,7 @@ a {
|
|||||||
right: 4px;
|
right: 4px;
|
||||||
width: 4px;
|
width: 4px;
|
||||||
height: 4px;
|
height: 4px;
|
||||||
content: "";
|
content: '';
|
||||||
background: #ebeef5;
|
background: #ebeef5;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
@@ -317,7 +319,7 @@ img.friends-list-avatar {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
content: "";
|
content: '';
|
||||||
background: #909399;
|
background: #909399;
|
||||||
border: 2px solid #fff;
|
border: 2px solid #fff;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
|||||||
@@ -55,28 +55,25 @@ class ConfigRepository extends SharedRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
remove(key) {
|
remove(key) {
|
||||||
key = transformKey(key);
|
var _key = transformKey(key);
|
||||||
sharedRepository.remove(key);
|
sharedRepository.remove(_key);
|
||||||
dirtyKeySet.add(key);
|
dirtyKeySet.add(_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
getString(key, defaultValue = null) {
|
getString(key, defaultValue = null) {
|
||||||
key = transformKey(key);
|
var _key = transformKey(key);
|
||||||
return sharedRepository.getString(key, defaultValue);
|
return sharedRepository.getString(_key, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
setString(key, value) {
|
setString(key, value) {
|
||||||
key = transformKey(key);
|
var _key = transformKey(key);
|
||||||
value = String(value);
|
var _value = String(value);
|
||||||
sharedRepository.setString(key, value);
|
sharedRepository.setString(_key, _value);
|
||||||
dirtyKeySet.add(key);
|
dirtyKeySet.add(_key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var self = new ConfigRepository();
|
var self = new ConfigRepository();
|
||||||
window.configRepository = self;
|
window.configRepository = self;
|
||||||
|
|
||||||
export {
|
export {self as default, ConfigRepository};
|
||||||
self as default,
|
|
||||||
ConfigRepository
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class Database {
|
|||||||
|
|
||||||
async getMemo(userId) {
|
async getMemo(userId) {
|
||||||
var row = {};
|
var row = {};
|
||||||
await sqliteService.execute((dbRow, userId) => {
|
await sqliteService.execute((dbRow) => {
|
||||||
row = {
|
row = {
|
||||||
userId: dbRow[0],
|
userId: dbRow[0],
|
||||||
editedAt: dbRow[1],
|
editedAt: dbRow[1],
|
||||||
@@ -177,7 +177,7 @@ class Database {
|
|||||||
var field = {};
|
var field = {};
|
||||||
for (var item of items) {
|
for (var item of items) {
|
||||||
if (typeof line[item] === 'string') {
|
if (typeof line[item] === 'string') {
|
||||||
field[item] = line[item].replace(/'/g, "\''");
|
field[item] = line[item].replace(/'/g, "''");
|
||||||
} else {
|
} else {
|
||||||
field[item] = '';
|
field[item] = '';
|
||||||
}
|
}
|
||||||
@@ -240,7 +240,15 @@ class Database {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var sqlValues = '';
|
var sqlValues = '';
|
||||||
var items = ['created_at', 'type', 'userId', 'displayName', 'previousDisplayName', 'trustLevel', 'previousTrustLevel'];
|
var items = [
|
||||||
|
'created_at',
|
||||||
|
'type',
|
||||||
|
'userId',
|
||||||
|
'displayName',
|
||||||
|
'previousDisplayName',
|
||||||
|
'trustLevel',
|
||||||
|
'previousTrustLevel'
|
||||||
|
];
|
||||||
for (var i = 0; i < inputData.length; ++i) {
|
for (var i = 0; i < inputData.length; ++i) {
|
||||||
var line = inputData[i];
|
var line = inputData[i];
|
||||||
sqlValues += '(';
|
sqlValues += '(';
|
||||||
@@ -248,7 +256,7 @@ class Database {
|
|||||||
var item = items[k];
|
var item = items[k];
|
||||||
var field = '';
|
var field = '';
|
||||||
if (typeof line[item] === 'string') {
|
if (typeof line[item] === 'string') {
|
||||||
field = `'${line[item].replace(/'/g, "\''")}'`;
|
field = `'${line[item].replace(/'/g, "''")}'`;
|
||||||
} else {
|
} else {
|
||||||
field = null;
|
field = null;
|
||||||
}
|
}
|
||||||
@@ -317,9 +325,12 @@ class Database {
|
|||||||
'@owner_id': entry.ownerId,
|
'@owner_id': entry.ownerId,
|
||||||
'@avatar_name': entry.avatarName,
|
'@avatar_name': entry.avatarName,
|
||||||
'@current_avatar_image_url': entry.currentAvatarImageUrl,
|
'@current_avatar_image_url': entry.currentAvatarImageUrl,
|
||||||
'@current_avatar_thumbnail_image_url': entry.currentAvatarThumbnailImageUrl,
|
'@current_avatar_thumbnail_image_url':
|
||||||
'@previous_current_avatar_image_url': entry.previousCurrentAvatarImageUrl,
|
entry.currentAvatarThumbnailImageUrl,
|
||||||
'@previous_current_avatar_thumbnail_image_url': entry.previousCurrentAvatarThumbnailImageUrl
|
'@previous_current_avatar_image_url':
|
||||||
|
entry.previousCurrentAvatarImageUrl,
|
||||||
|
'@previous_current_avatar_thumbnail_image_url':
|
||||||
|
entry.previousCurrentAvatarThumbnailImageUrl
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -343,7 +354,4 @@ class Database {
|
|||||||
var self = new Database();
|
var self = new Database();
|
||||||
window.database = self;
|
window.database = self;
|
||||||
|
|
||||||
export {
|
export {self as default, Database};
|
||||||
self as default,
|
|
||||||
Database
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ function transformKey(key) {
|
|||||||
|
|
||||||
class SharedRepository {
|
class SharedRepository {
|
||||||
remove(key) {
|
remove(key) {
|
||||||
key = transformKey(key);
|
var _key = transformKey(key);
|
||||||
return SharedVariable.Remove(key);
|
return SharedVariable.Remove(_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
getString(key, defaultValue = null) {
|
getString(key, defaultValue = null) {
|
||||||
key = transformKey(key);
|
var _key = transformKey(key);
|
||||||
var value = SharedVariable.Get(key);
|
var value = SharedVariable.Get(_key);
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
@@ -20,9 +20,9 @@ class SharedRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setString(key, value) {
|
setString(key, value) {
|
||||||
key = transformKey(key);
|
var _key = transformKey(key);
|
||||||
value = String(value);
|
var _value = String(value);
|
||||||
SharedVariable.Set(key, value);
|
SharedVariable.Set(_key, _value);
|
||||||
}
|
}
|
||||||
|
|
||||||
getBool(key, defaultValue = null) {
|
getBool(key, defaultValue = null) {
|
||||||
@@ -76,8 +76,7 @@ class SharedRepository {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
value = JSON.parse(value);
|
value = JSON.parse(value);
|
||||||
} catch (err) {
|
} catch (err) {}
|
||||||
}
|
|
||||||
if (value !== Object(value)) {
|
if (value !== Object(value)) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
@@ -104,7 +103,4 @@ class SharedRepository {
|
|||||||
var self = new SharedRepository();
|
var self = new SharedRepository();
|
||||||
window.sharedRepository = self;
|
window.sharedRepository = self;
|
||||||
|
|
||||||
export {
|
export {self as default, SharedRepository};
|
||||||
self as default,
|
|
||||||
SharedRepository
|
|
||||||
};
|
|
||||||
|
|||||||
+27
-27
@@ -1,67 +1,67 @@
|
|||||||
const defaultAESKey = new TextEncoder().encode(
|
const defaultAESKey = new TextEncoder().encode(
|
||||||
'https://github.com/pypy-vrc/VRCX'
|
'https://github.com/pypy-vrc/VRCX'
|
||||||
)
|
);
|
||||||
|
|
||||||
const hexToUint8Array = (hexStr) => {
|
const hexToUint8Array = (hexStr) => {
|
||||||
const r = hexStr.match(/.{1,2}/g)
|
const r = hexStr.match(/.{1,2}/g);
|
||||||
if (!r) return null
|
if (!r) return null;
|
||||||
return new Uint8Array(r.map((b) => parseInt(b, 16)))
|
return new Uint8Array(r.map((b) => parseInt(b, 16)));
|
||||||
}
|
};
|
||||||
|
|
||||||
const uint8ArrayToHex = (arr) =>
|
const uint8ArrayToHex = (arr) =>
|
||||||
arr.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '')
|
arr.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '');
|
||||||
|
|
||||||
function stdAESKey(key) {
|
function stdAESKey(key) {
|
||||||
const tKey = new TextEncoder().encode(key)
|
const tKey = new TextEncoder().encode(key);
|
||||||
let sk = tKey
|
let sk = tKey;
|
||||||
if (key.length < 32) {
|
if (key.length < 32) {
|
||||||
sk = new Uint8Array(32)
|
sk = new Uint8Array(32);
|
||||||
sk.set(tKey)
|
sk.set(tKey);
|
||||||
sk.set(defaultAESKey.slice(key.length, 32), key.length)
|
sk.set(defaultAESKey.slice(key.length, 32), key.length);
|
||||||
}
|
}
|
||||||
return sk.slice(0, 32)
|
return sk.slice(0, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function encrypt(plaintext, key) {
|
async function encrypt(plaintext, key) {
|
||||||
let iv = window.crypto.getRandomValues(new Uint8Array(12))
|
let iv = window.crypto.getRandomValues(new Uint8Array(12));
|
||||||
let sharedKey = await window.crypto.subtle.importKey(
|
let sharedKey = await window.crypto.subtle.importKey(
|
||||||
'raw',
|
'raw',
|
||||||
stdAESKey(key),
|
stdAESKey(key),
|
||||||
{name: 'AES-GCM', length: 256},
|
{name: 'AES-GCM', length: 256},
|
||||||
true,
|
true,
|
||||||
['encrypt']
|
['encrypt']
|
||||||
)
|
);
|
||||||
let cipher = await window.crypto.subtle.encrypt(
|
let cipher = await window.crypto.subtle.encrypt(
|
||||||
{name: 'AES-GCM', iv},
|
{name: 'AES-GCM', iv},
|
||||||
sharedKey,
|
sharedKey,
|
||||||
new TextEncoder().encode(plaintext)
|
new TextEncoder().encode(plaintext)
|
||||||
)
|
);
|
||||||
let ciphertext = new Uint8Array(cipher)
|
let ciphertext = new Uint8Array(cipher);
|
||||||
let encrypted = new Uint8Array(iv.length + ciphertext.byteLength)
|
let encrypted = new Uint8Array(iv.length + ciphertext.byteLength);
|
||||||
encrypted.set(iv, 0)
|
encrypted.set(iv, 0);
|
||||||
encrypted.set(ciphertext, iv.length)
|
encrypted.set(ciphertext, iv.length);
|
||||||
return uint8ArrayToHex(encrypted)
|
return uint8ArrayToHex(encrypted);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function decrypt(ciphertext, key) {
|
async function decrypt(ciphertext, key) {
|
||||||
let text = hexToUint8Array(ciphertext)
|
let text = hexToUint8Array(ciphertext);
|
||||||
if (!text) return ''
|
if (!text) return '';
|
||||||
let sharedKey = await window.crypto.subtle.importKey(
|
let sharedKey = await window.crypto.subtle.importKey(
|
||||||
'raw',
|
'raw',
|
||||||
stdAESKey(key),
|
stdAESKey(key),
|
||||||
{name: 'AES-GCM', length: 256},
|
{name: 'AES-GCM', length: 256},
|
||||||
true,
|
true,
|
||||||
['decrypt']
|
['decrypt']
|
||||||
)
|
);
|
||||||
let plaintext = await window.crypto.subtle.decrypt(
|
let plaintext = await window.crypto.subtle.decrypt(
|
||||||
{name: 'AES-GCM', iv: text.slice(0, 12)},
|
{name: 'AES-GCM', iv: text.slice(0, 12)},
|
||||||
sharedKey,
|
sharedKey,
|
||||||
text.slice(12)
|
text.slice(12)
|
||||||
)
|
);
|
||||||
return new TextDecoder().decode(new Uint8Array(plaintext))
|
return new TextDecoder().decode(new Uint8Array(plaintext));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
decrypt,
|
decrypt,
|
||||||
encrypt,
|
encrypt
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -94,7 +94,4 @@ class GameLogService {
|
|||||||
var self = new GameLogService();
|
var self = new GameLogService();
|
||||||
window.gameLogService = self;
|
window.gameLogService = self;
|
||||||
|
|
||||||
export {
|
export {self as default, GameLogService as LogWatcherService};
|
||||||
self as default,
|
|
||||||
GameLogService as LogWatcherService
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
class SQLiteService {
|
class SQLiteService {
|
||||||
execute(callback, sql, args = null) {
|
execute(callback, sql, args = null) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
SQLite.Execute((err, data) => {
|
SQLite.Execute(
|
||||||
|
(err, data) => {
|
||||||
if (err !== null) {
|
if (err !== null) {
|
||||||
reject(err);
|
reject(err);
|
||||||
} else if (data === null) {
|
} else if (data === null) {
|
||||||
@@ -11,7 +12,10 @@ class SQLiteService {
|
|||||||
} else {
|
} else {
|
||||||
callback(data);
|
callback(data);
|
||||||
}
|
}
|
||||||
}, sql, args);
|
},
|
||||||
|
sql,
|
||||||
|
args
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,7 +27,4 @@ class SQLiteService {
|
|||||||
var self = new SQLiteService();
|
var self = new SQLiteService();
|
||||||
window.sqliteService = self;
|
window.sqliteService = self;
|
||||||
|
|
||||||
export {
|
export {self as default, SQLiteService};
|
||||||
self as default,
|
|
||||||
SQLiteService
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -21,7 +21,4 @@ class WebApiService {
|
|||||||
var self = new WebApiService();
|
var self = new WebApiService();
|
||||||
window.webApiService = self;
|
window.webApiService = self;
|
||||||
|
|
||||||
export {
|
export {self as default, WebApiService};
|
||||||
self as default,
|
|
||||||
WebApiService
|
|
||||||
};
|
|
||||||
|
|||||||
+101
-70
@@ -42,10 +42,12 @@ speechSynthesis.getVoices();
|
|||||||
locale
|
locale
|
||||||
});
|
});
|
||||||
|
|
||||||
var escapeTag = (s) => String(s).replace(/["&'<>]/gu, (c) => `&#${c.charCodeAt(0)};`);
|
var escapeTag = (s) =>
|
||||||
|
String(s).replace(/["&'<>]/gu, (c) => `&#${c.charCodeAt(0)};`);
|
||||||
Vue.filter('escapeTag', escapeTag);
|
Vue.filter('escapeTag', escapeTag);
|
||||||
|
|
||||||
var commaNumber = (n) => String(Number(n) || 0).replace(/(\d)(?=(\d{3})+(?!\d))/gu, '$1,');
|
var commaNumber = (n) =>
|
||||||
|
String(Number(n) || 0).replace(/(\d)(?=(\d{3})+(?!\d))/gu, '$1,');
|
||||||
Vue.filter('commaNumber', commaNumber);
|
Vue.filter('commaNumber', commaNumber);
|
||||||
|
|
||||||
var formatDate = (s, format) => {
|
var formatDate = (s, format) => {
|
||||||
@@ -55,24 +57,27 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
var hours = dt.getHours();
|
var hours = dt.getHours();
|
||||||
var map = {
|
var map = {
|
||||||
'YYYY': String(10000 + dt.getFullYear()).substr(-4),
|
YYYY: String(10000 + dt.getFullYear()).substr(-4),
|
||||||
'MM': String(101 + dt.getMonth()).substr(-2),
|
MM: String(101 + dt.getMonth()).substr(-2),
|
||||||
'DD': String(100 + dt.getDate()).substr(-2),
|
DD: String(100 + dt.getDate()).substr(-2),
|
||||||
'HH24': String(100 + hours).substr(-2),
|
HH24: String(100 + hours).substr(-2),
|
||||||
'HH': String(100 + (hours > 12
|
HH: String(100 + (hours > 12 ? hours - 12 : hours)).substr(-2),
|
||||||
? hours - 12
|
MI: String(100 + dt.getMinutes()).substr(-2),
|
||||||
: hours)).substr(-2),
|
SS: String(100 + dt.getSeconds()).substr(-2),
|
||||||
'MI': String(100 + dt.getMinutes()).substr(-2),
|
AMPM: hours >= 12 ? 'PM' : 'AM'
|
||||||
'SS': String(100 + dt.getSeconds()).substr(-2),
|
|
||||||
'AMPM': hours >= 12
|
|
||||||
? 'PM'
|
|
||||||
: 'AM'
|
|
||||||
};
|
};
|
||||||
return format.replace(/YYYY|MM|DD|HH24|HH|MI|SS|AMPM/gu, (c) => map[c] || c);
|
return format.replace(
|
||||||
|
/YYYY|MM|DD|HH24|HH|MI|SS|AMPM/gu,
|
||||||
|
(c) => map[c] || c
|
||||||
|
);
|
||||||
};
|
};
|
||||||
Vue.filter('formatDate', formatDate);
|
Vue.filter('formatDate', formatDate);
|
||||||
|
|
||||||
var textToHex = (s) => String(s).split('').map((c) => c.charCodeAt(0).toString(16)).join(' ');
|
var textToHex = (s) =>
|
||||||
|
String(s)
|
||||||
|
.split('')
|
||||||
|
.map((c) => c.charCodeAt(0).toString(16))
|
||||||
|
.join(' ');
|
||||||
Vue.filter('textToHex', textToHex);
|
Vue.filter('textToHex', textToHex);
|
||||||
|
|
||||||
var timeToText = (t) => {
|
var timeToText = (t) => {
|
||||||
@@ -97,8 +102,7 @@ speechSynthesis.getVoices();
|
|||||||
arr.push(`${Math.floor(sec / 60)}m`);
|
arr.push(`${Math.floor(sec / 60)}m`);
|
||||||
sec %= 60;
|
sec %= 60;
|
||||||
}
|
}
|
||||||
if (sec ||
|
if (sec || !arr.length) {
|
||||||
!arr.length) {
|
|
||||||
arr.push(`${sec}s`);
|
arr.push(`${sec}s`);
|
||||||
}
|
}
|
||||||
return arr.join(' ');
|
return arr.join(' ');
|
||||||
@@ -185,28 +189,30 @@ speechSynthesis.getVoices();
|
|||||||
'Content-Type': 'application/json;charset=utf-8',
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
...init.headers
|
...init.headers
|
||||||
};
|
};
|
||||||
init.body = params === Object(params)
|
init.body =
|
||||||
? JSON.stringify(params)
|
params === Object(params) ? JSON.stringify(params) : '{}';
|
||||||
: '{}';
|
|
||||||
}
|
}
|
||||||
init.headers = {
|
init.headers = {
|
||||||
'User-Agent': appVersion,
|
'User-Agent': appVersion,
|
||||||
...init.headers
|
...init.headers
|
||||||
};
|
};
|
||||||
var req = webApiService.execute(init).catch((err) => {
|
var req = webApiService
|
||||||
|
.execute(init)
|
||||||
|
.catch((err) => {
|
||||||
this.$throw(0, err);
|
this.$throw(0, err);
|
||||||
}).then((response) => {
|
})
|
||||||
|
.then((response) => {
|
||||||
try {
|
try {
|
||||||
response.data = JSON.parse(response.data);
|
response.data = JSON.parse(response.data);
|
||||||
return response;
|
return response;
|
||||||
} catch (e) {
|
} catch (e) {}
|
||||||
}
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
this.$throw(0, 'Invalid JSON response');
|
this.$throw(0, 'Invalid JSON response');
|
||||||
}
|
}
|
||||||
this.$throw(response.status);
|
this.$throw(response.status);
|
||||||
return {};
|
return {};
|
||||||
}).then(({ data, status }) => {
|
})
|
||||||
|
.then(({data, status}) => {
|
||||||
if (data === Object(data)) {
|
if (data === Object(data)) {
|
||||||
if (status === 200) {
|
if (status === 200) {
|
||||||
if (data.success === Object(data.success)) {
|
if (data.success === Object(data.success)) {
|
||||||
@@ -224,10 +230,7 @@ speechSynthesis.getVoices();
|
|||||||
data.error.data
|
data.error.data
|
||||||
);
|
);
|
||||||
} else if (typeof data.error === 'string') {
|
} else if (typeof data.error === 'string') {
|
||||||
this.$throw(
|
this.$throw(data.status_code || status, data.error);
|
||||||
data.status_code || status,
|
|
||||||
data.error
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$throw(status, data);
|
this.$throw(status, data);
|
||||||
@@ -373,9 +376,9 @@ speechSynthesis.getVoices();
|
|||||||
// API: Location
|
// API: Location
|
||||||
|
|
||||||
API.parseLocation = function (tag) {
|
API.parseLocation = function (tag) {
|
||||||
tag = String(tag || '');
|
var _tag = String(tag || '');
|
||||||
var ctx = {
|
var ctx = {
|
||||||
tag,
|
tag: _tag,
|
||||||
isOffline: false,
|
isOffline: false,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
worldId: '',
|
worldId: '',
|
||||||
@@ -389,27 +392,21 @@ speechSynthesis.getVoices();
|
|||||||
friendsId: null,
|
friendsId: null,
|
||||||
canRequestInvite: false
|
canRequestInvite: false
|
||||||
};
|
};
|
||||||
if (tag === 'offline') {
|
if (_tag === 'offline') {
|
||||||
ctx.isOffline = true;
|
ctx.isOffline = true;
|
||||||
} else if (tag === 'private') {
|
} else if (_tag === 'private') {
|
||||||
ctx.isPrivate = true;
|
ctx.isPrivate = true;
|
||||||
} else if (tag.startsWith('local') === false) {
|
} else if (_tag.startsWith('local') === false) {
|
||||||
var sep = tag.indexOf(':');
|
var sep = _tag.indexOf(':');
|
||||||
if (sep >= 0) {
|
if (sep >= 0) {
|
||||||
ctx.worldId = tag.substr(0, sep);
|
ctx.worldId = _tag.substr(0, sep);
|
||||||
ctx.instanceId = tag.substr(sep + 1);
|
ctx.instanceId = _tag.substr(sep + 1);
|
||||||
ctx.instanceId.split('~').forEach((s, i) => {
|
ctx.instanceId.split('~').forEach((s, i) => {
|
||||||
if (i) {
|
if (i) {
|
||||||
var A = s.indexOf('(');
|
var A = s.indexOf('(');
|
||||||
var Z = A >= 0
|
var Z = A >= 0 ? s.lastIndexOf(')') : -1;
|
||||||
? s.lastIndexOf(')')
|
var key = Z >= 0 ? s.substr(0, A) : s;
|
||||||
: -1;
|
var value = A < Z ? s.substr(A + 1, Z - A - 1) : '';
|
||||||
var key = Z >= 0
|
|
||||||
? s.substr(0, A)
|
|
||||||
: s;
|
|
||||||
var value = A < Z
|
|
||||||
? s.substr(A + 1, Z - A - 1)
|
|
||||||
: '';
|
|
||||||
if (key === 'hidden') {
|
if (key === 'hidden') {
|
||||||
ctx.hiddenId = value;
|
ctx.hiddenId = value;
|
||||||
} else if (key === 'private') {
|
} else if (key === 'private') {
|
||||||
@@ -445,14 +442,15 @@ speechSynthesis.getVoices();
|
|||||||
ctx.userId = ctx.hiddenId;
|
ctx.userId = ctx.hiddenId;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ctx.worldId = tag;
|
ctx.worldId = _tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ctx;
|
return ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
Vue.component('location', {
|
Vue.component('location', {
|
||||||
template: '<span>{{ text }}<slot></slot><span class="famfamfam-flags" :class="region" style="display:inline-block;margin-left:5px"></span></span>',
|
template:
|
||||||
|
'<span>{{ text }}<slot></slot><span class="famfamfam-flags" :class="region" style="display:inline-block;margin-left:5px"></span></span>',
|
||||||
props: {
|
props: {
|
||||||
location: String,
|
location: String,
|
||||||
hint: {
|
hint: {
|
||||||
@@ -488,7 +486,12 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.region = '';
|
this.region = '';
|
||||||
if ((this.location !== '') && (L.instanceId) && (!L.isOffline) && (!L.isPrivate)) {
|
if (
|
||||||
|
this.location !== '' &&
|
||||||
|
L.instanceId &&
|
||||||
|
!L.isOffline &&
|
||||||
|
!L.isPrivate
|
||||||
|
) {
|
||||||
if (L.region === 'eu') {
|
if (L.region === 'eu') {
|
||||||
this.region = 'europeanunion';
|
this.region = 'europeanunion';
|
||||||
} else if (L.region === 'jp') {
|
} else if (L.region === 'jp') {
|
||||||
@@ -639,10 +642,7 @@ speechSynthesis.getVoices();
|
|||||||
if (asis === tobe) {
|
if (asis === tobe) {
|
||||||
delete props[prop];
|
delete props[prop];
|
||||||
} else {
|
} else {
|
||||||
props[prop] = [
|
props[prop] = [tobe, asis];
|
||||||
tobe,
|
|
||||||
asis
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -734,10 +734,12 @@ speechSynthesis.getVoices();
|
|||||||
// OO has muted you
|
// OO has muted you
|
||||||
// OO has hidden you
|
// OO has hidden you
|
||||||
// --
|
// --
|
||||||
API.getConfig().catch((err) => {
|
API.getConfig()
|
||||||
|
.catch((err) => {
|
||||||
// FIXME: 어케 복구하냐 이건
|
// FIXME: 어케 복구하냐 이건
|
||||||
throw err;
|
throw err;
|
||||||
}).then((args) => {
|
})
|
||||||
|
.then((args) => {
|
||||||
if (this.appType === '1') {
|
if (this.appType === '1') {
|
||||||
this.updateCpuUsageLoop();
|
this.updateCpuUsageLoop();
|
||||||
}
|
}
|
||||||
@@ -748,7 +750,9 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.updateVRConfigVars = function () {
|
$app.methods.updateVRConfigVars = function () {
|
||||||
this.currentUserStatus = sharedRepository.getString('current_user_status');
|
this.currentUserStatus = sharedRepository.getString(
|
||||||
|
'current_user_status'
|
||||||
|
);
|
||||||
this.isGameRunning = sharedRepository.getBool('is_game_running');
|
this.isGameRunning = sharedRepository.getBool('is_game_running');
|
||||||
this.isGameNoVR = sharedRepository.getBool('is_Game_No_VR');
|
this.isGameNoVR = sharedRepository.getBool('is_Game_No_VR');
|
||||||
this.downloadProgress = sharedRepository.getInt('downloadProgress');
|
this.downloadProgress = sharedRepository.getInt('downloadProgress');
|
||||||
@@ -756,7 +760,9 @@ speechSynthesis.getVoices();
|
|||||||
if (lastLocation) {
|
if (lastLocation) {
|
||||||
this.lastLocation = lastLocation;
|
this.lastLocation = lastLocation;
|
||||||
if (this.lastLocation.date !== 0) {
|
if (this.lastLocation.date !== 0) {
|
||||||
this.lastLocationTimer = timeToText(Date.now() - this.lastLocation.date);
|
this.lastLocationTimer = timeToText(
|
||||||
|
Date.now() - this.lastLocation.date
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.lastLocationTimer = '';
|
this.lastLocationTimer = '';
|
||||||
}
|
}
|
||||||
@@ -794,14 +800,16 @@ speechSynthesis.getVoices();
|
|||||||
} else {
|
} else {
|
||||||
console.error('missing displayName');
|
console.error('missing displayName');
|
||||||
}
|
}
|
||||||
if ((displayName) && (!this.notyMap[displayName]) ||
|
if (
|
||||||
(this.notyMap[displayName] < feed.created_at)) {
|
(displayName && !this.notyMap[displayName]) ||
|
||||||
|
this.notyMap[displayName] < feed.created_at
|
||||||
|
) {
|
||||||
this.notyMap[displayName] = feed.created_at;
|
this.notyMap[displayName] = feed.created_at;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.initLoop = async function () {
|
$app.methods.initLoop = function () {
|
||||||
if (!sharedRepository.getBool('VRInit')) {
|
if (!sharedRepository.getBool('VRInit')) {
|
||||||
setTimeout(this.initLoop, 500);
|
setTimeout(this.initLoop, 500);
|
||||||
} else {
|
} else {
|
||||||
@@ -813,7 +821,7 @@ speechSynthesis.getVoices();
|
|||||||
try {
|
try {
|
||||||
this.currentTime = new Date().toJSON();
|
this.currentTime = new Date().toJSON();
|
||||||
await this.updateVRConfigVars();
|
await this.updateVRConfigVars();
|
||||||
if ((!this.config.hideDevicesFromFeed) && (this.appType === '1')) {
|
if (!this.config.hideDevicesFromFeed && this.appType === '1') {
|
||||||
AppApi.GetVRDevices().then((devices) => {
|
AppApi.GetVRDevices().then((devices) => {
|
||||||
devices.forEach((device) => {
|
devices.forEach((device) => {
|
||||||
device[2] = parseInt(device[2], 10);
|
device[2] = parseInt(device[2], 10);
|
||||||
@@ -865,8 +873,10 @@ speechSynthesis.getVoices();
|
|||||||
} else {
|
} else {
|
||||||
console.error('missing displayName');
|
console.error('missing displayName');
|
||||||
}
|
}
|
||||||
if ((displayName) && (!this.notyMap[displayName]) ||
|
if (
|
||||||
(this.notyMap[displayName] < feed.created_at)) {
|
(displayName && !this.notyMap[displayName]) ||
|
||||||
|
this.notyMap[displayName] < feed.created_at
|
||||||
|
) {
|
||||||
this.notyMap[displayName] = feed.created_at;
|
this.notyMap[displayName] = feed.created_at;
|
||||||
notyToPlay.push(feed);
|
notyToPlay.push(feed);
|
||||||
}
|
}
|
||||||
@@ -877,7 +887,11 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
var bias = new Date(Date.now() - 60000).toJSON();
|
var bias = new Date(Date.now() - 60000).toJSON();
|
||||||
var noty = {};
|
var noty = {};
|
||||||
var messageList = ['inviteMessage', 'requestMessage', 'responseMessage'];
|
var messageList = [
|
||||||
|
'inviteMessage',
|
||||||
|
'requestMessage',
|
||||||
|
'responseMessage'
|
||||||
|
];
|
||||||
for (var i = 0; i < notyToPlay.length; i++) {
|
for (var i = 0; i < notyToPlay.length; i++) {
|
||||||
noty = notyToPlay[i];
|
noty = notyToPlay[i];
|
||||||
if (noty.created_at < bias) {
|
if (noty.created_at < bias) {
|
||||||
@@ -885,14 +899,21 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
var message = '';
|
var message = '';
|
||||||
for (var k = 0; k < messageList.length; k++) {
|
for (var k = 0; k < messageList.length; k++) {
|
||||||
if (typeof noty.details !== 'undefined' && typeof noty.details[messageList[k]] !== 'undefined') {
|
if (
|
||||||
|
typeof noty.details !== 'undefined' &&
|
||||||
|
typeof noty.details[messageList[k]] !== 'undefined'
|
||||||
|
) {
|
||||||
message = noty.details[messageList[k]];
|
message = noty.details[messageList[k]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message) {
|
if (message) {
|
||||||
message = `, ${message}`;
|
message = `, ${message}`;
|
||||||
}
|
}
|
||||||
if ((this.config.overlayNotifications) && (!this.isGameNoVR) && (this.isGameRunning)) {
|
if (
|
||||||
|
this.config.overlayNotifications &&
|
||||||
|
!this.isGameNoVR &&
|
||||||
|
this.isGameRunning
|
||||||
|
) {
|
||||||
var text = '';
|
var text = '';
|
||||||
switch (noty.type) {
|
switch (noty.type) {
|
||||||
case 'OnPlayerJoined':
|
case 'OnPlayerJoined':
|
||||||
@@ -905,7 +926,12 @@ speechSynthesis.getVoices();
|
|||||||
text = `<strong>${noty.displayName}</strong> is joining`;
|
text = `<strong>${noty.displayName}</strong> is joining`;
|
||||||
break;
|
break;
|
||||||
case 'GPS':
|
case 'GPS':
|
||||||
text = `<strong>${noty.displayName}</strong> is in ${this.displayLocation(noty.location, noty.worldName)}`;
|
text = `<strong>${
|
||||||
|
noty.displayName
|
||||||
|
}</strong> is in ${this.displayLocation(
|
||||||
|
noty.location,
|
||||||
|
noty.worldName
|
||||||
|
)}`;
|
||||||
break;
|
break;
|
||||||
case 'Online':
|
case 'Online':
|
||||||
text = `<strong>${noty.displayName}</strong> has logged in`;
|
text = `<strong>${noty.displayName}</strong> has logged in`;
|
||||||
@@ -917,7 +943,12 @@ speechSynthesis.getVoices();
|
|||||||
text = `<strong>${noty.displayName}</strong> status is now <i>${noty.status}</i> ${noty.statusDescription}`;
|
text = `<strong>${noty.displayName}</strong> status is now <i>${noty.status}</i> ${noty.statusDescription}`;
|
||||||
break;
|
break;
|
||||||
case 'invite':
|
case 'invite':
|
||||||
text = `<strong>${noty.senderUsername}</strong> has invited you to ${this.displayLocation(noty.details.worldId, noty.details.worldName)}${message}`;
|
text = `<strong>${
|
||||||
|
noty.senderUsername
|
||||||
|
}</strong> has invited you to ${this.displayLocation(
|
||||||
|
noty.details.worldId,
|
||||||
|
noty.details.worldName
|
||||||
|
)}${message}`;
|
||||||
break;
|
break;
|
||||||
case 'requestInvite':
|
case 'requestInvite':
|
||||||
text = `<strong>${noty.senderUsername}</strong> has requested an invite ${message}`;
|
text = `<strong>${noty.senderUsername}</strong> has requested an invite ${message}`;
|
||||||
@@ -1028,4 +1059,4 @@ speechSynthesis.getVoices();
|
|||||||
|
|
||||||
$app = new Vue($app);
|
$app = new Vue($app);
|
||||||
window.$app = $app;
|
window.$app = $app;
|
||||||
}());
|
})();
|
||||||
|
|||||||
+9
-7
@@ -8,11 +8,11 @@
|
|||||||
// For a copy, see <https://opensource.org/licenses/MIT>.
|
// For a copy, see <https://opensource.org/licenses/MIT>.
|
||||||
//
|
//
|
||||||
|
|
||||||
@import "~normalize.css/normalize.css";
|
@import '~normalize.css/normalize.css';
|
||||||
@import "~animate.css/animate.min.css";
|
@import '~animate.css/animate.min.css';
|
||||||
@import "~noty/lib/noty.css";
|
@import '~noty/lib/noty.css';
|
||||||
@import "~element-ui/lib/theme-chalk/index.css";
|
@import '~element-ui/lib/theme-chalk/index.css';
|
||||||
@import "~famfamfam-flags/dist/sprite/famfamfam-flags.min.css";
|
@import '~famfamfam-flags/dist/sprite/famfamfam-flags.min.css';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
마지노선인듯
|
마지노선인듯
|
||||||
@@ -163,9 +163,11 @@ input,
|
|||||||
textarea,
|
textarea,
|
||||||
select,
|
select,
|
||||||
button {
|
button {
|
||||||
font-family: "Noto Sans JP", "Noto Sans KR", "Meiryo UI", "Malgun Gothic", "Segoe UI", sans-serif;
|
font-family: 'Noto Sans JP', 'Noto Sans KR', 'Meiryo UI', 'Malgun Gothic',
|
||||||
|
'Segoe UI', sans-serif;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
text-shadow: #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px;
|
text-shadow: #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px,
|
||||||
|
#000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.x-app {
|
.x-app {
|
||||||
|
|||||||
Reference in New Issue
Block a user