зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central into mozilla-inbound.
This commit is contained in:
Коммит
870b77f6eb
|
@ -1038,6 +1038,18 @@ pref("devtools.hud.height", 0);
|
|||
// window - in a separate window/popup panel.
|
||||
pref("devtools.webconsole.position", "above");
|
||||
|
||||
// Remember the Web Console filters
|
||||
pref("devtools.webconsole.filter.network", true);
|
||||
pref("devtools.webconsole.filter.networkinfo", true);
|
||||
pref("devtools.webconsole.filter.csserror", true);
|
||||
pref("devtools.webconsole.filter.cssparser", true);
|
||||
pref("devtools.webconsole.filter.exception", true);
|
||||
pref("devtools.webconsole.filter.jswarn", true);
|
||||
pref("devtools.webconsole.filter.error", true);
|
||||
pref("devtools.webconsole.filter.warn", true);
|
||||
pref("devtools.webconsole.filter.info", true);
|
||||
pref("devtools.webconsole.filter.log", true);
|
||||
|
||||
// The number of lines that are displayed in the web console for the Net,
|
||||
// CSS, JS and Web Developer categories.
|
||||
pref("devtools.hud.loglimit.network", 200);
|
||||
|
|
|
@ -241,8 +241,20 @@
|
|||
#endif
|
||||
<key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
|
||||
<key id="key_errorConsole" key="&errorConsoleCmd.commandkey;" oncommand="toJavaScriptConsole();" modifiers="accel,shift" disabled="true"/>
|
||||
<key id="key_webConsole" key="&webConsoleCmd.commandkey;" oncommand="HUDConsoleUI.toggleHUD();" modifiers="accel,shift"/>
|
||||
<key id="key_inspect" key="&inspectMenu.commandkey;" command="Tools:Inspect" modifiers="accel,shift"/>
|
||||
<key id="key_webConsole" key="&webConsoleCmd.commandkey;" oncommand="HUDConsoleUI.toggleHUD();"
|
||||
#ifdef XP_MACOSX
|
||||
modifiers="accel,alt"
|
||||
#else
|
||||
modifiers="accel,shift"
|
||||
#endif
|
||||
/>
|
||||
<key id="key_inspect" key="&inspectMenu.commandkey;" command="Tools:Inspect"
|
||||
#ifdef XP_MACOSX
|
||||
modifiers="accel,alt"
|
||||
#else
|
||||
modifiers="accel,shift"
|
||||
#endif
|
||||
/>
|
||||
<key id="key_scratchpad" keycode="&scratchpad.keycode;" modifiers="shift"
|
||||
keytext="&scratchpad.keytext;" command="Tools:Scratchpad"/>
|
||||
<key id="key_styleeditor" keycode="&styleeditor.keycode;" modifiers="shift"
|
||||
|
|
|
@ -418,7 +418,7 @@ nsContextMenu.prototype = {
|
|||
this.showItem("context-media-unmute", onMedia && this.target.muted);
|
||||
this.showItem("context-media-showcontrols", onMedia && !this.target.controls);
|
||||
this.showItem("context-media-hidecontrols", onMedia && this.target.controls);
|
||||
this.showItem("context-video-fullscreen", this.onVideo);
|
||||
this.showItem("context-video-fullscreen", this.onVideo && this.target.ownerDocument.mozFullScreenElement == null);
|
||||
var statsShowing = this.onVideo && this.target.wrappedJSObject.mozMediaStatisticsShowing;
|
||||
this.showItem("context-video-showstats", this.onVideo && this.target.controls && !statsShowing);
|
||||
this.showItem("context-video-hidestats", this.onVideo && this.target.controls && statsShowing);
|
||||
|
@ -859,10 +859,15 @@ nsContextMenu.prototype = {
|
|||
},
|
||||
|
||||
fullScreenVideo: function () {
|
||||
this.target.pause();
|
||||
|
||||
openDialog("chrome://browser/content/fullscreen-video.xhtml",
|
||||
"", "chrome,centerscreen,dialog=no", this.target);
|
||||
let video = this.target;
|
||||
if (document.mozFullScreenEnabled)
|
||||
video.mozRequestFullScreen();
|
||||
else {
|
||||
// Fallback for the legacy full-screen video implementation.
|
||||
video.pause();
|
||||
openDialog("chrome://browser/content/fullscreen-video.xhtml",
|
||||
"", "chrome,centerscreen,dialog=no", video);
|
||||
}
|
||||
},
|
||||
|
||||
// Change current window to the URL of the background image.
|
||||
|
|
|
@ -66,6 +66,9 @@ const SCRATCHPAD_CONTEXT_CONTENT = 1;
|
|||
const SCRATCHPAD_CONTEXT_BROWSER = 2;
|
||||
const SCRATCHPAD_L10N = "chrome://browser/locale/devtools/scratchpad.properties";
|
||||
const DEVTOOLS_CHROME_ENABLED = "devtools.chrome.enabled";
|
||||
const BUTTON_POSITION_SAVE = 0;
|
||||
const BUTTON_POSITION_CANCEL = 1;
|
||||
const BUTTON_POSITION_DONT_SAVE = 2;
|
||||
|
||||
/**
|
||||
* The scratchpad object handles the Scratchpad window functionality.
|
||||
|
@ -601,22 +604,34 @@ var Scratchpad = {
|
|||
|
||||
/**
|
||||
* Save the textbox content to the currently open file.
|
||||
*
|
||||
* @param function aCallback
|
||||
* Optional function you want to call when file is saved
|
||||
*/
|
||||
saveFile: function SP_saveFile()
|
||||
saveFile: function SP_saveFile(aCallback)
|
||||
{
|
||||
if (!this.filename) {
|
||||
return this.saveFileAs();
|
||||
return this.saveFileAs(aCallback);
|
||||
}
|
||||
|
||||
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(this.filename);
|
||||
this.exportToFile(file, true, false, this.onTextSaved.bind(this));
|
||||
|
||||
this.exportToFile(file, true, false, function(aStatus) {
|
||||
this.onTextSaved();
|
||||
if (aCallback) {
|
||||
aCallback(aStatus);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Save the textbox content to a new file.
|
||||
*
|
||||
* @param function aCallback
|
||||
* Optional function you want to call when file is saved
|
||||
*/
|
||||
saveFileAs: function SP_saveFileAs()
|
||||
saveFileAs: function SP_saveFileAs(aCallback)
|
||||
{
|
||||
let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
|
||||
fp.init(window, this.strings.GetStringFromName("saveFileAs"),
|
||||
|
@ -624,7 +639,13 @@ var Scratchpad = {
|
|||
fp.defaultString = "scratchpad.js";
|
||||
if (fp.show() != Ci.nsIFilePicker.returnCancel) {
|
||||
this.setFilename(fp.file.path);
|
||||
this.exportToFile(fp.file, true, false, this.onTextSaved.bind(this));
|
||||
|
||||
this.exportToFile(fp.file, true, false, function(aStatus) {
|
||||
this.onTextSaved();
|
||||
if (aCallback) {
|
||||
aCallback(aStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -845,6 +866,9 @@ var Scratchpad = {
|
|||
if (aStatus && !Components.isSuccessCode(aStatus)) {
|
||||
return;
|
||||
}
|
||||
if (!document) {
|
||||
return; // file saved to disk after window has closed
|
||||
}
|
||||
document.title = document.title.replace(/^\*/, "");
|
||||
this.saved = true;
|
||||
this.editor.addEventListener(SourceEditor.EVENTS.TEXT_CHANGED,
|
||||
|
@ -882,6 +906,66 @@ var Scratchpad = {
|
|||
this.editor = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Prompt to save scratchpad if it has unsaved changes.
|
||||
*
|
||||
* @param function aCallback
|
||||
* Optional function you want to call when file is saved
|
||||
* @return boolean
|
||||
* Whether the window should be closed
|
||||
*/
|
||||
promptSave: function SP_promptSave(aCallback)
|
||||
{
|
||||
if (this.filename && !this.saved) {
|
||||
let ps = Services.prompt;
|
||||
let flags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_SAVE +
|
||||
ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL +
|
||||
ps.BUTTON_POS_2 * ps.BUTTON_TITLE_DONT_SAVE;
|
||||
|
||||
let button = ps.confirmEx(window,
|
||||
this.strings.GetStringFromName("confirmClose.title"),
|
||||
this.strings.GetStringFromName("confirmClose"),
|
||||
flags, null, null, null, null, {});
|
||||
|
||||
if (button == BUTTON_POSITION_CANCEL) {
|
||||
return false;
|
||||
}
|
||||
if (button == BUTTON_POSITION_SAVE) {
|
||||
this.saveFile(aCallback);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Handler for window close event. Prompts to save scratchpad if
|
||||
* there are unsaved changes.
|
||||
*
|
||||
* @param nsIDOMEvent aEvent
|
||||
*/
|
||||
onClose: function SP_onClose(aEvent)
|
||||
{
|
||||
let toClose = this.promptSave();
|
||||
if (!toClose) {
|
||||
aEvent.preventDefault();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Close the scratchpad window. Prompts before closing if the scratchpad
|
||||
* has unsaved changes.
|
||||
*
|
||||
* @param function aCallback
|
||||
* Optional function you want to call when file is saved
|
||||
*/
|
||||
close: function SP_close(aCallback)
|
||||
{
|
||||
let toClose = this.promptSave(aCallback);
|
||||
if (toClose) {
|
||||
window.close();
|
||||
}
|
||||
},
|
||||
|
||||
_observers: [],
|
||||
|
||||
/**
|
||||
|
@ -951,3 +1035,4 @@ XPCOMUtils.defineLazyGetter(Scratchpad, "strings", function () {
|
|||
|
||||
addEventListener("DOMContentLoaded", Scratchpad.onLoad.bind(Scratchpad), false);
|
||||
addEventListener("unload", Scratchpad.onUnload.bind(Scratchpad), false);
|
||||
addEventListener("close", Scratchpad.onClose.bind(Scratchpad), false);
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<command id="sp-cmd-printFile" oncommand="Scratchpad.printFile();" disabled="true"/>
|
||||
-->
|
||||
|
||||
<command id="sp-cmd-close" oncommand="window.close();"/>
|
||||
<command id="sp-cmd-close" oncommand="Scratchpad.close();"/>
|
||||
<command id="sp-cmd-run" oncommand="Scratchpad.run();"/>
|
||||
<command id="sp-cmd-inspect" oncommand="Scratchpad.inspect();"/>
|
||||
<command id="sp-cmd-display" oncommand="Scratchpad.display();"/>
|
||||
|
|
|
@ -59,6 +59,7 @@ _BROWSER_TEST_FILES = \
|
|||
browser_scratchpad_bug_699130_edit_ui_updates.js \
|
||||
browser_scratchpad_bug_669612_unsaved.js \
|
||||
head.js \
|
||||
browser_scratchpad_bug_653427_confirm_close.js \
|
||||
|
||||
libs:: $(_BROWSER_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
|
||||
|
|
|
@ -0,0 +1,188 @@
|
|||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
// only finish() when correct number of tests are done
|
||||
const expected = 5;
|
||||
var count = 0;
|
||||
function done()
|
||||
{
|
||||
if (++count == expected) {
|
||||
cleanup();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
var ScratchpadManager = Scratchpad.ScratchpadManager;
|
||||
var gFile;
|
||||
|
||||
var oldPrompt = Services.prompt;
|
||||
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
|
||||
gFile = createTempFile("fileForBug653427.tmp");
|
||||
writeFile(gFile, "text", testUnsaved.call(this));
|
||||
|
||||
testNew();
|
||||
testSavedFile();
|
||||
|
||||
content.location = "data:text/html,<p>test scratchpad save file prompt on closing";
|
||||
}
|
||||
|
||||
function testNew()
|
||||
{
|
||||
let win = ScratchpadManager.openScratchpad();
|
||||
|
||||
win.addEventListener("load", function() {
|
||||
win.Scratchpad.close();
|
||||
|
||||
ok(win.closed, "new scratchpad window should close without prompting")
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
function testSavedFile()
|
||||
{
|
||||
let win = ScratchpadManager.openScratchpad();
|
||||
|
||||
win.addEventListener("load", function() {
|
||||
win.Scratchpad.filename = "test.js";
|
||||
win.Scratchpad.saved = true;
|
||||
win.Scratchpad.close();
|
||||
|
||||
ok(win.closed, "scratchpad from file with no changes should close")
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
function testUnsaved()
|
||||
{
|
||||
testUnsavedFileCancel();
|
||||
testUnsavedFileSave();
|
||||
testUnsavedFileDontSave();
|
||||
}
|
||||
|
||||
function testUnsavedFileCancel()
|
||||
{
|
||||
let win = ScratchpadManager.openScratchpad();
|
||||
|
||||
win.addEventListener("load", function() {
|
||||
win.Scratchpad.filename = "test.js";
|
||||
win.Scratchpad.saved = false;
|
||||
|
||||
Services.prompt = {
|
||||
confirmEx: function() {
|
||||
return win.BUTTON_POSITION_CANCEL;
|
||||
}
|
||||
}
|
||||
|
||||
win.Scratchpad.close();
|
||||
|
||||
ok(!win.closed, "cancelling dialog shouldn't close scratchpad");
|
||||
|
||||
win.close();
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
function testUnsavedFileSave()
|
||||
{
|
||||
let win = ScratchpadManager.openScratchpad();
|
||||
|
||||
win.addEventListener("load", function() {
|
||||
win.Scratchpad.importFromFile(gFile, true, function(status, content) {
|
||||
win.Scratchpad.filename = gFile.path;
|
||||
win.Scratchpad.onTextSaved();
|
||||
|
||||
let text = "new text";
|
||||
win.Scratchpad.setText(text);
|
||||
|
||||
Services.prompt = {
|
||||
confirmEx: function() {
|
||||
return win.BUTTON_POSITION_SAVE;
|
||||
}
|
||||
}
|
||||
|
||||
win.Scratchpad.close(function() {
|
||||
readFile(gFile, function(savedContent) {
|
||||
is(savedContent, text, 'prompted "Save" worked when closing scratchpad');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
ok(win.closed, 'pressing "Save" in dialog should close scratchpad');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function testUnsavedFileDontSave()
|
||||
{
|
||||
let win = ScratchpadManager.openScratchpad();
|
||||
|
||||
win.addEventListener("load", function() {
|
||||
win.Scratchpad.filename = gFile.path;
|
||||
win.Scratchpad.saved = false;
|
||||
|
||||
Services.prompt = {
|
||||
confirmEx: function() {
|
||||
return win.BUTTON_POSITION_DONT_SAVE;
|
||||
}
|
||||
}
|
||||
|
||||
win.Scratchpad.close();
|
||||
|
||||
ok(win.closed, 'pressing "Don\'t Save" in dialog should close scratchpad');
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
function cleanup()
|
||||
{
|
||||
Services.prompt = oldPrompt;
|
||||
gFile.remove(false);
|
||||
gFile = null;
|
||||
}
|
||||
|
||||
function createTempFile(name)
|
||||
{
|
||||
let file = FileUtils.getFile("TmpD", [name]);
|
||||
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666);
|
||||
file.QueryInterface(Ci.nsILocalFile)
|
||||
return file;
|
||||
}
|
||||
|
||||
function writeFile(file, content, callback)
|
||||
{
|
||||
let fout = Cc["@mozilla.org/network/file-output-stream;1"].
|
||||
createInstance(Ci.nsIFileOutputStream);
|
||||
fout.init(file.QueryInterface(Ci.nsILocalFile), 0x02 | 0x08 | 0x20,
|
||||
0644, fout.DEFER_OPEN);
|
||||
|
||||
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
|
||||
createInstance(Ci.nsIScriptableUnicodeConverter);
|
||||
converter.charset = "UTF-8";
|
||||
let fileContentStream = converter.convertToInputStream(content);
|
||||
|
||||
NetUtil.asyncCopy(fileContentStream, fout, callback);
|
||||
}
|
||||
|
||||
function readFile(file, callback)
|
||||
{
|
||||
let channel = NetUtil.newChannel(file);
|
||||
channel.contentType = "application/javascript";
|
||||
|
||||
NetUtil.asyncFetch(channel, function(inputStream, status) {
|
||||
ok(Components.isSuccessCode(status),
|
||||
"file was read successfully");
|
||||
|
||||
let content = NetUtil.readInputStreamToString(inputStream,
|
||||
inputStream.available());
|
||||
callback(content);
|
||||
});
|
||||
}
|
|
@ -1638,6 +1638,7 @@ HUD_SERVICE.prototype =
|
|||
{
|
||||
this.filterPrefs[aHUDId][aToggleType] = aState;
|
||||
this.adjustVisibilityForMessageType(aHUDId, aToggleType, aState);
|
||||
Services.prefs.setBoolPref(PREFS_PREFIX + aToggleType, aState);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -6289,18 +6290,17 @@ HeadsUpDisplayUICommands = {
|
|||
// Adjust the state of the button appropriately.
|
||||
let menuPopup = this.parentNode;
|
||||
|
||||
let allChecked = true;
|
||||
let someChecked = false;
|
||||
let menuItem = menuPopup.firstChild;
|
||||
while (menuItem) {
|
||||
if (menuItem.getAttribute("checked") !== "true") {
|
||||
allChecked = false;
|
||||
if (menuItem.getAttribute("checked") === "true") {
|
||||
someChecked = true;
|
||||
break;
|
||||
}
|
||||
menuItem = menuItem.nextSibling;
|
||||
}
|
||||
|
||||
let toolbarButton = menuPopup.parentNode;
|
||||
toolbarButton.setAttribute("checked", allChecked);
|
||||
toolbarButton.setAttribute("checked", someChecked);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -6338,8 +6338,7 @@ HeadsUpDisplayUICommands = {
|
|||
var prefs = Services.prefs;
|
||||
|
||||
const GLOBAL_STORAGE_INDEX_ID = "GLOBAL_CONSOLE";
|
||||
const PREFS_BRANCH_PREF = "devtools.hud.display.filter";
|
||||
const PREFS_PREFIX = "devtools.hud.display.filter.";
|
||||
const PREFS_PREFIX = "devtools.webconsole.filter.";
|
||||
const PREFS = { network: PREFS_PREFIX + "network",
|
||||
networkinfo: PREFS_PREFIX + "networkinfo",
|
||||
csserror: PREFS_PREFIX + "csserror",
|
||||
|
@ -6350,7 +6349,6 @@ const PREFS = { network: PREFS_PREFIX + "network",
|
|||
info: PREFS_PREFIX + "info",
|
||||
warn: PREFS_PREFIX + "warn",
|
||||
log: PREFS_PREFIX + "log",
|
||||
global: PREFS_PREFIX + "global",
|
||||
};
|
||||
|
||||
function ConsoleStorage()
|
||||
|
@ -6365,89 +6363,22 @@ function ConsoleStorage()
|
|||
// TODO: need to create a method that truncates the message
|
||||
// see bug 570543
|
||||
|
||||
// store an index of display prefs
|
||||
this.displayPrefs = {};
|
||||
|
||||
// check prefs for existence, create & load if absent, load them if present
|
||||
let filterPrefs;
|
||||
let defaultDisplayPrefs;
|
||||
|
||||
try {
|
||||
filterPrefs = prefs.getBoolPref(PREFS_BRANCH_PREF);
|
||||
}
|
||||
catch (ex) {
|
||||
filterPrefs = false;
|
||||
}
|
||||
|
||||
// TODO: for FINAL release,
|
||||
// use the sitePreferencesService to save specific site prefs
|
||||
// see bug 570545
|
||||
|
||||
if (filterPrefs) {
|
||||
defaultDisplayPrefs = {
|
||||
network: (prefs.getBoolPref(PREFS.network) ? true: false),
|
||||
networkinfo: (prefs.getBoolPref(PREFS.networkinfo) ? true: false),
|
||||
csserror: (prefs.getBoolPref(PREFS.csserror) ? true: false),
|
||||
cssparser: (prefs.getBoolPref(PREFS.cssparser) ? true: false),
|
||||
exception: (prefs.getBoolPref(PREFS.exception) ? true: false),
|
||||
jswarn: (prefs.getBoolPref(PREFS.jswarn) ? true: false),
|
||||
error: (prefs.getBoolPref(PREFS.error) ? true: false),
|
||||
info: (prefs.getBoolPref(PREFS.info) ? true: false),
|
||||
warn: (prefs.getBoolPref(PREFS.warn) ? true: false),
|
||||
log: (prefs.getBoolPref(PREFS.log) ? true: false),
|
||||
global: (prefs.getBoolPref(PREFS.global) ? true: false),
|
||||
};
|
||||
}
|
||||
else {
|
||||
prefs.setBoolPref(PREFS_BRANCH_PREF, false);
|
||||
// default prefs for each HeadsUpDisplay
|
||||
prefs.setBoolPref(PREFS.network, true);
|
||||
prefs.setBoolPref(PREFS.networkinfo, true);
|
||||
prefs.setBoolPref(PREFS.csserror, true);
|
||||
prefs.setBoolPref(PREFS.cssparser, true);
|
||||
prefs.setBoolPref(PREFS.exception, true);
|
||||
prefs.setBoolPref(PREFS.jswarn, true);
|
||||
prefs.setBoolPref(PREFS.error, true);
|
||||
prefs.setBoolPref(PREFS.info, true);
|
||||
prefs.setBoolPref(PREFS.warn, true);
|
||||
prefs.setBoolPref(PREFS.log, true);
|
||||
prefs.setBoolPref(PREFS.global, false);
|
||||
|
||||
defaultDisplayPrefs = {
|
||||
network: prefs.getBoolPref(PREFS.network),
|
||||
networkinfo: prefs.getBoolPref(PREFS.networkinfo),
|
||||
csserror: prefs.getBoolPref(PREFS.csserror),
|
||||
cssparser: prefs.getBoolPref(PREFS.cssparser),
|
||||
exception: prefs.getBoolPref(PREFS.exception),
|
||||
jswarn: prefs.getBoolPref(PREFS.jswarn),
|
||||
error: prefs.getBoolPref(PREFS.error),
|
||||
info: prefs.getBoolPref(PREFS.info),
|
||||
warn: prefs.getBoolPref(PREFS.warn),
|
||||
log: prefs.getBoolPref(PREFS.log),
|
||||
global: prefs.getBoolPref(PREFS.global),
|
||||
};
|
||||
}
|
||||
this.defaultDisplayPrefs = defaultDisplayPrefs;
|
||||
this.defaultDisplayPrefs = {
|
||||
network: prefs.getBoolPref(PREFS.network),
|
||||
networkinfo: prefs.getBoolPref(PREFS.networkinfo),
|
||||
csserror: prefs.getBoolPref(PREFS.csserror),
|
||||
cssparser: prefs.getBoolPref(PREFS.cssparser),
|
||||
exception: prefs.getBoolPref(PREFS.exception),
|
||||
jswarn: prefs.getBoolPref(PREFS.jswarn),
|
||||
error: prefs.getBoolPref(PREFS.error),
|
||||
info: prefs.getBoolPref(PREFS.info),
|
||||
warn: prefs.getBoolPref(PREFS.warn),
|
||||
log: prefs.getBoolPref(PREFS.log),
|
||||
};
|
||||
}
|
||||
|
||||
ConsoleStorage.prototype = {
|
||||
|
||||
updateDefaultDisplayPrefs:
|
||||
function CS_updateDefaultDisplayPrefs(aPrefsObject) {
|
||||
prefs.setBoolPref(PREFS.network, (aPrefsObject.network ? true : false));
|
||||
prefs.setBoolPref(PREFS.networkinfo,
|
||||
(aPrefsObject.networkinfo ? true : false));
|
||||
prefs.setBoolPref(PREFS.csserror, (aPrefsObject.csserror ? true : false));
|
||||
prefs.setBoolPref(PREFS.cssparser, (aPrefsObject.cssparser ? true : false));
|
||||
prefs.setBoolPref(PREFS.exception, (aPrefsObject.exception ? true : false));
|
||||
prefs.setBoolPref(PREFS.jswarn, (aPrefsObject.jswarn ? true : false));
|
||||
prefs.setBoolPref(PREFS.error, (aPrefsObject.error ? true : false));
|
||||
prefs.setBoolPref(PREFS.info, (aPrefsObject.info ? true : false));
|
||||
prefs.setBoolPref(PREFS.warn, (aPrefsObject.warn ? true : false));
|
||||
prefs.setBoolPref(PREFS.log, (aPrefsObject.log ? true : false));
|
||||
prefs.setBoolPref(PREFS.global, (aPrefsObject.global ? true : false));
|
||||
},
|
||||
|
||||
sequenceId: function CS_sequencerId()
|
||||
{
|
||||
if (!this.sequencer) {
|
||||
|
|
|
@ -150,6 +150,7 @@ _BROWSER_TEST_FILES = \
|
|||
browser_gcli_require.js \
|
||||
browser_gcli_web.js \
|
||||
browser_webconsole_bug_658368_time_methods.js \
|
||||
browser_webconsole_bug_622303_persistent_filters.js \
|
||||
head.js \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -27,15 +27,14 @@ function onContentLoaded()
|
|||
|
||||
executeSoon(
|
||||
function (){
|
||||
HUDService.setFilterState(hudId, "cssparser", false);
|
||||
|
||||
let msg = "the unknown CSS property warning is not displayed, " +
|
||||
"after filtering";
|
||||
testLogEntry(outputNode, "foobarCssParser", msg, true, true);
|
||||
|
||||
HUDService.setFilterState(hudId, "cssparser", true);
|
||||
finishTest();
|
||||
}
|
||||
);
|
||||
|
||||
finishTest();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -54,6 +54,9 @@ function tabReload(aEvent) {
|
|||
ok(scrollBox.scrollTop >= scrollBox.scrollHeight - scrollBox.clientHeight -
|
||||
nodeHeight * 2, "scroll location is correct");
|
||||
|
||||
HUDService.setFilterState(hud.hudId, "network", true);
|
||||
HUDService.setFilterState(hud.hudId, "networkinfo", true);
|
||||
|
||||
executeSoon(finishTest);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,17 +59,17 @@ function testMenuFilterButton(aCategory) {
|
|||
ok(isChecked(button), "the button for category " + aCategory + " is " +
|
||||
"checked after turning on all its menu items");
|
||||
|
||||
// Turn one filter off; make sure the button is no longer checked.
|
||||
// Turn one filter off; make sure the button is still checked.
|
||||
prefKey = firstMenuItem.getAttribute("prefKey");
|
||||
chooseMenuItem(firstMenuItem);
|
||||
ok(!isChecked(firstMenuItem), "the first menu item for category " +
|
||||
aCategory + " is no longer checked after clicking it");
|
||||
ok(!HUDService.filterPrefs[hudId][prefKey], prefKey + " messages are " +
|
||||
"turned off after clicking the appropriate menu item");
|
||||
ok(!isChecked(button), "the button for category " + aCategory + " is no " +
|
||||
"longer checked after turning off its first menu item");
|
||||
ok(isChecked(button), "the button for category " + aCategory + " is still " +
|
||||
"checked after turning off its first menu item");
|
||||
|
||||
// Turn all the filters on by clicking the main part of the button.
|
||||
// Turn all the filters off by clicking the main part of the button.
|
||||
let anonymousNodes = document.getAnonymousNodes(button);
|
||||
let subbutton;
|
||||
for (let i = 0; i < anonymousNodes.length; i++) {
|
||||
|
@ -82,23 +82,8 @@ function testMenuFilterButton(aCategory) {
|
|||
ok(subbutton, "we have the subbutton for category " + aCategory);
|
||||
|
||||
clickButton(subbutton);
|
||||
ok(isChecked(button), "the button for category " + aCategory + " is " +
|
||||
"checked after clicking its main part");
|
||||
|
||||
menuItem = firstMenuItem;
|
||||
while (menuItem) {
|
||||
let prefKey = menuItem.getAttribute("prefKey");
|
||||
ok(isChecked(menuItem), "menu item " + prefKey + " for category " +
|
||||
aCategory + " is checked after clicking the button");
|
||||
ok(HUDService.filterPrefs[hudId][prefKey], prefKey + " messages are " +
|
||||
"on after clicking the button");
|
||||
menuItem = menuItem.nextSibling;
|
||||
}
|
||||
|
||||
// Turn all the filters off by clicking the main part of the button.
|
||||
clickButton(subbutton);
|
||||
ok(!isChecked(subbutton), "the button for category " + aCategory + " is " +
|
||||
"no longer checked after clicking it");
|
||||
ok(!isChecked(button), "the button for category " + aCategory + " is " +
|
||||
"no longer checked after clicking its main part");
|
||||
|
||||
menuItem = firstMenuItem;
|
||||
while (menuItem) {
|
||||
|
@ -110,6 +95,32 @@ function testMenuFilterButton(aCategory) {
|
|||
menuItem = menuItem.nextSibling;
|
||||
}
|
||||
|
||||
// Turn all the filters on by clicking the main part of the button.
|
||||
clickButton(subbutton);
|
||||
|
||||
ok(isChecked(button), "the button for category " + aCategory + " is " +
|
||||
"checked after clicking its main part");
|
||||
|
||||
menuItem = firstMenuItem;
|
||||
while (menuItem) {
|
||||
let prefKey = menuItem.getAttribute("prefKey");
|
||||
ok(isChecked(menuItem), "menu item " + prefKey + " for category " +
|
||||
aCategory + " is checked after clicking the button");
|
||||
ok(HUDService.filterPrefs[hudId][prefKey], prefKey + " messages are " +
|
||||
"on after clicking the button");
|
||||
menuItem = menuItem.nextSibling;
|
||||
}
|
||||
|
||||
// Uncheck the main button by unchecking all the filters
|
||||
menuItem = firstMenuItem;
|
||||
while (menuItem) {
|
||||
chooseMenuItem(menuItem);
|
||||
menuItem = menuItem.nextSibling;
|
||||
}
|
||||
|
||||
ok(!isChecked(button), "the button for category " + aCategory + " is " +
|
||||
"unchecked after unchecking all its filters");
|
||||
|
||||
// Turn all the filters on again by clicking the button.
|
||||
clickButton(subbutton);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
let prefService = Services.prefs;
|
||||
let prefs = [
|
||||
"network",
|
||||
"networkinfo",
|
||||
"csserror",
|
||||
"cssparser",
|
||||
"exception",
|
||||
"jswarn",
|
||||
"error",
|
||||
"warn",
|
||||
"info",
|
||||
"log"
|
||||
];
|
||||
|
||||
//Set all prefs to true
|
||||
prefs.forEach(function(pref) {
|
||||
prefService.setBoolPref("devtools.webconsole.filter." + pref, true);
|
||||
});
|
||||
|
||||
addTab("about:blank");
|
||||
openConsole();
|
||||
|
||||
let hud = HUDService.getHudByWindow(content);
|
||||
let hudId = HUDService.getHudIdByWindow(content);
|
||||
|
||||
//Check if the filters menuitems exists and is checked
|
||||
prefs.forEach(function(pref) {
|
||||
let checked = hud.HUDBox.querySelector("menuitem[prefKey=" + pref + "]").
|
||||
getAttribute("checked");
|
||||
is(checked, "true", "menuitem for " + pref + " exists and is checked");
|
||||
});
|
||||
|
||||
//Set all prefs to false
|
||||
prefs.forEach(function(pref) {
|
||||
HUDService.setFilterState(hudId, pref, false);
|
||||
});
|
||||
|
||||
//Re-init the console
|
||||
closeConsole();
|
||||
openConsole();
|
||||
|
||||
hud = HUDService.getHudByWindow(content);
|
||||
|
||||
//Check if filters menuitems exists and are unchecked
|
||||
prefs.forEach(function(pref) {
|
||||
let checked = hud.HUDBox.querySelector("menuitem[prefKey=" + pref + "]").
|
||||
getAttribute("checked");
|
||||
is(checked, "false", "menuitem for " + pref + " exists and is not checked");
|
||||
prefService.clearUserPref("devtools.webconsole.filter." + pref);
|
||||
});
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
|
||||
finish();
|
||||
}
|
|
@ -429,14 +429,23 @@ can reach it easily. -->
|
|||
<!ENTITY thisFrameMenu.accesskey "h">
|
||||
|
||||
<!-- Media (video/audio) controls -->
|
||||
<!-- LOCALIZATION NOTE: The access keys for "Play" and
|
||||
"Pause" are the same because the two context-menu
|
||||
items are mutually exclusive. -->
|
||||
<!ENTITY mediaPlay.label "Play">
|
||||
<!ENTITY mediaPlay.accesskey "P">
|
||||
<!ENTITY mediaPause.label "Pause">
|
||||
<!ENTITY mediaPause.accesskey "P">
|
||||
<!-- LOCALIZATION NOTE: The access keys for "Mute" and
|
||||
"Unmute" are the same because the two context-menu
|
||||
items are mutually exclusive. -->
|
||||
<!ENTITY mediaMute.label "Mute">
|
||||
<!ENTITY mediaMute.accesskey "M">
|
||||
<!ENTITY mediaUnmute.label "Unmute">
|
||||
<!ENTITY mediaUnmute.accesskey "m">
|
||||
<!-- LOCALIZATION NOTE: The access keys for "Show Controls" and
|
||||
"Hide Controls" are the same because the two context-menu
|
||||
items are mutually exclusive. -->
|
||||
<!ENTITY mediaShowControls.label "Show Controls">
|
||||
<!ENTITY mediaShowControls.accesskey "C">
|
||||
<!ENTITY mediaHideControls.label "Hide Controls">
|
||||
|
@ -445,6 +454,9 @@ can reach it easily. -->
|
|||
<!ENTITY videoFullScreen.accesskey "F">
|
||||
<!ENTITY videoSaveImage.label "Save Snapshot As…">
|
||||
<!ENTITY videoSaveImage.accesskey "S">
|
||||
<!-- LOCALIZATION NOTE: The access keys for "Show Statistics" and
|
||||
"Hide Statistics" are the same because the two context-menu
|
||||
items are mutually exclusive. -->
|
||||
<!ENTITY videoShowStats.label "Show Statistics">
|
||||
<!ENTITY videoShowStats.accesskey "t">
|
||||
<!ENTITY videoHideStats.label "Hide Statistics">
|
||||
|
|
|
@ -38,6 +38,14 @@ saveFileAs=Save File As
|
|||
# save fails.
|
||||
saveFile.failed=The file save operation failed.
|
||||
|
||||
# LOCALIZATION NOTE (confirmClose): This is message in the prompt dialog when
|
||||
# you try to close a scratchpad with unsaved changes.
|
||||
confirmClose=Do you want to save the changes you made to this scratchpad?
|
||||
|
||||
# LOCALIZATION NOTE (confirmClose.title): This is title of the prompt dialog when
|
||||
# you try to close a scratchpad with unsaved changes.
|
||||
confirmClose.title=Unsaved Changes
|
||||
|
||||
# LOCALIZATION NOTE (scratchpadIntro): This is a multi-line comment explaining
|
||||
# how to use the Scratchpad. Note that this should be a valid JavaScript
|
||||
# comment inside /* and */.
|
||||
|
|
|
@ -2633,13 +2633,15 @@ panel[dimmed="true"] {
|
|||
-moz-image-region: rect(0, 16px, 16px, 0);
|
||||
min-width: 16px;
|
||||
width: 16px;
|
||||
-moz-appearance: none;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
#highlighter-closebutton:hover {
|
||||
-moz-image-region: rect(0, 32px, 16px, 16px);
|
||||
}
|
||||
|
||||
#highlighter-closebutton:active {
|
||||
#highlighter-closebutton:hover:active {
|
||||
-moz-image-region: rect(0, 48px, 16px, 32px);
|
||||
}
|
||||
|
||||
|
@ -2855,7 +2857,6 @@ panel[dimmed="true"] {
|
|||
/* The content of the button can be larger than the button */
|
||||
overflow: hidden;
|
||||
min-height: 25px;
|
||||
|
||||
margin: 0 -11px 0 0;
|
||||
padding: 0 9px;
|
||||
}
|
||||
|
|
|
@ -1450,7 +1450,7 @@ random-if(d2d) == 523468-1.html 523468-1-ref.html
|
|||
== 534804-1.html 534804-1-ref.html
|
||||
== 534808-1.html 534808-1-ref.html
|
||||
== 534808-2.html 534808-2-ref.html
|
||||
== 534919-1.html 534919-1-ref.html
|
||||
fails-if(/Mac\x20OS\x20X\x2010\.7/.test(http.oscpu)) == 534919-1.html 534919-1-ref.html # Bug 705044
|
||||
random == 536061.html 536061-ref.html # fixedpoint division in blur code makes this fail
|
||||
== 537507-1.xul 537507-1-ref.xul
|
||||
== 537507-2.html 537507-2-ref.html
|
||||
|
|
|
@ -48,7 +48,7 @@ fails-if(Android) != text-font-lang.html text-font-lang-notref.html
|
|||
|
||||
# gradient off-by-one, fails on windows and linux
|
||||
== linear-gradient-1a.html linear-gradient-1-ref.html
|
||||
fails-if(cocoaWidget) == linear-gradient-1b.html linear-gradient-1-ref.html
|
||||
fails-if(/Mac\x20OS\x20X\x2010\.[56]/.test(http.oscpu)) == linear-gradient-1b.html linear-gradient-1-ref.html
|
||||
|
||||
== zero-dimensions.html zero-dimensions-ref.html
|
||||
|
||||
|
@ -65,7 +65,7 @@ random-if(Android) == dash-1.html dash-1-ref.svg # Bug 668412 (really is androi
|
|||
fails == ctm-singular-sanity.html data:text/html,<body>Pass # Bug 612033
|
||||
== ctm-1.html ctm-1-ref.html
|
||||
|
||||
fails-if(cocoaWidget) == 672646-alpha-radial-gradient.html 672646-alpha-radial-gradient-ref.html # Bug 673333
|
||||
fails-if(/Mac\x20OS\x20X\x2010\.[56]/.test(http.oscpu)) == 672646-alpha-radial-gradient.html 672646-alpha-radial-gradient-ref.html # Bug 673333
|
||||
== 674003-alpha-radial-gradient-superlum.html 674003-alpha-radial-gradient-superlum-ref.html
|
||||
|
||||
!= 693610-1.html 693610-1-notref.html # bug 693610: multiple glyph runs should not be overprinted
|
||||
|
|
|
@ -70,7 +70,7 @@ fails-if(d2d) == repeating-linear-1b.html repeating-linear-1-ref.html
|
|||
== repeating-radial-2a.html repeating-radial-2-ref.html
|
||||
== twostops-1a.html twostops-1-ref.html
|
||||
== twostops-1b.html twostops-1-ref.html
|
||||
fails-if(cocoaWidget) == twostops-1c.html twostops-1-ref.html # bug 524173
|
||||
fails-if(/Mac\x20OS\x20X\x2010\.[56]/.test(http.oscpu)) == twostops-1c.html twostops-1-ref.html # bug 524173
|
||||
== twostops-1d.html twostops-1-ref.html
|
||||
== twostops-1e.html twostops-1-ref.html
|
||||
== twostops-1f.html twostops-1-ref.html
|
||||
|
|
|
@ -11,5 +11,5 @@
|
|||
== scale-1.svg scale-1-ref.svg
|
||||
== skew-1.svg skew-1-ref.svg
|
||||
== translate-clipPath-1.svg lime.svg
|
||||
fails-if(cocoaWidget) == translate-gradient-1.svg lime.svg
|
||||
fails-if(/Mac\x20OS\x20X\x2010\.[56]/.test(http.oscpu)) == translate-gradient-1.svg lime.svg
|
||||
== translate-pattern-1.svg lime.svg
|
||||
|
|
|
@ -48,6 +48,11 @@
|
|||
background: url("chrome://browser/skin/images/unmute-hdpi.png") no-repeat center;
|
||||
}
|
||||
|
||||
/* This button is hidden until bug 704229 is fixed. */
|
||||
.fullscreenButton {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* bars */
|
||||
.scrubberStack {
|
||||
width: 100%;
|
||||
|
|
|
@ -30,14 +30,15 @@ const playButtonHeight = 28;
|
|||
const muteButtonWidth = 33;
|
||||
const muteButtonHeight = 28;
|
||||
const durationWidth = 34;
|
||||
const scrubberWidth = videoWidth - playButtonWidth - muteButtonWidth - durationWidth;
|
||||
const fullscreenButtonWidth = document.mozFullScreenEnabled ? 28 : 0;
|
||||
const scrubberWidth = videoWidth - playButtonWidth - muteButtonWidth - durationWidth - fullscreenButtonWidth;
|
||||
const scrubberHeight = 28;
|
||||
|
||||
// Play button is on the bottom-left
|
||||
const playButtonCenterX = 0 + Math.round(playButtonWidth / 2);
|
||||
const playButtonCenterY = videoHeight - Math.round(playButtonHeight / 2);
|
||||
// Mute button is on the bottom-right
|
||||
const muteButtonCenterX = videoWidth - Math.round(muteButtonWidth / 2);
|
||||
// Mute button is on the bottom-right before the full screen button
|
||||
const muteButtonCenterX = videoWidth - Math.round(muteButtonWidth / 2) - fullscreenButtonWidth;
|
||||
const muteButtonCenterY = videoHeight - Math.round(muteButtonHeight / 2);
|
||||
// Scrubber bar is between the play and mute buttons. We don't need it's
|
||||
// X center, just the offset of its box.
|
||||
|
|
|
@ -286,6 +286,9 @@
|
|||
<box class="volumeBackgroundBar"/>
|
||||
<scale class="volumeControl" orient="vertical" dir="reverse" movetoclick="true"/>
|
||||
</stack>
|
||||
<button class="fullscreenButton"
|
||||
enterfullscreenlabel="&fullscreenButton.enterfullscreenlabel;"
|
||||
exitfullscreenlabel="&fullscreenButton.exitfullscreenlabel;"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</stack>
|
||||
|
@ -320,6 +323,7 @@
|
|||
statusOverlay : null,
|
||||
controlsSpacer : null,
|
||||
stats : {},
|
||||
fullscreenButton : null,
|
||||
|
||||
randomID : 0,
|
||||
videoEvents : ["play", "pause", "ended", "volumechange", "loadeddata",
|
||||
|
@ -374,6 +378,8 @@
|
|||
this.setPlayButtonState(this.video.paused);
|
||||
this.setMuteButtonState(this.video.muted);
|
||||
|
||||
this.setFullscreenButtonState();
|
||||
|
||||
var volume = this.video.muted ? 0 : Math.round(this.video.volume * 100);
|
||||
this.volumeControl.value = volume;
|
||||
|
||||
|
@ -420,6 +426,7 @@
|
|||
this._playButtonWidth = this.playButton.clientWidth;
|
||||
this._durationLabelWidth = this.durationLabel.clientWidth;
|
||||
this._muteButtonWidth = this.muteButton.clientWidth;
|
||||
this._fullscreenButtonWidth = this.fullscreenButton.clientWidth;
|
||||
this._controlBarHeight = this.controlBar.clientHeight;
|
||||
if (controlBarWasHidden)
|
||||
this.controlBar.setAttribute("hidden", "true");
|
||||
|
@ -600,6 +607,7 @@
|
|||
for each (var event in this.videoEvents)
|
||||
this.video.removeEventListener(event, this, false);
|
||||
this.video.removeEventListener("media-showStatistics", this._handleCustomEventsBound, false);
|
||||
this.video.ownerDocument.removeEventListener("mozfullscreenchange", this.setFullscreenButtonState, false);
|
||||
delete this._handleCustomEventsBound;
|
||||
this.log("--- videocontrols terminated ---");
|
||||
},
|
||||
|
@ -826,8 +834,37 @@
|
|||
// controlling volume.
|
||||
},
|
||||
|
||||
isVideoInFullScreen : function () {
|
||||
return document.mozFullScreenElement != null;
|
||||
},
|
||||
|
||||
toggleFullscreen : function () {
|
||||
this.isVideoInFullScreen() ?
|
||||
document.mozCancelFullScreen() :
|
||||
this.video.mozRequestFullScreen();
|
||||
},
|
||||
|
||||
setFullscreenButtonState : function () {
|
||||
if (this.isAudioOnly || !document.mozFullScreenEnabled) {
|
||||
this.fullscreenButton.hidden = true;
|
||||
return;
|
||||
}
|
||||
|
||||
var attrName = this.isVideoInFullScreen() ? "enterfullscreenlabel" : "exitfullscreenlabel";
|
||||
var value = this.fullscreenButton.getAttribute(attrName);
|
||||
this.fullscreenButton.setAttribute("aria-label", value);
|
||||
|
||||
if (this.isVideoInFullScreen())
|
||||
this.fullscreenButton.setAttribute("fullscreened", "true");
|
||||
else
|
||||
this.fullscreenButton.removeAttribute("fullscreened");
|
||||
},
|
||||
|
||||
setPlayButtonState : function(aPaused) {
|
||||
this.playButton.setAttribute("paused", aPaused);
|
||||
if (aPaused)
|
||||
this.playButton.setAttribute("paused", "true");
|
||||
else
|
||||
this.playButton.removeAttribute("paused");
|
||||
|
||||
var attrName = aPaused ? "playlabel" : "pauselabel";
|
||||
var value = this.playButton.getAttribute(attrName);
|
||||
|
@ -835,7 +872,10 @@
|
|||
},
|
||||
|
||||
setMuteButtonState : function(aMuted) {
|
||||
this.muteButton.setAttribute("muted", aMuted);
|
||||
if (aMuted)
|
||||
this.muteButton.setAttribute("muted", "true");
|
||||
else
|
||||
this.muteButton.removeAttribute("muted");
|
||||
|
||||
var attrName = aMuted ? "unmutelabel" : "mutelabel";
|
||||
var value = this.muteButton.getAttribute(attrName);
|
||||
|
@ -1060,6 +1100,7 @@
|
|||
_playButtonWidth : 0,
|
||||
_durationLabelWidth : 0,
|
||||
_muteButtonWidth : 0,
|
||||
_fullscreenButtonWidth : 0,
|
||||
_controlBarHeight : 0,
|
||||
adjustControlSize : function adjustControlSize() {
|
||||
if (this.isAudioOnly)
|
||||
|
@ -1074,7 +1115,8 @@
|
|||
let minWidthAllControls = this._playButtonWidth +
|
||||
minScrubberWidth +
|
||||
this._durationLabelWidth +
|
||||
this._muteButtonWidth;
|
||||
this._muteButtonWidth +
|
||||
this._fullscreenButtonWidth;
|
||||
let minHeightForControlBar = this._controlBarHeight;
|
||||
let minWidthOnlyPlayPause = this._playButtonWidth + this._muteButtonWidth;
|
||||
|
||||
|
@ -1108,6 +1150,7 @@
|
|||
this.statusOverlay = document.getAnonymousElementByAttribute(binding, "class", "statusOverlay");
|
||||
this.statsOverlay = document.getAnonymousElementByAttribute(binding, "class", "statsOverlay");
|
||||
this.controlsSpacer = document.getAnonymousElementByAttribute(binding, "class", "controlsSpacer");
|
||||
this.fullscreenButton = document.getAnonymousElementByAttribute(binding, "class", "fullscreenButton");
|
||||
|
||||
this.statsTable = document.getAnonymousElementByAttribute(binding, "class", "statsTable");
|
||||
this.stats.filename = document.getAnonymousElementByAttribute(binding, "class", "statFilename");
|
||||
|
@ -1148,6 +1191,7 @@
|
|||
this.muteButton.addEventListener("command", function() { self.toggleMute(); }, false);
|
||||
this.playButton.addEventListener("command", function() { self.togglePause(); }, false);
|
||||
this.controlsSpacer.addEventListener("click", function(e) { if (e.button == 0) { self.togglePause(); } }, false);
|
||||
this.fullscreenButton.addEventListener("command", function() { self.toggleFullscreen(); }, false );
|
||||
if (!this.isAudioOnly) {
|
||||
this.muteButton.addEventListener("mouseover", function(e) { self.onVolumeMouseInOut(e); }, false);
|
||||
this.muteButton.addEventListener("mouseout", function(e) { self.onVolumeMouseInOut(e); }, false);
|
||||
|
@ -1156,6 +1200,7 @@
|
|||
}
|
||||
|
||||
this.videocontrols.addEventListener("transitionend", function(e) { self.onTransitionEnd(e); }, false);
|
||||
this.video.ownerDocument.addEventListener("mozfullscreenchange", this.setFullscreenButtonState, false);
|
||||
|
||||
// Make the <video> element keyboard accessible.
|
||||
this.video.setAttribute("tabindex", 0);
|
||||
|
@ -1217,6 +1262,9 @@
|
|||
<label class="positionLabel" role="presentation"/>
|
||||
<label class="durationLabel" role="presentation"/>
|
||||
</vbox>
|
||||
<button class="fullscreenButton"
|
||||
enterfullscreenlabel="&fullscreenButton.enterfullscreenlabel;"
|
||||
exitfullscreenlabel="&fullscreenButton.exitfullscreenlabel;"/>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</stack>
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<!ENTITY playButton.pauseLabel "Pause">
|
||||
<!ENTITY muteButton.muteLabel "Mute">
|
||||
<!ENTITY muteButton.unmuteLabel "Unmute">
|
||||
<!ENTITY fullscreenButton.enterfullscreenlabel "Full Screen">
|
||||
<!ENTITY fullscreenButton.exitfullscreenlabel "Exit Full Screen">
|
||||
|
||||
<!ENTITY stats.media "Media">
|
||||
<!ENTITY stats.size "Size">
|
||||
|
|
|
@ -144,6 +144,7 @@ toolkit.jar:
|
|||
skin/classic/global/media/playButton.png (media/playButton.png)
|
||||
skin/classic/global/media/muteButton.png (media/muteButton.png)
|
||||
skin/classic/global/media/unmuteButton.png (media/unmuteButton.png)
|
||||
skin/classic/global/media/fullscreenButton.png (media/fullscreenButton.png)
|
||||
skin/classic/global/media/scrubberThumb.png (media/scrubberThumb.png)
|
||||
skin/classic/global/media/scrubberThumbWide.png (media/scrubberThumbWide.png)
|
||||
skin/classic/global/media/error.png (media/error.png)
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 320 B |
|
@ -17,7 +17,7 @@
|
|||
margin-right: -22px; /* 1/2 of scrubber thumb width, for overhang. */
|
||||
position: relative; /* Trick to work around negative margin interfering with clicking on the button. */
|
||||
}
|
||||
.playButton[paused="true"] {
|
||||
.playButton[paused] {
|
||||
background: url(chrome://global/skin/media/playButton.png) no-repeat center;
|
||||
}
|
||||
|
||||
|
@ -30,10 +30,25 @@
|
|||
min-height: 28px;
|
||||
min-width: 33px;
|
||||
}
|
||||
.muteButton[muted="true"] {
|
||||
.muteButton[muted] {
|
||||
background: url(chrome://global/skin/media/unmuteButton.png) no-repeat center;
|
||||
}
|
||||
|
||||
.fullscreenButton {
|
||||
background-color: transparent;
|
||||
list-style-image: url("chrome://global/skin/media/fullscreenButton.png");
|
||||
-moz-image-region: rect(0px, 16px, 16px, 0px);
|
||||
-moz-appearance: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 28px;
|
||||
min-width: 28px;
|
||||
}
|
||||
|
||||
.fullscreenButton[fullscreened] {
|
||||
-moz-image-region: rect(0px, 32px, 16px, 16px);
|
||||
}
|
||||
|
||||
.volumeStack {
|
||||
width: 28px;
|
||||
height: 70px;
|
||||
|
|
|
@ -152,6 +152,7 @@ toolkit.jar:
|
|||
skin/classic/global/media/playButton.png (media/playButton.png)
|
||||
skin/classic/global/media/muteButton.png (media/muteButton.png)
|
||||
skin/classic/global/media/unmuteButton.png (media/unmuteButton.png)
|
||||
skin/classic/global/media/fullscreenButton.png (media/fullscreenButton.png)
|
||||
skin/classic/global/media/scrubberThumb.png (media/scrubberThumb.png)
|
||||
skin/classic/global/media/scrubberThumbWide.png (media/scrubberThumbWide.png)
|
||||
skin/classic/global/media/throbber.png (media/throbber.png)
|
||||
|
@ -332,6 +333,7 @@ toolkit.jar:
|
|||
skin/classic/aero/global/media/playButton.png (media/playButton.png)
|
||||
skin/classic/aero/global/media/muteButton.png (media/muteButton.png)
|
||||
skin/classic/aero/global/media/unmuteButton.png (media/unmuteButton.png)
|
||||
skin/classic/aero/global/media/fullscreenButton.png (media/fullscreenButton.png)
|
||||
skin/classic/aero/global/media/scrubberThumb.png (media/scrubberThumb.png)
|
||||
skin/classic/aero/global/media/scrubberThumbWide.png (media/scrubberThumbWide.png)
|
||||
skin/classic/aero/global/media/throbber.png (media/throbber.png)
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 320 B |
|
@ -18,7 +18,7 @@
|
|||
margin-right: -22px; /* 1/2 of scrubber thumb width, for overhang. */
|
||||
position: relative; /* Trick to work around negative margin interfering with clicking on the button. */
|
||||
}
|
||||
.playButton[paused="true"] {
|
||||
.playButton[paused] {
|
||||
background: url(chrome://global/skin/media/playButton.png) no-repeat center;
|
||||
}
|
||||
|
||||
|
@ -32,10 +32,26 @@
|
|||
min-width: 33px;
|
||||
border: none;
|
||||
}
|
||||
.muteButton[muted="true"] {
|
||||
.muteButton[muted] {
|
||||
background: url(chrome://global/skin/media/unmuteButton.png) no-repeat center;
|
||||
}
|
||||
|
||||
.fullscreenButton {
|
||||
background-color: transparent;
|
||||
list-style-image: url("chrome://global/skin/media/fullscreenButton.png");
|
||||
-moz-image-region: rect(0px, 16px, 16px, 0px);
|
||||
-moz-appearance: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 28px;
|
||||
min-width: 28px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.fullscreenButton[fullscreened] {
|
||||
-moz-image-region: rect(0px, 32px, 16px, 16px);
|
||||
}
|
||||
|
||||
.volumeStack {
|
||||
width: 28px;
|
||||
height: 70px;
|
||||
|
@ -68,7 +84,6 @@
|
|||
border-radius: 4px 4px;
|
||||
}
|
||||
|
||||
|
||||
.durationBox {
|
||||
-moz-box-pack: center;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче