var matchKey = (function () { var elem = document.documentElement; if (elem.matches) return 'matches'; else if (elem.webkitMatchesSelector) return 'webkitMatchesSelector'; else if (elem.mozMatchesSelector) return 'mozMatchesSelector'; else if (elem.msMatchesSelector) return 'msMatchesSelector'; else if (elem.oMatchesSelector) return 'oMatchesSelector'; })(); JSONEditor.AbstractTheme = Class.extend({ getContainer: function() { return document.createElement('div'); }, getFloatRightLinkHolder: function() { var el = document.createElement('div'); el.style = el.style || {}; el.style.cssFloat = 'right'; el.style.marginLeft = '10px'; return el; }, getModal: function() { var el = document.createElement('div'); el.style.backgroundColor = 'white'; el.style.border = '1px solid black'; el.style.boxShadow = '3px 3px black'; el.style.position = 'absolute'; el.style.zIndex = '10'; el.style.display = 'none'; return el; }, getGridContainer: function() { var el = document.createElement('div'); return el; }, getGridRow: function() { var el = document.createElement('div'); el.className = 'row'; return el; }, getGridColumn: function() { var el = document.createElement('div'); return el; }, setGridColumnSize: function(el,size) { }, getLink: function(text) { var el = document.createElement('a'); el.setAttribute('href','#'); el.appendChild(document.createTextNode(text)); return el; }, disableHeader: function(header) { header.style.color = '#ccc'; }, disableLabel: function(label) { label.style.color = '#ccc'; }, enableHeader: function(header) { header.style.color = ''; }, enableLabel: function(label) { label.style.color = ''; }, getFormInputLabel: function(text) { var el = document.createElement('label'); el.appendChild(document.createTextNode(text)); return el; }, getCheckboxLabel: function(text) { var el = this.getFormInputLabel(text); el.style.fontWeight = 'normal'; return el; }, getHeader: function(text) { var el = document.createElement('h3'); if(typeof text === "string") { el.textContent = text; } else { el.appendChild(text); } return el; }, getCheckbox: function() { var el = this.getFormInputField('checkbox'); el.style.display = 'inline-block'; el.style.width = 'auto'; return el; }, getMultiCheckboxHolder: function(controls,label,description) { var el = document.createElement('div'); if(label) { label.style.display = 'block'; el.appendChild(label); } for(var i in controls) { if(!controls.hasOwnProperty(i)) continue; controls[i].style.display = 'inline-block'; controls[i].style.marginRight = '20px'; el.appendChild(controls[i]); } if(description) el.appendChild(description); return el; }, getSelectInput: function(options) { var select = document.createElement('select'); if(options) this.setSelectOptions(select, options); return select; }, getSwitcher: function(options) { var switcher = this.getSelectInput(options); switcher.style.backgroundColor = 'transparent'; switcher.style.display = 'inline-block'; switcher.style.fontStyle = 'italic'; switcher.style.fontWeight = 'normal'; switcher.style.height = 'auto'; switcher.style.marginBottom = 0; switcher.style.marginLeft = '5px'; switcher.style.padding = '0 0 0 3px'; switcher.style.width = 'auto'; return switcher; }, getSwitcherOptions: function(switcher) { return switcher.getElementsByTagName('option'); }, setSwitcherOptions: function(switcher, options, titles) { this.setSelectOptions(switcher, options, titles); }, setSelectOptions: function(select, options, titles) { titles = titles || []; select.innerHTML = ''; for(var i=0; i