-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
263 lines (228 loc) · 10.6 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jqFenster</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link href='//fonts.googleapis.com/css?family=Molengo&subset=latin,latin-ext' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="//www.blueprintcss.org/blueprint/screen.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="//www.blueprintcss.org/blueprint/print.css" type="text/css" media="print" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.0.0/styles/github.min.css" media="screen, projection" />
<link rel="stylesheet" href="//code.jquery.com/qunit/qunit-1.20.0.css" type="text/css" media="screen, projection" />
<!-- jqFenster styles. Optional if default template engine used. -->
<link rel="stylesheet" href="src/jquery.fenster.css" type="text/css" />
<style type="text/css">
h1, h2, h3{ font-family: "Molengo", "Trebuchet MS", "Tahoma"; }
body{ background-color: #FFFCE3; font: 14px "Trebuchet MS", "Tahoma"; }
div.container{ margin-top: 20px; background-color: #FFF6CA; border: 4px solid #FFEABC; padding: 10px; border-radius: 8px; }
pre{ margin: 0; }
div.jqFensterModal{ width: 400px; }
hr{ border-bottom: 2px solid #FFEABC; background-color: #FFD578; }
tbody tr:nth-child(even) td, tbody tr.even td{ background: #FFEABD; border-radius: 4px; }
</style>
</head>
<body>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.0.0/highlight.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/qunit/qunit-1.20.0.js"></script>
<script type="text/javascript">
$(function() {
$('div.code').each(
function (i, e) {
$(this).wrap('<pre><code></code></pre>');
hljs.tabReplace = ' ';
hljs.highlightBlock(e, null);
}
);
});
</script>
<!-- Full installation. Required. -->
<script type="text/javascript" src="jqEbony/jquery.ebony.js"></script>
<script type="text/javascript" src="src/jquery.fenster-helper.js"></script>
<script type="text/javascript" src="src/jquery.fenster.js"></script>
<script type="text/javascript" src="src/jquery.fenster-helper-template-table.js"></script>
<!-- Examples -->
<div class="container">
<h2>
jqFenster<br />
<small><small>Lightweight Modal Framework</small></small>
</h2>
<hr/>
<h3>
Tests (<a href="http://qunitjs.com/">QUnit</a>)
<button onclick="QUnit.start();return false;">Run</button>
</h3>
<script type="text/javascript" src="src/tests.js"></script>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<hr />
<h3>DOM Helpers (<a href="https://github.com/kkamkou/jqFenster/blob/master/src/jquery.fenster-helper.js" style="color:red">jquery.fenster-helper.js</a>)</h3>
<table>
<tr>
<td>
1. <a href="#" data-selector="#target" class="jqFenster" id="simplelink">Simple link</a>
<div class="code"><a href="#" data-selector="#target" class="jqFenster">Simple link</a></div>
</td>
</tr>
<tr>
<td>
2. <a href="#" data-selector="#targetSecond" data-options="{animationSpeed: 400}" class="jqFenster">With animation</a>
<div class="code"><a href="#" data-selector="#targetSecond" data-options="{animationSpeed: 400}"
class="jqFenster">With animation</a>
</div>
</td>
</tr>
<tr>
<td>
3. <a href="#" data-selector="#targetSecond" data-options="{animationSpeed: 0, noOverlay: true}" class="jqFenster">Without overlay and animation (appends to the end of this page)</a>
<div class="code"><a href="#" data-selector="#targetSecond" data-options="{animationSpeed: 0, noOverlay: true}"
class="jqFenster">Without overlay and animation</a></div>
</td>
</tr>
<tr>
<td>
4. <a href="#" data-selector="#targetSecond" data-options='{callbackOpen: "myOpen", callbackClose: "myClose"}' class="jqFenster">Callback</a>
<div class="code"><a href="#" data-selector="#targetSecond" data-options='{callbackOpen: "myOpen", callbackClose: "myClose"}'
class="jqFenster">Callback</a></div>
</td>
</tr>
<tr>
<td>
5. <a href="#" data-selector="#targetThird" class="jqFenster">Popup in Popup</a>
<div class="code"><a href="#" data-selector="#targetThird" class="jqFenster">Popup in Popup</a></div>
</td>
</tr>
<tr>
<td>
6. <a href="remote.html" class="jqFenster">Remote one</a>
<div class="code"><a href="remote.html" class="jqFenster">Remote one</a></div>
</td>
</tr>
<tr>
<td>
7. <button data-selector="#targetSecond" class="jqFenster">I'm button</button>
<div class="code"><button data-selector="#targetSecond" class="jqFenster">I'm button</button></div>
</td>
</tr>
<tr>
<td>
8. <button id="callbackOpenChanger">change the callbackOpen option globally</button>
<div class="code"><button id="callbackOpenChanger">change the callbackOpen option globally</button></div>
<div class="code">$('#callbackOpenChanger').bind('click', function () {
// global option for the jqFenster
$.jqFensterOptions.callbackOpen = function() {
alert('You have changed it globally');
};
// opens modal using object
$.fenster('#target').open();
return false;
});</div>
</td>
</tr>
</table>
<hr />
<h3>API (<a href="https://github.com/kkamkou/jqFenster/blob/master/src/jquery.fenster.js" style="color:red">jquery.fenster.js</a>)</h3>
<table>
<tr>
<td>
1. <button id="api1">open()</button>
<div class="code">// static, by jQuery object
$('#targetJsApiFirst').fenster().open();
// dynamic, by selector
$.fenster('#target').open();
// dynamic, just options
$.fenster({'selector': '#target'}).open();</div>
</td>
</tr>
<tr>
<td>
2. <button id="api2">reInit()</button>
<div class="code">// #1 example with an in-dom element
var $link = $('#simplelink'), modal;
modal = $.fensterFinder($link.click())
// it is possible to use {selector: '#targetSecond'} INSTEAD OF href
.setOptions({href: 'remote.html', options: {animationSpeed: 300}})
.reInit();
// later
modal.destroy();
// #2 example with a remote file
// this file
$.fenster({href: 'remote-reinit.html'}).open();
// remote-reinit.html
$('#reinitAnother').bind('click', function () {
// you can use the current element (this)
$.fensterFinder(this).setOptions(...).reInit();
return false;
});
</div>
</td>
</tr>
</table>
</div>
<!-- Inline elements -->
<div id="target" class="jqFensterModal">
<div class="jqFensterModalContent">
<h4>Hello, I'm the #target</h4>
<hr>
<a href="#" class="jqFensterClose">Close me please.</a>
</div>
<a href="#" class="jqFensterClose jqFensterModalClose">×</a>
</div>
<div id="targetHidden" class="jqFensterModal">
<div class="jqFensterModalContent">targetHidden</div>
<a href="#" class="jqFensterClose jqFensterModalClose">×</a>
</div>
<div id="targetSecond" class="jqFensterModal">
<div class="jqFensterModalContent">
Hello, I'm the #targetSecond,<br />
<form>
<fieldset>
<label for="test-input">Label:</label>
<input type="text" id="test-input" />
</fieldset>
</form>
<a href="#" class="jqFensterClose">[CloseMe]</a>
</div>
</div>
<div id="targetThird" class="jqFensterModal">
<div class="jqFensterModalContent">
Hello, I'm the #targetThird<br />
<a href="#" data-selector="#targetSecond" class="jqFenster">[Another]</a>
<a href="#" class="jqFensterClose">[CloseMe]</a>
</div>
</div>
<!-- javascript part -->
<script type="text/javascript">
$(function () {
$('#callbackOpenChanger').bind('click', function () {
// global option for the jqFenster
$.jqFensterOptions.callbackOpen = function() {
alert('You have changed it globally');
};
// opens modal using object
$.fenster('#target').open();
return false;
});
});
function myOpen() {
alert('open');
}
function myClose() {
alert('close');
}
</script>
<!-- API bindings -->
<script type="text/javascript">
$(function () {
$('#api1').bind('click', function () {
$('#targetSecond').fenster().open();
return false;
});
$('#api2').bind('click', function () {
$.fenster({'href': 'remote-reinit.html'}).open();
return false;
});
});
</script>
</body>
</html>