Add prettier and reformat code
This commit is contained in:
parent
68eb00bae9
commit
970a34981f
37 changed files with 3459 additions and 1969 deletions
12
js/Util.js
12
js/Util.js
|
|
@ -1,5 +1,4 @@
|
|||
BR.Util = {
|
||||
|
||||
get: function(url, cb) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
|
|
@ -16,7 +15,7 @@ BR.Util = {
|
|||
};
|
||||
try {
|
||||
xhr.send();
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
cb(e);
|
||||
}
|
||||
},
|
||||
|
|
@ -24,9 +23,9 @@ BR.Util = {
|
|||
getError: function(xhr) {
|
||||
var msg = i18next.t('warning.no-response');
|
||||
if (xhr.responseText) {
|
||||
msg = xhr.responseText;
|
||||
msg = xhr.responseText;
|
||||
} else if (xhr.status || xhr.statusText) {
|
||||
msg = xhr.status + ': ' + xhr.statusText;
|
||||
msg = xhr.status + ': ' + xhr.statusText;
|
||||
}
|
||||
return new Error(msg);
|
||||
},
|
||||
|
|
@ -46,9 +45,8 @@ BR.Util = {
|
|||
storage.setItem(x, x);
|
||||
storage.removeItem(x);
|
||||
return true;
|
||||
}
|
||||
catch(e) {
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue