Debug Log: Copy URL instead of open in browser
This commit is contained in:
parent
dc81bf2bba
commit
7bb7c0d1e1
7 changed files with 61 additions and 34 deletions
|
@ -7,17 +7,33 @@
|
|||
|
||||
window.Whisper = window.Whisper || {};
|
||||
|
||||
Whisper.LinkedCopiedToast = Whisper.ToastView.extend({
|
||||
render_attributes() {
|
||||
return { toastMessage: i18n('debugLogLinkCopied') };
|
||||
},
|
||||
});
|
||||
|
||||
Whisper.DebugLogLinkView = Whisper.View.extend({
|
||||
templateName: 'debug-log-link',
|
||||
initialize(options) {
|
||||
this.url = options.url;
|
||||
},
|
||||
events: {
|
||||
'click .copy': 'copy',
|
||||
},
|
||||
render_attributes() {
|
||||
return {
|
||||
url: this.url,
|
||||
reportIssue: i18n('reportIssue'),
|
||||
debugLogCopy: i18n('debugLogCopy'),
|
||||
debugLogCopyAlt: i18n('debugLogCopyAlt'),
|
||||
};
|
||||
},
|
||||
copy(e) {
|
||||
e.preventDefault();
|
||||
window.copyText(e.currentTarget.href);
|
||||
Whisper.ToastView.show(Whisper.LinkedCopiedToast, document.body);
|
||||
},
|
||||
});
|
||||
Whisper.DebugLogView = Whisper.View.extend({
|
||||
templateName: 'debug-log',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue