mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-09 03:16:36 +00:00
fix indentation woops
This commit is contained in:
@@ -73,18 +73,18 @@ var gZenCommonActions = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
CopyCurrentURLAsMarkdownToClipboard() {
|
CopyCurrentURLAsMarkdownToClipboard() {
|
||||||
const currentUrl = gBrowser.currentURI.spec;
|
const currentTabs = gZenViewSplitter.getTabsInCurrentView()
|
||||||
const tabTitle = gBrowser.selectedTab.label;
|
if (currentTabs) {
|
||||||
if (currentUrl && tabTitle) {
|
const stringArray = currentTabs.map(t => `[${t.label}](${t.linkedBrowser.currentURI.spec})`)
|
||||||
const markdownLink = `[${tabTitle}](${currentUrl})`
|
const markdownString = stringArray.join("\n")
|
||||||
let str = Cc['@mozilla.org/supports-string;1'].createInstance(Ci.nsISupportsString);
|
let str = Cc['@mozilla.org/supports-string;1'].createInstance(Ci.nsISupportsString);
|
||||||
str.data = markdownLink;
|
str.data = markdownString;
|
||||||
let transferable = Cc['@mozilla.org/widget/transferable;1'].createInstance(Ci.nsITransferable);
|
let transferable = Cc['@mozilla.org/widget/transferable;1'].createInstance(Ci.nsITransferable);
|
||||||
transferable.init(getLoadContext());
|
transferable.init(getLoadContext());
|
||||||
transferable.addDataFlavor('text/plain');
|
transferable.addDataFlavor('text/plain');
|
||||||
transferable.setTransferData('text/plain', str);
|
transferable.setTransferData('text/plain', str);
|
||||||
Services.clipboard.setData(transferable, null, Ci.nsIClipboard.kGlobalClipboard);
|
Services.clipboard.setData(transferable, null, Ci.nsIClipboard.kGlobalClipboard);
|
||||||
ConfirmationHint.show(document.getElementById('PanelUI-menu-button'), 'zen-copy-current-url-confirmation');
|
ConfirmationHint.show(document.getElementById('PanelUI-menu-button'), 'zen-copy-current-url-confirmation');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -909,19 +909,19 @@ class ZenKeyboardShortcutsVersioner {
|
|||||||
window.addEventListener('zen-devtools-keyset-added', listener);
|
window.addEventListener('zen-devtools-keyset-added', listener);
|
||||||
}
|
}
|
||||||
if (version < 8) {
|
if (version < 8) {
|
||||||
// Migrate from 7 to 8
|
// Migrate from 7 to 8
|
||||||
// In this new version, we add the "Copy URL as Markdown" shortcut to the default shortcuts
|
// In this new version, we add the "Copy URL as Markdown" shortcut to the default shortcuts
|
||||||
data.push(
|
data.push(
|
||||||
new KeyShortcut(
|
new KeyShortcut(
|
||||||
'zen-copy-url-markdown',
|
'zen-copy-url-markdown',
|
||||||
'C',
|
'C',
|
||||||
'',
|
'',
|
||||||
ZEN_OTHER_SHORTCUTS_GROUP,
|
ZEN_OTHER_SHORTCUTS_GROUP,
|
||||||
KeyShortcutModifiers.fromObject({ accel: true, shift: true, alt: true }),
|
KeyShortcutModifiers.fromObject({ accel: true, shift: true, alt: true }),
|
||||||
'code:gZenCommonActions.CopyCurrentURLAsMarkdownToClipboard()',
|
'code:gZenCommonActions.CopyCurrentURLAsMarkdownToClipboard()',
|
||||||
'zen-text-action-copy-url-markdown-shortcut'
|
'zen-text-action-copy-url-markdown-shortcut'
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user