-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
39 lines (37 loc) · 1.73 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>jQuery Bookmarklet</title>
</head>
<body>
<p>
<a id="bookmarklet">BOOKMARKLET</a>
</p>
<script type="text/javascript" language="javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
//
// change these values
//
var scriptPath = 'http://github.com/spoon16/jQuery-Bookmarklet/raw/master/bookmarklet.js';
var postPath = 'http://spoon16.github.com/jQuery-Bookmarklet/bookmarklet.html';
var minVersion = '1.4.2';
var initFunction = '__initBookmarklet';
//
// the script that is executed when the bookmarklet is clicked
//
var bookmarklet = "javascript:function%20__i(){jQueryBookmarklet.init('" + minVersion + "'," + initFunction + ");};(function(__u){var%20__d=document,__b=__d.body;__scriptPath=__u;__postPath='" + postPath + "';try{if(!__b)throw(0);if(typeof(jQueryBookmarklet)!='undefined'){__i();}else{var%20__s=__d.createElement('script');__s.type='text/javascript';__s.src=__scriptPath;__s.onload=__s.onreadystatechange=function(){if(__s.readyState||__s.readyState=='loaded'||__s.readyState=='complete'){__s.onreadystatechange=null;__i();}else{__i();}};__d.getElementsByTagName('head')[0].appendChild(__s);}}catch(e){alert('Wait%20till%20page%20has%20loaded%20and%20try%20again')}})('" + scriptPath + "?'+Math.round(Math.random()*10000000));";
//
// set bookmarklet href value
//
$(document).ready(function () {
$('#bookmarklet')
.attr('href', bookmarklet)
.click(function (event) {
alert('Drag bookmarklet to your bookmark toolbar to install.');
event.preventDefault();
});
});
</script>
</body>
</html>