Moved the distribution files from root to the ./dist folder

This commit is contained in:
jos 2015-02-28 20:47:23 +01:00
parent 75372fa3d7
commit 12214f930a
20 changed files with 177 additions and 170 deletions

View File

@ -6,10 +6,11 @@ https://github.com/josdejong/jsoneditor
## not yet released, version 4.0.0
- Ace editor and jsonlint are now packed with jsoneditor.js by default.
- The distribution files are now moved from the root to the `/dist` folder.
- Reworked the source code to CommonJS modules, using `brace` to load Ace.
- JSONP is now automatically stripped from JSON. Thanks @yanivefraim.
- Fixed bugs in the JSON sanitizer, no longer manipulating comments or
JSON-like structures inside strings.
- Fixed bugs in the JSON sanitizer, no longer manipulating JSON-like structures
inside strings.
## 2015-01-25, version 3.2.0

View File

@ -73,8 +73,8 @@ download:
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="jsoneditor/jsoneditor.min.css">
<script src="jsoneditor/jsoneditor.min.js"></script>
<link href="jsoneditor/dist/jsoneditor.min.css" rel="stylesheet" type="text/css">
<script src="jsoneditor/dist/jsoneditor.min.js"></script>
</head>
<body>
<div id="jsoneditor" style="width: 400px; height: 400px;"></div>

View File

@ -14,8 +14,8 @@
"url": "https://github.com/josdejong/jsoneditor.git"
},
"main": [
"jsoneditor.min.js",
"jsoneditor.min.css"
"./dist/jsoneditor.min.js",
"./dist/jsoneditor.min.css"
],
"bugs": "https://github.com/josdejong/jsoneditor/issues",
"ignore": [

BIN
dist/img/jsoneditor-icons.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -33,12 +33,12 @@
}
.jsoneditor .field.empty {
background-image: url("img/jsoneditor-icons.png");
background-image: url("../img/jsoneditor-icons.png");
background-position: 0 -144px;
}
.jsoneditor .value.empty {
background-image: url("img/jsoneditor-icons.png");
background-image: url("../img/jsoneditor-icons.png");
background-position: -48px -144px;
}
@ -87,7 +87,7 @@
margin: 0;
border: none;
cursor: pointer;
background: transparent url("img/jsoneditor-icons.png");
background: transparent url("../img/jsoneditor-icons.png");
}
.jsoneditor div.tree button.collapsed {
@ -182,7 +182,7 @@
}
.jsoneditor div.tree button.dragarea {
background: url("img/jsoneditor-icons.png") -72px -72px;
background: url("../img/jsoneditor-icons.png") -72px -72px;
cursor: move;
}
@ -280,7 +280,7 @@
border: none;
padding: 0;
margin: 0;
background-image: url("img/jsoneditor-icons.png");
background-image: url("../img/jsoneditor-icons.png");
}
.jsoneditor-contextmenu ul li button div.expand {
@ -289,7 +289,7 @@
height: 24px;
padding: 0;
margin: 0 4px 0 0;
background: url("img/jsoneditor-icons.png") 0 -72px;
background: url("../img/jsoneditor-icons.png") 0 -72px;
opacity: 0.4;
}
@ -463,7 +463,7 @@
padding: 0;
border-radius: 2px;
border: 1px solid #aec0f8;
background: #e3eaf6 url("img/jsoneditor-icons.png");
background: #e3eaf6 url("../img/jsoneditor-icons.png");
color: #4D4D4D;
opacity: 0.8;
font-family: arial, sans-serif;
@ -592,7 +592,7 @@
padding: 0;
margin: 0;
border: none;
background: url("img/jsoneditor-icons.png");
background: url("../img/jsoneditor-icons.png");
vertical-align: top;
}

View File

