Skip to content

Commit

Permalink
JSLint fixes, documentation updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdorn committed Apr 13, 2016
1 parent 55e69d8 commit 2b66657
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
16 changes: 12 additions & 4 deletions README.md
Expand Up @@ -301,17 +301,21 @@ JSON Editor can integrate with several popular CSS frameworks out of the box.

The currently supported themes are:

* barebones
* html (the default)
* bootstrap2
* bootstrap3
* foundation3
* foundation4
* foundation5
* foundation6
* jqueryui

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

If you want to specify your own styles with CSS, you can use `barebones`, which includes almost no classes or inline styles.

```javascript
JSONEditor.defaults.options.theme = 'foundation5';
```
Expand Down Expand Up @@ -421,15 +425,16 @@ Simple text link
}
```

Make link download when clicked (can also )
Make link download when clicked
```js+jinja
{
"title": "Document filename",
"type": "string",
"links": [
{
"rel": "Download File",
"href": "/documents/{{self}}",
// Can also specify a filename string here instead of `true`
// Can also set `download` to a string as per the HTML5 spec
"download": true
}
]
Expand Down Expand Up @@ -598,6 +603,7 @@ __Ace Editor__ is a syntax highlighting source code editor. You can use it by se
* ejs
* erlang
* golang
* groovy
* handlebars
* haskell
* haxe
Expand Down Expand Up @@ -747,7 +753,9 @@ Editors can accept options which alter the behavior in some way.

* `collapsed` - If set to true, the editor will start collapsed (works for objects and arrays)
* `disable_array_add` - If set to true, the "add row" button will be hidden (works for arrays)
* `disable_array_delete` - If set to true, the "delete row" buttons will be hidden (works for arrays)
* `disable_array_delete` - If set to true, all of the "delete" buttons will be hidden (works for arrays)
* `disable_array_delete_all_rows` - If set to true, just the "delete all rows" button will be hidden (works for arrays)
* `disable_array_delete_last_row` - If set to true, just the "delete last row" buttons will be hidden (works for arrays)
* `disable_array_reorder` - If set to true, the "move up/down" buttons will be hidden (works for arrays)
* `disable_collapse` - If set to true, the collapse button will be hidden (works for objects and arrays)
* `disable_edit_json` - If set to true, the Edit JSON button will be hidden (works for objects)
Expand Down
6 changes: 5 additions & 1 deletion demo.html
Expand Up @@ -44,13 +44,15 @@ <h2>Options</h2>
<div>
<label>CSS Framework</label>
<select id='theme_switcher' class='form-control'>
<option value='html'>None</option>
<option value='barebones'>Barebones</option>
<option value='html'>HTML</option>
<option value='jqueryui'>jQuery UI</option>
<option value='bootstrap2'>Bootstrap 2</option>
<option value='bootstrap3'>Bootstrap 3</option>
<option value='foundation3'>Foundation 3</option>
<option value='foundation4'>Foundation 4</option>
<option value='foundation5'>Foundation 5</option>
<option value='foundation6'>Foundation 6</option>
</select>
</div>
<div>
Expand Down Expand Up @@ -333,12 +335,14 @@ <h2>Code</h2>
theme = theme || '';

var mapping = {
barebones: '',
html: '',
bootstrap2: '//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css',
bootstrap3: '//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css',
foundation3: '//cdnjs.cloudflare.com/ajax/libs/foundation/3.2.5/stylesheets/foundation.css',
foundation4: '//cdn.jsdelivr.net/foundation/4.3.2/css/foundation.min.css',
foundation5: '//cdn.jsdelivr.net/foundation/5.0.2/css/foundation.min.css',
foundation6: '//cdn.jsdelivr.net/foundation/6.2.1/foundation.min.css',
jqueryui: '//code.jquery.com/ui/1.10.3/themes/south-street/jquery-ui.css'
};

Expand Down
6 changes: 4 additions & 2 deletions src/themes/foundation.js
Expand Up @@ -279,6 +279,8 @@ JSONEditor.defaults.themes.foundation6 = JSONEditor.defaults.themes.foundation5.
removeInputError: function(input) {
if(!input.errmsg) return;
input.className = input.className.replace(/ is-invalid-input/g,'');
input.errmsg.parentNode.removeChild(input.errmsg);
if(input.errmsg.parentNode) {
input.errmsg.parentNode.removeChild(input.errmsg);
}
},
})
});

0 comments on commit 2b66657

Please sign in to comment.