diff options
author | Moonchild <mcwerewolf@wolfbeast.com> | 2019-02-15 14:06:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-15 14:06:27 +0100 |
commit | 3642628942a4908e561f8e8fb6980afecfda1c4c (patch) | |
tree | 6dc073fb8f12de42f31dd1248bbb4efe9a0dada1 /application | |
parent | f475489b649425e2ec70c6b300ffec111d517790 (diff) | |
parent | 4a89b18b31f6b5a2d358466e47a1159fa6d785fb (diff) | |
download | uxp-3642628942a4908e561f8e8fb6980afecfda1c4c.tar.gz |
Merge pull request #967 from Ascrod/master
Pale Moon: Add loop context menu to HTML5 media elements.
Diffstat (limited to 'application')
-rw-r--r-- | application/palemoon/base/content/browser-context.inc | 7 | ||||
-rw-r--r-- | application/palemoon/base/content/nsContextMenu.js | 5 | ||||
-rw-r--r-- | application/palemoon/locales/en-US/chrome/browser/browser.dtd | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/application/palemoon/base/content/browser-context.inc b/application/palemoon/base/content/browser-context.inc index f672ede615..38c4725082 100644 --- a/application/palemoon/base/content/browser-context.inc +++ b/application/palemoon/base/content/browser-context.inc @@ -70,7 +70,7 @@ label="&mediaUnmute.label;" accesskey="&mediaUnmute.accesskey;" oncommand="gContextMenu.mediaCommand('unmute');"/> - <menu id="context-media-playbackrate" label="&mediaPlaybackRate.label;" accesskey="&mediaPlaybackRate.accesskey;"> + <menu id="context-media-playbackrate" label="&mediaPlaybackRate2.label;" accesskey="&mediaPlaybackRate2.accesskey;"> <menupopup> <menuitem id="context-media-playbackrate-050x" label="&mediaPlaybackRate050x.label;" @@ -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 1d4f888165..916dd2637a 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 439057a84b..c810b074ed 100644 --- a/application/palemoon/locales/en-US/chrome/browser/browser.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/browser.dtd @@ -417,8 +417,8 @@ items are mutually exclusive. --> <!ENTITY mediaMute.accesskey "M"> <!ENTITY mediaUnmute.label "Unmute"> <!ENTITY mediaUnmute.accesskey "m"> -<!ENTITY mediaPlaybackRate.label "Play Speed"> -<!ENTITY mediaPlaybackRate.accesskey "l"> +<!ENTITY mediaPlaybackRate2.label "Play Speed"> +<!ENTITY mediaPlaybackRate2.accesskey "d"> <!ENTITY mediaPlaybackRate050x.label "Slow Motion (0.5×)"> <!ENTITY mediaPlaybackRate050x.accesskey "S"> <!ENTITY mediaPlaybackRate100x.label "Normal Speed"> @@ -430,6 +430,8 @@ movie "Space Balls" and is meant to say that this speed is very fast. --> <!ENTITY mediaPlaybackRate200x.label "Ludicrous Speed (2×)"> <!ENTITY mediaPlaybackRate200x.accesskey "L"> +<!ENTITY mediaLoop.label "Loop"> +<!ENTITY mediaLoop.accesskey "L"> <!-- LOCALIZATION NOTE: The access keys for "Show Controls" and "Hide Controls" are the same because the two context-menu items are mutually exclusive. --> |