forked from MiBu/jquery.yesno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
76 lines (67 loc) · 3.07 KB
/
test.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>jquery.yesno demo</title>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="jquery.yesno.js"></script>
</head>
<body>
<div class="container">
<div class="row-fluid">
<div class="span12">
<h1>jQuery.YesNo demo</h1>
<p class="">I used Google homepage as link here. Hope they won't mind.'</p>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<fieldset>
<legend>No options:</legend>
<a href="http://google.com" class="btn btn-primary" data-yn-confirm="confirm">Click me</a>
</fieldset>
<fieldset>
<legend>Custome options inside data dash attributes</legend>
<a href="http://google.com" class="btn btn-primary" data-yn-text="Are you sure you are going to do this?" data-yn-no="No. Go back." data-yn-yes="I'm sure" data-yn-title="Warning!" data-yn-confirm="confirm">Click me</a>
</fieldset>
<fieldset>
<legend>Submit button of the form</legend>
<form id="post-form" action="http://www.google.com" method="post">
<button type="submit" class="btn btn-primary" data-yn-text="You are going to post this form?" data-yn-confirm="confirm">Click me</button>
</form>
</fieldset>
<fieldset>
<legend>Submitting form using data dash attribute</legend>
<button type="submit" class="btn btn-primary" data-yn-text="You are going to post some other form?" data-yn-post="true" data-yn-formId="post-form1" data-yn-confirm="confirm">Click me</button>
<form id="post-form1" action="http://www.google.com" method="post"></form>
</fieldset>
</div>
<div class="span6">
<div class="alert">
<pre>
// Default settings, can be overriden outside
$.fn.yesno.defaults = {
text: "Are you sure you want to do this?", //text in body
yes: "Yes", //text in confirm button
no: "No", //text in cancel button
title: "Are you sure?", //title of modal
post: false, //if element action=post and type!="submit"
formid: "" //id of the form to post
};
</pre>
</div>
<div class="alert">
<pre>
$.fn.yesno.parameters = {
autoinit: true, // if false, you need to init script manually
buttonminwidth: "100px" // min width of buttons
};
</pre>
</div>
</div>
</div>
</div>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
</body>
</html>