UNPKG

jsoneditor4code

Version:

JSON Editor for UML Diagrams developed with Javascript Code Templates based on JSON Editor of Jeremy Dorn

37 lines (34 loc) 1.71 kB
<script language="javascript"> var vFileBase = "class"; /* Defined the Syntax Highlighting for ACE Editor - Used in Schema "schema/class_schema.js" * set the default CSS theme and icon library globally * see https://www.github.com/niebert/json-editor for further details */ //---- Initialize Editor with JSON -------------- // The JSON data is defined in file "db/umljs.js" var vJSON = vDataJSON["umljs"]; //---- Create one JSON Editor for Code --------- if (JSONEditor4Code) { var vJSONEditor = new JSONEditor4Code(); vJSONEditor.initDoc(document); } /* "editor_id": DOM id where the editor will be injected, */ var vOptions = { "editor_var": "vJSONEditor", // Variable in index.html that stores the JSONeditor "editor_id": "editor_holder", // ID of DOM element, that stores the editor. "validator_id":"valid_indicator", // ID of DOM, that contains the validator result "valid" or "not valid" "filejson_id" : "fileJSON", // ID of DOM element that contains the JSON file upload "filename_id" : "display_filename", // innerHTML for DOM element to display the loaded filename "filename_key" : "data.classname", // key that stores the basename for the filename "out_json": "tOutJSON", "out_code": "tOutput", "out_errors": "tErrors" }; //console.log("Edit JSON:\n"+JSON.stringify(vJSON,null,3)); // vJSONEditor.init(...) will be called at very end of this file // var vID4JSON = "umljs"; //see file "db/uml_default.js" //var vDefaultID4JSON = "uml_default"; //see file "db/uml_default.js" </script>