73 lines
2.1 KiB
HTML
73 lines
2.1 KiB
HTML
<!--
|
|
@license
|
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
Code distributed by Google as part of the polymer project is also
|
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
-->
|
|
|
|
<link rel="import" href="../bower_components/polymer/polymer-element.html">
|
|
<link rel="import" href="shared-styles.html">
|
|
|
|
<script src="js/jsoneditor.js"></script>
|
|
<script src="js/schema.js"></script>
|
|
|
|
<dom-module id="json-view">
|
|
<template>
|
|
<style include="shared-styles">
|
|
:host {
|
|
display: block;
|
|
|
|
padding: 10px;
|
|
}
|
|
</style>
|
|
|
|
<div class="card">
|
|
<div class="circle">J</div>
|
|
<h1>JSON Editor</h1>
|
|
<p>You may edit all config parameters</p>
|
|
<p>
|
|
</p>
|
|
<div id="editor_holder" name="editor_holder"></div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
class JsonView extends Polymer.Element {
|
|
static get is() { return 'json-view'; }
|
|
ready() {
|
|
super.ready();
|
|
|
|
var element = this.$.editor_holder;
|
|
var editor;
|
|
|
|
if (!element) {
|
|
alert("Could not find editor_holder element!");
|
|
} else {
|
|
editor = new JSONEditor(element, {
|
|
schema: window.schema,
|
|
iconlib: "fontawesome4",
|
|
disable_properties: true,
|
|
no_additional_properties: false,
|
|
disable_edit_json: true
|
|
});
|
|
}
|
|
}
|
|
/*
|
|
static get properties() {
|
|
return {
|
|
editing: { type: Boolean, value: false },
|
|
comment: { type: String, value: "" },
|
|
clockStartTime: { type: Time, value: "00:00" },
|
|
clockSpeed: {type: Number, value: 4 }
|
|
}
|
|
}
|
|
*/
|
|
}
|
|
|
|
window.customElements.define(JsonView.is, JsonView);
|
|
</script>
|
|
</dom-module>
|