Renamed all CSS classes They now have prefixes `.jsoneditor-` to prevent name collisions with css frameworks like bootstrap.

This commit is contained in:
jos 2015-12-27 21:43:18 +01:00
parent b571707b54
commit 301e33983c
13 changed files with 294 additions and 291 deletions

View File

@ -12,6 +12,8 @@ https://github.com/josdejong/jsoneditor
- Implemented #203: Objects and arrays in mode `form` and `view` are now
expandable by clicking the field names too.
- Replaced the PNG icon images with SVG. Thanks @1j01.
- Renamed all CSS classes They now have prefixes `.jsoneditor-` to prevent
name collisions with css frameworks like bootstrap.
- Renamed options `change`, `editable`, `error` to respectively `onChange`,
`onEditable`, and `onError`. Old options are still working and give a
deprecation warning.

View File

@ -1,75 +1,75 @@
/* dark styling of the editor */
.jsoneditor,
.jsoneditor div.menu {
div.jsoneditor,
div.jsoneditor-menu {
border-color: #4b4b4b;
}
.jsoneditor div.menu {
div.jsoneditor-menu {
background-color: #4b4b4b;
}
.jsoneditor div.tree,
.jsoneditor textarea.text {
div.jsoneditor-tree,
div.jsoneditor textarea.jsoneditor-text {
background-color: #666666;
color: #ffffff;
}
.jsoneditor .field,
.jsoneditor .value {
div.jsoneditor-field,
div.jsoneditor-value {
color: #ffffff;
}
.jsoneditor .search .frame {
div.jsoneditor-search div.jsoneditor-frame {
background: #808080;
}
.jsoneditor tr.highlight {
tr.jsoneditor-highlight {
background-color: #808080;
}
.jsoneditor .field[contenteditable=true]:focus,
.jsoneditor .field[contenteditable=true]:hover,
.jsoneditor .value[contenteditable=true]:focus,
.jsoneditor .value[contenteditable=true]:hover,
.jsoneditor .field.highlight,
.jsoneditor .value.highlight {
div.jsoneditor-field[contenteditable=true]:focus,
div.jsoneditor-field[contenteditable=true]:hover,
div.jsoneditor-value[contenteditable=true]:focus,
div.jsoneditor-value[contenteditable=true]:hover,
div.jsoneditor-field.jsoneditor-highlight,
div.jsoneditor-value.jsoneditor-highlight {
background-color: #808080;
border-color: #808080;
}
.jsoneditor .field.highlight-active,
.jsoneditor .field.highlight-active:focus,
.jsoneditor .field.highlight-active:hover,
.jsoneditor .value.highlight-active,
.jsoneditor .value.highlight-active:focus,
.jsoneditor .value.highlight-active:hover {
div.jsoneditor-field.highlight-active,
div.jsoneditor-field.highlight-active:focus,
div.jsoneditor-field.highlight-active:hover,
div.jsoneditor-value.highlight-active,
div.jsoneditor-value.highlight-active:focus,
div.jsoneditor-value.highlight-active:hover {
background-color: #b1b1b1;
border-color: #b1b1b1;
}
.jsoneditor div.tree button:focus {
div.jsoneditor-tree button:focus {
background-color: #868686;
}
/* coloring of JSON in tree mode */
.jsoneditor .readonly {
div.jsoneditor-readonly {
color: #acacac;
}
.jsoneditor .separator {
div.jsoneditor-separator {
color: #acacac;
}
.jsoneditor .value.string {
div.jsoneditor-value.jsoneditor-string {
color: #00ff88;
}
.jsoneditor .value.object,
.jsoneditor .value.array {
div.jsoneditor-value.jsoneditor-object,
div.jsoneditor-value.jsoneditor-array {
color: #bababa;
}
.jsoneditor .value.number {
div.jsoneditor-value.jsoneditor-number {
color: #ff4040;
}
.jsoneditor .value.boolean {
div.jsoneditor-value.jsoneditor-boolean {
color: #ff8048;
}
.jsoneditor .value.null {
div.jsoneditor-value.jsoneditor-null {
color: #49a7fc;
}
.jsoneditor .value.invalid {
div.jsoneditor-value.jsoneditor-invalid {
color: white;
}

View File

@ -1,12 +1,12 @@
/* ContextMenu - main menu */
.jsoneditor-contextmenu {
div.jsoneditor-contextmenu {
position: absolute;
z-index: 99999;
}
.jsoneditor-contextmenu ul {
div.jsoneditor-contextmenu ul {
position: relative;
left: 0;
top: 0;
@ -21,7 +21,7 @@
padding: 0;
}
.jsoneditor-contextmenu ul li button {
div.jsoneditor-contextmenu ul li button {
padding: 0;
margin: 0;
width: 124px;
@ -36,30 +36,30 @@
}
/* Fix button padding in firefox */
.jsoneditor-contextmenu ul li button::-moz-focus-inner {
div.jsoneditor-contextmenu ul li button::-moz-focus-inner {
padding: 0;
border: 0;
}
.jsoneditor-contextmenu ul li button:hover,
.jsoneditor-contextmenu ul li button:focus {
div.jsoneditor-contextmenu ul li button:hover,
div.jsoneditor-contextmenu ul li button:focus {
color: #1a1a1a;
background-color: #f5f5f5;
outline: none;
}
.jsoneditor-contextmenu ul li button.default {
div.jsoneditor-contextmenu ul li button.jsoneditor-default {
width: 92px;
}
.jsoneditor-contextmenu ul li button.expand {
div.jsoneditor-contextmenu ul li button.jsoneditor-expand {
float: right;
width: 32px;
height: 24px;
border-left: 1px solid #e5e5e5;
}
.jsoneditor-contextmenu div.icon {
div.jsoneditor-contextmenu div.jsoneditor-icon {
float: left;
width: 24px;
height: 24px;
@ -69,7 +69,7 @@
background-image: url('img/jsoneditor-icons.svg');
}
.jsoneditor-contextmenu ul li button div.expand {
div.jsoneditor-contextmenu ul li button div.jsoneditor-expand {
float: right;
width: 24px;
height: 24px;
@ -79,81 +79,82 @@
opacity: 0.4;
}
.jsoneditor-contextmenu ul li button:hover div.expand,
.jsoneditor-contextmenu ul li button:focus div.expand,
.jsoneditor-contextmenu ul li.selected div.expand,
.jsoneditor-contextmenu ul li button.expand:hover div.expand,
.jsoneditor-contextmenu ul li button.expand:focus div.expand {
div.jsoneditor-contextmenu ul li button:hover div.jsoneditor-expand,
div.jsoneditor-contextmenu ul li button:focus div.jsoneditor-expand,
div.jsoneditor-contextmenu ul li.jsoneditor-selected div.jsoneditor-expand,
div.jsoneditor-contextmenu ul li button.jsoneditor-expand:hover div.jsoneditor-expand,
div.jsoneditor-contextmenu ul li button.jsoneditor-expand:focus div.jsoneditor-expand {
opacity: 1;
}
.jsoneditor-contextmenu .separator {
div.jsoneditor-contextmenu div.jsoneditor-separator {
height: 0;
border-top: 1px solid #e5e5e5;
padding-top: 5px;
margin-top: 5px;
}
.jsoneditor-contextmenu button.remove > .icon {
div.jsoneditor-contextmenu button.jsoneditor-remove > div.jsoneditor-icon {
background-position: -24px -24px;
}
.jsoneditor-contextmenu button.remove:hover > .icon,
.jsoneditor-contextmenu button.remove:focus > .icon {
div.jsoneditor-contextmenu button.jsoneditor-remove:hover > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-remove:focus > div.jsoneditor-icon {
background-position: -24px 0;
}
.jsoneditor-contextmenu button.append > .icon {
div.jsoneditor-contextmenu button.jsoneditor-append > div.jsoneditor-icon {
background-position: 0 -24px;
}
.jsoneditor-contextmenu button.append:hover > .icon,
.jsoneditor-contextmenu button.append:focus > .icon {
div.jsoneditor-contextmenu button.jsoneditor-append:hover > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-append:focus > div.jsoneditor-icon {
background-position: 0 0;
}
.jsoneditor-contextmenu button.insert > .icon {
div.jsoneditor-contextmenu button.jsoneditor-insert > div.jsoneditor-icon {
background-position: 0 -24px;
}
.jsoneditor-contextmenu button.insert:hover > .icon,
.jsoneditor-contextmenu button.insert:focus > .icon {
div.jsoneditor-contextmenu button.jsoneditor-insert:hover > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-insert:focus > div.jsoneditor-icon {
background-position: 0 0;
}
.jsoneditor-contextmenu button.duplicate > .icon {
div.jsoneditor-contextmenu button.jsoneditor-duplicate > div.jsoneditor-icon {
background-position: -48px -24px;
}
.jsoneditor-contextmenu button.duplicate:hover > .icon,
.jsoneditor-contextmenu button.duplicate:focus > .icon {
div.jsoneditor-contextmenu button.jsoneditor-duplicate:hover > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-duplicate:focus > div.jsoneditor-icon {
background-position: -48px 0;
}
.jsoneditor-contextmenu button.sort-asc > .icon {
div.jsoneditor-contextmenu button.jsoneditor-sort-asc > div.jsoneditor-icon {
background-position: -168px -24px;
}
.jsoneditor-contextmenu button.sort-asc:hover > .icon,
.jsoneditor-contextmenu button.sort-asc:focus > .icon {
div.jsoneditor-contextmenu button.jsoneditor-sort-asc:hover > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-sort-asc:focus > div.jsoneditor-icon {
background-position: -168px 0;
}
.jsoneditor-contextmenu button.sort-desc > .icon {
div.jsoneditor-contextmenu button.jsoneditor-sort-desc > div.jsoneditor-icon {
background-position: -192px -24px;
}
.jsoneditor-contextmenu button.sort-desc:hover > .icon,
.jsoneditor-contextmenu button.sort-desc:focus > .icon {
div.jsoneditor-contextmenu button.jsoneditor-sort-desc:hover > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-sort-desc:focus > div.jsoneditor-icon {
background-position: -192px 0;
}
/* ContextMenu - sub menu */
.jsoneditor-contextmenu ul li .selected {
div.jsoneditor-contextmenu ul li button.jsoneditor-selected,
div.jsoneditor-contextmenu ul li button.jsoneditor-selected:hover {
color: white;
background-color: #ee422e;
}
.jsoneditor-contextmenu ul li {
div.jsoneditor-contextmenu ul li {
overflow: hidden;
}
.jsoneditor-contextmenu ul li ul {
div.jsoneditor-contextmenu ul li ul {
display: none;
position: relative;
left: -10px;
@ -170,56 +171,56 @@
transition: all 0.3s ease-out;
}
.jsoneditor-contextmenu ul li.selected ul {
div.jsoneditor-contextmenu ul li.jsoneditor-selected ul {
}
.jsoneditor-contextmenu ul li ul li button {
div.jsoneditor-contextmenu ul li ul li button {
padding-left: 24px;
animation: all ease-in-out 1s;
}
.jsoneditor-contextmenu ul li ul li button:hover,
.jsoneditor-contextmenu ul li ul li button:focus {
div.jsoneditor-contextmenu ul li ul li button:hover,
div.jsoneditor-contextmenu ul li ul li button:focus {
background-color: #f5f5f5;
}
.jsoneditor-contextmenu button.type-string > .icon {
div.jsoneditor-contextmenu button.jsoneditor-type-string > div.jsoneditor-icon {
background-position: -144px -24px;
}
.jsoneditor-contextmenu button.type-string:hover > .icon,
.jsoneditor-contextmenu button.type-string:focus > .icon,
.jsoneditor-contextmenu button.type-string.selected > .icon{
div.jsoneditor-contextmenu button.jsoneditor-type-string:hover > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-type-string:focus > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-type-string.jsoneditor-selected > div.jsoneditor-icon{
background-position: -144px 0;
}
.jsoneditor-contextmenu button.type-auto > .icon {
div.jsoneditor-contextmenu button.jsoneditor-type-auto > div.jsoneditor-icon {
background-position: -120px -24px;
}
.jsoneditor-contextmenu button.type-auto:hover > .icon,
.jsoneditor-contextmenu button.type-auto:focus > .icon,
.jsoneditor-contextmenu button.type-auto.selected > .icon {
div.jsoneditor-contextmenu button.jsoneditor-type-auto:hover > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-type-auto:focus > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-type-auto.jsoneditor-selected > div.jsoneditor-icon {
background-position: -120px 0;
}
.jsoneditor-contextmenu button.type-object > .icon {
div.jsoneditor-contextmenu button.jsoneditor-type-object > div.jsoneditor-icon {
background-position: -72px -24px;
}
.jsoneditor-contextmenu button.type-object:hover > .icon,
.jsoneditor-contextmenu button.type-object:focus > .icon,
.jsoneditor-contextmenu button.type-object.selected > .icon{
div.jsoneditor-contextmenu button.jsoneditor-type-object:hover > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-type-object:focus > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-type-object.jsoneditor-selected > div.jsoneditor-icon{
background-position: -72px 0;
}
.jsoneditor-contextmenu button.type-array > .icon {
div.jsoneditor-contextmenu button.jsoneditor-type-array > div.jsoneditor-icon {
background-position: -96px -24px;
}
.jsoneditor-contextmenu button.type-array:hover > .icon,
.jsoneditor-contextmenu button.type-array:focus > .icon,
.jsoneditor-contextmenu button.type-array.selected > .icon{
div.jsoneditor-contextmenu button.jsoneditor-type-array:hover > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-type-array:focus > div.jsoneditor-icon,
div.jsoneditor-contextmenu button.jsoneditor-type-array.jsoneditor-selected > div.jsoneditor-icon{
background-position: -96px 0;
}
.jsoneditor-contextmenu button.type-modes > .icon {
div.jsoneditor-contextmenu button.jsoneditor-type-modes > div.jsoneditor-icon {
background-image: none;
width: 6px;
}

View File

@ -1,7 +1,7 @@
.jsoneditor .field,
.jsoneditor .value,
.jsoneditor .readonly {
div.jsoneditor-field,
div.jsoneditor-value,
div.jsoneditor-readonly {
border: 1px solid transparent;
min-height: 16px;
min-width: 32px;
@ -12,108 +12,108 @@
}
/* adjust margin of p elements inside editable divs, needed for Opera, IE */
.jsoneditor .field p,
.jsoneditor .value p {
div.jsoneditor-field p,
div.jsoneditor-value p {
margin: 0;
}
.jsoneditor .value {
div.jsoneditor-value {
word-break: break-word;
}
.jsoneditor .readonly {
div.jsoneditor-readonly {
min-width: 16px;
color: gray;
}
.jsoneditor .empty {
div.jsoneditor-empty {
border-color: lightgray;
border-style: dashed;
border-radius: 2px;
}
.jsoneditor .field.empty::after,
.jsoneditor .value.empty::after {
div.jsoneditor-field.jsoneditor-empty::after,
div.jsoneditor-value.jsoneditor-empty::after {
pointer-events: none;
color: lightgray;
font-size: 8pt;
}
.jsoneditor .field.empty::after {
div.jsoneditor-field.jsoneditor-empty::after {
content: "field";
}
.jsoneditor .value.empty::after {
div.jsoneditor-value.jsoneditor-empty::after {
content: "value";
}
.jsoneditor .value.url {
div.jsoneditor-value.jsoneditor-url {
color: green;
text-decoration: underline;
}
.jsoneditor a.value.url:hover,
.jsoneditor a.value.url:focus {
a.jsoneditor-value.jsoneditor-url:hover,
a.jsoneditor-value.jsoneditor-url:focus {
color: #ee422e;
}
.jsoneditor .separator {
div.jsoneditor div.jsoneditor-separator {
padding: 3px 0;
vertical-align: top;
color: gray;
}
.jsoneditor .field[contenteditable=true]:focus,
.jsoneditor .field[contenteditable=true]:hover,
.jsoneditor .value[contenteditable=true]:focus,
.jsoneditor .value[contenteditable=true]:hover,
.jsoneditor .field.highlight,
.jsoneditor .value.highlight {
div.jsoneditor-field[contenteditable=true]:focus,
div.jsoneditor-field[contenteditable=true]:hover,
div.jsoneditor-value[contenteditable=true]:focus,
div.jsoneditor-value[contenteditable=true]:hover,
div.jsoneditor-field.jsoneditor-highlight,
div.jsoneditor-value.jsoneditor-highlight {
background-color: #FFFFAB;
border: 1px solid yellow;
border-radius: 2px;
}
.jsoneditor .field.highlight-active,
.jsoneditor .field.highlight-active:focus,
.jsoneditor .field.highlight-active:hover,
.jsoneditor .value.highlight-active,
.jsoneditor .value.highlight-active:focus,
.jsoneditor .value.highlight-active:hover {
div.jsoneditor-field.jsoneditor-highlight-active,
div.jsoneditor-field.jsoneditor-highlight-active:focus,
div.jsoneditor-field.jsoneditor-highlight-active:hover,
div.jsoneditor-value.jsoneditor-highlight-active,
div.jsoneditor-value.jsoneditor-highlight-active:focus,
div.jsoneditor-value.jsoneditor-highlight-active:hover {
background-color: #ffee00;
border: 1px solid #ffc700;
border-radius: 2px;
}
.jsoneditor .value.string {
div.jsoneditor-value.jsoneditor-string {
color: #008000;
}
.jsoneditor .value.object,
.jsoneditor .value.array {
div.jsoneditor-value.jsoneditor-object,
div.jsoneditor-value.jsoneditor-array {
min-width: 16px;
color: #808080;
}
.jsoneditor .value.number {
div.jsoneditor-value.jsoneditor-number {
color: #ee422e;
}
.jsoneditor .value.boolean {
div.jsoneditor-value.jsoneditor-boolean {
color: #ff8c00;
}
.jsoneditor .value.null {
div.jsoneditor-value.jsoneditor-null {
color: #004ED0;
}
.jsoneditor .value.invalid {
div.jsoneditor-value.jsoneditor-invalid {
color: #000000;
}
.jsoneditor div.tree button {
div.jsoneditor-tree button {
width: 24px;
height: 24px;
padding: 0;
@ -123,34 +123,34 @@
background: transparent url('img/jsoneditor-icons.svg');
}
.jsoneditor.mode-view tr.expandable td.tree,
.jsoneditor.mode-form tr.expandable td.tree {
div.jsoneditor-mode-view tr.jsoneditor-expandable td.jsoneditor-tree,
div.jsoneditor-mode-form tr.jsoneditor-expandable td.jsoneditor-tree {
cursor: pointer;
}
.jsoneditor div.tree button.collapsed {
div.jsoneditor-tree button.jsoneditor-collapsed {
background-position: 0 -48px;
}
.jsoneditor div.tree button.expanded {
div.jsoneditor-tree button.jsoneditor-expanded {
background-position: 0 -72px;
}
.jsoneditor div.tree button.contextmenu {
div.jsoneditor-tree button.jsoneditor-contextmenu {
background-position: -48px -72px;
}
.jsoneditor div.tree button.contextmenu:hover,
.jsoneditor div.tree button.contextmenu:focus,
.jsoneditor div.tree button.contextmenu.selected {
div.jsoneditor-tree button.jsoneditor-contextmenu:hover,
div.jsoneditor-tree button.jsoneditor-contextmenu:focus,
div.jsoneditor-tree button.jsoneditor-contextmenu.selected {
background-position: -48px -48px;
}
.jsoneditor div.tree *:focus {
div.jsoneditor-tree *:focus {
outline: none;
}
.jsoneditor div.tree button:focus {
div.jsoneditor-tree button:focus {
/* TODO: nice outline for buttons with focus
outline: #97B0F8 solid 2px;
box-shadow: 0 0 8px #97B0F8;
@ -159,12 +159,12 @@
outline: #e5e5e5 solid 1px;
}
.jsoneditor div.tree button.invisible {
div.jsoneditor-tree button.jsoneditor-invisible {
visibility: hidden;
background: none;
}
.jsoneditor {
div.jsoneditor {
color: #1A1A1A;
border: 1px solid #3883fa;
-moz-box-sizing: border-box;
@ -180,14 +180,14 @@
}
.jsoneditor div.tree table.tree {
div.jsoneditor-tree table.jsoneditor-tree {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
margin: 0;
}
.jsoneditor div.outer {
div.jsoneditor-outer {
width: 100%;
height: 100%;
margin: -35px 0 0 0;
@ -200,14 +200,14 @@
overflow: hidden;
}
.jsoneditor div.tree {
div.jsoneditor-tree {
width: 100%;
height: 100%;
position: relative;
overflow: auto;
}
.jsoneditor textarea.text {
textarea.jsoneditor-text {
width: 100%;
height: 100%;
margin: 0;
@ -222,40 +222,40 @@
resize: none;
}
.jsoneditor tr.highlight {
tr.jsoneditor-highlight {
background-color: #FFFFAB;
}
.jsoneditor div.tree button.dragarea {
div.jsoneditor-tree button.jsoneditor-dragarea {
background: url('img/jsoneditor-icons.svg') -72px -72px;
cursor: move;
}
.jsoneditor div.tree button.dragarea:hover,
.jsoneditor div.tree button.dragarea:focus {
div.jsoneditor-tree button.jsoneditor-dragarea:hover,
div.jsoneditor-tree button.jsoneditor-dragarea:focus {
background-position: -72px -48px;
}
.jsoneditor tr,
.jsoneditor th,
.jsoneditor td {
div.jsoneditor tr,
div.jsoneditor th,
div.jsoneditor td {
padding: 0;
margin: 0;
}
.jsoneditor td {
div.jsoneditor td {
vertical-align: top;
}
.jsoneditor td.tree {
div.jsoneditor td.jsoneditor-tree {
vertical-align: top;
}
.jsoneditor .field,
.jsoneditor .value,
.jsoneditor td,
.jsoneditor th,
.jsoneditor textarea {
div.jsoneditor-field,
div.jsoneditor-value,
div.jsoneditor td,
div.jsoneditor th,
div.jsoneditor textarea {
font-family: droid sans mono, consolas, monospace, courier new, courier, sans-serif;
font-size: 10pt;
color: #1A1A1A;

View File

@ -1,5 +1,5 @@
.jsoneditor .menu {
div.jsoneditor-menu {
width: 100%;
height: 35px;
padding: 2px;
@ -14,7 +14,7 @@
border-bottom: 1px solid #3883fa;
}
.jsoneditor .menu button {
div.jsoneditor-menu > button {
width: 26px;
height: 26px;
margin: 2px;
@ -31,55 +31,55 @@
float: left;
}
.jsoneditor .menu button:hover {
div.jsoneditor-menu > button:hover {
background-color: rgba(255,255,255,0.2);
border: 1px solid rgba(255,255,255,0.4);
}
.jsoneditor .menu button:focus,
.jsoneditor .menu button:active {
div.jsoneditor-menu > button:focus,
div.jsoneditor-menu > button:active {
background-color: rgba(255,255,255,0.3);
}
.jsoneditor .menu button:disabled {
div.jsoneditor-menu > button:disabled {
opacity: 0.5;
}
.jsoneditor .menu button.collapse-all {
div.jsoneditor-menu > button.jsoneditor-collapse-all {
background-position: 0 -96px;
}
.jsoneditor .menu button.expand-all {
div.jsoneditor-menu > button.jsoneditor-expand-all {
background-position: 0 -120px;
}
.jsoneditor .menu button.undo {
div.jsoneditor-menu > button.jsoneditor-undo {
background-position: -24px -96px;
}
.jsoneditor .menu button.undo:disabled {
div.jsoneditor-menu > button.jsoneditor-undo:disabled {
background-position: -24px -120px;
}
.jsoneditor .menu button.redo {
div.jsoneditor-menu > button.jsoneditor-redo {
background-position: -48px -96px;
}
.jsoneditor .menu button.redo:disabled {
div.jsoneditor-menu > button.jsoneditor-redo:disabled {
background-position: -48px -120px;
}
.jsoneditor .menu button.compact {
div.jsoneditor-menu > button.jsoneditor-compact {
background-position: -72px -96px;
}
.jsoneditor .menu button.format {
div.jsoneditor-menu > button.jsoneditor-format {
background-position: -72px -120px;
}
.jsoneditor .menu button.modes {
div.jsoneditor-menu > button.jsoneditor-modes {
background-image: none;
width: auto;
padding-left: 6px;
padding-right: 6px;
}
.jsoneditor .menu button.separator {
div.jsoneditor-menu > button.jsoneditor-separator {
margin-left: 10px;
}
.jsoneditor .menu a {
div.jsoneditor-menu a {
font-family: arial, sans-serif;
font-size: 10pt;
color: white;
@ -87,11 +87,11 @@
vertical-align: middle;
}
.jsoneditor .menu a:hover {
div.jsoneditor-menu a:hover {
opacity: 1;
}
.jsoneditor .menu a.poweredBy {
div.jsoneditor-menu a.jsoneditor-poweredBy {
font-size: 8pt;
position: absolute;
right: 0;

View File

@ -1,30 +1,30 @@
.jsoneditor .search input,
.jsoneditor .search .results {
table.jsoneditor-search input,
table.jsoneditor-search div.jsoneditor-results {
font-family: arial, sans-serif;
font-size: 10pt;
color: #1A1A1A;
background: transparent; /* For Firefox */
}
.jsoneditor .search {
table.jsoneditor-search {
position: absolute;
right: 2px;
top: 2px;
}
.jsoneditor .search .frame {
table.jsoneditor-search div.jsoneditor-frame {
border: 1px solid transparent;
background-color: white;
padding: 0 2px;
margin: 0;
}
.jsoneditor .search .frame table {
table.jsoneditor-search div.jsoneditor-frame table {
border-collapse: collapse;
}
.jsoneditor .search input {
table.jsoneditor-search input {
width: 120px;
border: none;
outline: none;
@ -32,13 +32,13 @@
line-height: 20px;
}
.jsoneditor .search .results {
table.jsoneditor-search .jsoneditor-results {
color: #4d4d4d;
padding-right: 5px;
line-height: 24px;
}
.jsoneditor .search button {
table.jsoneditor-search button {
width: 16px;
height: 24px;
padding: 0;
@ -48,28 +48,28 @@
vertical-align: top;
}
.jsoneditor .search button:hover {
table.jsoneditor-search button:hover {
background-color: transparent;
}
.jsoneditor .search button.refresh {
table.jsoneditor-search button.jsoneditor-refresh {
width: 18px;
background-position: -99px -73px;
}
.jsoneditor .search button.next {
table.jsoneditor-search button.jsoneditor-next {
cursor: pointer;
background-position: -124px -73px;
}
.jsoneditor .search button.next:hover {
table.jsoneditor-search button.jsoneditor-next:hover {
background-position: -124px -49px;
}
.jsoneditor .search button.previous {
table.jsoneditor-search button.jsoneditor-previous {
cursor: pointer;
background-position: -148px -73px;
margin-right: 2px;
}
.jsoneditor .search button.previous:hover {
table.jsoneditor-search button.jsoneditor-previous:hover {
background-position: -148px -49px;
}

View File

@ -28,7 +28,7 @@ function ContextMenu (items, options) {
// create a list to hold the menu items
var list = document.createElement('ul');
list.className = 'menu';
list.className = 'jsoneditor-menu';
menu.appendChild(list);
dom.list = list;
dom.items = []; // list with all buttons
@ -47,7 +47,7 @@ function ContextMenu (items, options) {
if (item.type == 'separator') {
// create a separator
var separator = document.createElement('div');
separator.className = 'separator';
separator.className = 'jsoneditor-separator';
li = document.createElement('li');
li.appendChild(separator);
list.appendChild(li);
@ -78,19 +78,19 @@ function ContextMenu (items, options) {
if (item.submenu) {
// add the icon to the button
var divIcon = document.createElement('div');
divIcon.className = 'icon';
divIcon.className = 'jsoneditor-icon';
button.appendChild(divIcon);
button.appendChild(document.createTextNode(item.text));
var buttonSubmenu;
if (item.click) {
// submenu and a button with a click handler
button.className += ' default';
button.className += ' jsoneditor-default';
var buttonExpand = document.createElement('button');
domItem.buttonExpand = buttonExpand;
buttonExpand.className = 'expand';
buttonExpand.innerHTML = '<div class="expand"></div>';
buttonExpand.className = 'jsoneditor-expand';
buttonExpand.innerHTML = '<div class="jsoneditor-expand"></div>';
li.appendChild(buttonExpand);
if (item.submenuTitle) {
buttonExpand.title = item.submenuTitle;
@ -101,7 +101,7 @@ function ContextMenu (items, options) {
else {
// submenu and a button without a click handler
var divExpand = document.createElement('div');
divExpand.className = 'expand';
divExpand.className = 'jsoneditor-expand';
button.appendChild(divExpand);
buttonSubmenu = button;
@ -118,14 +118,14 @@ function ContextMenu (items, options) {
domItem.subItems = domSubItems;
var ul = document.createElement('ul');
domItem.ul = ul;
ul.className = 'menu';
ul.className = 'jsoneditor-menu';
ul.style.height = '0';
li.appendChild(ul);
createMenuItems(ul, domSubItems, item.submenu);
}
else {
// no submenu, just a button with clickhandler
button.innerHTML = '<div class="icon"></div>' + item.text;
button.innerHTML = '<div class="jsoneditor-icon"></div>' + item.text;
}
domItems.push(domItem);
@ -292,7 +292,7 @@ ContextMenu.prototype._onExpandItem = function (domItem) {
setTimeout(function () {
if (me.expandedItem != expandedItem) {
expandedItem.ul.style.display = '';
util.removeClassName(expandedItem.ul.parentNode, 'selected');
util.removeClassName(expandedItem.ul.parentNode, 'jsoneditor-selected');
}
}, 300); // timeout duration must match the css transition duration
this.expandedItem = undefined;
@ -308,7 +308,7 @@ ContextMenu.prototype._onExpandItem = function (domItem) {
ul.style.padding = '5px 10px';
}
}, 0);
util.addClassName(ul.parentNode, 'selected');
util.addClassName(ul.parentNode, 'jsoneditor-selected');
this.expandedItem = domItem;
}
};
@ -360,7 +360,7 @@ ContextMenu.prototype._onKeyDown = function (event) {
}
}
else if (keynum == 37) { // Arrow Left
if (target.className == 'expand') {
if (target.className == 'jsoneditor-expand') {
buttons = this._getVisibleButtons();
targetIndex = buttons.indexOf(target);
prevButton = buttons[targetIndex - 1];
@ -374,7 +374,7 @@ ContextMenu.prototype._onKeyDown = function (event) {
buttons = this._getVisibleButtons();
targetIndex = buttons.indexOf(target);
prevButton = buttons[targetIndex - 1];
if (prevButton && prevButton.className == 'expand') {
if (prevButton && prevButton.className == 'jsoneditor-expand') {
// skip expand button
prevButton = buttons[targetIndex - 2];
}
@ -391,7 +391,7 @@ ContextMenu.prototype._onKeyDown = function (event) {
buttons = this._getVisibleButtons();
targetIndex = buttons.indexOf(target);
nextButton = buttons[targetIndex + 1];
if (nextButton && nextButton.className == 'expand') {
if (nextButton && nextButton.className == 'jsoneditor-expand') {
nextButton.focus();
}
handled = true;
@ -400,7 +400,7 @@ ContextMenu.prototype._onKeyDown = function (event) {
buttons = this._getVisibleButtons();
targetIndex = buttons.indexOf(target);
nextButton = buttons[targetIndex + 1];
if (nextButton && nextButton.className == 'expand') {
if (nextButton && nextButton.className == 'jsoneditor-expand') {
// skip expand button
nextButton = buttons[targetIndex + 2];
}

View File

@ -277,7 +277,7 @@ Node.prototype.expand = function(recurse) {
// set this node expanded
this.expanded = true;
if (this.dom.expand) {
this.dom.expand.className = 'expanded';
this.dom.expand.className = 'jsoneditor-expanded';
}
this.showChilds();
@ -311,7 +311,7 @@ Node.prototype.collapse = function(recurse) {
// make this node collapsed
if (this.dom.expand) {
this.dom.expand.className = 'collapsed';
this.dom.expand.className = 'jsoneditor-collapsed';
}
this.expanded = false;
};
@ -1023,30 +1023,30 @@ Node.prototype._getDomValue = function(silent) {
Node.prototype._updateDomValue = function () {
var domValue = this.dom.value;
if (domValue) {
var classNames = ['value'];
var classNames = ['jsoneditor-value'];
// set text color depending on value type
var value = this.value;
var type = (this.type == 'auto') ? util.type(value) : this.type;
var isUrl = type == 'string' && util.isUrl(value);
classNames.push(type);
classNames.push('jsoneditor-' + type);
if (isUrl) {
classNames.push('url');
classNames.push('jsoneditor-url');
}
// visual styling when empty
var isEmpty = (String(this.value) == '' && this.type != 'array' && this.type != 'object');
if (isEmpty) {
classNames.push('empty');
classNames.push('jsoneditor-empty');
}
// highlight when there is a search result
if (this.searchValueActive) {
classNames.push('highlight-active');
classNames.push('jsoneditor-highlight-active');
}
if (this.searchValue) {
classNames.push('highlight');
classNames.push('jsoneditor-highlight');
}
domValue.className = classNames.join(' ');
@ -1081,24 +1081,24 @@ Node.prototype._updateDomField = function () {
// make backgound color lightgray when empty
var isEmpty = (String(this.field) == '' && this.parent.type != 'array');
if (isEmpty) {
util.addClassName(domField, 'empty');
util.addClassName(domField, 'jsoneditor-empty');
}
else {
util.removeClassName(domField, 'empty');
util.removeClassName(domField, 'jsoneditor-empty');
}
// highlight when there is a search result
if (this.searchFieldActive) {
util.addClassName(domField, 'highlight-active');
util.addClassName(domField, 'jsoneditor-highlight-active');
}
else {
util.removeClassName(domField, 'highlight-active');
util.removeClassName(domField, 'jsoneditor-highlight-active');
}
if (this.searchField) {
util.addClassName(domField, 'highlight');
util.addClassName(domField, 'jsoneditor-highlight');
}
else {
util.removeClassName(domField, 'highlight');
util.removeClassName(domField, 'jsoneditor-highlight');
}
// strip formatting from the contents of the editable div
@ -1178,7 +1178,7 @@ Node.prototype.getDom = function() {
if (this.parent) {
var domDrag = document.createElement('button');
dom.drag = domDrag;
domDrag.className = 'dragarea';
domDrag.className = 'jsoneditor-dragarea';
domDrag.title = 'Drag to move this field (Alt+Shift+Arrows)';
tdDrag.appendChild(domDrag);
}
@ -1189,7 +1189,7 @@ Node.prototype.getDom = function() {
var tdMenu = document.createElement('td');
var menu = document.createElement('button');
dom.menu = menu;
menu.className = 'contextmenu';
menu.className = 'jsoneditor-contextmenu';
menu.title = 'Click to open the actions menu (Ctrl+M)';
tdMenu.appendChild(dom.menu);
dom.tr.appendChild(tdMenu);
@ -1453,7 +1453,7 @@ Node.prototype._createDomField = function () {
*/
Node.prototype.setHighlight = function (highlight) {
if (this.dom.tr) {
this.dom.tr.className = (highlight ? 'highlight' : '');
this.dom.tr.className = (highlight ? 'jsoneditor-highlight' : '');
if (this.append) {
this.append.setHighlight(highlight);
@ -1510,11 +1510,11 @@ Node.prototype.updateDom = function (options) {
// parent is an object
domField.contentEditable = this.editable.field;
domField.spellcheck = false;
domField.className = 'field';
domField.className = 'jsoneditor-field';
}
else {
// parent is an array this is the root node
domField.className = 'readonly';
domField.className = 'jsoneditor-readonly';
}
var field;
@ -1539,11 +1539,11 @@ Node.prototype.updateDom = function (options) {
var count = this.childs ? this.childs.length : 0;
if (this.type == 'array') {
domValue.innerHTML = '[' + count + ']';
this.dom.tr.className = 'expandable';
this.dom.tr.className = 'jsoneditor-expandable';
}
else if (this.type == 'object') {
domValue.innerHTML = '{' + count + '}';
this.dom.tr.className = 'expandable';
this.dom.tr.className = 'jsoneditor-expandable';
}
else {
domValue.innerHTML = this._escapeHTML(this.value);
@ -1653,13 +1653,13 @@ Node.prototype._createDomExpandButton = function () {
// create expand button
var expand = document.createElement('button');
if (this._hasChilds()) {
expand.className = this.expanded ? 'expanded' : 'collapsed';
expand.className = this.expanded ? 'jsoneditor-expanded' : 'jsoneditor-collapsed';
expand.title =
'Click to expand/collapse this field (Ctrl+E). \n' +
'Ctrl+Click to expand/collapse including all childs.';
}
else {
expand.className = 'invisible';
expand.className = 'jsoneditor-invisible';
expand.title = '';
}
@ -1677,14 +1677,14 @@ Node.prototype._createDomTree = function () {
var domTree = document.createElement('table');
var tbody = document.createElement('tbody');
domTree.style.borderCollapse = 'collapse'; // TODO: put in css
domTree.className = 'values';
domTree.className = 'jsoneditor-values';
domTree.appendChild(tbody);
var tr = document.createElement('tr');
tbody.appendChild(tr);
// create expand button
var tdExpand = document.createElement('td');
tdExpand.className = 'tree';
tdExpand.className = 'jsoneditor-tree';
tr.appendChild(tdExpand);
dom.expand = this._createDomExpandButton();
tdExpand.appendChild(dom.expand);
@ -1692,7 +1692,7 @@ Node.prototype._createDomTree = function () {
// create the field
var tdField = document.createElement('td');
tdField.className = 'tree';
tdField.className = 'jsoneditor-tree';
tr.appendChild(tdField);
dom.field = this._createDomField();
tdField.appendChild(dom.field);
@ -1700,17 +1700,17 @@ Node.prototype._createDomTree = function () {
// create a separator
var tdSeparator = document.createElement('td');
tdSeparator.className = 'tree';
tdSeparator.className = 'jsoneditor-tree';
tr.appendChild(tdSeparator);
if (this.type != 'object' && this.type != 'array') {
tdSeparator.appendChild(document.createTextNode(':'));
tdSeparator.className = 'separator';
tdSeparator.className = 'jsoneditor-separator';
}
dom.tdSeparator = tdSeparator;
// create the value
var tdValue = document.createElement('td');
tdValue.className = 'tree';
tdValue.className = 'jsoneditor-tree';
tr.appendChild(tdValue);
dom.value = this._createDomValue();
tdValue.appendChild(dom.value);
@ -1752,9 +1752,9 @@ Node.prototype.onEvent = function (event) {
var highlighter = node.editor.highlighter;
highlighter.highlight(node);
highlighter.lock();
util.addClassName(dom.menu, 'selected');
util.addClassName(dom.menu, 'jsoneditor-selected');
this.showContextMenu(dom.menu, function () {
util.removeClassName(dom.menu, 'selected');
util.removeClassName(dom.menu, 'jsoneditor-selected');
highlighter.unlock();
highlighter.unhighlight();
});
@ -2565,12 +2565,12 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
items.push({
text: 'Type',
title: 'Change the type of this field',
className: 'type-' + this.type,
className: 'jsoneditor-type-' + this.type,
submenu: [
{
text: 'Auto',
className: 'type-auto' +
(this.type == 'auto' ? ' selected' : ''),
className: 'jsoneditor-type-auto' +
(this.type == 'auto' ? ' jsoneditor-selected' : ''),
title: titles.auto,
click: function () {
node._onChangeType('auto');
@ -2578,8 +2578,8 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
},
{
text: 'Array',
className: 'type-array' +
(this.type == 'array' ? ' selected' : ''),
className: 'jsoneditor-type-array' +
(this.type == 'array' ? ' jsoneditor-selected' : ''),
title: titles.array,
click: function () {
node._onChangeType('array');
@ -2587,8 +2587,8 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
},
{
text: 'Object',
className: 'type-object' +
(this.type == 'object' ? ' selected' : ''),
className: 'jsoneditor-type-object' +
(this.type == 'object' ? ' jsoneditor-selected' : ''),
title: titles.object,
click: function () {
node._onChangeType('object');
@ -2596,8 +2596,8 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
},
{
text: 'String',
className: 'type-string' +
(this.type == 'string' ? ' selected' : ''),
className: 'jsoneditor-type-string' +
(this.type == 'string' ? ' jsoneditor-selected' : ''),
title: titles.string,
click: function () {
node._onChangeType('string');
@ -2612,14 +2612,14 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
items.push({
text: 'Sort',
title: 'Sort the childs of this ' + this.type,
className: 'sort-' + direction,
className: 'jsoneditor-sort-' + direction,
click: function () {
node._onSort(direction);
},
submenu: [
{
text: 'Ascending',
className: 'sort-asc',
className: 'jsoneditor-sort-asc',
title: 'Sort the childs of this ' + this.type + ' in ascending order',
click: function () {
node._onSort('asc');
@ -2627,7 +2627,7 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
},
{
text: 'Descending',
className: 'sort-desc',
className: 'jsoneditor-sort-desc',
title: 'Sort the childs of this ' + this.type +' in descending order',
click: function () {
node._onSort('desc');
@ -2652,14 +2652,14 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
text: 'Append',
title: 'Append a new field with type \'auto\' after this field (Ctrl+Shift+Ins)',
submenuTitle: 'Select the type of the field to be appended',
className: 'append',
className: 'jsoneditor-append',
click: function () {
node._onAppend('', '', 'auto');
},
submenu: [
{
text: 'Auto',
className: 'type-auto',
className: 'jsoneditor-type-auto',
title: titles.auto,
click: function () {
node._onAppend('', '', 'auto');
@ -2667,7 +2667,7 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
},
{
text: 'Array',
className: 'type-array',
className: 'jsoneditor-type-array',
title: titles.array,
click: function () {
node._onAppend('', []);
@ -2675,7 +2675,7 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
},
{
text: 'Object',
className: 'type-object',
className: 'jsoneditor-type-object',
title: titles.object,
click: function () {
node._onAppend('', {});
@ -2683,7 +2683,7 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
},
{
text: 'String',
className: 'type-string',
className: 'jsoneditor-type-string',
title: titles.string,
click: function () {
node._onAppend('', '', 'string');
@ -2698,14 +2698,14 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
text: 'Insert',
title: 'Insert a new field with type \'auto\' before this field (Ctrl+Ins)',
submenuTitle: 'Select the type of the field to be inserted',
className: 'insert',
className: 'jsoneditor-insert',
click: function () {
node._onInsertBefore('', '', 'auto');
},
submenu: [
{
text: 'Auto',
className: 'type-auto',
className: 'jsoneditor-type-auto',
title: titles.auto,
click: function () {
node._onInsertBefore('', '', 'auto');
@ -2713,7 +2713,7 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
},
{
text: 'Array',
className: 'type-array',
className: 'jsoneditor-type-array',
title: titles.array,
click: function () {
node._onInsertBefore('', []);
@ -2721,7 +2721,7 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
},
{
text: 'Object',
className: 'type-object',
className: 'jsoneditor-type-object',
title: titles.object,
click: function () {
node._onInsertBefore('', {});
@ -2729,7 +2729,7 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
},
{
text: 'String',
className: 'type-string',
className: 'jsoneditor-type-string',
title: titles.string,
click: function () {
node._onInsertBefore('', '', 'string');
@ -2743,7 +2743,7 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
items.push({
text: 'Duplicate',
title: 'Duplicate this field (Ctrl+D)',
className: 'duplicate',
className: 'jsoneditor-duplicate',
click: function () {
node._onDuplicate();
}
@ -2753,7 +2753,7 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
items.push({
text: 'Remove',
title: 'Remove this field (Ctrl+Del)',
className: 'remove',
className: 'jsoneditor-remove',
click: function () {
node._onRemove();
}

View File

@ -18,7 +18,7 @@ function SearchBox (editor, container) {
var table = document.createElement('table');
this.dom.table = table;
table.className = 'search';
table.className = 'jsoneditor-search';
container.appendChild(table);
var tbody = document.createElement('tbody');
this.dom.tbody = tbody;
@ -30,14 +30,14 @@ function SearchBox (editor, container) {
tr.appendChild(td);
var results = document.createElement('div');
this.dom.results = results;
results.className = 'results';
results.className = 'jsoneditor-results';
td.appendChild(results);
td = document.createElement('td');
tr.appendChild(td);
var divInput = document.createElement('div');
this.dom.input = divInput;
divInput.className = 'frame';
divInput.className = 'jsoneditor-frame';
divInput.title = 'Search fields and values';
td.appendChild(divInput);
@ -50,7 +50,7 @@ function SearchBox (editor, container) {
tbodySearch.appendChild(tr);
var refreshSearch = document.createElement('button');
refreshSearch.className = 'refresh';
refreshSearch.className = 'jsoneditor-refresh';
td = document.createElement('td');
td.appendChild(refreshSearch);
tr.appendChild(td);
@ -80,7 +80,7 @@ function SearchBox (editor, container) {
var searchNext = document.createElement('button');
searchNext.title = 'Next result (Enter)';
searchNext.className = 'next';
searchNext.className = 'jsoneditor-next';
searchNext.onclick = function () {
searchBox.next();
};
@ -90,7 +90,7 @@ function SearchBox (editor, container) {
var searchPrevious = document.createElement('button');
searchPrevious.title = 'Previous result (Shift+Enter)';
searchPrevious.className = 'previous';
searchPrevious.className = 'jsoneditor-previous';
searchPrevious.onclick = function () {
searchBox.previous();
};

View File

@ -50,7 +50,7 @@ function appendNodeFactory(Node) {
var tdMenu = document.createElement('td');
dom.tdMenu = tdMenu;
var menu = document.createElement('button');
menu.className = 'contextmenu';
menu.className = 'jsoneditor-contextmenu';
menu.title = 'Click to open the actions menu (Ctrl+M)';
dom.menu = menu;
tdMenu.appendChild(dom.menu);
@ -60,7 +60,7 @@ function appendNodeFactory(Node) {
var tdAppend = document.createElement('td');
var domText = document.createElement('div');
domText.innerHTML = '(empty)';
domText.className = 'readonly';
domText.className = 'jsoneditor-readonly';
tdAppend.appendChild(domText);
dom.td = tdAppend;
dom.text = domText;
@ -137,14 +137,14 @@ function appendNodeFactory(Node) {
'text': 'Append',
'title': 'Append a new field with type \'auto\' (Ctrl+Shift+Ins)',
'submenuTitle': 'Select the type of the field to be appended',
'className': 'insert',
'className': 'jsoneditor-insert',
'click': function () {
node._onAppend('', '', 'auto');
},
'submenu': [
{
'text': 'Auto',
'className': 'type-auto',
'className': 'jsoneditor-type-auto',
'title': titles.auto,
'click': function () {
node._onAppend('', '', 'auto');
@ -152,7 +152,7 @@ function appendNodeFactory(Node) {
},
{
'text': 'Array',
'className': 'type-array',
'className': 'jsoneditor-type-array',
'title': titles.array,
'click': function () {
node._onAppend('', []);
@ -160,7 +160,7 @@ function appendNodeFactory(Node) {
},
{
'text': 'Object',
'className': 'type-object',
'className': 'jsoneditor-type-object',
'title': titles.object,
'click': function () {
node._onAppend('', {});
@ -168,7 +168,7 @@ function appendNodeFactory(Node) {
},
{
'text': 'String',
'className': 'type-string',
'className': 'jsoneditor-type-string',
'title': titles.string,
'click': function () {
node._onAppend('', '', 'string');
@ -207,9 +207,9 @@ function appendNodeFactory(Node) {
var highlighter = this.editor.highlighter;
highlighter.highlight(this.parent);
highlighter.lock();
util.addClassName(dom.menu, 'selected');
util.addClassName(dom.menu, 'jsoneditor-selected');
this.showContextMenu(dom.menu, function () {
util.removeClassName(dom.menu, 'selected');
util.removeClassName(dom.menu, 'jsoneditor-selected');
highlighter.unlock();
highlighter.unhighlight();
});

View File

@ -73,7 +73,7 @@ function createModeSwitcher(editor, modes, current) {
throw new Error('Unknown mode "' + mode + '"');
}
item.className = 'type-modes' + ((current == mode) ? ' selected' : '');
item.className = 'jsoneditor-type-modes' + ((current == mode) ? ' jsoneditor-selected' : '');
items.push(item);
}
@ -86,7 +86,7 @@ function createModeSwitcher(editor, modes, current) {
// create the html element
var box = document.createElement('button');
box.className = 'modes separator';
box.className = 'jsoneditor-modes jsoneditor-separator';
box.innerHTML = currentTitle + ' &#x25BE;';
box.title = 'Switch editor mode';
box.onclick = function () {

View File

@ -72,7 +72,7 @@ textmode.create = function (container, options) {
this.height = container.clientHeight;
this.frame = document.createElement('div');
this.frame.className = 'jsoneditor mode-' + this.options.mode;
this.frame.className = 'jsoneditor jsoneditor-mode-' + this.options.mode;
this.frame.onclick = function (event) {
// prevent default submit action when the editor is located inside a form
event.preventDefault();
@ -83,12 +83,12 @@ textmode.create = function (container, options) {
// create menu
this.menu = document.createElement('div');
this.menu.className = 'menu';
this.menu.className = 'jsoneditor-menu';
this.frame.appendChild(this.menu);
// create format button
var buttonFormat = document.createElement('button');
buttonFormat.className = 'format';
buttonFormat.className = 'jsoneditor-format';
buttonFormat.title = 'Format JSON data, with proper indentation and line feeds (Ctrl+\\)';
this.menu.appendChild(buttonFormat);
buttonFormat.onclick = function () {
@ -102,7 +102,7 @@ textmode.create = function (container, options) {
// create compact button
var buttonCompact = document.createElement('button');
buttonCompact.className = 'compact';
buttonCompact.className = 'jsoneditor-compact';
buttonCompact.title = 'Compact JSON data, remove all whitespaces (Ctrl+Shift+\\)';
this.menu.appendChild(buttonCompact);
buttonCompact.onclick = function () {
@ -122,7 +122,7 @@ textmode.create = function (container, options) {
}
this.content = document.createElement('div');
this.content.className = 'outer';
this.content.className = 'jsoneditor-outer';
this.frame.appendChild(this.content);
this.container.appendChild(this.frame);
@ -164,7 +164,7 @@ textmode.create = function (container, options) {
poweredBy.appendChild(document.createTextNode('powered by ace'));
poweredBy.href = 'http://ace.ajax.org';
poweredBy.target = '_blank';
poweredBy.className = 'poweredBy';
poweredBy.className = 'jsoneditor-poweredBy';
poweredBy.onclick = function () {
// TODO: this anchor falls below the margin of the content,
// therefore the normal a.href does not work. We use a click event
@ -181,7 +181,7 @@ textmode.create = function (container, options) {
else {
// load a plain text textarea
var textarea = document.createElement('textarea');
textarea.className = 'text';
textarea.className = 'jsoneditor-text';
textarea.spellcheck = false;
this.content.appendChild(textarea);
this.textarea = textarea;

View File

@ -476,7 +476,7 @@ treemode.scrollTo = function (top, callback) {
treemode._createFrame = function () {
// create the frame
this.frame = document.createElement('div');
this.frame.className = 'jsoneditor mode-' + this.options.mode;
this.frame.className = 'jsoneditor jsoneditor-mode-' + this.options.mode;
this.container.appendChild(this.frame);
// create one global event listener to handle all events from all nodes
@ -515,12 +515,12 @@ treemode._createFrame = function () {
// create menu
this.menu = document.createElement('div');
this.menu.className = 'menu';
this.menu.className = 'jsoneditor-menu';
this.frame.appendChild(this.menu);
// create expand all button
var expandAll = document.createElement('button');
expandAll.className = 'expand-all';
expandAll.className = 'jsoneditor-expand-all';
expandAll.title = 'Expand all fields';
expandAll.onclick = function () {
editor.expandAll();
@ -530,7 +530,7 @@ treemode._createFrame = function () {
// create expand all button
var collapseAll = document.createElement('button');
collapseAll.title = 'Collapse all fields';
collapseAll.className = 'collapse-all';
collapseAll.className = 'jsoneditor-collapse-all';
collapseAll.onclick = function () {
editor.collapseAll();
};
@ -540,7 +540,7 @@ treemode._createFrame = function () {
if (this.history) {
// create undo button
var undo = document.createElement('button');
undo.className = 'undo separator';
undo.className = 'jsoneditor-undo jsoneditor-separator';
undo.title = 'Undo last action (Ctrl+Z)';
undo.onclick = function () {
editor._onUndo();
@ -550,7 +550,7 @@ treemode._createFrame = function () {
// create redo button
var redo = document.createElement('button');
redo.className = 'redo';
redo.className = 'jsoneditor-redo';
redo.title = 'Redo (Ctrl+Shift+Z)';
redo.onclick = function () {
editor._onRedo();
@ -697,15 +697,15 @@ treemode._onKeyDown = function (event) {
*/
treemode._createTable = function () {
var contentOuter = document.createElement('div');
contentOuter.className = 'outer';
contentOuter.className = 'jsoneditor-outer';
this.contentOuter = contentOuter;
this.content = document.createElement('div');
this.content.className = 'tree';
this.content.className = 'jsoneditor-tree';
contentOuter.appendChild(this.content);
this.table = document.createElement('table');
this.table.className = 'tree';
this.table.className = 'jsoneditor-tree';
this.content.appendChild(this.table);
// create colgroup where the first two columns don't have a fixed