forked from hpbuniat/jquery-popunder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·130 lines (107 loc) · 4.58 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html>
<html>
<head>
<meta content="Hans-Peter Buniat" name="author">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Popunder with Cookie support</title>
<script type="text/javascript" src="bower_components/jquery/jquery.min.js"></script>
<!-- script type="text/javascript" src="src/jquery.min.js"></script-->
<!-- Cookie support -->
<script type="text/javascript" src="bower_components/jquery.cookie/jquery.cookie.js"></script>
<script type="text/javascript" src="src/jquery.popunder.js"></script>
</head>
<body>
<h1>jQuery-Popunder Demo Page</h1>
<h4>© Hans-Peter Buniat (<a href="https://github.com/hpbuniat/jquery-popunder/blob/master/LICENCE">LICENCE</a>) - (<a href="https://github.com/hpbuniat/jquery-popunder">Github Project</a>)</h4>
<hr />
<form id="testFormFour" action="#">
<h3>Testcase #1 (1 Popunder, use a function as parameter)</h3>
<pre>
window.fPopunder = function(event) {
if (!window.fPopunderStack) {
window.fPopunderStack = [[$(event.target).data('target')]];
}
return window.fPopunderStack;
};
$.popunder(window.fPopunder, '#testFormFour', '#testFormFour input[type="submit"]');
</pre>
<input id="submitButtonFourClick" data-target="http://www.github.com" type="submit" value="Open Popunder via Button-Click" />
</form>
<form id="testForm" action="#">
<h3>Testcase #2 (3 Popunder)</h3>
<pre>
window.aThreePopunder = [
['http://www.google.com', {window: {height:400, width:400}, blocktime: 1}],
['http://www.github.com', {window: {height:100, width:100}, cb: function() {
console.log('github.com has been opened');
}}],
['http://www.heise.de']
];
$.popunder(window.aThreePopunder, '#testForm', '#testForm input[type="submit"], #testForm a');
</pre>
<input id="submitButton" type="submit" value="Open Popunder via Form-Submit" />
<a href="#">Open Popunder via Link</a>
</form>
<div id="testFive">
<h3>Testcase #3 (1 Popunder)</h3>
<pre>
window.aPopunder = [
['http://www.github.com']
];
</pre>
<a href="#" onclick="$.popunder()">Open Popunder via Link</a>
</div>
<form id="testFormSix" target="_blank" action="http://www.bing.com">
<h3>Testcase #4 (1 Popunder, use a function as parameter - form with target="_blank")</h3>
<pre>
window.fPopunder = function(event) {
if (!window.fPopunderStack) {
window.fPopunderStack = [[$(event.target).data('target'), {window: {height:100, width:100}, cb: function() {
console.log('github.com has been opened');
}}]];
}
return window.fPopunderStack;
};
$.popunder(window.fPopunder, '#testFormSix', '#testFormSix input[type="submit"]');
</pre>
<input type="hidden" name="test" value="test" />
<input id="submitButtonSix" type="submit" data-target="http://www.google.com" value="Open Popunder via Button-Click" />
</form>
<form id="testFormTwo" action="#">
<h3>Not supported, legacy Testcase #5 (3 Popunder with explicit binding)</h3>
<pre>
var fHandler = function(e) {
$.popunder(window.aThreePopunder);
};
$('#submitButtonTwoClick').on('click', fHandler);
$('#testFormTwo a').on('click', fHandler);
$('#testFormTwo').on('submit', fHandler);
</pre>
<input id="submitButtonTwoClick" type="submit" value="Open Popunder via Button-Click" />
<a href="#">Open Popunder via Link</a>
</form>
<form id="testFormThree" action="#">
<h3>Not supported, legacy Testcase #6 (1 Popunder with explicit binding)</h3>
<pre>
window.aOnePopunder = [
['http://www.github.com']
];
var fOneHandler = function(e) {
$.popunder(window.aOnePopunder);
};
$('#submitButtonThreeClick').on('click', fOneHandler);
$('#testFormThree').on('submit', fOneHandler);
</pre>
<input id="submitButtonThreeClick" type="submit" value="Open Popunder via Button-Click" />
</form>
<a href="https://github.com/hpbuniat/jquery-popunder"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<script type="text/javascript">
$(function() {
$('form[target!="_blank"]').attr('action', document.location.href);
$('pre').each(function(i, e) {
eval(e.innerHTML);
});
});
</script>
</body>
</html>