Skip to content

Commit

Permalink
Switched everything to 2-space indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Nov 15, 2013
1 parent 8ddc6f3 commit 8e07ebb
Show file tree
Hide file tree
Showing 44 changed files with 10,779 additions and 10,779 deletions.
492 changes: 246 additions & 246 deletions Jakefile.js

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions app/chrome/manifest.json
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
}
62 changes: 31 additions & 31 deletions app/web/ajax.js
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
}
})();
Loading

0 comments on commit 8e07ebb

Please sign in to comment.