-
Notifications
You must be signed in to change notification settings - Fork 161
/
bookmarklet.html
93 lines (81 loc) · 2.4 KB
/
bookmarklet.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Visual Event javascript booklet</title>
<style type="text/css" media="screen">
body {
font: 80%/1.45em Arial, Verdana, Helvetica, sans-serif;
margin: 0;
padding: 0;
}
#wrapper {
width: 800px;
margin: 0 auto;
}
textarea {
width: 100%;
height: 300px
}
</style>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {
$('#js').keyup( makeBookmarklet );
makeBookmarklet();
} );
function makeBookmarklet () {
var s = $('#js').val();
var a = s.split('\n');
for ( var i=0, iLen=a.length ; i<iLen ; i++ ) {
a[i] = $.trim(a[i]);
if ( a[i].indexOf('//') === 0 ) {
a[i] = "";
}
}
s = a.join('');
s.replace( ' ', '%20' );
document.getElementById('bookmarklet').href = "javascript:"+s;
}
</script>
</head>
<body>
<div id="wrapper">
<h1>Visual Event bookmarklet generator</h1>
<p>
Visual Event is a bookmarklet which will visually show you which elements on an HTML
page have Javascript events assigned to them. This page can be used to generate the
bookmarklet that you want to use for testing or deployment of Visual Event.
</p>
<p>
To generate a bookmarklet, modify the Javascript in the textarea below, the
bookmarklet link will be updated as you type (typically you will only need to
change the URL to load Visual Event) and then click and drag the
<i>Visual Event</i> link to your bookmarklet bar.
</p>
<p style="text-align:center">
<a id="bookmarklet" href="">Visual Event</a>
</p>
<textarea id="js">(function() {
var protocol = window.location.protocol === 'file:' ?
'http:' : '';
var url = protocol+'//www.sprymedia.co.uk/VisualEvent/VisualEvent_Loader.js';
//var url = protocol+'//localhost/VisualEvent/builds/VisualEvent_Loader.js';
if( typeof VisualEvent!='undefined' ) {
if ( VisualEvent.instance !== null ) {
VisualEvent.close();
}
else {
new VisualEvent();
}
}
else {
var n=document.createElement('script');
n.setAttribute('language','JavaScript');
n.setAttribute('src',url+'?rand='+new Date().getTime());
document.body.appendChild(n);
}
})();</textarea>
</div>
</body>
</html>