editor: parse inputs with JSON5 instead of JSON, it's more flexible and will avoid many typing errors

This commit is contained in:
jean-emmanuel 2017-10-04 18:30:02 +02:00
parent 7d477da4e9
commit 141641bd29
4 changed files with 8 additions and 1 deletions

View file

@ -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()
}