From 6bfede956b06fb5e6b4895823edc4db36cf5e98c Mon Sep 17 00:00:00 2001 From: jos Date: Thu, 29 Aug 2019 15:45:32 +0200 Subject: [PATCH] Rewrite code styling of browser examples --- README.md | 12 +- examples/01_basic_usage.html | 20 +-- examples/02_viewer.html | 12 +- examples/03_switch_mode.html | 16 +-- examples/04_load_and_save.html | 30 ++--- examples/05_custom_fields_editable.html | 18 +-- examples/06_custom_styling.html | 30 ++--- examples/07_json_schema_validation.html | 20 +-- examples/08_custom_ace.html | 12 +- examples/09_readonly_text_mode.html | 16 +-- examples/10_templates.html | 63 +++++---- examples/11_autocomplete_basic.html | 17 ++- examples/12_autocomplete_dynamic.html | 23 ++-- examples/13_autocomplete_advanced.html | 72 ++++++----- examples/14_translate.html | 66 +++++----- examples/15_selection_api.html | 48 ++++--- examples/16_synchronize_editors.html | 20 +-- examples/17_on_event_api.html | 42 +++--- examples/18_custom_validation.html | 51 ++++---- examples/19_custom_validation_async.html | 32 ++--- examples/20_custom_css_style_for_nodes.html | 54 ++++---- examples/21_customize_context_menu.html | 135 ++++++++------------ examples/requirejs_demo/scripts/main.js | 10 +- 23 files changed, 394 insertions(+), 425 deletions(-) diff --git a/README.md b/README.md index 4ed8232..ee6f87f 100644 --- a/README.md +++ b/README.md @@ -96,12 +96,12 @@ with npm (recommended): diff --git a/examples/01_basic_usage.html b/examples/01_basic_usage.html index f8d76f2..875bd29 100644 --- a/examples/01_basic_usage.html +++ b/examples/01_basic_usage.html @@ -22,13 +22,13 @@ diff --git a/examples/02_viewer.html b/examples/02_viewer.html index f6d9532..0404ffb 100644 --- a/examples/02_viewer.html +++ b/examples/02_viewer.html @@ -23,22 +23,22 @@
diff --git a/examples/03_switch_mode.html b/examples/03_switch_mode.html index 26218a9..b729639 100644 --- a/examples/03_switch_mode.html +++ b/examples/03_switch_mode.html @@ -38,29 +38,29 @@
diff --git a/examples/04_load_and_save.html b/examples/04_load_and_save.html index d8be3c9..4a2b68a 100644 --- a/examples/04_load_and_save.html +++ b/examples/04_load_and_save.html @@ -38,36 +38,36 @@ diff --git a/examples/05_custom_fields_editable.html b/examples/05_custom_fields_editable.html index d8a5dae..67483cc 100644 --- a/examples/05_custom_fields_editable.html +++ b/examples/05_custom_fields_editable.html @@ -25,9 +25,9 @@
diff --git a/examples/06_custom_styling.html b/examples/06_custom_styling.html index 37d9add..e185486 100644 --- a/examples/06_custom_styling.html +++ b/examples/06_custom_styling.html @@ -22,30 +22,30 @@ -

- This example demonstrates how to customize the look of JSONEditor, - the editor below has a dark theme. Note that the example isn't worked - out for the mode code. To do that, you can load and configure - a custom theme for the Ace editor. -

+

+ This example demonstrates how to customize the look of JSONEditor, + the editor below has a dark theme. Note that the example isn't worked + out for the mode code. To do that, you can load and configure + a custom theme for the Ace editor. +

-
+
- + } + const editor = new JSONEditor(container, options, json) + diff --git a/examples/07_json_schema_validation.html b/examples/07_json_schema_validation.html index b3bc8d5..087cf37 100644 --- a/examples/07_json_schema_validation.html +++ b/examples/07_json_schema_validation.html @@ -34,7 +34,7 @@
diff --git a/examples/08_custom_ace.html b/examples/08_custom_ace.html index fe0b4fd..077c51b 100644 --- a/examples/08_custom_ace.html +++ b/examples/08_custom_ace.html @@ -52,21 +52,21 @@ diff --git a/examples/09_readonly_text_mode.html b/examples/09_readonly_text_mode.html index 05cb4f8..a9b18c7 100644 --- a/examples/09_readonly_text_mode.html +++ b/examples/09_readonly_text_mode.html @@ -38,9 +38,9 @@
diff --git a/examples/10_templates.html b/examples/10_templates.html index 742bdef..e47c815 100644 --- a/examples/10_templates.html +++ b/examples/10_templates.html @@ -27,46 +27,45 @@
diff --git a/examples/11_autocomplete_basic.html b/examples/11_autocomplete_basic.html index df42354..b17a60d 100644 --- a/examples/11_autocomplete_basic.html +++ b/examples/11_autocomplete_basic.html @@ -2,11 +2,10 @@ JSONEditor | Auto Complete - + - -

Context Menu Customization

-

- This example demonstrates the use of the onCreateMenu callback option, which - allows you to customise context menus after they are created but before they - are shown to the user. You can alter/delete existing items as well as - adding new menu items. See the source code for this example for more - information. -

-
+

Context Menu Customization

+

+ This example demonstrates the use of the onCreateMenu callback option, which + allows you to customise context menus after they are created but before they + are shown to the user. You can alter/delete existing items as well as + adding new menu items. See the source code for this example for more + information. +

+
- diff --git a/examples/requirejs_demo/scripts/main.js b/examples/requirejs_demo/scripts/main.js index f05b4e9..d17d738 100644 --- a/examples/requirejs_demo/scripts/main.js +++ b/examples/requirejs_demo/scripts/main.js @@ -1,12 +1,12 @@ -var module = '../../../dist/jsoneditor' +const module = '../../../dist/jsoneditor' require([module], function (JSONEditor) { // create the editor - var container = document.getElementById('jsoneditor') - var editor = new JSONEditor(container) + const container = document.getElementById('jsoneditor') + const editor = new JSONEditor(container) // set json document.getElementById('setJSON').onclick = function () { - var json = { + const json = { array: [1, 2, 3], boolean: true, null: null, @@ -19,7 +19,7 @@ require([module], function (JSONEditor) { // get json document.getElementById('getJSON').onclick = function () { - var json = editor.get() + const json = editor.get() window.alert(JSON.stringify(json, null, 2)) } })