1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-01 14:28:07 +00:00

Custom copy clipboard notifications (#8211)

* Initial Commit

* Improve plugin tests

Fixes #8209

* Fix RSOE

* Fix extraneous copy to clipboard at startup
This commit is contained in:
Jeremy Ruston
2024-05-29 15:06:33 +01:00
committed by GitHub
parent 928f3fc413
commit 78fb4a2c1d
7 changed files with 53 additions and 24 deletions

View File

@@ -292,7 +292,9 @@ exports.copyToClipboard = function(text,options) {
} catch (err) {
}
if(!options.doNotNotify) {
$tw.notifier.display(succeeded ? "$:/language/Notifications/CopiedToClipboard/Succeeded" : "$:/language/Notifications/CopiedToClipboard/Failed");
var successNotification = options.successNotification || "$:/language/Notifications/CopiedToClipboard/Succeeded",
failureNotification = options.failureNotification || "$:/language/Notifications/CopiedToClipboard/Failed"
$tw.notifier.display(succeeded ? successNotification : failureNotification);
}
document.body.removeChild(textArea);
};