Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #109 from Idrinth/idrinth
Browse files Browse the repository at this point in the history
Idrinth
  • Loading branch information
w20k authored Aug 9, 2016
2 parents 6742550 + e3d3e7d commit 5828589
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions stable.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,39 @@ var idrinth = {
idrinth.facebook.timeout = window.setTimeout ( idrinth.facebook.restart, 11111 );
}
},
copyToClipboard: function ( text ) {
var success;
try {
var textAreaElement = idrinth.ui.buildElement ( {
type: 'textarea',
id: "idrinth-copy-helper"
} );
textAreaElement.value = text;
idrinth.ui.body.appendChild ( textAreaElement );
textAreaElement.select ();
success = document.execCommand ( 'copy' );
} catch ( exception ) {
idrinth.log ( exception.getMessage () );
success = false;
}
idrinth.ui.removeElement ( "idrinth-copy-helper" );
return success;
},
sendNotification: function ( title, content ) {
if ( !( "Notification" in window ) ) {
return false;
}
if ( window.Notification.permission === "default" ) {
window.Notification.requestPermission ();
}
if ( window.Notification.permission === "denied" ) {
return false;
}
return new window.Notification ( title, {
icon: "https://dotd.idrinth.de/Resources/Images/logo.png",
body: content
} );
},
newgrounds: {
originalUrl: '',
raids: [ ],
Expand Down

0 comments on commit 5828589

Please sign in to comment.