Fixed the application not working on IE8 due to missing console object.

This commit is contained in:
josdejong 2013-03-11 20:29:46 +01:00
parent f52e3ad109
commit bdcf202adb
7 changed files with 21 additions and 5 deletions

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "JSON Editor", "name": "JSON Editor",
"version": "2.1.0", "version": "2.1.1",
"description": "JSON Editor is a tool to view, edit, and format JSON. It shows your data in an editable treeview and in a code editor.", "description": "JSON Editor is a tool to view, edit, and format JSON. It shows your data in an editable treeview and in a code editor.",
"app": { "app": {
"urls": [ "urls": [

View File

@ -319,7 +319,10 @@ app.resize = function() {
else { else {
// both editor and formatter visible // both editor and formatter visible
splitterLeft = width * value - splitterWidth / 2; splitterLeft = width * value - splitterWidth / 2;
domSplitterDrag.innerHTML = '⋮';
// TODO: find a character with vertical dots that works on IE8 too, or use an image
var isIE8 = (jsoneditor.util.getInternetExplorerVersion() == 8);
domSplitterDrag.innerHTML = (!isIE8) ? '⋮' : '|';
domSplitterDrag.title = 'Drag left or right to change the width of the panels'; domSplitterDrag.title = 'Drag left or right to change the width of the panels';
} }

View File

@ -168,7 +168,7 @@
<div id="footer"> <div id="footer">
<div id="footer-inner"> <div id="footer-inner">
<a href="http://jsoneditoronline.org" class="footer">JSON Editor Online 2.1.0</a> <a href="http://jsoneditoronline.org" class="footer">JSON Editor Online 2.1.1</a>
&bull; &bull;
<a href="changelog.txt" target="_blank" class="footer">Changelog</a> <a href="changelog.txt" target="_blank" class="footer">Changelog</a>
&bull; &bull;

View File

@ -201,7 +201,7 @@
<div id="footer"> <div id="footer">
<div id="footer-inner"> <div id="footer-inner">
<a href="http://jsoneditoronline.org" class="footer">JSON Editor Online 2.1.0</a> <a href="http://jsoneditoronline.org" class="footer">JSON Editor Online 2.1.1</a>
&bull; &bull;
<a href="../../changelog.txt" target="_blank" class="footer">Changelog</a> <a href="../../changelog.txt" target="_blank" class="footer">Changelog</a>
&bull; &bull;

View File

@ -2,7 +2,7 @@
<project name="jsoneditor-builder" default="main"> <project name="jsoneditor-builder" default="main">
<!-- the version number of must be updated here (according to changelog.txt) --> <!-- the version number of must be updated here (according to changelog.txt) -->
<property name="version" value="2.1.0"/> <property name="version" value="2.1.1"/>
<!-- compression tools --> <!-- compression tools -->
<property name="compressor" value="tools/yuicompressor-2.4.7.jar" /> <property name="compressor" value="tools/yuicompressor-2.4.7.jar" />

View File

@ -3,6 +3,12 @@
http://jsoneditoronline.org http://jsoneditoronline.org
## 2013-03-11, version 2.1.1
- Fixed an issue with console outputs on IE8, causing the editor not to work
at all on IE8.
## 2013-03-08, version 2.1.0 ## 2013-03-08, version 2.1.0
- Replaced the plain text editor with code editor Ace, which brings in syntax - Replaced the plain text editor with code editor Ace, which brings in syntax

View File

@ -46,6 +46,13 @@ if (!Array.prototype.forEach) {
} }
} }
// Old browsers do not have a console, so create a fake one in that case.
if (typeof console === 'undefined') {
console = {
log: function () {}
};
}
/** /**
* Parse JSON using the parser built-in in the browser. * Parse JSON using the parser built-in in the browser.
* On exception, the jsonString is validated and a detailed error is thrown. * On exception, the jsonString is validated and a detailed error is thrown.