feat: add page_settings JSON property + ACE JSON mode
- Add property :page_settings (Hash, default {}) to Page model
- JSON.parse string input in setter (form submits as text)
- Add collapsible 'Page Settings (JSON)' section to page form
- Support data-mode='json' attribute for ACE editor
(html_edit.js.coffee: check textarea data-mode attribute)
This commit is contained in:
@@ -17,6 +17,10 @@ class HtmlEdit
|
||||
editor.setValue template_field.val(), -1
|
||||
editor.getSession().setMode 'ace/mode/slim'
|
||||
console.log "Editing Emblem using Slim mode for ACE editor"
|
||||
else if data_mode = text_field.data('mode')
|
||||
editor.setValue text_field.val(), -1
|
||||
editor.getSession().setMode "ace/mode/#{data_mode}"
|
||||
console.log "Editing #{data_mode} using ACE editor"
|
||||
else
|
||||
editor.setValue text_field.val(), -1
|
||||
editor.getSession().setMode 'ace/mode/handlebars'
|
||||
|
||||
Reference in New Issue
Block a user