Skip to content

Commit 8362060

Browse files
authored
Merge branch 'master' into align-with-json-editor-master
2 parents e1b4b8a + 5396510 commit 8362060

File tree

12 files changed

+28
-243
lines changed

12 files changed

+28
-243
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### 2.3.0-dev
66

77
- Removed codeception container, use `codeceptjs` as node-dev module
8+
- Enabled Bootstrap 3 theme/icons
89

910
### 2.2.1-current
1011

@@ -53,6 +54,7 @@
5354
- Fix of #629 - BS4 theme bug where basic tab was placed outside tabs container.
5455
- Improved IMask support for `Date`, `Number`, `IMask.MaskedEnum`, `IMask.MaskedRange` and regular expression masks. #591
5556
- Added support for recursive callback options.
57+
- Fix of #692 - Resolves an issue where modal click detection was not working when the editor is attached inside a shadow DOM by changing the event target to use the path.
5658

5759
### 2.0.0-alpha-1
5860

docs/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ <h2>Options</h2>
5656
<label for="theme-select">theme</label><br>
5757
<select id='theme-select' name="theme" class='form-control browser-default'>
5858
<option value='barebones'>Barebones</option>
59+
<option value='bootstrap3'>Bootstrap 3</option>
5960
<option value='bootstrap4'>Bootstrap 4</option>
6061
<option value='html'>HTML</option>
6162
<option value='spectre'>Spectre</option>
@@ -301,6 +302,7 @@ <h2>Schema</h2>
301302
// theme
302303
const themeMap = {
303304
barebones: '',
305+
bootstrap3: 'https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css',
304306
bootstrap4: 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css',
305307
html: '',
306308
spectre: 'https://unpkg.com/spectre.css/dist/spectre.min.css',

package-lock.json

Lines changed: 0 additions & 226 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/defaults.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ languages.en = {
251251
/**
252252
* Default title for array items
253253
*/
254-
default_array_item_title: 'item'
254+
default_array_item_title: 'item',
255+
/**
256+
* Warning when deleting a node
257+
*/
258+
button_delete_node_warning: 'Are you sure you want to remove this node?'
255259
}
256260

257261
/* Default per-editor options */

src/editors/array.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { extend, trigger } from '../utilities.js'
44
export class ArrayEditor extends AbstractEditor {
55
askConfirmation () {
66
if (this.jsoneditor.options.prompt_before_delete === true) {
7-
if (window.confirm('Are you sure you want to remove this node?') === false) {
7+
if (window.confirm(this.translate('button_delete_node_warning')) === false) {
88
return false
99
}
1010
}

src/editors/object.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,9 @@ export class ObjectEditor extends AbstractEditor {
10411041
}
10421042

10431043
onOutsideModalClick (e) {
1044-
if (this.addproperty_holder && !this.addproperty_holder.contains(e.target) && this.adding_property) {
1044+
if (this.addproperty_holder &&
1045+
!this.addproperty_holder.contains(e.path[0] || e.composedPath()[0]) &&
1046+
this.adding_property) {
10451047
e.preventDefault()
10461048
e.stopPropagation()
10471049
this.toggleAddProperty()

src/iconlibs/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// import { bootstrap2Iconlib } from './bootstrap2.js'
2-
// import { bootstrap3Iconlib } from './bootstrap3.js'
2+
import { bootstrap3Iconlib } from './bootstrap3.js'
33
import { fontawesome3Iconlib } from './fontawesome3.js'
44
import { fontawesome4Iconlib } from './fontawesome4.js'
55
import { fontawesome5Iconlib } from './fontawesome5.js'
@@ -11,7 +11,7 @@ import { spectreIconlib } from './spectre.js'
1111

1212
export const iconlibs = {
1313
// bootstrap2: bootstrap2Iconlib,
14-
// bootstrap3: bootstrap3Iconlib,
14+
bootstrap3: bootstrap3Iconlib,
1515
fontawesome3: fontawesome3Iconlib,
1616
fontawesome4: fontawesome4Iconlib,
1717
fontawesome5: fontawesome5Iconlib,

src/themes/bootstrap3.css

Whitespace-only changes.

src/themes/bootstrap3.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AbstractTheme } from '../theme.js'
2+
import rules from './bootstrap3.css'
23

34
export class bootstrap3Theme extends AbstractTheme {
45
getSelectInput (options, multiple) {
@@ -300,4 +301,4 @@ export class bootstrap3Theme extends AbstractTheme {
300301
}
301302

302303
/* Custom stylesheet rules. format: "selector" : "CSS rules" */
303-
bootstrap3Theme.rules = { 'div[data-schemaid="root"]:after': 'position:relative;color:red;margin:10px 0;font-weight:600;display:block;width:100%;text-align:center;content:"This is an old JSON-Editor 1.x Theme and might not display elements correctly when used with the 2.x version"' }
304+
bootstrap3Theme.rules = rules

src/themes/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import { htmlTheme } from './html.js'
33
// import { bootstrap2Theme } from './bootstrap2'
4-
// import { bootstrap3Theme } from './bootstrap3'
4+
import { bootstrap3Theme } from './bootstrap3.js'
55
import { bootstrap4Theme } from './bootstrap4.js'
66
// import { foundationTheme, foundation3Theme, foundation4Theme, foundation5Theme, foundation6Theme } from './foundation.js'
77
import { jqueryuiTheme } from './jqueryui.js'
@@ -13,7 +13,7 @@ import { tailwindTheme } from './tailwind.js'
1313
export const themes = {
1414
html: htmlTheme,
1515
// bootstrap2: bootstrap2Theme,
16-
// bootstrap3: bootstrap3Theme,
16+
bootstrap3: bootstrap3Theme,
1717
bootstrap4: bootstrap4Theme,
1818
// foundation: foundationTheme,
1919
// foundation3: foundation3Theme,

0 commit comments

Comments
 (0)