editor: parse inputs with JSON5 instead of JSON, it's more flexible and will avoid many typing errors
This commit is contained in:
parent
7d477da4e9
commit
141641bd29
4 changed files with 8 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
var updateDom = require('./data-workers').updateDom,
|
||||
{widgets, categories} = require('../widgets'),
|
||||
{icon} = require('../utils'),
|
||||
JSON5 = require('json5'),
|
||||
defaults = {}
|
||||
|
||||
for (var k in widgets) {
|
||||
|
|
@ -101,7 +102,7 @@ var editObject = function(container, data, refresh){
|
|||
v
|
||||
|
||||
try {
|
||||
v = JSON.parse(input.val())
|
||||
v = JSON5.parse(input.val())
|
||||
} catch(err) {
|
||||
v = input.val()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue