${lines
.slice(1)
@@ -412,7 +409,7 @@ function formatErr(err) {
msg +
stack.replace(
regJsUrl,
- match => `
${match}`
+ (match) => `
${match}`
)
)
}
@@ -424,7 +421,7 @@ function formatJs(code) {
number: `color:${curTheme.numberColor}`,
operator: `color:${curTheme.operatorColor}`,
comment: `color:${curTheme.commentColor}`,
- string: `color:${curTheme.stringColor}`
+ string: `color:${curTheme.stringColor}`,
})
}
@@ -455,7 +452,7 @@ function formatMsg(args, { htmlForEl = true } = {}) {
return args.join(' ') + '
'
}
-const formatDir = args => formatMsg(args, { htmlForEl: false })
+const formatDir = (args) => formatMsg(args, { htmlForEl: false })
function substituteStr(args) {
const str = escape(args[0])
@@ -521,7 +518,7 @@ function correctStyle(val) {
val = lowerCase(val)
const rules = val.split(';')
const style = {}
- each(rules, rule => {
+ each(rules, (rule) => {
if (!contain(rule, ':')) return
const [name, val] = rule.split(':')
style[trim(name)] = trim(val)
@@ -558,17 +555,17 @@ function formatEl(val) {
}
const tpl = require('./Log.hbs')
-const render = data => tpl(data)
+const render = (data) => tpl(data)
function extractObj(obj, options = {}, cb) {
defaults(options, {
accessGetter: Log.showGetterVal,
unenumerable: Log.showUnenumerable,
symbol: Log.showUnenumerable,
- timeout: 1000
+ timeout: 1000,
})
- stringify(obj, options, result => cb(JSON.parse(result)))
+ stringify(obj, options, (result) => cb(JSON.parse(result)))
}
function stringify(obj, options, cb) {
diff --git a/src/Console/Logger.js b/src/Console/Logger.js
index 853d63c..0dfd125 100644
--- a/src/Console/Logger.js
+++ b/src/Console/Logger.js
@@ -24,7 +24,7 @@ import {
xpath,
isHidden,
lowerCase,
- dateFormat
+ dateFormat,
} from '../lib/util'
import evalCss from '../lib/evalCss'
@@ -75,7 +75,7 @@ export default class Logger extends Emitter {
this._minSpeedTolerance = 800
}
- this.renderViewport = throttle(options => {
+ this.renderViewport = throttle((options) => {
this._renderViewport(options)
}, 16)
@@ -97,13 +97,13 @@ export default class Logger extends Emitter {
clear: () => {
this.clear()
},
- dir: value => {
+ dir: (value) => {
this.dir(value)
},
table: (data, columns) => {
this.table(data, columns)
},
- keys
+ keys,
}
this._bindEvent()
@@ -221,7 +221,7 @@ export default class Logger extends Emitter {
return this.insert('log', [
'%cConsole was cleared',
- 'color:#808080;font-style:italic;'
+ 'color:#808080;font-style:italic;',
])
}
silentClear() {
@@ -258,14 +258,14 @@ export default class Logger extends Emitter {
return this.insert({
type: 'group',
args,
- ignoreFilter: true
+ ignoreFilter: true,
})
}
groupCollapsed(...args) {
return this.insert({
type: 'groupCollapsed',
args,
- ignoreFilter: true
+ ignoreFilter: true,
})
}
groupEnd() {
@@ -275,7 +275,7 @@ export default class Logger extends Emitter {
this.insert({
type: 'input',
args: [jsCode],
- ignoreFilter: true
+ ignoreFilter: true,
})
try {
@@ -284,7 +284,7 @@ export default class Logger extends Emitter {
this.insert({
type: 'error',
ignoreFilter: true,
- args: [e]
+ args: [e],
})
}
@@ -294,7 +294,7 @@ export default class Logger extends Emitter {
return this.insert({
type: 'output',
args: [val],
- ignoreFilter: true
+ ignoreFilter: true,
})
}
html(...args) {
@@ -319,7 +319,7 @@ export default class Logger extends Emitter {
if (this._displayHeader) {
headers = {
time: getCurTime(),
- from: getFrom()
+ from: getFrom(),
}
}
@@ -350,7 +350,7 @@ export default class Logger extends Emitter {
}
extend(options, {
id: ++id,
- headers
+ headers,
})
if (options.type === 'group' || options.type === 'groupCollapsed') {
@@ -358,7 +358,7 @@ export default class Logger extends Emitter {
id: uniqId('group'),
collapsed: false,
parent: groupStack.peek(),
- indentLevel: groupStack.size + 1
+ indentLevel: groupStack.size + 1,
}
if (options.type === 'groupCollapsed') group.collapsed = true
options.targetGroup = group
@@ -613,22 +613,16 @@ export default class Logger extends Emitter {
const $el = this._$el
$el
- .on('click', '.eruda-log-container', function() {
+ .on('click', '.eruda-log-container', function () {
this.log.click(self)
})
- .on('click', '.eruda-icon-caret-down', function() {
- const $el = $(this)
- .parent()
- .parent()
- .parent()
+ .on('click', '.eruda-icon-caret-down', function () {
+ const $el = $(this).parent().parent().parent()
self._collapseGroup($el.get(0).log)
})
- .on('click', '.eruda-icon-caret-right', function() {
- const $el = $(this)
- .parent()
- .parent()
- .parent()
+ .on('click', '.eruda-icon-caret-right', function () {
+ const $el = $(this).parent().parent().parent()
self._openGroup($el.get(0).log)
})
@@ -687,7 +681,7 @@ export default class Logger extends Emitter {
this.renderViewport({
topTolerance: topTolerance * 2,
- bottomTolerance: bottomTolerance * 2
+ bottomTolerance: bottomTolerance * 2,
})
})
}
diff --git a/src/DevTools/DevTools.js b/src/DevTools/DevTools.js
index ddf2023..cb25cff 100644
--- a/src/DevTools/DevTools.js
+++ b/src/DevTools/DevTools.js
@@ -13,7 +13,7 @@ import {
$,
throttle,
isDarkMode,
- extend
+ extend,
} from '../lib/util'
import evalCss from '../lib/evalCss'
import LunaNotification from 'luna-notification'
@@ -26,7 +26,7 @@ export default class DevTools extends Emitter {
{
transparency: 1,
displaySize: 80,
- theme: isDarkMode() ? 'Dark' : 'Light'
+ theme: isDarkMode() ? 'Dark' : 'Light',
},
defaults
)
@@ -114,7 +114,7 @@ export default class DevTools extends Emitter {
return this
}
removeAll() {
- each(this._tools, tool => this.remove(tool.name))
+ each(this._tools, (tool) => this.remove(tool.name))
return this
}
@@ -134,7 +134,7 @@ export default class DevTools extends Emitter {
let lastTool = {}
- each(tools, tool => {
+ each(tools, (tool) => {
if (tool.active) {
lastTool = tool
tool.active = false
@@ -175,12 +175,12 @@ export default class DevTools extends Emitter {
.range(cfg, 'transparency', 'Transparency', {
min: 0.2,
max: 1,
- step: 0.01
+ step: 0.01,
})
.range(cfg, 'displaySize', 'Display Size', {
min: 40,
max: 100,
- step: 1
+ step: 1,
})
.separator()
}
@@ -214,19 +214,19 @@ export default class DevTools extends Emitter {
}
_initNavBar() {
this._navBar = new NavBar(this._$el.find('.eruda-nav-bar-container'))
- this._navBar.on('showTool', name => this.showTool(name))
+ this._navBar.on('showTool', (name) => this.showTool(name))
}
_initNotification() {
this._notification = new LunaNotification(this._$el.get(0), {
position: {
x: 'center',
- y: 'top'
- }
+ y: 'top',
+ },
})
}
_bindEvent() {
const $navBar = this._$el.find('.eruda-nav-bar')
- const startListener = e => {
+ const startListener = (e) => {
e = e.origEvent
this._resizeTimer = setTimeout(() => {
e.preventDefault()
@@ -238,10 +238,10 @@ export default class DevTools extends Emitter {
}, 1000)
}
const setDisplaySize = throttle(
- size => this.config.set('displaySize', size),
+ (size) => this.config.set('displaySize', size),
50
)
- const moveListener = e => {
+ const moveListener = (e) => {
if (!this._isResizing) {
return clearTimeout(this._resizeTimer)
}
@@ -265,14 +265,14 @@ export default class DevTools extends Emitter {
this._isResizing = false
$navBar.css('filter', 'brightness(1)')
}
- const getClientY = e => {
+ const getClientY = (e) => {
if (e.clientY) return e.clientY
if (e.touches) return e.touches[0].clientY
return 0
}
- $navBar.on('contextmenu', e => e.preventDefault())
+ $navBar.on('contextmenu', (e) => e.preventDefault())
const $root = $(document.documentElement)
if (isMobile()) {
$navBar.on('touchstart', startListener).on('touchmove', moveListener)
diff --git a/src/DevTools/NavBar.js b/src/DevTools/NavBar.js
index dcd2914..6fc1500 100644
--- a/src/DevTools/NavBar.js
+++ b/src/DevTools/NavBar.js
@@ -28,7 +28,7 @@ export default class NavBar extends Emitter {
}
remove(name) {
this._len--
- this._$el.find('.eruda-nav-bar-item').each(function() {
+ this._$el.find('.eruda-nav-bar-item').each(function () {
const $this = $(this)
if ($this.text().toLowerCase() === name.toLowerCase()) $this.remove()
})
@@ -37,7 +37,7 @@ export default class NavBar extends Emitter {
activateTool(name) {
const self = this
- this._$el.find('.eruda-nav-bar-item').each(function() {
+ this._$el.find('.eruda-nav-bar-item').each(function () {
const $this = $(this)
if ($this.text() === name) {
@@ -84,14 +84,14 @@ export default class NavBar extends Emitter {
$bottomBar.css({
width: li.offsetWidth,
- left: li.offsetLeft - $el.get(0).scrollLeft
+ left: li.offsetLeft - $el.get(0).scrollLeft,
})
}
_bindEvent() {
const self = this
this._$el
- .on('click', '.eruda-nav-bar-item', function() {
+ .on('click', '.eruda-nav-bar-item', function () {
self.emit('showTool', $(this).text())
})
.on('scroll', () => this.resetBottomBar())
diff --git a/src/DevTools/Tool.js b/src/DevTools/Tool.js
index d37b35c..40683e6 100644
--- a/src/DevTools/Tool.js
+++ b/src/DevTools/Tool.js
@@ -16,5 +16,5 @@ export default Class({
},
destroy() {
this._$el.remove()
- }
+ },
})
diff --git a/src/Elements/CssStore.js b/src/Elements/CssStore.js
index 5133eae..5f801c4 100644
--- a/src/Elements/CssStore.js
+++ b/src/Elements/CssStore.js
@@ -16,7 +16,7 @@ function formatStyle(style) {
const elProto = Element.prototype
-let matchesSel = function() {
+let matchesSel = function () {
return false
}
@@ -38,7 +38,7 @@ export default class CssStore {
getMatchedCSSRules() {
const ret = []
- each(document.styleSheets, styleSheet => {
+ each(document.styleSheets, (styleSheet) => {
try {
// Started with version 64, Chrome does not allow cross origin script to access this property.
if (!styleSheet.cssRules) return
@@ -46,7 +46,7 @@ export default class CssStore {
return
}
- each(styleSheet.cssRules, cssRule => {
+ each(styleSheet.cssRules, (cssRule) => {
let matchesEl = false
// Mobile safari will throw DOM Exception 12 error, need to try catch it.
@@ -59,7 +59,7 @@ export default class CssStore {
ret.push({
selectorText: cssRule.selectorText,
- style: formatStyle(cssRule.style)
+ style: formatStyle(cssRule.style),
})
})
})
@@ -90,7 +90,7 @@ function sortStyleKeys(style) {
if (lenA < lenB) return -1
return 0
- }
+ },
})
}
diff --git a/src/Elements/Elements.js b/src/Elements/Elements.js
index c5dd1f7..32d404a 100644
--- a/src/Elements/Elements.js
+++ b/src/Elements/Elements.js
@@ -27,7 +27,7 @@ import {
isNull,
trim,
lowerCase,
- pick
+ pick,
} from '../lib/util'
import { isErudaEl } from '../lib/extraUtil'
import evalCss from '../lib/evalCss'
@@ -97,12 +97,12 @@ export default class Elements extends Tool {
const origAddEvent = (this._origAddEvent = winEventProto.addEventListener)
const origRmEvent = (this._origRmEvent = winEventProto.removeEventListener)
- winEventProto.addEventListener = function(type, listener, useCapture) {
+ winEventProto.addEventListener = function (type, listener, useCapture) {
addEvent(this, type, listener, useCapture)
origAddEvent.apply(this, arguments)
}
- winEventProto.removeEventListener = function(type, listener, useCapture) {
+ winEventProto.removeEventListener = function (type, listener, useCapture) {
rmEvent(this, type, listener, useCapture)
origRmEvent.apply(this, arguments)
}
@@ -144,7 +144,7 @@ export default class Elements extends Tool {
const select = this._select
this._$el
- .on('click', '.eruda-child', function() {
+ .on('click', '.eruda-child', function () {
const idx = $(this).data('idx')
const curEl = self._curEl
const el = curEl.childNodes[idx]
@@ -176,7 +176,7 @@ export default class Elements extends Tool {
!isElExist(el) ? self._render() : self.set(el)
})
- .on('click', '.eruda-listener-content', function() {
+ .on('click', '.eruda-listener-content', function () {
const text = $(this).text()
const sources = container.get('sources')
@@ -193,7 +193,7 @@ export default class Elements extends Tool {
container.showTool('sources')
}
})
- .on('click', '.eruda-parent', function() {
+ .on('click', '.eruda-parent', function () {
let idx = $(this).data('idx')
const curEl = self._curEl
let el = curEl.parentNode
@@ -224,7 +224,7 @@ export default class Elements extends Tool {
.on('click', '.eruda-select', () => this._toggleSelect())
.on('click', '.eruda-reset', () => this.set(this._htmlEl))
- select.on('select', target => this.set(target))
+ select.on('select', (target) => this.set(target))
}
_toggleAllComputedStyle() {
this._rmDefComputedStyle = !this._rmDefComputedStyle
@@ -235,7 +235,7 @@ export default class Elements extends Tool {
this._observer.observe(this._htmlEl, {
attributes: true,
childList: true,
- subtree: true
+ subtree: true,
})
}
_disableObserver() {
@@ -301,14 +301,14 @@ export default class Elements extends Tool {
function getBoxModelValue(type) {
let keys = ['top', 'left', 'right', 'bottom']
- if (type !== 'position') keys = map(keys, key => `${type}-${key}`)
- if (type === 'border') keys = map(keys, key => `${key}-width`)
+ if (type !== 'position') keys = map(keys, (key) => `${type}-${key}`)
+ if (type === 'border') keys = map(keys, (key) => `${key}-width`)
return {
top: boxModelValue(computedStyle[keys[0]], type),
left: boxModelValue(computedStyle[keys[1]], type),
right: boxModelValue(computedStyle[keys[2]], type),
- bottom: boxModelValue(computedStyle[keys[3]], type)
+ bottom: boxModelValue(computedStyle[keys[3]], type),
}
}
@@ -318,8 +318,8 @@ export default class Elements extends Tool {
padding: getBoxModelValue('padding'),
content: {
width: boxModelValue(computedStyle['width']),
- height: boxModelValue(computedStyle['height'])
- }
+ height: boxModelValue(computedStyle['height']),
+ },
}
if (computedStyle['position'] !== 'static') {
@@ -329,7 +329,7 @@ export default class Elements extends Tool {
const styles = cssStore.getMatchedCSSRules()
styles.unshift(getInlineStyle(el.style))
- styles.forEach(style => processStyleRules(style.style))
+ styles.forEach((style) => processStyleRules(style.style))
ret.styles = styles
if (this._rmDefComputedStyle) {
@@ -373,8 +373,8 @@ export default class Elements extends Tool {
}
}
_initObserver() {
- this._observer = new MutationObserver(mutations => {
- each(mutations, mutation => this._handleMutation(mutation))
+ this._observer = new MutationObserver((mutations) => {
+ each(mutations, (mutation) => this._handleMutation(mutation))
})
}
_handleMutation(mutation) {
@@ -418,7 +418,7 @@ export default class Elements extends Tool {
_initCfg() {
const cfg = (this.config = Settings.createCfg('elements', {
overrideEventTarget: true,
- observeElement: true
+ observeElement: true,
}))
if (cfg.get('overrideEventTarget')) this.overrideEventTarget()
@@ -466,7 +466,7 @@ function processStyleRule(val) {
.replace(regCssUrl, (match, url) => `url("${wrapLink(url)}")`)
}
-const isElExist = val => isEl(val) && val.parentNode
+const isElExist = (val) => isEl(val) && val.parentNode
function formatElName(data, { noAttr = false } = {}) {
const { id, className, attributes } = data
@@ -477,7 +477,7 @@ function formatElName(data, { noAttr = false } = {}) {
if (isStr(className)) {
let classes = ''
- each(className.split(/\s+/g), val => {
+ each(className.split(/\s+/g), (val) => {
if (val.trim() === '') return
classes += `.${val}`
})
@@ -485,7 +485,7 @@ function formatElName(data, { noAttr = false } = {}) {
}
if (!noAttr) {
- each(attributes, attr => {
+ each(attributes, (attr) => {
const name = attr.name
if (name === 'id' || name === 'class' || name === 'style') return
ret += `
${name}="${attr.value}"`
@@ -495,8 +495,8 @@ function formatElName(data, { noAttr = false } = {}) {
return ret
}
-const formatAttr = attributes =>
- map(attributes, attr => {
+const formatAttr = (attributes) =>
+ map(attributes, (attr) => {
let { value } = attr
const { name } = attr
value = escape(value)
@@ -522,7 +522,7 @@ function formatChildNodes(nodes) {
ret.push({
text: val,
isCmt: nodeType === 8,
- idx: i
+ idx: i,
})
continue
}
@@ -537,7 +537,7 @@ function formatChildNodes(nodes) {
ret.push({
text: formatElName(child),
isEl: true,
- idx: i
+ idx: i,
})
}
}
@@ -553,7 +553,7 @@ function getParents(el) {
while (parent && parent.nodeType === 1) {
ret.push({
text: formatElName(parent, { noAttr: true }),
- idx: i++
+ idx: i++,
})
parent = parent.parentNode
@@ -565,7 +565,7 @@ function getParents(el) {
function getInlineStyle(style) {
const ret = {
selectorText: 'element.style',
- style: {}
+ style: {},
}
for (let i = 0, len = style.length; i < len; i++) {
@@ -581,7 +581,7 @@ function rmDefComputedStyle(computedStyle, styles) {
const ret = {}
let keepStyles = ['display', 'width', 'height']
- each(styles, style => {
+ each(styles, (style) => {
keepStyles = keepStyles.concat(keys(style.style))
})
keepStyles = unique(keepStyles)
@@ -597,7 +597,8 @@ function rmDefComputedStyle(computedStyle, styles) {
const NO_STYLE_TAG = ['script', 'style', 'meta', 'title', 'link', 'head']
-const needNoStyle = tagName => NO_STYLE_TAG.indexOf(tagName.toLowerCase()) > -1
+const needNoStyle = (tagName) =>
+ NO_STYLE_TAG.indexOf(tagName.toLowerCase()) > -1
function addEvent(el, type, listener, useCapture = false) {
if (!isEl(el) || !isFn(listener) || !isBool(useCapture)) return
@@ -608,7 +609,7 @@ function addEvent(el, type, listener, useCapture = false) {
events[type].push({
listener: listener,
listenerStr: listener.toString(),
- useCapture: useCapture
+ useCapture: useCapture,
})
}
@@ -636,7 +637,7 @@ const getWinEventProto = () => {
return safeGet(window, 'EventTarget.prototype') || window.Node.prototype
}
-const wrapLink = link => `
${link}`
+const wrapLink = (link) => `
${link}`
function boxModelValue(val, type) {
if (isNum(val)) return val
diff --git a/src/Elements/Highlight.js b/src/Elements/Highlight.js
index 4c05265..8f497f1 100644
--- a/src/Elements/Highlight.js
+++ b/src/Elements/Highlight.js
@@ -39,7 +39,7 @@ export default class Highlight {
this._$el.css('visibility', 'visible')
}
- const getNumStyle = name => pxToNum(computedStyle.getPropertyValue(name))
+ const getNumStyle = (name) => pxToNum(computedStyle.getPropertyValue(name))
const ml = getNumStyle('margin-left')
const mr = getNumStyle('margin-right')
@@ -72,7 +72,7 @@ export default class Highlight {
borderTop: `${mt}px solid ${marginColor}`,
borderLeft: `${ml}px solid ${marginColor}`,
borderRight: `${mr}px solid ${marginColor}`,
- borderBottom: `${mb}px solid ${marginColor}`
+ borderBottom: `${mb}px solid ${marginColor}`,
})
this._$border.css({
@@ -83,7 +83,7 @@ export default class Highlight {
borderTop: `${bt}px solid ${borderColor}`,
borderLeft: `${bl}px solid ${borderColor}`,
borderRight: `${br}px solid ${borderColor}`,
- borderBottom: `${bb}px solid ${borderColor}`
+ borderBottom: `${bb}px solid ${borderColor}`,
})
this._$padding.css({
@@ -94,7 +94,7 @@ export default class Highlight {
borderTop: `${pt}px solid ${paddingColor}`,
borderLeft: `${pl}px solid ${paddingColor}`,
borderRight: `${pr}px solid ${paddingColor}`,
- borderBottom: `${pb}px solid ${paddingColor}`
+ borderBottom: `${pb}px solid ${paddingColor}`,
})
this._$content.css({
@@ -102,13 +102,13 @@ export default class Highlight {
top: bt + pt,
width: pw - pl - pr,
height: ph - pt - pb,
- background: contentColor
+ background: contentColor,
})
this._$size
.css({
top: -mt - (top - mt < 25 ? 0 : 25),
- left: -ml
+ left: -ml,
})
.html(`${formatElName(this._target)} | ${width} × ${height}`)
}
@@ -143,7 +143,7 @@ function formatElName(el) {
let classes = ''
if (isStr(className)) {
- each(className.split(/\s+/g), val => {
+ each(className.split(/\s+/g), (val) => {
if (trim(val) === '') return
classes += `.${val}`
diff --git a/src/Elements/Select.js b/src/Elements/Select.js
index b0c06ef..bf3da91 100644
--- a/src/Elements/Select.js
+++ b/src/Elements/Select.js
@@ -7,21 +7,21 @@ export default class Select extends Emitter {
const self = this
- this._startListener = function(e) {
+ this._startListener = function (e) {
if (isErudaEl(e.target)) return
- self._timer = setTimeout(function() {
+ self._timer = setTimeout(function () {
self.emit('select', e.target)
}, 200)
return false
}
- this._moveListener = function() {
+ this._moveListener = function () {
clearTimeout(self._timer)
}
- this._clickListener = function(e) {
+ this._clickListener = function (e) {
if (isErudaEl(e.target)) return
e.preventDefault()
diff --git a/src/EntryBtn/EntryBtn.js b/src/EntryBtn/EntryBtn.js
index 95bab0a..268da34 100644
--- a/src/EntryBtn/EntryBtn.js
+++ b/src/EntryBtn/EntryBtn.js
@@ -29,7 +29,7 @@ export default class EntryBtn extends Emitter {
this._$el.css({
left: pos.x,
- top: pos.y
+ top: pos.y,
})
this.config.set('pos', pos)
@@ -91,7 +91,7 @@ export default class EntryBtn extends Emitter {
if (cfg.get('rememberPos')) {
cfg.set('pos', {
x: pxToNum(this._$el.css('left')),
- y: pxToNum(this._$el.css('top'))
+ y: pxToNum(this._$el.css('top')),
})
}
@@ -103,13 +103,13 @@ export default class EntryBtn extends Emitter {
}
_makeDraggable() {
this._draggabilly = new Draggabilly(this._$el.get(0), {
- containment: true
+ containment: true,
})
}
initCfg(settings) {
const cfg = (this.config = Settings.createCfg('entry-button', {
rememberPos: true,
- pos: this._getDefPos()
+ pos: this._getDefPos(),
}))
settings
@@ -123,7 +123,7 @@ export default class EntryBtn extends Emitter {
return {
x: window.innerWidth - minWidth,
- y: window.innerHeight - minWidth
+ y: window.innerHeight - minWidth,
}
}
}
diff --git a/src/Info/Info.js b/src/Info/Info.js
index 64ad953..603ab0d 100644
--- a/src/Info/Info.js
+++ b/src/Info/Info.js
@@ -27,7 +27,7 @@ export default class Info extends Tool {
const infos = this._infos
let isUpdate = false
- each(infos, info => {
+ each(infos, (info) => {
if (name !== info.name) return
info.val = val
@@ -49,7 +49,7 @@ export default class Info extends Tool {
let result
- each(infos, info => {
+ each(infos, (info) => {
if (name === info.name) result = info.val
})
@@ -74,7 +74,7 @@ export default class Info extends Tool {
return this
}
_addDefInfo() {
- each(defInfo, info => this.add(info.name, info.val))
+ each(defInfo, (info) => this.add(info.name, info.val))
}
_render() {
const infos = []
diff --git a/src/Info/defInfo.js b/src/Info/defInfo.js
index c259ab6..7b427f7 100644
--- a/src/Info/defInfo.js
+++ b/src/Info/defInfo.js
@@ -7,11 +7,11 @@ export default [
name: 'Location',
val() {
return escape(location.href)
- }
+ },
},
{
name: 'User Agent',
- val: navigator.userAgent
+ val: navigator.userAgent,
},
{
name: 'Device',
@@ -20,25 +20,25 @@ export default [
`
| screen | ${screen.width} * ${screen.height} |
`,
`
| viewport | ${window.innerWidth} * ${window.innerHeight} |
`,
`
| pixel ratio | ${window.devicePixelRatio} |
`,
- '