mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-04-02 12:11:31 +00:00
14 lines
542 B
Text
14 lines
542 B
Text
window.setupJsonEditor = ($editors = $(".live-json-editor")) ->
|
|
JSONEditor.prototype.ADD_IMG = '<%= image_path 'json-editor/add.png' %>'
|
|
JSONEditor.prototype.DELETE_IMG = '<%= image_path 'json-editor/delete.png' %>'
|
|
editors = []
|
|
$editors.each ->
|
|
$editor = $(this)
|
|
jsonEditor = new JSONEditor($editor, $editor.data('width') || 400, $editor.data('height') || 500)
|
|
jsonEditor.doTruncation true
|
|
jsonEditor.showFunctionButtons()
|
|
editors.push jsonEditor
|
|
return editors
|
|
|
|
$ ->
|
|
window.jsonEditor = setupJsonEditor()[0]
|