Created
January 5, 2015 11:17
-
-
Save wegorich/8836f461917ceda3e95c to your computer and use it in GitHub Desktop.
goo.gl format link for dissertation literature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var textToPutOnClipboard = "This is some text"; | |
| document.addEventListener('copy', function(e) { | |
| e.clipboardData.setData('text/plain', textToPutOnClipboard); | |
| e.preventDefault(); | |
| }); | |
| $('#shortenerSubmitButton').on('mousedown',function(){ | |
| setTimeout(function(){ | |
| var host = new URL($('#shortenerInputText').val()).hostname; | |
| host = host.charAt(0).toUpperCase() + host.substring(1); | |
| console.log(host); | |
| var shortUrl = $('.GJUPD0RBPC').first().find('.GJUPD0RBOC.GJUPD0RBAD:nth-child(4) a').attr('href'); | |
| console.log(shortUrl); | |
| textToPutOnClipboard = host + ' [Электронный ресурс] / a. – Режим доступа: ' + shortUrl; | |
| $('#shortener div:nth-child(5)').html(textToPutOnClipboard); | |
| document.execCommand('copy'); | |
| window.open(shortUrl,"","width=600,height=300"); | |
| }, 500); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment