Released version 5.1.2
This commit is contained in:
parent
419880dba8
commit
69f106a911
|
@ -3,12 +3,14 @@
|
|||
https://github.com/josdejong/jsoneditor
|
||||
|
||||
|
||||
## not yet released, version 5.1.2
|
||||
## 2016-01-21, version 5.1.2
|
||||
|
||||
- Improvements in sanitizing invalid JSON.
|
||||
- Updated dependencies to the latest version.
|
||||
- Fixed clicking format/compact not triggering an onChange event.
|
||||
- Fixed #259: when having a JSONEditor inside an HTML form, clicking an entry
|
||||
in the context menu did submit the form.
|
||||
- Fixed browserify build, see #260. Thanks @onip.
|
||||
|
||||
|
||||
## 2016-01-16, version 5.1.1
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
* Copyright (c) 2011-2016 Jos de Jong, http://jsoneditoronline.org
|
||||
*
|
||||
* @author Jos de Jong, <wjosdejong@gmail.com>
|
||||
* @version 5.1.1
|
||||
* @date 2016-01-16
|
||||
* @version 5.1.2
|
||||
* @date 2016-01-21
|
||||
*/
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
|
@ -85,7 +85,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
|
||||
var Ajv;
|
||||
try {
|
||||
Ajv = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"ajv/dist/ajv.bundle.js\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()));
|
||||
Ajv = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"ajv\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()));
|
||||
}
|
||||
catch (err) {
|
||||
// no problem... when we need Ajv we will throw a neat exception
|
||||
|
@ -1717,6 +1717,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
buttonFormat.onclick = function () {
|
||||
try {
|
||||
me.format();
|
||||
me._onChange();
|
||||
}
|
||||
catch (err) {
|
||||
me._onError(err);
|
||||
|
@ -1731,6 +1732,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
buttonCompact.onclick = function () {
|
||||
try {
|
||||
me.compact();
|
||||
me._onChange();
|
||||
}
|
||||
catch (err) {
|
||||
me._onError(err);
|
||||
|
@ -1853,9 +1855,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
if (keynum == 220 && event.ctrlKey) {
|
||||
if (event.shiftKey) { // Ctrl+Shift+\
|
||||
this.compact();
|
||||
this._onChange();
|
||||
}
|
||||
else { // Ctrl+\
|
||||
this.format();
|
||||
this._onChange();
|
||||
}
|
||||
handled = true;
|
||||
}
|
||||
|
@ -2139,26 +2143,23 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
function next() { return jsString.charAt(i + 1); }
|
||||
function prev() { return jsString.charAt(i - 1); }
|
||||
|
||||
// test whether the last non-whitespace character was a brace-open '{'
|
||||
function prevIsBrace() {
|
||||
var ii = i - 1;
|
||||
while (ii >= 0) {
|
||||
var cc = jsString.charAt(ii);
|
||||
if (cc === '{') {
|
||||
return true;
|
||||
// get the last parsed non-whitespace character
|
||||
function lastNonWhitespace () {
|
||||
var p = chars.length - 1;
|
||||
|
||||
while (p >= 0) {
|
||||
var pp = chars[p];
|
||||
if (pp !== ' ' && pp !== '\n' && pp !== '\r' && pp !== '\t') { // non whitespace
|
||||
return pp;
|
||||
}
|
||||
else if (cc === ' ' || cc === '\n' || cc === '\r') { // whitespace
|
||||
ii--;
|
||||
p--;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
// skip a block comment '/* ... */'
|
||||
function skipComment () {
|
||||
function skipBlockComment () {
|
||||
i += 2;
|
||||
while (i < jsString.length && (curr() !== '*' || next() !== '/')) {
|
||||
i++;
|
||||
|
@ -2166,6 +2167,14 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
i += 2;
|
||||
}
|
||||
|
||||
// skip a comment '// ...'
|
||||
function skipComment () {
|
||||
i += 2;
|
||||
while (i < jsString.length && (curr() !== '\n')) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// parse single or double quoted string
|
||||
function parseString(quote) {
|
||||
chars.push('"');
|
||||
|
@ -2223,12 +2232,15 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
var c = curr();
|
||||
|
||||
if (c === '/' && next() === '*') {
|
||||
skipBlockComment();
|
||||
}
|
||||
else if (c === '/' && next() === '/') {
|
||||
skipComment();
|
||||
}
|
||||
else if (c === '\'' || c === '"') {
|
||||
parseString(c);
|
||||
}
|
||||
else if (/[a-zA-Z_$]/.test(c) && prevIsBrace()) {
|
||||
else if (/[a-zA-Z_$]/.test(c) && ['{', ','].indexOf(lastNonWhitespace()) !== -1) {
|
||||
// an unquoted object key (like a in '{a:2}')
|
||||
parseKey();
|
||||
}
|
||||
|
@ -3579,6 +3591,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
}
|
||||
if (item.click) {
|
||||
button.onclick = function () {
|
||||
event.preventDefault();
|
||||
me.hide();
|
||||
item.click();
|
||||
};
|
||||
|
@ -3619,7 +3632,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
}
|
||||
|
||||
// attach a handler to expand/collapse the submenu
|
||||
buttonSubmenu.onclick = function () {
|
||||
buttonSubmenu.onclick = function (event) {
|
||||
event.preventDefault();
|
||||
me._onExpandItem(domItem);
|
||||
buttonSubmenu.focus();
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
24
package.json
24
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "jsoneditor",
|
||||
"version": "5.1.1",
|
||||
"version": "5.1.2",
|
||||
"main": "./index",
|
||||
"description": "A web-based tool to view, edit, format, and validate JSON",
|
||||
"tags": [
|
||||
|
@ -23,19 +23,19 @@
|
|||
"test": "mocha test"
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": "3.2.0",
|
||||
"ajv": "3.4.0",
|
||||
"brace": "0.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp": "^3.8.11",
|
||||
"gulp-concat-css": "^2.0.0",
|
||||
"gulp-minify-css": "^0.4.5",
|
||||
"gulp-shell": "^0.3.0",
|
||||
"gulp-util": "^3.0.3",
|
||||
"json-loader": "^0.5.4",
|
||||
"mkdirp": "^0.5.0",
|
||||
"mocha": "^2.1.0",
|
||||
"uglify-js": "^2.4.16",
|
||||
"webpack": "^1.5.3"
|
||||
"gulp": "3.9.0",
|
||||
"gulp-concat-css": "2.2.0",
|
||||
"gulp-minify-css": "1.2.3",
|
||||
"gulp-shell": "0.5.1",
|
||||
"gulp-util": "3.0.7",
|
||||
"json-loader": "0.5.4",
|
||||
"mkdirp": "0.5.1",
|
||||
"mocha": "2.3.4",
|
||||
"uglify-js": "2.6.1",
|
||||
"webpack": "1.12.11"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue