summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorAscrod <32915892+Ascrod@users.noreply.github.com>2019-02-09 14:05:34 -0500
committerAscrod <32915892+Ascrod@users.noreply.github.com>2019-02-09 14:05:34 -0500
commit8906ccd05ee2d59e85cc6262c775b924ff0347ae (patch)
treef76d4988d87d0345af7375acb4b8097a7fd6dd1f /application
parent4adc4098851a84ed9436162e8114c6f834fbb64c (diff)
downloadUXP-8906ccd05ee2d59e85cc6262c775b924ff0347ae.tar
UXP-8906ccd05ee2d59e85cc6262c775b924ff0347ae.tar.gz
UXP-8906ccd05ee2d59e85cc6262c775b924ff0347ae.tar.lz
UXP-8906ccd05ee2d59e85cc6262c775b924ff0347ae.tar.xz
UXP-8906ccd05ee2d59e85cc6262c775b924ff0347ae.zip
Pale Moon: Add loop context menu to HTML5 media elements.
Diffstat (limited to 'application')
-rw-r--r--application/palemoon/base/content/browser-context.inc5
-rw-r--r--application/palemoon/base/content/nsContextMenu.js5
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/browser.dtd2
3 files changed, 12 insertions, 0 deletions
diff --git a/application/palemoon/base/content/browser-context.inc b/application/palemoon/base/content/browser-context.inc
index f672ede61..8ef376999 100644
--- a/application/palemoon/base/content/browser-context.inc
+++ b/application/palemoon/base/content/browser-context.inc
@@ -99,6 +99,11 @@
oncommand="gContextMenu.mediaCommand('playbackRate', 2.0);"/>
</menupopup>
</menu>
+ <menuitem id="context-media-loop"
+ label="&mediaLoop.label;"
+ accesskey="&mediaLoop.accesskey;"
+ type="checkbox"
+ oncommand="gContextMenu.mediaCommand('loop');"/>
<menuitem id="context-media-showcontrols"
label="&mediaShowControls.label;"
accesskey="&mediaShowControls.accesskey;"
diff --git a/application/palemoon/base/content/nsContextMenu.js b/application/palemoon/base/content/nsContextMenu.js
index 1d4f88816..916dd2637 100644
--- a/application/palemoon/base/content/nsContextMenu.js
+++ b/application/palemoon/base/content/nsContextMenu.js
@@ -381,6 +381,7 @@ nsContextMenu.prototype = {
this.showItem("context-media-mute", onMedia && !this.target.muted);
this.showItem("context-media-unmute", onMedia && this.target.muted);
this.showItem("context-media-playbackrate", onMedia);
+ this.showItem("context-media-loop", onMedia);
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.target.ownerDocument.mozFullScreenElement == null);
@@ -394,6 +395,7 @@ nsContextMenu.prototype = {
this.setItemAttr("context-media-playbackrate-100x", "checked", this.target.playbackRate == 1.0);
this.setItemAttr("context-media-playbackrate-150x", "checked", this.target.playbackRate == 1.5);
this.setItemAttr("context-media-playbackrate-200x", "checked", this.target.playbackRate == 2.0);
+ this.setItemAttr("context-media-loop", "checked", this.target.loop);
var hasError = this.target.error != null ||
this.target.networkState == this.target.NETWORK_NO_SOURCE;
this.setItemAttr("context-media-play", "disabled", hasError);
@@ -1531,6 +1533,9 @@ nsContextMenu.prototype = {
case "pause":
media.pause();
break;
+ case "loop":
+ media.loop = !media.loop;
+ break;
case "mute":
media.muted = true;
break;
diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.dtd b/application/palemoon/locales/en-US/chrome/browser/browser.dtd
index 439057a84..e7564d152 100644
--- a/application/palemoon/locales/en-US/chrome/browser/browser.dtd
+++ b/application/palemoon/locales/en-US/chrome/browser/browser.dtd
@@ -433,6 +433,8 @@ fast. -->
<!-- LOCALIZATION NOTE: The access keys for "Show Controls" and
"Hide Controls" are the same because the two context-menu
items are mutually exclusive. -->
+<!ENTITY mediaLoop.label "Loop">
+<!ENTITY mediaLoop.accesskey "L">
<!ENTITY mediaShowControls.label "Show Controls">
<!ENTITY mediaShowControls.accesskey "C">
<!ENTITY mediaHideControls.label "Hide Controls">