forked from josdejong/jsoneditor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched everything to 2-space indentation
- Loading branch information
Showing
44 changed files
with
10,779 additions
and
10,779 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "JSON Editor", | ||
"version": "@@version", | ||
"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": { | ||
"urls": [ | ||
"http://jsoneditoronline.org/", | ||
"http://jsoneditoronline.org/index.html", | ||
"http://jsoneditoronline.org/changelog.txt", | ||
"http://jsoneditoronline.org/NOTICE" | ||
], | ||
"launch": { | ||
"web_url": "http://jsoneditoronline.org/index.html" | ||
} | ||
}, | ||
"icons": { | ||
"16": "icon_16.png", | ||
"128": "icon_128.png" | ||
}, | ||
"permissions": [ | ||
"unlimitedStorage" | ||
"manifest_version": 2, | ||
"name": "JSON Editor", | ||
"version": "@@version", | ||
"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": { | ||
"urls": [ | ||
"http://jsoneditoronline.org/", | ||
"http://jsoneditoronline.org/index.html", | ||
"http://jsoneditoronline.org/changelog.txt", | ||
"http://jsoneditoronline.org/NOTICE" | ||
], | ||
"offline_enabled": true | ||
"launch": { | ||
"web_url": "http://jsoneditoronline.org/index.html" | ||
} | ||
}, | ||
"icons": { | ||
"16": "icon_16.png", | ||
"128": "icon_128.png" | ||
}, | ||
"permissions": [ | ||
"unlimitedStorage" | ||
], | ||
"offline_enabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
/** | ||
* ajax | ||
* Utility to perform ajax get and post requests. Supported browsers: | ||
* Utility to perform ajax get and post requests. Supported browsers: | ||
* Chrome, Firefox, Opera, Safari, Internet Explorer 7+. | ||
*/ | ||
var ajax = (function () { | ||
function fetch (method, url, body, headers, callback) { | ||
try { | ||
var xhr = new XMLHttpRequest(); | ||
xhr.onreadystatechange = function() { | ||
if (xhr.readyState == 4) { | ||
callback(xhr.responseText, xhr.status); | ||
} | ||
}; | ||
xhr.open(method, url, true); | ||
if (headers) { | ||
for (var name in headers) { | ||
if (headers.hasOwnProperty(name)) { | ||
xhr.setRequestHeader(name, headers[name]); | ||
} | ||
} | ||
} | ||
xhr.send(body); | ||
function fetch (method, url, body, headers, callback) { | ||
try { | ||
var xhr = new XMLHttpRequest(); | ||
xhr.onreadystatechange = function() { | ||
if (xhr.readyState == 4) { | ||
callback(xhr.responseText, xhr.status); | ||
} | ||
catch (err) { | ||
callback(err, 0); | ||
}; | ||
xhr.open(method, url, true); | ||
if (headers) { | ||
for (var name in headers) { | ||
if (headers.hasOwnProperty(name)) { | ||
xhr.setRequestHeader(name, headers[name]); | ||
} | ||
} | ||
} | ||
xhr.send(body); | ||
} | ||
|
||
function get (url, headers, callback) { | ||
fetch('GET', url, null, headers, callback); | ||
catch (err) { | ||
callback(err, 0); | ||
} | ||
} | ||
|
||
function post (url, body, headers, callback) { | ||
fetch('POST', url, body, headers, callback) | ||
} | ||
function get (url, headers, callback) { | ||
fetch('GET', url, null, headers, callback); | ||
} | ||
|
||
return { | ||
'fetch': fetch, | ||
'get': get, | ||
'post': post | ||
} | ||
function post (url, body, headers, callback) { | ||
fetch('POST', url, body, headers, callback) | ||
} | ||
|
||
return { | ||
'fetch': fetch, | ||
'get': get, | ||
'post': post | ||
} | ||
})(); |
Oops, something went wrong.