Created
March 20, 2018 06:24
-
-
Save alexandr-kazakov/8222b6aa96d9de4a8f3e4062f2714de7 to your computer and use it in GitHub Desktop.
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
/* ------------------------------------------------------------------------- | |
begin Bookmark | |
* ------------------------------------------------------------------------- */ | |
$('.bookmark-add').click(function(event) { | |
event.preventDefault(); | |
if (window.sidebar && window.sidebar.addPanel) { // Mozilla Firefox Bookmark | |
window.sidebar.addPanel(document.title, window.location.href, ''); | |
} else if (window.external && ('AddFavorite' in window.external)) { // IE Favorite | |
window.external.AddFavorite(location.href, document.title); | |
} else if (window.opera && window.print) { // Opera Hotlist | |
this.title = document.title; | |
return true; | |
} else { // webkit - safari/chrome | |
alert('Press ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + ' + D to bookmark this page.'); | |
} | |
}); | |
/* ------------------------------------------------------------------------- | |
end Bookmark | |
* ------------------------------------------------------------------------- */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment