From 7cdb9f4f4a223d96cb2954bbc8046800902c2e6d Mon Sep 17 00:00:00 2001 From: Freddie Date: Sat, 30 May 2020 20:46:00 +0100 Subject: [PATCH] v1.16 --- build-env/assets/changelog.md | 8 +++++++- build-env/assets/static/css/bulma-fix.css | 2 +- build-env/assets/static/js/data_plugin.js | 5 +---- build-env/assets/views/_layout.pug | 2 +- build-env/assets/views/data_plugin.pug | 2 +- src/utils/Consts.ts | 2 +- src/utils/KBinJSON.ts | 5 +---- src/utils/KDataReader.ts | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build-env/assets/changelog.md b/build-env/assets/changelog.md index 046f89d..42c129e 100644 --- a/build-env/assets/changelog.md +++ b/build-env/assets/changelog.md @@ -1,6 +1,12 @@ +## v1.16 beta + +- **API**: Now `$()` throws error if a non-plain-object is passed in as data +- **API**: `$.ELEMENTS` and `$().elements` now always return valid arrays +- **API**: DB queries now ignore `__refid` fields instead of throwing errors + ## v1.15 beta -- **PluginLoader**: Lodash (\_) is now exposed as API. +- **PluginLoader**: Lodash (`\_`) is now exposed as API. - **WebUI**: Added a query shell for plugins. You need to enable developer mode to use it - **WebUI**: Added a dark mode which follows system's color preference diff --git a/build-env/assets/static/css/bulma-fix.css b/build-env/assets/static/css/bulma-fix.css index 6b55111..26b3657 100644 --- a/build-env/assets/static/css/bulma-fix.css +++ b/build-env/assets/static/css/bulma-fix.css @@ -81,7 +81,7 @@ background-color: #282c33; } } -@media screen and (max-width: 1023px) { +@media screen and (max-width: 1023px) and (prefers-color-scheme: dark) { nav.navbar .navbar-menu .navbar-item.has-dropdown > .navbar-link { background-color: #343434; } diff --git a/build-env/assets/static/js/data_plugin.js b/build-env/assets/static/js/data_plugin.js index d82c53b..3241e06 100644 --- a/build-env/assets/static/js/data_plugin.js +++ b/build-env/assets/static/js/data_plugin.js @@ -44,7 +44,7 @@ let __auto_starts = 0; $('#shell-command').on('keydown', async e => { - if (e.code == 'Enter') { + if (e.code == 'Enter' || e.keyCode == 13) { e.preventDefault(); __history_cur = 0; const command = $('#shell-command').val(); @@ -181,9 +181,6 @@ '(': ')', '{': '}', '[': ']', - '"': '"', - "'": "'", - '`': '`', }; if (input[end - 1] in fillRight) { diff --git a/build-env/assets/views/_layout.pug b/build-env/assets/views/_layout.pug index 6b04e0b..9562fc1 100644 --- a/build-env/assets/views/_layout.pug +++ b/build-env/assets/views/_layout.pug @@ -30,7 +30,7 @@ html.has-aside-left.has-aside-mobile-transition.has-navbar-fixed-top.has-aside-e head meta(charset="utf-8") meta(http-equiv="X-UA-Compatible", content="ie=edge") - meta(name="viewport", content="width=device-width, initial-scale=1.0") + meta(name="viewport", content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0") title Asphyxia CORE - #{title} if subtitle | diff --git a/build-env/assets/views/data_plugin.pug b/build-env/assets/views/data_plugin.pug index 2e310b8..8bc704c 100644 --- a/build-env/assets/views/data_plugin.pug +++ b/build-env/assets/views/data_plugin.pug @@ -8,7 +8,7 @@ block head block content .shell .control.has-icons-left.shell-input - input.input#shell-command(type="text" spellcheck="false" data-plugin=subtitle) + input.input#shell-command(type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-plugin=subtitle) span.icon.is-left i.mdi.mdi-chevron-right pre.has-padding-7.is-marginless#shell-content diff --git a/src/utils/Consts.ts b/src/utils/Consts.ts index 7981c1d..2696247 100644 --- a/src/utils/Consts.ts +++ b/src/utils/Consts.ts @@ -1,4 +1,4 @@ -export const VERSION = 'v1.15 beta'; +export const VERSION = 'v1.16 beta'; export const NAMES = [ 'Akehiro', 'Akihiro', diff --git a/src/utils/KBinJSON.ts b/src/utils/KBinJSON.ts index 8b551bf..653c191 100644 --- a/src/utils/KBinJSON.ts +++ b/src/utils/KBinJSON.ts @@ -1102,10 +1102,7 @@ export const getElement = (data: any, path: string): any => { export const getElements = (data: any, path: string): any[] => { const item: any = get(data, `${path}`); - if (isNil(item)) return item; - if (isEmpty(item)) { - return []; - } + if (isNil(item)) return []; if (isArray(item)) { return item; } else { diff --git a/src/utils/KDataReader.ts b/src/utils/KDataReader.ts index 06a7d55..1b4e245 100644 --- a/src/utils/KDataReader.ts +++ b/src/utils/KDataReader.ts @@ -51,7 +51,7 @@ export class KDataReader { elements(path: string): KDataReader[] { const ele = getElements(this.obj, path); - if (isNil(ele)) return null; + if (isNil(ele)) return []; return ele.map(e => new KDataReader(e)); }