Skip to content

Commit

Permalink
Fixed displaying error in non-supported browsers. Fixed word wrap in …
Browse files Browse the repository at this point in the history
…Firefox and Opera.
  • Loading branch information
= committed Apr 21, 2012
1 parent 28ba72f commit eee9748
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ main.load = function() {
]
};

// try { // TODO
try {
// formatter
var container = document.getElementById("jsonformatter");
formatter = new JSONFormatter(container);
Expand All @@ -141,7 +141,6 @@ main.load = function() {
var container = document.getElementById("jsoneditor");
editor = new JSONEditor(container);
editor.set(json);
try { // TODO: remove

// splitter
var domSplitter = document.getElementById('splitter');
Expand Down
2 changes: 1 addition & 1 deletion jsoneditor-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions jsoneditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.jsoneditor-field, .jsoneditor-value, .jsoneditor-field-readonly, .jsoneditor-readonly {
border: 1px solid transparent;
min-height: 16px;
min-width: 24px;
min-width: 24px;
padding: 2px;
margin: 1px;
outline: none;
Expand Down Expand Up @@ -187,7 +187,7 @@ div.jsoneditor-content {
width: 100%;
height: 100%;
position: relative;
overflow: auto;
overflow: auto;
}

textarea.jsonformatter-textarea {
Expand Down Expand Up @@ -277,4 +277,3 @@ td.jsoneditor-droparea {
font-family: droid sans mono, monospace, courier new, courier;
font-size: 10pt;
}

6 changes: 3 additions & 3 deletions jsoneditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ JSONEditor.Node.prototype.getDom = function() {
dom.value = this._createDomValue();
dom.tree = this._createDomTree(dom.expand, dom.field, dom.value);
tdField.appendChild(dom.tree);

// create type select box
var tdType = document.createElement('td');
tdType.className = 'jsoneditor-td jsoneditor-td-edit';
Expand Down Expand Up @@ -1351,7 +1351,7 @@ JSONEditor.Node.prototype._createDomTree = function (domExpand, domField, domVal
var dom = this.dom;
var domTree = document.createElement('table');
var tbody = document.createElement('tbody');
domTree.style.borderCollapse = 'collapse';
domTree.style.borderCollapse = 'collapse'; // TODO: put in css
domTree.appendChild(tbody);
var tr = document.createElement('tr');
tbody.appendChild(tr);
Expand Down Expand Up @@ -1793,7 +1793,7 @@ JSONEditor.Node.prototype._stringCast = function(str) {
* @return {String} escapedText
*/
JSONEditor.Node.prototype._escape = function (text) {
var htmlEscaped = String(text).replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/ /g, '&nbsp;');
var htmlEscaped = String(text).replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/ /g, ' &nbsp;');
var json = JSON.stringify(htmlEscaped);
var escapedText = json.substring(1, json.length - 1);
return escapedText;
Expand Down

0 comments on commit eee9748

Please sign in to comment.