Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b02ffee679 | ||
|
|
c54ffa1cae | ||
|
|
4f0ca3d633 | ||
|
|
048a0bee5d |
@@ -1,3 +1,8 @@
|
|||||||
|
## 2.6.1 (26 Nov 2022)
|
||||||
|
|
||||||
|
* fix: dark mode scrollbar style
|
||||||
|
* fix: unable to load timing plugin
|
||||||
|
|
||||||
## 2.6.0 (25 Nov 2022)
|
## 2.6.0 (25 Nov 2022)
|
||||||
|
|
||||||
* feat(console): select and copy
|
* feat(console): select and copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const BundleAnalyzerPlugin =
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
|
||||||
require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
.BundleAnalyzerPlugin
|
||||||
|
|
||||||
exports = require('./webpack.prod')
|
exports = require('./webpack.prod')
|
||||||
|
|
||||||
|
|||||||
@@ -303,9 +303,11 @@ Add color to select a color.
|
|||||||
Add a separator.
|
Add a separator.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
let cfg = eruda.util.createCfg('test');
|
import defaults from 'licia/defaults';
|
||||||
|
|
||||||
cfg.set(eruda.util.defaults(cfg.get(), {
|
let cfg = eruda.Settings.createCfg('test');
|
||||||
|
|
||||||
|
cfg.set(defaults(cfg.get(), {
|
||||||
testBool: true,
|
testBool: true,
|
||||||
testSelect: 'select1',
|
testSelect: 'select1',
|
||||||
testRange: 1
|
testRange: 1
|
||||||
|
|||||||
2831
doc/UTIL_API.md
2831
doc/UTIL_API.md
File diff suppressed because it is too large
Load Diff
4
eruda.d.ts
vendored
4
eruda.d.ts
vendored
@@ -400,8 +400,8 @@ declare module 'eruda' {
|
|||||||
* @see https://github.com/liriliri/eruda/blob/master/doc/UTIL_API.md
|
* @see https://github.com/liriliri/eruda/blob/master/doc/UTIL_API.md
|
||||||
*/
|
*/
|
||||||
export interface Util {
|
export interface Util {
|
||||||
createCfg(name: string): object
|
evalCss(css: string): HTMLStyleElement
|
||||||
defaults(obj: object, ...src: object[]): object
|
isErudaEl(val: any): boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eruda",
|
"name": "eruda",
|
||||||
"version": "2.6.0",
|
"version": "2.6.1",
|
||||||
"description": "Console for Mobile Browsers",
|
"description": "Console for Mobile Browsers",
|
||||||
"main": "eruda.js",
|
"main": "eruda.js",
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
@@ -18,8 +18,7 @@
|
|||||||
"lint:fix": "npm run lint -- --fix",
|
"lint:fix": "npm run lint -- --fix",
|
||||||
"es5": "es-check es5 dist/eruda.js",
|
"es5": "es-check es5 dist/eruda.js",
|
||||||
"setup": "lsla shx mkdir -p test/lib && lsla shx cp node_modules/jasmine-core/lib/jasmine-core/{jasmine.css,jasmine.js,jasmine-html.js,boot.js} test/lib && lsla shx cp node_modules/jasmine-jquery/lib/jasmine-jquery.js test/lib && lsla shx cp node_modules/jquery/dist/jquery.js test/lib",
|
"setup": "lsla shx mkdir -p test/lib && lsla shx cp node_modules/jasmine-core/lib/jasmine-core/{jasmine.css,jasmine.js,jasmine-html.js,boot.js} test/lib && lsla shx cp node_modules/jasmine-jquery/lib/jasmine-jquery.js test/lib && lsla shx cp node_modules/jquery/dist/jquery.js test/lib",
|
||||||
"genIcon": "lsla genIcon --input src/style/icon --output src/style/icon.css --name eruda-icon && prettier src/**/*.css --write",
|
"genIcon": "lsla genIcon --input src/style/icon --output src/style/icon.css --name eruda-icon && prettier src/**/*.css --write"
|
||||||
"genUtilDoc": "eustia doc src/lib/util.js -f md -o doc/UTIL_API.md -t \"Eruda Util Documentation\""
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
extend,
|
extend,
|
||||||
} from '../lib/util'
|
} from '../lib/util'
|
||||||
import evalCss from '../lib/evalCss'
|
import evalCss from '../lib/evalCss'
|
||||||
|
import { isDarkTheme } from '../lib/themes'
|
||||||
import LunaNotification from 'luna-notification'
|
import LunaNotification from 'luna-notification'
|
||||||
|
|
||||||
export default class DevTools extends Emitter {
|
export default class DevTools extends Emitter {
|
||||||
@@ -156,7 +157,7 @@ export default class DevTools extends Emitter {
|
|||||||
|
|
||||||
this._setTransparency(cfg.get('transparency'))
|
this._setTransparency(cfg.get('transparency'))
|
||||||
this._setDisplaySize(cfg.get('displaySize'))
|
this._setDisplaySize(cfg.get('displaySize'))
|
||||||
evalCss.setTheme(cfg.get('theme'))
|
this._setTheme(cfg.get('theme'))
|
||||||
|
|
||||||
cfg.on('change', (key, val) => {
|
cfg.on('change', (key, val) => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
@@ -165,7 +166,7 @@ export default class DevTools extends Emitter {
|
|||||||
case 'displaySize':
|
case 'displaySize':
|
||||||
return this._setDisplaySize(val)
|
return this._setDisplaySize(val)
|
||||||
case 'theme':
|
case 'theme':
|
||||||
return evalCss.setTheme(val)
|
return this._setTheme(val)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -193,6 +194,16 @@ export default class DevTools extends Emitter {
|
|||||||
this._navBar.destroy()
|
this._navBar.destroy()
|
||||||
this._$el.remove()
|
this._$el.remove()
|
||||||
}
|
}
|
||||||
|
_setTheme(theme) {
|
||||||
|
const { $container } = this
|
||||||
|
|
||||||
|
if (isDarkTheme(theme)) {
|
||||||
|
$container.addClass('eruda-dark')
|
||||||
|
} else {
|
||||||
|
$container.rmClass('eruda-dark')
|
||||||
|
}
|
||||||
|
evalCss.setTheme(theme)
|
||||||
|
}
|
||||||
_setTransparency(opacity) {
|
_setTransparency(opacity) {
|
||||||
if (!isNum(opacity)) return
|
if (!isNum(opacity)) return
|
||||||
|
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ function loadPlugin(name) {
|
|||||||
const pluginVersion = {
|
const pluginVersion = {
|
||||||
fps: '2.0.0',
|
fps: '2.0.0',
|
||||||
features: '2.0.0',
|
features: '2.0.0',
|
||||||
timing: '2.0.0',
|
timing: '2.0.1',
|
||||||
memory: '2.0.0',
|
memory: '2.0.0',
|
||||||
code: '2.0.0',
|
code: '2.0.0',
|
||||||
benchmark: '2.0.0',
|
benchmark: '2.0.0',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { extend, isArr } from './util'
|
import { extend, isArr } from './util'
|
||||||
|
import contain from 'licia/contain'
|
||||||
|
|
||||||
const keyMap = [
|
const keyMap = [
|
||||||
'background',
|
'background',
|
||||||
@@ -70,6 +71,24 @@ function createLightTheme(theme) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const darkThemes = [
|
||||||
|
'Dark',
|
||||||
|
'Material Oceanic',
|
||||||
|
'Material Darker',
|
||||||
|
'Material Palenight',
|
||||||
|
'Material Deep Ocean',
|
||||||
|
'Monokai Pro',
|
||||||
|
'Dracula',
|
||||||
|
'Arc Dark',
|
||||||
|
'Atom One Dark',
|
||||||
|
'Solarized Dark',
|
||||||
|
'Night Owl',
|
||||||
|
]
|
||||||
|
|
||||||
|
export function isDarkTheme(theme) {
|
||||||
|
return contain(darkThemes, theme)
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Light: createLightTheme({
|
Light: createLightTheme({
|
||||||
darkerBackground: '#f3f3f3',
|
darkerBackground: '#f3f3f3',
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
@import 'luna';
|
@import 'luna';
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
|
&.dark {
|
||||||
|
color-scheme: dark;
|
||||||
|
}
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
@@ -39,9 +39,6 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="#" id="override-style">Override Style</a>
|
<a href="#" id="override-style">Override Style</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<a href="#" id="stringify-timing">Stringify Timing</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<a href="#" id="log">Log</a>
|
<a href="#" id="log">Log</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -126,11 +123,6 @@
|
|||||||
addClickEvent('override-style', function () {
|
addClickEvent('override-style', function () {
|
||||||
util.evalCss('.eruda-nav-bar {background: red !important;}')
|
util.evalCss('.eruda-nav-bar {background: red !important;}')
|
||||||
})
|
})
|
||||||
addClickEvent('stringify-timing', function () {
|
|
||||||
console.time('stringify window')
|
|
||||||
eruda.util.stringifyAll(window)
|
|
||||||
console.timeEnd('stringify window')
|
|
||||||
})
|
|
||||||
addClickEvent('log', () => {
|
addClickEvent('log', () => {
|
||||||
console.clear()
|
console.clear()
|
||||||
console.log('log')
|
console.log('log')
|
||||||
|
|||||||
Reference in New Issue
Block a user