-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathindex.html
executable file
·162 lines (136 loc) · 6.66 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!DOCTYPE html>
<html>
<head>
<meta content="Hans-Peter Buniat" name="author">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="expires" content="0" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="page-type" content="html"/>
<title>Popunder with Cookie support</title>
<!-- script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script-->
<script type="text/javascript" src="src/jquery.min.js"></script>
<!-- Cookie support -->
<script type="text/javascript" src="bower_components/js-cookie/src/js.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="testFormOne" action="https://www.google.de" method="GET">
<h3>Testcase #1 (1 Popunder, use a function as parameter)</h3>
<pre>
window.fPopunder = function(event) {
if (!window.fPopunderStack) {
window.fPopunderStack = [
['https://www.bing.com']
];
}
return window.fPopunderStack;
};
$.popunder(window.fPopunder, '#testFormOne', '#testFormOne input[type="submit"]');
</pre>
<input type="hidden" name="q" value="jquery-popunder" />
<input id="submitButtonOneClick" type="submit" value="Open Popunder via Button-Click" />
</form>
<form id="testFormTwo" action="https://www.google.de" method="GET">
<h3>Testcase #2 (3 Popunder)</h3>
<pre>
window.aThreePopunder = [
['https://www.github.com', {window: {height:400, width:400}, blocktime: 1}],
['https://www.bing.com', {window: {height:100, width:100}, cb: function() {
console.log('bing.com has been opened');
}}],
['https://www.google.com']
];
$.popunder(window.aThreePopunder, '#testFormTwo', '#testFormTwo input[type="submit"], #testFormTwo a');
</pre>
<input type="hidden" name="q" value="jquery-popunder" />
<input id="submitButton" type="submit" value="Open Popunder via Form-Submit" />
<a href="#">Open Popunder via Link</a>
</form>
<div id="testThree">
<h3>Testcase #3 (1 Popunder)</h3>
<pre>
window.aPopunder = [
['https://www.bing.com']
];
</pre>
<a href="#" onclick="$.popunder(this)">Open Popunder via Link</a>
</div>
<form id="testFormFour" target="_blank" action="https://www.google.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 = [
['https://www.bing.com', {window: {height:100, width:100}, cb: function(popunderWindow) {
console.log('google.com has been opened', popunderWindow);
}}]
];
}
return window.fPopunderStack;
};
$.popunder(window.fPopunder, '#testFormFour', '#testFormFour input[type="submit"]');
</pre>
<input type="hidden" name="test" value="test" />
<input type="submit" value="Open Popunder via Button-Click" />
</form>
<form id="testFormFive" action="#">
<h3>Testcase #5 (1 Popunder, use a function as parameter and check for enabled checkboxes)</h3>
<pre>
window.fPopunder = function(event) {
if (!window.fPopunderStack) {
var $checkboxes = $(event.target).parent('form').eq(0).find('input[type="checkbox"]:checked'),
stack = [];
$.each($checkboxes, function(i, d) {
stack.push([$(d).val()]);
});
window.fPopunderStack = stack;
}
return window.fPopunderStack;
};
$.popunder(window.fPopunder, '#testFormFive', '#testFormFive input[type="submit"]');
</pre>
<p>
<input id="checkBoxOne" type="checkbox" value="https://www.github.com" /> <label for="checkBoxOne">github.com</label>
</p>
<input id="submitButtonFiveClick" type="submit" value="Open Popunder via Button-Click" />
<a href="#">Open Popunder via Link</a>
</form>
<div id="testFormSix">
<h3>Example #6 (unbind a popunder)</h3>
<pre>
window.fPopunder = function(event) {
if (!window.fPopunderStack) {
window.fPopunderStack = [
['https://www.github.com']
];
}
return window.fPopunderStack;
};
$.popunder(window.fPopunder, '#testFormSix', '#testFormSix input[type="submit"]');
</pre>
<div style="display:none">
<input id="submitButtonSix" type="submit" value="Open Popunder via Button-Click" />
</div>
<a href="#" onclick="$.popunder.helper.unbind('#testFormSix', '#submitButtonSix');">Unbind popunder</a>
<a href="#" onclick="$('#submitButtonSix').parent('div').show();">Show Button</a>
</div>
<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[action="#"]').attr('action', document.location.href);
$('pre').each(function(i, e) {
eval(e.innerHTML);
});
});
</script>
</body>
</html>