Skip to content

Commit 2b66657

Browse files
committed
JSLint fixes, documentation updates.
1 parent 55e69d8 commit 2b66657

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,21 @@ JSON Editor can integrate with several popular CSS frameworks out of the box.
301301

302302
The currently supported themes are:
303303

304+
* barebones
304305
* html (the default)
305306
* bootstrap2
306307
* bootstrap3
307308
* foundation3
308309
* foundation4
309310
* foundation5
311+
* foundation6
310312
* jqueryui
311313

312-
The default theme is `html`, which doesn't use any special class names or styling.
314+
The default theme is `html`, which does not rely on an external framework.
313315
This default can be changed by setting the `JSONEditor.defaults.options.theme` variable.
314316

317+
If you want to specify your own styles with CSS, you can use `barebones`, which includes almost no classes or inline styles.
318+
315319
```javascript
316320
JSONEditor.defaults.options.theme = 'foundation5';
317321
```
@@ -421,15 +425,16 @@ Simple text link
421425
}
422426
```
423427

424-
Make link download when clicked (can also )
428+
Make link download when clicked
425429
```js+jinja
426430
{
427431
"title": "Document filename",
428432
"type": "string",
429433
"links": [
430434
{
435+
"rel": "Download File",
431436
"href": "/documents/{{self}}",
432-
// Can also specify a filename string here instead of `true`
437+
// Can also set `download` to a string as per the HTML5 spec
433438
"download": true
434439
}
435440
]
@@ -598,6 +603,7 @@ __Ace Editor__ is a syntax highlighting source code editor. You can use it by se
598603
* ejs
599604
* erlang
600605
* golang
606+
* groovy
601607
* handlebars
602608
* haskell
603609
* haxe
@@ -747,7 +753,9 @@ Editors can accept options which alter the behavior in some way.
747753

748754
* `collapsed` - If set to true, the editor will start collapsed (works for objects and arrays)
749755
* `disable_array_add` - If set to true, the "add row" button will be hidden (works for arrays)
750-
* `disable_array_delete` - If set to true, the "delete row" buttons will be hidden (works for arrays)
756+
* `disable_array_delete` - If set to true, all of the "delete" buttons will be hidden (works for arrays)
757+
* `disable_array_delete_all_rows` - If set to true, just the "delete all rows" button will be hidden (works for arrays)
758+
* `disable_array_delete_last_row` - If set to true, just the "delete last row" buttons will be hidden (works for arrays)
751759
* `disable_array_reorder` - If set to true, the "move up/down" buttons will be hidden (works for arrays)
752760
* `disable_collapse` - If set to true, the collapse button will be hidden (works for objects and arrays)
753761
* `disable_edit_json` - If set to true, the Edit JSON button will be hidden (works for objects)

demo.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ <h2>Options</h2>
4444
<div>
4545
<label>CSS Framework</label>
4646
<select id='theme_switcher' class='form-control'>
47-
<option value='html'>None</option>
47+
<option value='barebones'>Barebones</option>
48+
<option value='html'>HTML</option>
4849
<option value='jqueryui'>jQuery UI</option>
4950
<option value='bootstrap2'>Bootstrap 2</option>
5051
<option value='bootstrap3'>Bootstrap 3</option>
5152
<option value='foundation3'>Foundation 3</option>
5253
<option value='foundation4'>Foundation 4</option>
5354
<option value='foundation5'>Foundation 5</option>
55+
<option value='foundation6'>Foundation 6</option>
5456
</select>
5557
</div>
5658
<div>
@@ -333,12 +335,14 @@ <h2>Code</h2>
333335
theme = theme || '';
334336

335337
var mapping = {
338+
barebones: '',
336339
html: '',
337340
bootstrap2: '//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css',
338341
bootstrap3: '//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css',
339342
foundation3: '//cdnjs.cloudflare.com/ajax/libs/foundation/3.2.5/stylesheets/foundation.css',
340343
foundation4: '//cdn.jsdelivr.net/foundation/4.3.2/css/foundation.min.css',
341344
foundation5: '//cdn.jsdelivr.net/foundation/5.0.2/css/foundation.min.css',
345+
foundation6: '//cdn.jsdelivr.net/foundation/6.2.1/foundation.min.css',
342346
jqueryui: '//code.jquery.com/ui/1.10.3/themes/south-street/jquery-ui.css'
343347
};
344348

src/themes/foundation.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ JSONEditor.defaults.themes.foundation6 = JSONEditor.defaults.themes.foundation5.
279279
removeInputError: function(input) {
280280
if(!input.errmsg) return;
281281
input.className = input.className.replace(/ is-invalid-input/g,'');
282-
input.errmsg.parentNode.removeChild(input.errmsg);
282+
if(input.errmsg.parentNode) {
283+
input.errmsg.parentNode.removeChild(input.errmsg);
284+
}
283285
},
284-
})
286+
});

0 commit comments

Comments
 (0)