mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 20:22:00 +00:00
Bug 674771 - Add a "Paste & Go" entry in the URL bar context menu. r=mfinkle
This commit is contained in:
parent
1f4cd33169
commit
dc46cbb1b1
@ -29,6 +29,13 @@ var ContextCommands = {
|
||||
}
|
||||
},
|
||||
|
||||
pasteAndGo: function cc_pasteAndGo() {
|
||||
let target = ContextHelper.popupState.target;
|
||||
target.editor.selectAll();
|
||||
target.editor.paste(Ci.nsIClipboard.kGlobalClipboard);
|
||||
BrowserUI.goToURI();
|
||||
},
|
||||
|
||||
selectAll: function cc_selectAll() {
|
||||
let target = ContextHelper.popupState.target;
|
||||
if (target.localName == "browser") {
|
||||
|
@ -1820,8 +1820,12 @@
|
||||
let flavors = ["text/unicode"];
|
||||
let hasData = clipboard.hasDataMatchingFlavors(flavors, flavors.length, Ci.nsIClipboard.kGlobalClipboard);
|
||||
|
||||
if (hasData && (!aTextbox.readOnly || aIgnoreReadOnly))
|
||||
if (hasData && (!aTextbox.readOnly || aIgnoreReadOnly)) {
|
||||
json.types.push("paste");
|
||||
if (aTextbox.type == "url") {
|
||||
json.types.push("paste-url");
|
||||
}
|
||||
}
|
||||
|
||||
ContextHelper.showPopup({ target: aTextbox, json: json });
|
||||
]]></body>
|
||||
|
@ -626,6 +626,9 @@
|
||||
<richlistitem class="context-command" id="context-paste" type="paste" onclick="ContextCommands.paste();">
|
||||
<label value="&paste.label;"/>
|
||||
</richlistitem>
|
||||
<richlistitem class="context-command" id="context-paste-n-go" type="paste-url" onclick="ContextCommands.pasteAndGo();">
|
||||
<label value="&pasteAndGo.label;"/>
|
||||
</richlistitem>
|
||||
<richlistitem class="context-command" id="context-select-all" type="select-all" onclick="ContextCommands.selectAll();">
|
||||
<label value="&selectAll.label;"/>
|
||||
</richlistitem>
|
||||
|
@ -16,6 +16,7 @@
|
||||
<!ENTITY copyAll.label "Copy All">
|
||||
<!ENTITY copylink.label "Copy Link Location">
|
||||
<!ENTITY paste.label "Paste">
|
||||
<!ENTITY pasteAndGo.label "Paste & Go">
|
||||
<!ENTITY delete.label "Delete">
|
||||
<!ENTITY selectAll.label "Select All">
|
||||
<!ENTITY noSuggestions.label "(No suggestions)">
|
||||
|
Loading…
x
Reference in New Issue
Block a user