@ -1461,7 +1461,7 @@ return /******/ (function(modules) { // webpackBootstrap
//If JSON starts with a function (characters/digits/"_-"), remove this function.
//This is useful for "stripping" JSONP objects to become JSON
//For example: /* some comment */ function_12321321 ( [{"a":"b"}] ); => [{"a":"b"}]
var match = jsString.match(/^(\/\*(.|[\r\n])*?\*\/)?\s*[\da-zA-Z_$]+\s*\(([\s\S]*)\)\s*;?\s*$/);
var match = jsString.match(/^\s*(\/\*(.|[\r\n])*?\*\/)?\s*[\da-zA-Z_$]+\s*\(([\s\S]*)\)\s*;?\s*$/);
if (match) {
jsString = match[3];
}
@ -9376,7 +9376,7 @@ return /******/ (function(modules) { // webpackBootstrap
};
init(true);function init(packaged) {
options.packaged = packaged || acequire.packaged || module.packaged || (global.define && __webpack_require__(17).packaged);
options.packaged = packaged || acequire.packaged || module.packaged || (global.define && __webpack_require__(19).packaged);
if (!global.document)
return "";
@ -26208,7 +26208,7 @@ return /******/ (function(modules) { // webpackBootstrap
if (!args[1])
throw new Error('Usage: '+args[0]+' FILE');
if (typeof process !== 'undefined') {
var source = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"fs\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())).readFileSync(__webpack_require__(20).join(process.cwd(), args[1]), "utf8");
var source = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"fs\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())).readFileSync(__webpack_require__(17).join(process.cwd(), args[1]), "utf8");
} else {
var cwd = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"file\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())).path(__webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"file\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())).cwd());
var source = cwd.join(args[1]).read({charset: "utf-8"});
@ -26219,7 +26219,7 @@ return /******/ (function(modules) { // webpackBootstrap
exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"system\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())).args);
}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19), __webpack_require__(18)(module)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18), __webpack_require__(20)(module)))
/***/ },
/* 16 */
@ -26230,121 +26230,6 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
module.exports = function() { throw new Error("define cannot be used indirect"); };
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
module.children = [];
module.webpackPolyfill = 1;
}
return module;
}
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
// shim for using process in browser
var process = module.exports = {};
process.nextTick = (function () {
var canSetImmediate = typeof window !== 'undefined'
&& window.setImmediate;
var canMutationObserver = typeof window !== 'undefined'
&& window.MutationObserver;
var canPost = typeof window !== 'undefined'
&& window.postMessage && window.addEventListener
;
if (canSetImmediate) {
return function (f) { return window.setImmediate(f) };
}
var queue = [];
if (canMutationObserver) {
var hiddenDiv = document.createElement("div");
var observer = new MutationObserver(function () {
var queueList = queue.slice();
queue.length = 0;
queueList.forEach(function (fn) {
fn();
});
});
observer.observe(hiddenDiv, { attributes: true });
return function nextTick(fn) {
if (!queue.length) {
hiddenDiv.setAttribute('yes', 'no');
}
queue.push(fn);
};
}
if (canPost) {
window.addEventListener('message', function (ev) {
var source = ev.source;
if ((source === window || source === null) && ev.data === 'process-tick') {
ev.stopPropagation();
if (queue.length > 0) {
var fn = queue.shift();
fn();
}
}
}, true);
return function nextTick(fn) {
queue.push(fn);
window.postMessage('process-tick', '*');
};
}
return function nextTick(fn) {
setTimeout(fn, 0);
};
})();
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
// TODO(shtylman)
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
@ -26572,7 +26457,122 @@ return /******/ (function(modules) { // webpackBootstrap
}
;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)))
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
// shim for using process in browser
var process = module.exports = {};
process.nextTick = (function () {
var canSetImmediate = typeof window !== 'undefined'
&& window.setImmediate;
var canMutationObserver = typeof window !== 'undefined'
&& window.MutationObserver;
var canPost = typeof window !== 'undefined'
&& window.postMessage && window.addEventListener
;
if (canSetImmediate) {
return function (f) { return window.setImmediate(f) };
}
var queue = [];
if (canMutationObserver) {
var hiddenDiv = document.createElement("div");
var observer = new MutationObserver(function () {
var queueList = queue.slice();
queue.length = 0;
queueList.forEach(function (fn) {
fn();
});
});
observer.observe(hiddenDiv, { attributes: true });
return function nextTick(fn) {
if (!queue.length) {
hiddenDiv.setAttribute('yes', 'no');
}
queue.push(fn);
};
}
if (canPost) {
window.addEventListener('message', function (ev) {
var source = ev.source;
if ((source === window || source === null) && ev.data === 'process-tick') {
ev.stopPropagation();
if (queue.length > 0) {
var fn = queue.shift();
fn();
}
}
}, true);
return function nextTick(fn) {
queue.push(fn);
window.postMessage('process-tick', '*');
};
}
return function nextTick(fn) {
setTimeout(fn, 0);
};
})();
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
// TODO(shtylman)
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
module.exports = function() { throw new Error("define cannot be used indirect"); };
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
module.children = [];
module.webpackPolyfill = 1;
}
return module;
}
/***/ },
/* 21 */

1
dist/jsoneditor.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/jsoneditor.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -23,8 +23,8 @@ To implement JSONEditor in a web application, load the javascript and css file
in the head of the HTML page:
```html
<link rel="stylesheet" type="text/css" href="jsoneditor/jsoneditor.min.css">
<script src="jsoneditor/jsoneditor.min.js"></script>
<link href="jsoneditor/dist/jsoneditor.min.css" rel="stylesheet" type="text/css">
<script src="jsoneditor/dist/jsoneditor.min.js"></script>
```
## Use
@ -72,8 +72,8 @@ var json = editor.get();
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="jsoneditor/jsoneditor.min.css">
<script src="jsoneditor/jsoneditor.min.js"></script>
<link href="jsoneditor/dist/jsoneditor.min.css" rel="stylesheet" type="text/css">
<script src="jsoneditor/dist/jsoneditor.min.js"></script>
</head>
<body>
<p>

View File

@ -3,8 +3,8 @@
<head>
<title>JSONEditor | Basic usage</title>
<link rel="stylesheet" type="text/css" href="../jsoneditor.css">
<script src="../jsoneditor.js"></script>
<link href="../dist/jsoneditor.css" rel="stylesheet" type="text/css">
<script src="../dist/jsoneditor.js"></script>
<style type="text/css">
#jsoneditor {

View File

@ -3,8 +3,9 @@
<head>
<title>JSONEditor | Viewer</title>
<link rel="stylesheet" type="text/css" href="../jsoneditor.css">
<script src="../jsoneditor.js"></script>
<link href="../dist/jsoneditor.css" rel="stylesheet" type="text/css">
<script src="../dist/jsoneditor.js"></script>
<style type="text/css">
body {

View File

@ -4,8 +4,8 @@
<title>JSONEditor | Switch mode</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link rel="stylesheet" type="text/css" href="../jsoneditor.css">
<script src="../jsoneditor.js"></script>
<link href="../dist/jsoneditor.css" rel="stylesheet" type="text/css">
<script src="../dist/jsoneditor.js"></script>
<style type="text/css">
body {

View File

@ -3,8 +3,8 @@
<head>
<title>JSONEditor | Load and save</title>
<link rel="stylesheet" type="text/css" href="../jsoneditor.css">
<script src="../jsoneditor.js"></script>
<link href="../dist/jsoneditor.css" rel="stylesheet" type="text/css">
<script src="../dist/jsoneditor.js"></script>
<script src="http://bgrins.github.io/filereader.js/filereader.js"></script>
<script src="http://eligrey.com/demos/FileSaver.js/FileSaver.js"></script>

View File

@ -3,8 +3,8 @@
<head>
<title>JSONEditor | Basic usage</title>
<link rel="stylesheet" type="text/css" href="../jsoneditor.css">
<script src="../jsoneditor.js"></script>
<link href="../dist/jsoneditor.css" rel="stylesheet" type="text/css">
<script src="../dist/jsoneditor.js"></script>
<style type="text/css">
#jsoneditor {

View File

@ -8,7 +8,7 @@
height: 500px;
}
</style>
<link rel="stylesheet" type="text/css" href="../../jsoneditor.css">
<link rel="stylesheet" type="text/css" href="../../dist/jsoneditor.css">
<script data-main="scripts/main" src="scripts/require.js"></script>
</head>
<body>

View File

@ -1,4 +1,4 @@
var module = '../../../jsoneditor';
var module = '../../../dist/jsoneditor';
require([module], function (JSONEditor) {
// create the editor
var container = document.getElementById('jsoneditor');

View File

@ -10,15 +10,15 @@ var uglify = require('uglify-js');
var ENTRY = './src/js/JSONEditor.js';
var HEADER = './src/js/header.js';
var IMAGE = './src/css/img/jsoneditor-icons.png';
var DIST = './dist';
var FILE = 'jsoneditor.js';
var FILE_MIN = 'jsoneditor.min.js';
var FILE_MAP = 'jsoneditor.map';
var DIST = './';
var JSONEDITOR_JS = DIST + FILE;
var JSONEDITOR_MIN_JS = DIST + FILE_MIN;
var JSONEDITOR_MAP_JS = DIST + FILE_MAP;
var JSONEDITOR_CSS = DIST + 'jsoneditor.css';
var JSONEDITOR_MIN_CSS = DIST + 'jsoneditor.min.css';
var JSONEDITOR_JS = DIST + '/' + FILE;
var JSONEDITOR_MIN_JS = DIST + '/jsoneditor.min.js';
var JSONEDITOR_MAP_JS = DIST + '/' + FILE_MAP;
var JSONEDITOR_CSS = DIST + '/jsoneditor.css';
var JSONEDITOR_MIN_CSS = DIST + '/jsoneditor.min.css';
// generate banner with today's date and correct version
function createBanner() {
@ -57,8 +57,14 @@ var uglifyConfig = {
// create a single instance of the compiler to allow caching
var compiler = webpack(webpackConfig);
// make dist and dist/img folders
gulp.task('mkdir', function () {
mkdirp.sync(DIST);
mkdirp.sync(DIST + '/img');
});
// bundle javascript
gulp.task('bundle', function (done) {
gulp.task('bundle', ['mkdir'], function (done) {
// update the banner contents (has a date in it which should stay up to date)
bannerPlugin.banner = createBanner();
@ -74,7 +80,7 @@ gulp.task('bundle', function (done) {
});
// bundle css
gulp.task('bundle-css', function () {
gulp.task('bundle-css', ['mkdir'], function () {
gulp.src([
'src/css/jsoneditor.css',
'src/css/contextmenu.css',
@ -92,11 +98,10 @@ gulp.task('bundle-css', function () {
});
// create a folder img and copy the icons
gulp.task('copy-img', function () {
mkdirp.sync('./img');
gulp.src('./src/css/img/jsoneditor-icons.png')
.pipe(gulp.dest('./img/'));
gutil.log('Copied jsoneditor-icons.png to ./img/');
gulp.task('copy-img', ['mkdir'], function () {
gulp.src(IMAGE)
.pipe(gulp.dest(DIST +'/img'));
gutil.log('Copied images');
});
gulp.task('minify', ['bundle'], function () {

File diff suppressed because one or more lines are too long

1
jsoneditor.min.css vendored

File diff suppressed because one or more lines are too long