Skip to content

Commit 8be3303

Browse files
committed
Released version 5.1.3
1 parent 2a4fa90 commit 8be3303

8 files changed

+1086
-1086
lines changed

HISTORY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
https://github.com/josdejong/jsoneditor
44

55

6-
## not yet released, version 5.1.3
6+
## 2016-02-03, version 5.1.3
77

88
- Fixed #264: Clicking items in the context menu not working on Firefox.
99

dist/jsoneditor-minimalist.js

+127-127
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* Copyright (c) 2011-2016 Jos de Jong, http://jsoneditoronline.org
2525
*
2626
* @author Jos de Jong, <[email protected]>
27-
* @version 5.1.2
28-
* @date 2016-01-21
27+
* @version 5.1.3
28+
* @date 2016-02-03
2929
*/
3030
(function webpackUniversalModuleDefinition(root, factory) {
3131
if(typeof exports === 'object' && typeof module === 'object')
@@ -460,12 +460,12 @@ return /******/ (function(modules) { // webpackBootstrap
460460
/* 1 */
461461
/***/ function(module, exports, __webpack_require__) {
462462

463-
var Highlighter = __webpack_require__(4);
464-
var History = __webpack_require__(5);
465-
var SearchBox = __webpack_require__(6);
466-
var ContextMenu = __webpack_require__(7);
467-
var Node = __webpack_require__(8);
468-
var modeswitcher = __webpack_require__(9);
463+
var Highlighter = __webpack_require__(5);
464+
var History = __webpack_require__(6);
465+
var SearchBox = __webpack_require__(7);
466+
var ContextMenu = __webpack_require__(8);
467+
var Node = __webpack_require__(9);
468+
var modeswitcher = __webpack_require__(4);
469469
var util = __webpack_require__(3);
470470

471471
// create a mixin with the functions for tree mode
@@ -1624,7 +1624,7 @@ return /******/ (function(modules) { // webpackBootstrap
16241624
// failed to load ace, no problem, we will fall back to plain text
16251625
}
16261626

1627-
var modeswitcher = __webpack_require__(9);
1627+
var modeswitcher = __webpack_require__(4);
16281628
var util = __webpack_require__(3);
16291629

16301630
// create a mixin with the functions for text mode
@@ -2865,6 +2865,117 @@ return /******/ (function(modules) { // webpackBootstrap
28652865

28662866
/***/ },
28672867
/* 4 */
2868+
/***/ function(module, exports, __webpack_require__) {
2869+
2870+
var ContextMenu = __webpack_require__(8);
2871+
2872+
/**
2873+
* Create a select box to be used in the editor menu's, which allows to switch mode
2874+
* @param {Object} editor
2875+
* @param {String[]} modes Available modes: 'code', 'form', 'text', 'tree', 'view'
2876+
* @param {String} current Available modes: 'code', 'form', 'text', 'tree', 'view'
2877+
* @returns {HTMLElement} box
2878+
*/
2879+
function createModeSwitcher(editor, modes, current) {
2880+
// TODO: decouple mode switcher from editor
2881+
2882+
/**
2883+
* Switch the mode of the editor
2884+
* @param {String} mode
2885+
*/
2886+
function switchMode(mode) {
2887+
// switch mode
2888+
editor.setMode(mode);
2889+
2890+
// restore focus on mode box
2891+
var modeBox = editor.dom && editor.dom.modeBox;
2892+
if (modeBox) {
2893+
modeBox.focus();
2894+
}
2895+
}
2896+
2897+
// available modes
2898+
var availableModes = {
2899+
code: {
2900+
'text': 'Code',
2901+
'title': 'Switch to code highlighter',
2902+
'click': function () {
2903+
switchMode('code')
2904+
}
2905+
},
2906+
form: {
2907+
'text': 'Form',
2908+
'title': 'Switch to form editor',
2909+
'click': function () {
2910+
switchMode('form');
2911+
}
2912+
},
2913+
text: {
2914+
'text': 'Text',
2915+
'title': 'Switch to plain text editor',
2916+
'click': function () {
2917+
switchMode('text');
2918+
}
2919+
},
2920+
tree: {
2921+
'text': 'Tree',
2922+
'title': 'Switch to tree editor',
2923+
'click': function () {
2924+
switchMode('tree');
2925+
}
2926+
},
2927+
view: {
2928+
'text': 'View',
2929+
'title': 'Switch to tree view',
2930+
'click': function () {
2931+
switchMode('view');
2932+
}
2933+
}
2934+
};
2935+
2936+
// list the selected modes
2937+
var items = [];
2938+
for (var i = 0; i < modes.length; i++) {
2939+
var mode = modes[i];
2940+
var item = availableModes[mode];
2941+
if (!item) {
2942+
throw new Error('Unknown mode "' + mode + '"');
2943+
}
2944+
2945+
item.className = 'jsoneditor-type-modes' + ((current == mode) ? ' jsoneditor-selected' : '');
2946+
items.push(item);
2947+
}
2948+
2949+
// retrieve the title of current mode
2950+
var currentMode = availableModes[current];
2951+
if (!currentMode) {
2952+
throw new Error('Unknown mode "' + current + '"');
2953+
}
2954+
var currentTitle = currentMode.text;
2955+
2956+
// create the html element
2957+
var box = document.createElement('button');
2958+
box.className = 'jsoneditor-modes jsoneditor-separator';
2959+
box.innerHTML = currentTitle + ' &#x25BE;';
2960+
box.title = 'Switch editor mode';
2961+
box.onclick = function () {
2962+
var menu = new ContextMenu(items);
2963+
menu.show(box);
2964+
};
2965+
2966+
var div = document.createElement('div');
2967+
div.className = 'jsoneditor-modes';
2968+
div.style.position = 'relative';
2969+
div.appendChild(box);
2970+
2971+
return div;
2972+
}
2973+
2974+
exports.create = createModeSwitcher;
2975+
2976+
2977+
/***/ },
2978+
/* 5 */
28682979
/***/ function(module, exports, __webpack_require__) {
28692980

28702981
/**
@@ -2954,7 +3065,7 @@ return /******/ (function(modules) { // webpackBootstrap
29543065

29553066

29563067
/***/ },
2957-
/* 5 */
3068+
/* 6 */
29583069
/***/ function(module, exports, __webpack_require__) {
29593070

29603071
var util = __webpack_require__(3);
@@ -3212,7 +3323,7 @@ return /******/ (function(modules) { // webpackBootstrap
32123323

32133324

32143325
/***/ },
3215-
/* 6 */
3326+
/* 7 */
32163327
/***/ function(module, exports, __webpack_require__) {
32173328

32183329
/**
@@ -3513,7 +3624,7 @@ return /******/ (function(modules) { // webpackBootstrap
35133624

35143625

35153626
/***/ },
3516-
/* 7 */
3627+
/* 8 */
35173628
/***/ function(module, exports, __webpack_require__) {
35183629

35193630
var util = __webpack_require__(3);
@@ -3590,7 +3701,7 @@ return /******/ (function(modules) { // webpackBootstrap
35903701
button.title = item.title;
35913702
}
35923703
if (item.click) {
3593-
button.onclick = function () {
3704+
button.onclick = function (event) {
35943705
event.preventDefault();
35953706
me.hide();
35963707
item.click();
@@ -3974,10 +4085,10 @@ return /******/ (function(modules) { // webpackBootstrap
39744085

39754086

39764087
/***/ },
3977-
/* 8 */
4088+
/* 9 */
39784089
/***/ function(module, exports, __webpack_require__) {
39794090

3980-
var ContextMenu = __webpack_require__(7);
4091+
var ContextMenu = __webpack_require__(8);
39814092
var appendNodeFactory = __webpack_require__(12);
39824093
var util = __webpack_require__(3);
39834094

@@ -7379,117 +7490,6 @@ return /******/ (function(modules) { // webpackBootstrap
73797490
module.exports = Node;
73807491

73817492

7382-
/***/ },
7383-
/* 9 */
7384-
/***/ function(module, exports, __webpack_require__) {
7385-
7386-
var ContextMenu = __webpack_require__(7);
7387-
7388-
/**
7389-
* Create a select box to be used in the editor menu's, which allows to switch mode
7390-
* @param {Object} editor
7391-
* @param {String[]} modes Available modes: 'code', 'form', 'text', 'tree', 'view'
7392-
* @param {String} current Available modes: 'code', 'form', 'text', 'tree', 'view'
7393-
* @returns {HTMLElement} box
7394-
*/
7395-
function createModeSwitcher(editor, modes, current) {
7396-
// TODO: decouple mode switcher from editor
7397-
7398-
/**
7399-
* Switch the mode of the editor
7400-
* @param {String} mode
7401-
*/
7402-
function switchMode(mode) {
7403-
// switch mode
7404-
editor.setMode(mode);
7405-
7406-
// restore focus on mode box
7407-
var modeBox = editor.dom && editor.dom.modeBox;
7408-
if (modeBox) {
7409-
modeBox.focus();
7410-
}
7411-
}
7412-
7413-
// available modes
7414-
var availableModes = {
7415-
code: {
7416-
'text': 'Code',
7417-
'title': 'Switch to code highlighter',
7418-
'click': function () {
7419-
switchMode('code')
7420-
}
7421-
},
7422-
form: {
7423-
'text': 'Form',
7424-
'title': 'Switch to form editor',
7425-
'click': function () {
7426-
switchMode('form');
7427-
}
7428-
},
7429-
text: {
7430-
'text': 'Text',
7431-
'title': 'Switch to plain text editor',
7432-
'click': function () {
7433-
switchMode('text');
7434-
}
7435-
},
7436-
tree: {
7437-
'text': 'Tree',
7438-
'title': 'Switch to tree editor',
7439-
'click': function () {
7440-
switchMode('tree');
7441-
}
7442-
},
7443-
view: {
7444-
'text': 'View',
7445-
'title': 'Switch to tree view',
7446-
'click': function () {
7447-
switchMode('view');
7448-
}
7449-
}
7450-
};
7451-
7452-
// list the selected modes
7453-
var items = [];
7454-
for (var i = 0; i < modes.length; i++) {
7455-
var mode = modes[i];
7456-
var item = availableModes[mode];
7457-
if (!item) {
7458-
throw new Error('Unknown mode "' + mode + '"');
7459-
}
7460-
7461-
item.className = 'jsoneditor-type-modes' + ((current == mode) ? ' jsoneditor-selected' : '');
7462-
items.push(item);
7463-
}
7464-
7465-
// retrieve the title of current mode
7466-
var currentMode = availableModes[current];
7467-
if (!currentMode) {
7468-
throw new Error('Unknown mode "' + current + '"');
7469-
}
7470-
var currentTitle = currentMode.text;
7471-
7472-
// create the html element
7473-
var box = document.createElement('button');
7474-
box.className = 'jsoneditor-modes jsoneditor-separator';
7475-
box.innerHTML = currentTitle + ' &#x25BE;';
7476-
box.title = 'Switch editor mode';
7477-
box.onclick = function () {
7478-
var menu = new ContextMenu(items);
7479-
menu.show(box);
7480-
};
7481-
7482-
var div = document.createElement('div');
7483-
div.className = 'jsoneditor-modes';
7484-
div.style.position = 'relative';
7485-
div.appendChild(box);
7486-
7487-
return div;
7488-
}
7489-
7490-
exports.create = createModeSwitcher;
7491-
7492-
74937493
/***/ },
74947494
/* 10 */
74957495
/***/ function(module, exports, __webpack_require__) {
@@ -7933,7 +7933,7 @@ return /******/ (function(modules) { // webpackBootstrap
79337933
/***/ function(module, exports, __webpack_require__) {
79347934

79357935
var util = __webpack_require__(3);
7936-
var ContextMenu = __webpack_require__(7);
7936+
var ContextMenu = __webpack_require__(8);
79377937

79387938
/**
79397939
* A factory function to create an AppendNode, which depends on a Node

dist/jsoneditor-minimalist.map

+1-1
Large diffs are not rendered by default.

dist/jsoneditor-minimalist.min.js

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)