mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 1341029 - Turn on the ESLint no-undef rule for all of toolkit/. r=jaws
MozReview-Commit-ID: Ed9FfkskDos --HG-- extra : rebase_source : 6ae47dc76b3ebe77b66725a899d32e728af5d35e
This commit is contained in:
parent
c1b9e3db78
commit
a656cedb11
@ -287,6 +287,7 @@ toolkit/components/osfile/**
|
||||
|
||||
# External code:
|
||||
toolkit/components/microformats/test/**
|
||||
toolkit/components/microformats/microformat-shiv.js
|
||||
toolkit/components/reader/Readability.js
|
||||
toolkit/components/reader/JSDOMParser.js
|
||||
|
||||
|
@ -19,10 +19,13 @@ module.exports = {
|
||||
"addLoadEvent": false,
|
||||
"Assert": false,
|
||||
"BrowserTestUtils": false,
|
||||
"ContentTask": false,
|
||||
"EventUtils": false,
|
||||
"executeSoon": false,
|
||||
"export_assertions": false,
|
||||
"extractJarToTmp": false,
|
||||
"finish": false,
|
||||
"getJar": false,
|
||||
"getRootDirectory": false,
|
||||
"getTestFilePath": false,
|
||||
"gTestPath": false,
|
||||
|
@ -251,9 +251,13 @@ module.exports = {
|
||||
"ChromeUtils": false,
|
||||
"Components": false,
|
||||
"dump": true,
|
||||
// Specific to Firefox
|
||||
// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/InternalError
|
||||
"InternalError": true,
|
||||
"KeyEvent": false,
|
||||
"openDialog": false,
|
||||
"MenuBoxObject": false,
|
||||
"SimpleGestureEvent": false,
|
||||
"sizeToContent": false,
|
||||
"SharedArrayBuffer": false,
|
||||
// Note: StopIteration will likely be removed as part of removing legacy
|
||||
|
@ -1,7 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"rules": {
|
||||
"no-undef": "off"
|
||||
}
|
||||
};
|
@ -2,6 +2,9 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// Global in the DOM for privileged code only.
|
||||
/* global CheckerboardReportService */
|
||||
|
||||
"use strict";
|
||||
|
||||
var trace;
|
||||
|
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"../../../../../testing/xpcshell/xpcshell.eslintrc.js"
|
||||
]
|
||||
};
|
@ -429,6 +429,8 @@ function testAboutModuleRegistration() {
|
||||
*/
|
||||
let testAboutModulesWork = (browser) => {
|
||||
let testConnection = () => {
|
||||
// This section is loaded into a frame script.
|
||||
/* global content:false */
|
||||
let request = new content.XMLHttpRequest();
|
||||
try {
|
||||
request.open("GET", "about:test1", false);
|
||||
|
@ -68,7 +68,7 @@ add_task(function* testTimeout() {
|
||||
var [ready] = yield promiseImage(alert, 1000);
|
||||
ok(!ready, "Should cancel request if timeout fires");
|
||||
|
||||
[ready, request] = yield promiseImage(alert, 45000);
|
||||
[ready] = yield promiseImage(alert, 45000);
|
||||
ok(ready, "Should load image if request finishes before timeout");
|
||||
});
|
||||
|
||||
|
@ -2,6 +2,9 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// This file expects these globals to be declared before it is included.
|
||||
/* global Ci, Cc */
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/AddonManager.jsm");
|
||||
|
||||
|
@ -30,7 +30,7 @@ Services.scriptloader.loadSubScript(sharedUrl, this);
|
||||
// Define output functions so they look the same across all frameworks. Since
|
||||
// we don't have an output function available here, we report as TEST-PASS.
|
||||
var Output = {
|
||||
print: message => assert.ok(true, message),
|
||||
print: message => assert.ok(false, message),
|
||||
};
|
||||
|
||||
// Define assertion functions so they look the same across all frameworks.
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* eslint-env mozilla/frame-script */
|
||||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const gfxFrameScript = {
|
||||
domUtils: null,
|
||||
|
@ -20,6 +20,7 @@ if (typeof Components != "undefined") {
|
||||
this.Primitives = Primitives;
|
||||
this.exports = {};
|
||||
} else if (typeof module != "undefined" && typeof require != "undefined") {
|
||||
/* global require:false */
|
||||
SharedAll = require("resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
|
||||
} else {
|
||||
throw new Error("Please load this module with Component.utils.import or with require()");
|
||||
@ -56,6 +57,7 @@ libxul.declareLazyFFI(Primitives, "maxCompressedSize",
|
||||
);
|
||||
|
||||
if (typeof module != "undefined") {
|
||||
/* global module:false */
|
||||
module.exports = {
|
||||
get compress() {
|
||||
return Primitives.compress;
|
||||
|
8
toolkit/components/microformats/.eslintrc.js
Normal file
8
toolkit/components/microformats/.eslintrc.js
Normal file
@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
"node": true,
|
||||
"amd": true,
|
||||
}
|
||||
};
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
// configuration
|
||||
var deployDir = "../"
|
||||
exportedSymbol = 'try {\n // mozilla jsm support\n Components.utils.importGlobalProperties(["URL"]);\n} catch(e) {}\nthis.EXPORTED_SYMBOLS = [\'Microformats\'];';
|
||||
var deployDir = "../";
|
||||
var exportedSymbol = 'try {\n // mozilla jsm support\n Components.utils.importGlobalProperties(["URL"]);\n} catch(e) {}\nthis.EXPORTED_SYMBOLS = [\'Microformats\'];';
|
||||
|
||||
|
||||
|
||||
|
7
toolkit/components/mozprotocol/tests/.eslintrc.js
Normal file
7
toolkit/components/mozprotocol/tests/.eslintrc.js
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"../../../../testing/mochitest/chrome.eslintrc.js"
|
||||
],
|
||||
};
|
@ -71,8 +71,10 @@ add_task(function* test_open_window_then_watch_it() {
|
||||
}
|
||||
|
||||
info(`Attempting to remove a performance listener incorrectly, check that this does not hurt our real listener`);
|
||||
Assert.throws(() => PerformanceWatcher.removePerformanceListener({addonId: addon.addonId}, () => {}));
|
||||
Assert.throws(() => PerformanceWatcher.removePerformanceListener({addonId: addon.addonId + "-unbound-id-" + Math.random()}, realListener.listener));
|
||||
Assert.throws(() => PerformanceWatcher.removePerformanceListener({windowId: burner.windowId}, () => {}),
|
||||
/No listener for target/, "should throw an error for a different listener");
|
||||
Assert.throws(() => PerformanceWatcher.removePerformanceListener({windowId: burner.windowId + "-unbound-id-" + Math.random()}, realListener.listener),
|
||||
/No listener for target/, "should throw an error for a different window id");
|
||||
|
||||
// Waiting a little – listeners are buffered.
|
||||
yield new Promise(resolve => setTimeout(resolve, 100));
|
||||
|
@ -1,3 +1,6 @@
|
||||
// This file is loaded into the browser window scope.
|
||||
/* eslint mozilla/import-browserjs-globals:"warn" */
|
||||
|
||||
// -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*-
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
|
7
toolkit/components/printing/tests/.eslintrc.js
Normal file
7
toolkit/components/printing/tests/.eslintrc.js
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"../../../../testing/mochitest/chrome.eslintrc.js"
|
||||
],
|
||||
};
|
@ -1,3 +1,6 @@
|
||||
// This file spawns content tasks.
|
||||
/* global content */
|
||||
|
||||
/**
|
||||
* Verify that if the page contents change after print preview is initialized,
|
||||
* and we re-initialize print preview (e.g. by changing page orientation),
|
||||
|
@ -2,6 +2,9 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// Defined in dialog.xml.
|
||||
/* globals centerWindowOnScreen:false, moveToAlertPosition:false */
|
||||
|
||||
var Ci = Components.interfaces;
|
||||
var Cr = Components.results;
|
||||
var Cc = Components.classes;
|
||||
|
@ -3,6 +3,10 @@
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!-- This file is imported into the browser window, and expects various variables,
|
||||
e.g. Ci, Services, to be available. -->
|
||||
<!-- eslint mozilla/import-browserjs-globals:"warn" -->
|
||||
|
||||
<!DOCTYPE bindings [
|
||||
<!ENTITY % commonDialogDTD SYSTEM "chrome://global/locale/commonDialog.dtd">
|
||||
<!ENTITY % dialogOverlayDTD SYSTEM "chrome://global/locale/dialogOverlay.dtd">
|
||||
|
@ -1,4 +1,6 @@
|
||||
/* eslint-env mozilla/frame-script */
|
||||
// assert is available to chrome scripts loaded via SpecialPowers.loadChromeScript.
|
||||
/* global assert */
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
|
@ -1,5 +1,10 @@
|
||||
// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
|
||||
|
||||
/* import-globals-from ../../../content/globalOverlay.js */
|
||||
/* import-globals-from ../../printing/content/printUtils.js */
|
||||
/* import-globals-from ../../../content/viewZoomOverlay.js */
|
||||
/* import-globals-from ../../../content/contentAreaUtils.js */
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
@ -16,6 +21,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
|
||||
"resource://gre/modules/Deprecated.jsm");
|
||||
|
||||
/* global gBrowser, gViewSourceBundle, gContextMenu */
|
||||
[
|
||||
["gBrowser", "content"],
|
||||
["gViewSourceBundle", "viewSourceBundle"],
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
module.exports = { // eslint-disable-line no-undef
|
||||
"extends": [
|
||||
"../../../../testing/mochitest/browser.eslintrc.js",
|
||||
"../../../../testing/mochitest/chrome.eslintrc.js",
|
||||
"../../../../testing/mochitest/mochitest.eslintrc.js",
|
||||
]
|
||||
};
|
||||
|
@ -238,6 +238,8 @@ add_task(function* test_new_remote_window_flags() {
|
||||
// as part of the TabChild, so we have to check those too.
|
||||
let b = win.gBrowser.selectedBrowser;
|
||||
let contentChromeFlags = yield ContentTask.spawn(b, null, function*() {
|
||||
// Content scripts provide docShell as a global.
|
||||
/* global docShell */
|
||||
docShell.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
try {
|
||||
// This will throw if we're not a remote browser.
|
||||
|
@ -2,6 +2,6 @@
|
||||
|
||||
module.exports = {
|
||||
"rules": {
|
||||
"no-undef": "off"
|
||||
"mozilla/import-browserjs-globals": "warn",
|
||||
}
|
||||
};
|
||||
|
@ -508,7 +508,7 @@ var snapshotFormatters = {
|
||||
if (crashGuards.length) {
|
||||
for (let guard of crashGuards) {
|
||||
let resetButton = $.new("button");
|
||||
onClickReset = function() {
|
||||
let onClickReset = function() {
|
||||
Services.prefs.setIntPref(guard.prefName, 0);
|
||||
resetButton.removeEventListener("click", onClickReset);
|
||||
resetButton.disabled = true;
|
||||
|
@ -37,6 +37,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script type="application/javascript">
|
||||
/* import-globals-from widgets/datepicker.js */
|
||||
// We need to hide the scroll bar but maintain its scrolling
|
||||
// capability, so using |overflow: hidden| is not an option.
|
||||
// Instead, we are inserting a user agent stylesheet that is
|
||||
@ -57,4 +58,4 @@
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -4,6 +4,9 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// Defined in dialog.xml.
|
||||
/* globals moveToAlertPosition */
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://gre/modules/FormHistory.jsm");
|
||||
|
||||
|
@ -22,7 +22,7 @@ function macWindowMenuDidShow() {
|
||||
|
||||
function toOpenWindow( aWindow ) {
|
||||
// deminiaturize the window, if it's in the Dock
|
||||
if (aWindow.windowState == STATE_MINIMIZED)
|
||||
if (aWindow.windowState == window.STATE_MINIMIZED)
|
||||
aWindow.restore();
|
||||
aWindow.document.commandDispatcher.focusedWindow.focus();
|
||||
}
|
||||
@ -40,7 +40,7 @@ function ShowWindowFromResource( node ) {
|
||||
}
|
||||
|
||||
function zoomWindow() {
|
||||
if (window.windowState == STATE_NORMAL)
|
||||
if (window.windowState == window.STATE_NORMAL)
|
||||
window.maximize();
|
||||
else
|
||||
window.restore();
|
||||
|
@ -23,7 +23,7 @@ function check_audio_onplay() {
|
||||
var audio = list[0];
|
||||
return new Promise((resolve, reject) => {
|
||||
audio.onplay = () => {
|
||||
ok(needToReceiveOnPlay, "Should not receive play event!");
|
||||
ok(false, "Should not receive play event!");
|
||||
this.onplay = null;
|
||||
reject();
|
||||
};
|
||||
|
@ -3,6 +3,8 @@
|
||||
const IMAGE_PAGE = "https://example.com/browser/toolkit/content/tests/browser/image_page.html";
|
||||
const PREF_UNSAFE_FORBIDDEN = "dom.ipc.cpows.forbid-unsafe-from-browser";
|
||||
|
||||
var MockFilePicker = SpecialPowers.MockFilePicker;
|
||||
|
||||
MockFilePicker.init(window);
|
||||
MockFilePicker.returnValue = MockFilePicker.returnCancel;
|
||||
|
||||
|
@ -95,6 +95,7 @@ function test() {
|
||||
}
|
||||
}
|
||||
|
||||
/* import-globals-from common/mockTransfer.js */
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://mochitests/content/browser/toolkit/content/tests/browser/common/mockTransfer.js",
|
||||
|
@ -18,7 +18,7 @@ var gPrefs = Cc["@mozilla.org/preferences-service;1"].
|
||||
// we know the mochitest harness kills off the profile when it's done.
|
||||
function copyToTemporaryFile(f) {
|
||||
let tmpd = gDirSvc.get("ProfD", Ci.nsIFile);
|
||||
tmpf = tmpd.clone();
|
||||
let tmpf = tmpd.clone();
|
||||
tmpf.append("temp.manifest");
|
||||
tmpf.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600);
|
||||
tmpf.remove(false);
|
||||
@ -68,7 +68,7 @@ function copyDirToTempProfile(path, subdirname) {
|
||||
|
||||
// The SimpleTest directory is hidden
|
||||
var files = Array.from(dirIter("file://" + rootDir));
|
||||
for (f in files) {
|
||||
for (let f in files) {
|
||||
files[f].copyTo(tmpdir, "");
|
||||
}
|
||||
return tmpdir;
|
||||
|
@ -1,3 +1,5 @@
|
||||
/* import-globals-from ../widgets/popup_shared.js */
|
||||
|
||||
var gMenuPopup = null;
|
||||
var gTrigger = null;
|
||||
var gIsMenu = false;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
/* import-globals-from file_autocomplete_with_composition.js */
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
@ -258,7 +258,7 @@ function runTest(event) {
|
||||
// it's timing depending if the <scale> things it's click-and-hold, or a
|
||||
// single click. So, just make sure we end up less that the previous
|
||||
// position.
|
||||
lastPosition = (videoDuration / 2) - 0.1;
|
||||
var lastPosition = (videoDuration / 2) - 0.1;
|
||||
ok(video.currentTime < lastPosition, "checking expected playback position");
|
||||
|
||||
// Set volume to 0.1 so one down arrow hit will decrease it to 0.
|
||||
|
@ -1,3 +1,9 @@
|
||||
// This file expects the following globals to be defined at various times.
|
||||
/* globals getCustomTreeViewCellInfo */
|
||||
|
||||
// This files relies on these specific Chrome/XBL globals
|
||||
/* globals TreeColumns, TreeColumn */
|
||||
|
||||
var columns_simpletree =
|
||||
[
|
||||
{ name: "name", label: "Name", key: true, properties: "one two" },
|
||||
|
@ -1,3 +1,6 @@
|
||||
// This file expects `tests` to have been declared in the global scope.
|
||||
/* global tests */
|
||||
|
||||
var RemoteCanvas = function(url, id) {
|
||||
this.url = url;
|
||||
this.id = id;
|
||||
|
@ -21,6 +21,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script type="application/javascript">
|
||||
/* import-globals-from widgets/timepicker.js */
|
||||
// We need to hide the scroll bar but maintain its scrolling
|
||||
// capability, so using |overflow: hidden| is not an option.
|
||||
// Instead, we are inserting a user agent stylesheet that is
|
||||
@ -33,4 +34,4 @@
|
||||
new TimePicker(document.getElementById("time-picker"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -401,7 +401,7 @@
|
||||
|
||||
<handler event="focus" phase="capturing">
|
||||
<![CDATA[
|
||||
if (!mIsPopup && this.getAttribute("focused") != "true") {
|
||||
if (!this.mIsPopup && this.getAttribute("focused") != "true") {
|
||||
this.setAttribute("focused", "true");
|
||||
document.addEventListener("keydown", this, true);
|
||||
if (this.mSelectedCell)
|
||||
@ -412,7 +412,7 @@
|
||||
|
||||
<handler event="blur" phase="capturing">
|
||||
<![CDATA[
|
||||
if (!mIsPopup && this.getAttribute("focused") == "true") {
|
||||
if (!this.mIsPopup && this.getAttribute("focused") == "true") {
|
||||
document.removeEventListener("keydown", this, true);
|
||||
this.removeAttribute("focused");
|
||||
this.resetHover();
|
||||
@ -559,4 +559,3 @@
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
||||
|
@ -2,6 +2,10 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* import-globals-from datekeeper.js */
|
||||
/* import-globals-from calendar.js */
|
||||
/* import-globals-from spinner.js */
|
||||
|
||||
"use strict";
|
||||
|
||||
function DatePicker(context) {
|
||||
|
@ -1051,7 +1051,7 @@
|
||||
this.EVENTS.forEach((eventName) => {
|
||||
this.removeEventListener(eventName, this, { mozSystemGroup: true });
|
||||
});
|
||||
this.removeEventListener("keypress", onKeyPress, {
|
||||
this.removeEventListener("keypress", this, {
|
||||
capture: true,
|
||||
mozSystemGroup: true
|
||||
});
|
||||
|
@ -1118,10 +1118,6 @@
|
||||
}
|
||||
|
||||
this._fireEvent("monthchange", this);
|
||||
if (this.hasAttribute("monthchange")) {
|
||||
var fn = new Function("event", aTarget.getAttribute("onmonthchange"));
|
||||
fn.call(aTarget, event);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -26,8 +26,8 @@
|
||||
this.l10n = {};
|
||||
const mozIntl = Components.classes["@mozilla.org/mozintl;1"]
|
||||
.getService(Components.interfaces.mozIMozIntl);
|
||||
mozIntl.addGetCalendarInfo(l10n);
|
||||
mozIntl.addGetDisplayNames(l10n);
|
||||
mozIntl.addGetCalendarInfo(this.l10n);
|
||||
mozIntl.addGetDisplayNames(this.l10n);
|
||||
]]></constructor>
|
||||
<method name="loadPicker">
|
||||
<parameter name="type"/>
|
||||
|
@ -4,6 +4,9 @@
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!-- This files relies on these specific Chrome/XBL globals -->
|
||||
<!-- globals ChromeNodeList -->
|
||||
|
||||
<bindings id="listboxBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
|
@ -3,6 +3,8 @@
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!-- This files relies on these specific Chrome/XBL globals -->
|
||||
<!-- globals PopupBoxObject -->
|
||||
|
||||
<bindings id="popupBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
|
@ -3,6 +3,9 @@
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!-- This files relies on these specific Chrome/XBL globals -->
|
||||
<!-- globals ChromeWindow -->
|
||||
|
||||
|
||||
<!DOCTYPE bindings [
|
||||
<!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd" >
|
||||
|
@ -2,6 +2,9 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* import-globals-from timekeeper.js */
|
||||
/* import-globals-from spinner.js */
|
||||
|
||||
"use strict";
|
||||
|
||||
function TimePicker(context) {
|
||||
|
@ -52,13 +52,13 @@
|
||||
// Look to see if there is a toolbarset.
|
||||
this.toolbarset = this.firstChild;
|
||||
while (this.toolbarset && this.toolbarset.localName != "toolbarset")
|
||||
this.toolbarset = toolbarset.nextSibling;
|
||||
this.toolbarset = this.toolbarset.nextSibling;
|
||||
|
||||
if (this.toolbarset) {
|
||||
// Create each toolbar described by the toolbarset.
|
||||
var index = 0;
|
||||
while (toolbarset.hasAttribute("toolbar" + (++index))) {
|
||||
var toolbarInfo = toolbarset.getAttribute("toolbar" + index);
|
||||
while (this.toolbarset.hasAttribute("toolbar" + (++index))) {
|
||||
var toolbarInfo = this.toolbarset.getAttribute("toolbar" + index);
|
||||
var infoSplit = toolbarInfo.split(":");
|
||||
this.appendCustomToolbar(infoSplit[0], infoSplit[1]);
|
||||
}
|
||||
@ -587,4 +587,3 @@
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
||||
|
@ -901,84 +901,84 @@
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveByOffset(-1, 0, event);
|
||||
this._moveByOffset(-1, 0, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_DOWN" modifiers="accel any">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveByOffset(1, this.view.rowCount - 1, event);
|
||||
this._moveByOffset(1, this.view.rowCount - 1, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_UP" modifiers="accel any, shift">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveByOffsetShift(-1, 0, event);
|
||||
this._moveByOffsetShift(-1, 0, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_DOWN" modifiers="accel any, shift">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveByOffsetShift(1, this.view.rowCount - 1, event);
|
||||
this._moveByOffsetShift(1, this.view.rowCount - 1, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_PAGE_UP" modifiers="accel any">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveByPage(-1, 0, event);
|
||||
this._moveByPage(-1, 0, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_PAGE_DOWN" modifiers="accel any">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveByPage(1, this.view.rowCount - 1, event);
|
||||
this._moveByPage(1, this.view.rowCount - 1, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_PAGE_UP" modifiers="accel any, shift">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveByPageShift(-1, 0, event);
|
||||
this._moveByPageShift(-1, 0, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_PAGE_DOWN" modifiers="accel any, shift">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveByPageShift(1, this.view.rowCount - 1, event);
|
||||
this._moveByPageShift(1, this.view.rowCount - 1, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_HOME" modifiers="accel any">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveToEdge(0, event);
|
||||
this._moveToEdge(0, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_END" modifiers="accel any">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveToEdge(this.view.rowCount - 1, event);
|
||||
this._moveToEdge(this.view.rowCount - 1, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_HOME" modifiers="accel any, shift">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveToEdgeShift(0, event);
|
||||
this._moveToEdgeShift(0, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keydown" keycode="VK_END" modifiers="accel any, shift">
|
||||
<![CDATA[
|
||||
if (this._editingColumn)
|
||||
return;
|
||||
_moveToEdgeShift(this.view.rowCount - 1, event);
|
||||
this._moveToEdgeShift(this.view.rowCount - 1, event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keypress">
|
||||
|
@ -970,19 +970,19 @@
|
||||
_showControlsTimeout : 0,
|
||||
SHOW_CONTROLS_TIMEOUT_MS: 500,
|
||||
_showControlsFn() {
|
||||
if (Utils.video.matches("video:hover")) {
|
||||
Utils.startFadeIn(Utils.controlBar, false);
|
||||
Utils._showControlsTimeout = 0;
|
||||
Utils._controlsHiddenByTimeout = false;
|
||||
if (this.Utils.video.matches("video:hover")) {
|
||||
this.Utils.startFadeIn(this.Utils.controlBar, false);
|
||||
this.Utils._showControlsTimeout = 0;
|
||||
this.Utils._controlsHiddenByTimeout = false;
|
||||
}
|
||||
},
|
||||
|
||||
_hideControlsTimeout : 0,
|
||||
_hideControlsFn() {
|
||||
if (!Utils.scrubber.isDragging) {
|
||||
Utils.startFade(Utils.controlBar, false);
|
||||
Utils._hideControlsTimeout = 0;
|
||||
Utils._controlsHiddenByTimeout = true;
|
||||
if (!this.Utils.scrubber.isDragging) {
|
||||
this.Utils.startFade(this.Utils.controlBar, false);
|
||||
this.Utils._hideControlsTimeout = 0;
|
||||
this.Utils._controlsHiddenByTimeout = true;
|
||||
}
|
||||
},
|
||||
HIDE_CONTROLS_TIMEOUT_MS : 2000,
|
||||
@ -1067,7 +1067,7 @@
|
||||
this.startFadeOut(this.controlBar, false);
|
||||
this.textTrackList.setAttribute("hidden", "true");
|
||||
clearTimeout(this._showControlsTimeout);
|
||||
Utils._controlsHiddenByTimeout = false;
|
||||
this.Utils._controlsHiddenByTimeout = false;
|
||||
}
|
||||
},
|
||||
|
||||
@ -1231,7 +1231,7 @@
|
||||
|
||||
onFullscreenChange() {
|
||||
if (this.isVideoInFullScreen()) {
|
||||
Utils._hideControlsTimeout = setTimeout(this._hideControlsFn, this.HIDE_CONTROLS_TIMEOUT_MS);
|
||||
this.Utils._hideControlsTimeout = setTimeout(this._hideControlsFn, this.HIDE_CONTROLS_TIMEOUT_MS);
|
||||
}
|
||||
this.setFullscreenButtonState();
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user