1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 07:22:28 +02:00

keep naming consistent with purpose

This commit is contained in:
gorhill 2014-07-20 17:32:43 -04:00
parent b8a8c04857
commit 9b11843ea8

View File

@ -361,25 +361,25 @@ var updateFromRemote = function(details, callback) {
}); });
}; };
var onRemoteFileLoaded = function() { var onRepoFileLoaded = function() {
this.onload = this.onerror = null; this.onload = this.onerror = null;
if ( typeof this.responseText !== 'string' ) { if ( typeof this.responseText !== 'string' ) {
console.error('µBlock> updateFromRemote("%s") / onRemoteFileLoaded(): no response', repositoryURL); console.error('µBlock> updateFromRemote("%s") / onRepoFileLoaded(): no response', repositoryURL);
reportBackError(); reportBackError();
return; return;
} }
if ( targetMd5 !== '' && YaMD5.hashStr(this.responseText) !== targetMd5 ) { if ( targetMd5 !== '' && YaMD5.hashStr(this.responseText) !== targetMd5 ) {
console.error('µBlock> updateFromRemote("%s") / onRemoteFileLoaded(): bad md5 checksum', repositoryURL); console.error('µBlock> updateFromRemote("%s") / onRepoFileLoaded(): bad md5 checksum', repositoryURL);
reportBackError(); reportBackError();
return; return;
} }
// console.debug('µBlock> updateFromRemote("%s") / onRemoteFileLoaded()', repositoryURL); // console.debug('µBlock> updateFromRemote("%s") / onRepoFileLoaded()', repositoryURL);
writeLocalFile(targetPath, this.responseText, callback); writeLocalFile(targetPath, this.responseText, callback);
}; };
var onRemoteFileError = function(ev) { var onRepoFileError = function(ev) {
this.onload = this.onerror = null; this.onload = this.onerror = null;
console.error('µBlock> updateFromRemote() / onRemoteFileError("%s"):', repositoryURL, this.statusText); console.error('µBlock> updateFromRemote() / onRepoFileError("%s"):', repositoryURL, this.statusText);
reportBackError(); reportBackError();
}; };
@ -387,12 +387,12 @@ var updateFromRemote = function(details, callback) {
this.onload = this.onerror = null; this.onload = this.onerror = null;
if ( typeof this.responseText !== 'string' ) { if ( typeof this.responseText !== 'string' ) {
console.error('µBlock> updateFromRemote("%s") / onHomeFileLoaded(): no response', homeURL); console.error('µBlock> updateFromRemote("%s") / onHomeFileLoaded(): no response', homeURL);
getTextFileFromURL(repositoryURL, onRemoteFileLoaded, onRemoteFileError); getTextFileFromURL(repositoryURL, onRepoFileLoaded, onRepoFileError);
return; return;
} }
if ( targetMd5 !== '' && YaMD5.hashStr(this.responseText) !== targetMd5 ) { if ( targetMd5 !== '' && YaMD5.hashStr(this.responseText) !== targetMd5 ) {
console.error('µBlock> updateFromRemote("%s") / onHomeFileLoaded(): bad md5 checksum', homeURL); console.error('µBlock> updateFromRemote("%s") / onHomeFileLoaded(): bad md5 checksum', homeURL);
getTextFileFromURL(repositoryURL, onRemoteFileLoaded, onRemoteFileError); getTextFileFromURL(repositoryURL, onRepoFileLoaded, onRepoFileError);
return; return;
} }
// console.debug('µBlock> updateFromRemote("%s") / onHomeFileLoaded()', homeURL); // console.debug('µBlock> updateFromRemote("%s") / onHomeFileLoaded()', homeURL);
@ -402,7 +402,7 @@ var updateFromRemote = function(details, callback) {
var onHomeFileError = function(ev) { var onHomeFileError = function(ev) {
this.onload = this.onerror = null; this.onload = this.onerror = null;
console.error('µBlock> updateFromRemote() / onHomeFileError("%s"):', homeURL, this.statusText); console.error('µBlock> updateFromRemote() / onHomeFileError("%s"):', homeURL, this.statusText);
getTextFileFromURL(repositoryURL, onRemoteFileLoaded, onRemoteFileError); getTextFileFromURL(repositoryURL, onRepoFileLoaded, onRepoFileError);
}; };
// https://github.com/gorhill/uBlock/issues/84 // https://github.com/gorhill/uBlock/issues/84
@ -428,7 +428,7 @@ var updateFromRemote = function(details, callback) {
} }
// The resource will be pulled from Github repo. It's reserved for // The resource will be pulled from Github repo. It's reserved for
// more important assets, so we keep and use the checksum. // more important assets, so we keep and use the checksum.
getTextFileFromURL(repositoryURL, onRemoteFileLoaded, onRemoteFileError); getTextFileFromURL(repositoryURL, onRepoFileLoaded, onRepoFileError);
}; };
// https://github.com/gorhill/uBlock/issues/84 // https://github.com/gorhill/uBlock/issues/84