Merge pull request #11142 from Snuffleupagus/webL10n-rm-fireL10nReadyEvent
Stop dispatching a "localized" event from the webL10n library, since it's unused and may clash with the default viewer
This commit is contained in:
commit
b86bdefcd9
12
external/webL10n/l10n.js
vendored
12
external/webL10n/l10n.js
vendored
@ -26,6 +26,9 @@
|
|||||||
- Removes consoleWarn and consoleLog and use console.log/warn directly.
|
- Removes consoleWarn and consoleLog and use console.log/warn directly.
|
||||||
- Removes window._ assignment.
|
- Removes window._ assignment.
|
||||||
- Remove compatibility code for OldIE.
|
- Remove compatibility code for OldIE.
|
||||||
|
- Replaces `String.prototype.substr()` with `String.prototype.substring()`.
|
||||||
|
- Removes `fireL10nReadyEvent` since the "localized" event it dispatches
|
||||||
|
is unused and may clash with an identically named event in the viewer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*jshint browser: true, devel: true, es5: true, globalstrict: true */
|
/*jshint browser: true, devel: true, es5: true, globalstrict: true */
|
||||||
@ -93,13 +96,6 @@ document.webL10n = (function(window, document, undefined) {
|
|||||||
return { id: l10nId, args: args };
|
return { id: l10nId, args: args };
|
||||||
}
|
}
|
||||||
|
|
||||||
function fireL10nReadyEvent(lang) {
|
|
||||||
var evtObject = document.createEvent('Event');
|
|
||||||
evtObject.initEvent('localized', true, false);
|
|
||||||
evtObject.language = lang;
|
|
||||||
document.dispatchEvent(evtObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
function xhrLoadText(url, onSuccess, onFailure) {
|
function xhrLoadText(url, onSuccess, onFailure) {
|
||||||
onSuccess = onSuccess || function _onSuccess(data) {};
|
onSuccess = onSuccess || function _onSuccess(data) {};
|
||||||
onFailure = onFailure || function _onFailure() {};
|
onFailure = onFailure || function _onFailure() {};
|
||||||
@ -326,7 +322,6 @@ document.webL10n = (function(window, document, undefined) {
|
|||||||
console.log('no resource to load, early way out');
|
console.log('no resource to load, early way out');
|
||||||
}
|
}
|
||||||
// early way out
|
// early way out
|
||||||
fireL10nReadyEvent(lang);
|
|
||||||
gReadyState = 'complete';
|
gReadyState = 'complete';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -338,7 +333,6 @@ document.webL10n = (function(window, document, undefined) {
|
|||||||
gResourceCount++;
|
gResourceCount++;
|
||||||
if (gResourceCount >= langCount) {
|
if (gResourceCount >= langCount) {
|
||||||
callback();
|
callback();
|
||||||
fireL10nReadyEvent(lang);
|
|
||||||
gReadyState = 'complete';
|
gReadyState = 'complete';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user