-
Notifications
You must be signed in to change notification settings - Fork 52
/
bootstrap.html
173 lines (167 loc) · 5.9 KB
/
bootstrap.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Portlet</title>
<link rel="stylesheet" href="../lib/bootstrap/css/bootstrap.min.css" />
<!-- jquery 1.4 and jquery ui 1.8 -->
<link rel="stylesheet" href="../lib/themes/bootstrap/jquery-ui-1.10.0.custom.css" />
<link rel="stylesheet" href="../lib/themes/bootstrap/jquery.ui.1.10.0.ie.css" />
<link rel="stylesheet" href="../css/jquery.portlet.css?v=1.3.1" />
<script src="../lib/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../lib/jquery-ui-1.10.2.custom.min.js" type="text/javascript"></script>
<!--<link rel="stylesheet" href="../lib/themes/1.9/start/jquery-ui-1.9.1.custom.min.css" />-->
<!--<script src="../lib/jquery-1.8.3.js" type="text/javascript"></script>-->
<!--<script src="../lib/themes/jquery-ui-1.9.1.custom.min.js" type="text/javascript"></script>-->
<script src="../script/jquery.portlet.pack.js?v=1.3.1"></script>
<style>
body {font-size: 13px;}
.highlight-content {color: red;}
</style>
<script>
$(function() {
$('#portlet-demo').portlet({
sortable: true,
create: function() {
//alert('created portlet.');
},
removeItem: function() {
alert('after remove');
},
columns: [{
width: 400,
portlets: [{
attrs: {
id: 'feeds'
},
title: function() {
var d = new Date();
return 'Feeds(' + (d.getMonth() + 1) + '-' + d.getDate() + '日)';
},
icon: 'ui-icon-signal-diag',
content: {
//设置区域内容属性
style: {
height: '100'
},
type: 'text',
text: '<ul><li>Feed item 1</li><li>Feed item 2</li></ul>',
beforeShow: function(aa) {
//alert('before show, content is: ' + aa);
},
afterShow: function() {
//alert('after show');
}
},
scripts: ['loaded-by-portlet.js']
}, {
attrs: {
id: 'news'
},
title: '主题整合支持',
beforeRefresh: function() {
alert("before refresh");
},
afterRefresh: function(data) {
//alert("after refresh: " + data);
},
content: {
style: {
height: '300'
},
type: 'text',
text: function() {
return $('#newsTemplate').html();
//return $('#newsTemplate ul');
}
}
}]
}, {
width: 350,
portlets: [{
title: 'Code',
content: {
type: 'text',
text: function() {
return $('#code').html();
}
}
}, {
title: 'Ajax 错误',
content: {
type: 'ajax',
url: 'noexsit.html',
error: function() {
$(this).append('<br/><br/>捕获到ajax错误');
// alert('出错了');
}
}
}, {
title: 'Table',
content: {
type: 'text',
text: function() {
return $('#tableTemplate').html();
}
}
}]
}]
});
});
</script>
</head>
<body>
<div class="ui-state-highlight ui-corner-all" style="padding: 0 .7em;">
<p>
<i class="icon-heart"></i>使用Bootstrap主题(由jQuery UI的Bootstrap主题风格支持)
</p>
</div>
<hr class='ui-widget-content' />
<div id='portlet-demo'></div>
<!-- 模板 -->
<div id="newsTemplate" style="display:none">
<a href="http://addyosmani.github.com/jquery-ui-bootstrap/">http://addyosmani.github.com/jquery-ui-bootstrap/</a>
<hr/>
<p class="text-warning">警告信息。</p>
<p class="text-error">错误信息。</p>
<p class="text-info">提示信息。</p>
<p class="text-success">成功信息。</p>
<button class="btn btn-primary">Bootstrap的按钮</button>
</div>
<div id="tableTemplate" style="display:none">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td>2</td>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<td>3</td>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
<div id="code" style="display:none">
<code>.highlight-content {color: red;}</code>
</div>
</body>
</html>