mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-06 16:57:04 +00:00
Rename CopyCurrentURLAsMarkdownToClipboard method to follow camelCase convention
This commit is contained in:
2
l10n
2
l10n
Submodule l10n updated: 98c54b87df...57853cc9e1
@@ -72,19 +72,19 @@ var gZenCommonActions = {
|
||||
ConfirmationHint.show(document.getElementById('PanelUI-menu-button'), 'zen-copy-current-url-confirmation');
|
||||
}
|
||||
},
|
||||
CopyCurrentURLAsMarkdownToClipboard() {
|
||||
copyCurrentURLAsMarkdownToClipboard() {
|
||||
const currentUrl = gBrowser.currentURI.spec;
|
||||
const tabTitle = gBrowser.selectedTab.label;
|
||||
if (currentUrl && tabTitle) {
|
||||
const markdownLink = `[${tabTitle}](${currentUrl})`;
|
||||
let str = Cc['@mozilla.org/supports-string;1'].createInstance(Ci.nsISupportsString);
|
||||
str.data = markdownLink;
|
||||
let transferable = Cc['@mozilla.org/widget/transferable;1'].createInstance(Ci.nsITransferable);
|
||||
transferable.init(getLoadContext());
|
||||
transferable.addDataFlavor('text/plain');
|
||||
transferable.setTransferData('text/plain', str);
|
||||
Services.clipboard.setData(transferable, null, Ci.nsIClipboard.kGlobalClipboard);
|
||||
ConfirmationHint.show(document.getElementById('PanelUI-menu-button'), 'zen-copy-current-url-confirmation');
|
||||
const markdownLink = `[${tabTitle}](${currentUrl})`;
|
||||
let str = Cc['@mozilla.org/supports-string;1'].createInstance(Ci.nsISupportsString);
|
||||
str.data = markdownLink;
|
||||
let transferable = Cc['@mozilla.org/widget/transferable;1'].createInstance(Ci.nsITransferable);
|
||||
transferable.init(getLoadContext());
|
||||
transferable.addDataFlavor('text/plain');
|
||||
transferable.setTransferData('text/plain', str);
|
||||
Services.clipboard.setData(transferable, null, Ci.nsIClipboard.kGlobalClipboard);
|
||||
ConfirmationHint.show(document.getElementById('PanelUI-menu-button'), 'zen-copy-current-url-confirmation');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -918,10 +918,10 @@ class ZenKeyboardShortcutsVersioner {
|
||||
'',
|
||||
ZEN_OTHER_SHORTCUTS_GROUP,
|
||||
KeyShortcutModifiers.fromObject({ accel: true, shift: true, alt: true }),
|
||||
'code:gZenCommonActions.CopyCurrentURLAsMarkdownToClipboard()',
|
||||
'code:gZenCommonActions.copyCurrentURLAsMarkdownToClipboard()',
|
||||
'zen-text-action-copy-url-markdown-shortcut'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user