|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 3 | +<head> |
| 4 | +<meta http-equiv="content-type" content="text/html;charset=utf-8" /> |
| 5 | + |
| 6 | + <title>JSON Lint Editor Example</title> |
| 7 | + |
| 8 | + <link rel="stylesheet" href="json-editor/css/built-editor.css" /> |
| 9 | + <link rel="stylesheet" href="json-editor/css/app.css" /> |
| 10 | + |
| 11 | + <script type="text/javascript" src="json-editor/libs/require.js"></script> |
| 12 | + <script type="text/javascript" src="json-editor/config.js"></script> |
| 13 | + |
| 14 | +</head> |
| 15 | + |
| 16 | +<body> |
| 17 | + |
| 18 | + <h1>JSON Lint EXT</h1> |
| 19 | + <div> |
| 20 | + <p> |
| 21 | + Example for the <em>Extended JSON parser</em>: the editor uses the <em>location information</em> |
| 22 | + for marking JSON errors within the editor-view. |
| 23 | + <br/> |
| 24 | + Enabling <em>strict mode</em> will give an error, if the JSON contains duplicate properties. |
| 25 | + <br/> |
| 26 | + <em><small> |
| 27 | + NOTE: The editor demo is based on the <a href="http://esprima.org/demo/validate.html">Esprima Demo</a> |
| 28 | + using the JavaScript editor component of <a href="https://wiki.eclipse.org/Orion">Orion</a>. |
| 29 | + </small></em> |
| 30 | + </p> |
| 31 | + </div> |
| 32 | + <div> |
| 33 | + <button id="button">Validate</button> |
| 34 | + <input type="checkbox" value="yes" id="reformat" /><label for="reformat"> reformat JSON</label> |
| 35 | + |
| 36 | + <em> |
| 37 | + <input type="checkbox" value="yes" id="strict-mode" checked="checked" /> |
| 38 | + <label for="strict-mode" title="will cause errors for duplicate properties"> use <u>strict</u> parsing mode</label> |
| 39 | + </em> |
| 40 | + |
| 41 | + <em> |
| 42 | + <input type="checkbox" value="yes" id="extract-loc" /> |
| 43 | + <label for="extract-loc" title="attaches position data to parsed objects"> extract <u>location information</u> as meta data</label> |
| 44 | + </em> |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + <fieldset id="advanved-options-container"> |
| 49 | + <em> |
| 50 | + <input type="checkbox" value="yes" id="advanced-options" /> |
| 51 | + <label for="advanced-options"> show advanved options for <u>location information</u></label> |
| 52 | + </em> |
| 53 | + |
| 54 | + <ul id="advanved-options-set"> |
| 55 | + <li><em> |
| 56 | + <input type="checkbox" value="yes" id="convert-array" checked="checked" /> |
| 57 | + <label for="convert-array" title="if positions are enabled do convert arrays to make position information visible"> |
| 58 | + convert arrays if <u>location information</u> and <u>reformatting</u> is enabled |
| 59 | + </label> |
| 60 | + </em></li> |
| 61 | + |
| 62 | + <li><em> |
| 63 | + <label for="loc-field" placeholder="default" title="name of the field into which position information will be stored"> |
| 64 | + field name for <u>location information</u>: |
| 65 | + </label> |
| 66 | + <input type="text" id="loc-field" /> |
| 67 | + </em></li> |
| 68 | + </ul> |
| 69 | + </fieldset> |
| 70 | + |
| 71 | + <fieldset id="result"> |
| 72 | + <legend>Validation Results</legend> |
| 73 | + <div class="text"> </div> |
| 74 | + </fieldset> |
| 75 | + |
| 76 | + </div> |
| 77 | + |
| 78 | + <hr/> |
| 79 | + |
| 80 | +<!-- editor element / placeholder --> |
| 81 | +<pre id="inputBox" class="editor"> |
| 82 | +{ |
| 83 | + |
| 84 | + "duplicate_property": "first value!", |
| 85 | + |
| 86 | + "duplicate_property": ["second", |
| 87 | + "value", |
| 88 | + 3]} |
| 89 | +</pre> |
| 90 | + |
| 91 | +<hr/> |
| 92 | +<p id="info"><a href="https://github.com/russaa/jsonlint-ext">project on github</a> |
| 93 | + <em><small>(based on <a href="https://github.com/zaach/jsonlint">jsonlint@github</a>)</small></em> |
| 94 | +</p> |
| 95 | + |
| 96 | +<!-- ################### SECTION: Popup dialogs & tooltip dialogs ################################# --> |
| 97 | +<div id="dialogs" style="display:none"> |
| 98 | + |
| 99 | + <div id="errorPopup" class="ui-content ui-corner-all"> |
| 100 | + <div id="errorPopupTitle" class="hidden"> |
| 101 | + <div> <i></i> <span>a short title</span></div> |
| 102 | + </div> |
| 103 | + <div id="errorPopupContent" class="ui-content ui-corner-bottom ui-content"> |
| 104 | + <h3 class="ui-title" id="errorPopupCaption">short description or question.</h3> |
| 105 | + <div id="errorPopupText">detailed description</div> |
| 106 | + </div> |
| 107 | + </div> |
| 108 | + |
| 109 | + <div id="infoPopup"class="ui-content ui-corner-all"> |
| 110 | + <div id="infoPopupTitle" class="hidden"> |
| 111 | + <div> <i></i> <span>a short title</span></div> |
| 112 | + </div> |
| 113 | + <div id="infoPopupContent" class="ui-content ui-corner-bottom ui-content"> |
| 114 | + <div id="infoPopupText">information text</div> |
| 115 | + </div> |
| 116 | + </div> |
| 117 | + |
| 118 | + <div id="popupAppHelpInfo" class="ui-content" data-title="Quick Reference"> |
| 119 | + <div><!-- h3>Quick Reference</h3--> |
| 120 | + |
| 121 | + <h5>Editor Shortcuts</h5> |
| 122 | + <ul class="function-list"> |
| 123 | + <li><span class="key">CTRL</span> + <span class="key">#</span>: comment / un-comment line</li> |
| 124 | + <li><span class="key">CTRL</span> + <span class="key">a</span>: select all</li> |
| 125 | + <li><span class="key">CTRL</span> + <span class="key">d</span>: delete line</li> |
| 126 | + <li><span class="key">CTRL</span> + <span class="key">f</span>: search / replace dialog</li> |
| 127 | + <li><span class="key">CTRL</span> + <span class="key">l</span>: "go to line" dialog</li> |
| 128 | + <li><span class="key">CTRL</span> + <span class="key">q</span>: jump to last edited position</li> |
| 129 | + |
| 130 | + <li><span class="key">CTRL</span> + <span class="key">y</span>: redo</li> |
| 131 | + <li><span class="key">CTRL</span> + <span class="key">z</span>: undo</li> |
| 132 | + </ul> |
| 133 | + <br/><br/> |
| 134 | + </div> |
| 135 | + </div> |
| 136 | + |
| 137 | +</div> |
| 138 | + |
| 139 | +</body> |
| 140 | +</html> |
0 commit comments