Add copy.js plugin and small logo for openAIRE

This commit is contained in:
Konstantinos Triantafyllou 2023-06-26 11:32:23 +03:00
parent f15bbfa726
commit 39cb4e56d0
2 changed files with 23 additions and 0 deletions

BIN
common/Logo_Small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

23
js/copy.js Normal file
View File

@ -0,0 +1,23 @@
var copy= {
exec: (id) => {
var element = document.getElementById(id);
if (document.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(element);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
}
try {
document.execCommand('copy');
return true;
} catch (err) {
console.error('unable to copy text');
return false;
}
}
}