├── index.php
├── monit.sock
├── port.json
├── public
├── images
│ ├── Thumbs.db
│ ├── ajax-loading.gif
│ ├── glyphicons-halflings.png
│ └── glyphicons-halflings-white.png
├── stylesheets
│ ├── style.css
│ └── bootstrap-responsive.css
└── javascripts
│ ├── serverInform.js
│ ├── main.js
│ ├── bootstrap.js
│ └── jquery-1.8.0.min.js
├── views
├── index.jade
└── layout.jade
├── .gitignore
├── routes
├── index.js
└── cache.js
├── package.json
├── README.md
└── app.js
/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/monit.sock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/port.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "tcp",
3 | "port": 3000
4 | }
5 |
--------------------------------------------------------------------------------
/public/images/Thumbs.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlemaneuver/open-m-monit/HEAD/public/images/Thumbs.db
--------------------------------------------------------------------------------
/public/images/ajax-loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlemaneuver/open-m-monit/HEAD/public/images/ajax-loading.gif
--------------------------------------------------------------------------------
/views/index.jade:
--------------------------------------------------------------------------------
1 | extends layout
2 |
3 | block content
4 | div.content
5 | div#load
6 | img(src='/images/ajax-loading.gif')
--------------------------------------------------------------------------------
/public/images/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlemaneuver/open-m-monit/HEAD/public/images/glyphicons-halflings.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # General
2 | *~
3 |
4 | # Specific
5 | config.json
6 | .idea/
7 | projectFilesBackup/
8 | node_modules/
9 | .DS_store
10 |
--------------------------------------------------------------------------------
/public/images/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlemaneuver/open-m-monit/HEAD/public/images/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/routes/index.js:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * GET home page.
4 | */
5 |
6 | exports.index = function(req, res){
7 | res.render('index', { title: 'Express' });
8 | };
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "application-name",
3 | "version": "0.0.2",
4 | "private": true,
5 | "scripts": {
6 | "start": "node app"
7 | },
8 | "dependencies": {
9 | "express": "3.0.3",
10 | "jade": "*",
11 | "node-xml2json": "^1.0.0",
12 | "request": "^2.72.0",
13 | "socket.io": "^1.4.8"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/public/stylesheets/style.css:
--------------------------------------------------------------------------------
1 | html {
2 | width: 100%;
3 | }
4 | body {
5 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
6 | width: 100%;
7 | }
8 |
9 | a {
10 | color: #00B7FF;
11 | }
12 | .border {
13 | margin-left: 8px;
14 | }
15 | .content{
16 | width: 100%;
17 | }
18 | #load {
19 | margin-left: auto;
20 | width: 400px;
21 | height: 400px;
22 | margin: auto;
23 | }
24 | a.active,
25 | a.active:hover {
26 | font-weight: bold;
27 | background: lightblue !important;
28 | }
--------------------------------------------------------------------------------
/routes/cache.js:
--------------------------------------------------------------------------------
1 | module.exports = (function () {
2 | var cache = {};
3 | var addToCache = function (name, elem) {
4 | "use strict";
5 | cache[name] = {elem: elem, timeToDie: (new Date)};
6 | },
7 | useInformationFromCache = function (name) {
8 | "use strict";
9 | if (cache[name] && (((new Date) - cache[name].timeToDie) < 5 * 60 * 1000)) {
10 | return cache[name].elem;
11 | } else {
12 | return false;
13 | }
14 | },
15 | removeInformationFromCache = function (name) {
16 | "use strict";
17 | delete cache[name];
18 | };
19 | return {
20 | add: addToCache,
21 | use: useInformationFromCache,
22 | remove: removeInformationFromCache
23 | };
24 | })();
--------------------------------------------------------------------------------
/views/layout.jade:
--------------------------------------------------------------------------------
1 | doctype html
2 | html
3 | head
4 | title open-m-monit
5 | link(rel='stylesheet', href='/stylesheets/bootstrap.css')
6 | link(rel='stylesheet', href='/stylesheets/bootstrap-responsive.css')
7 | link(rel='stylesheet', href='/stylesheets/style.css')
8 | body
9 | script(src='/javascripts/jquery-1.8.0.min.js')
10 | script(src='/javascripts/bootstrap.js')
11 | script(src='/socket.io/socket.io.js')
12 | -if (href === '') {
13 | script(src='/javascripts/main.js')
14 | - } else {
15 | script(src='/javascripts/serverInform.js')
16 | - }
17 | div.navbar
18 | div.navbar-inner
19 | ul.nav
20 | each cluster in clusters
21 | li
22 | a(href="/cluster/" + cluster)=cluster
23 | -if (href !== '') {
24 | li
25 | a > #{href}
26 | - }
27 | block content
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Open-m-monit on Nodejs
2 |
3 |
4 | ### how to run
5 | 1. Create the file config.json and add your monit servers:
6 |
7 | ```javascript
8 | {"clusterName":
9 | [
10 | {
11 | "hostname": "serverHostname or ip and port",
12 | "username": "baseAuth username",
13 | "password": "your baseAuth password",
14 | "protocol": "https(optional, http by default)",
15 | "alias" : "aliasName(optional, means short name)"
16 | },
17 | ....
18 | ],
19 | ....
20 | }
21 | ```
22 | 2. Configure your port. U can use **tcp** or **unix** socket. Change *port.json*:
23 |
24 | ```javascript
25 | {
26 | "type": "tcp",
27 | "port": 3000
28 | }
29 | ```
30 | or:
31 |
32 | ```javascript
33 | {
34 | "type": "unix",
35 | "socket": "path_to_file"
36 | }
37 | ```
38 | 3. run `node app`
39 | Your open-m-monit is at `your.hostname:port`.
40 |
41 | All information about m-monit is available [here](http://mmonit.com/).
42 |
--------------------------------------------------------------------------------
/public/javascripts/serverInform.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function () {
2 | var url = document.URL.split('/');
3 | url.length = 3;
4 | url = url.join('/');
5 | var serverInfo = io.connect(url + '/server'),
6 | content = $('.content');
7 | var getUptime = function (seconds) {
8 | var kof = Math.floor(seconds/86400),
9 | div = seconds - kof*86400,
10 | days = (kof > 0) ? kof : 0,
11 | hours,
12 | minutes;
13 | kof = Math.floor(div/3600);
14 | hours = (kof > 0) ? kof : 0;
15 | div -= kof*3600;
16 | kof = Math.floor(div/60);
17 | minutes = (kof > 0) ? kof : 0;
18 | minutes = Math.floor(minutes);
19 | return "" + days + "d :" + hours + "h :" + minutes + "m";
20 | },
21 | buildInform = function (data) {
22 | var prop,
23 | prop2,
24 | table = $('
', {
25 | "class": "table table-bordered table-hover"
26 | }),
27 | htr = $('
'),
28 | btr = $('
');
29 | for (prop in data) {
30 | if (typeof data[prop] === 'object') {
31 | for (prop2 in data[prop]) {
32 | htr.append('' + prop2 + ' | ');
33 | btr.append('' + data[prop][prop2] + ' | ');
34 | }
35 | } else {
36 | if (prop === 'uptime') {
37 | htr.append('' + prop + ' | ');
38 | btr.append('' + getUptime(data[prop]) + ' | ');
39 | } else {
40 | htr.append('' + prop + ' | ');
41 | btr.append('' + data[prop] + ' | ');
42 | }
43 | }
44 | }
45 | return table.append($('').append(htr)).append($('').append(btr));
46 | },
47 | buildTable = function (data) {
48 | div = $('');
49 | div.append('Platform
')
50 | .append(buildInform(data.platform))
51 | .append('Server
')
52 | .append(buildInform(data.server));
53 | return div;
54 | };
55 | serverInfo.on('serverInfo', function (data) {
56 | content.html(buildTable(data));
57 | });
58 | (function () {
59 | var links = $('.nav a'),
60 | name = location.search.match(/cluster=(.+)/)[1];
61 | console.log(name);
62 | links.removeClass('active');
63 | $.each(links, function (i, link) {
64 | "use strict";
65 | link = $(link);
66 | if (link.text() == decodeURI(name)) {
67 | link.addClass('active');
68 | }
69 | });
70 | })();
71 | });
72 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Module dependencies.
3 | */
4 |
5 | var express = require('express')
6 | , routes = require('./routes')
7 | , http = require('http')
8 | , path = require('path')
9 | , cache = require('./routes/cache');
10 |
11 | var app = express(),
12 | server = http.createServer(app),
13 | io = require('socket.io').listen(server),
14 | request = require('request'),
15 | fs = require('fs'),
16 | xml = require('node-xml2json'),
17 | dnsList = JSON.parse(fs.readFileSync('config.json', 'utf-8')),
18 | connectionConf = JSON.parse(fs.readFileSync('port.json', 'utf-8')),
19 | clusters = Object.keys(dnsList),
20 | cluster = clusters[0],
21 | smallDnsList = dnsList[cluster],
22 | serverInterval,
23 | infoTime = 5000 * (smallDnsList.length + 1),
24 | infoInterval,
25 | port,
26 | totalArray = [],
27 | firstTimeUse = {};
28 |
29 | clusters.forEach(function (name) {
30 | "use strict";
31 | firstTimeUse[name] = false;
32 | });
33 |
34 | if (connectionConf.type === 'tcp') {
35 | port = connectionConf.port;
36 | } else if (connectionConf.type === 'unix') {
37 | port = connectionConf.socket;
38 | } else {
39 | port = 3000;
40 | }
41 |
42 |
43 | app.configure(function () {
44 | app.set('port', port);
45 | app.set('views', __dirname + '/views');
46 | app.set('view engine', 'jade');
47 | app.enable('view cache');
48 | app.use(express.favicon());
49 | //app.use(express.logger('dev'));
50 | app.use(express.bodyParser());
51 | app.use(express.methodOverride());
52 | app.use(app.router);
53 | app.use(express.static(path.join(__dirname, 'public')));
54 | });
55 |
56 | //app.configure('development', function(){
57 | // app.use(express.errorHandler());
58 | //});
59 |
60 | fs.watchFile('config.json', function (current) {
61 | "use strict";
62 | dnsList = JSON.parse(fs.readFileSync('config.json', 'utf-8'));
63 | clusters = Object.keys(dnsList);
64 | cluster = clusters[0];
65 | smallDnsList = dnsList[cluster];
66 | });
67 |
68 | var findInform = function (hostname, data) {
69 | var inform = {};
70 | for (var i = 0; i < data.length; i++) {
71 | if (data[i].hostname === hostname) {
72 | inform = {
73 | username: data[i].username,
74 | password: data[i].password,
75 | hostname: data[i].hostname,
76 | alias: data[i].alias
77 | };
78 | }
79 | }
80 | return inform;
81 | };
82 | var serverInfo = io.of('/server'),
83 | serverInformation;
84 |
85 | app.get('/', function (req, res) {
86 | clearInterval(infoInterval);
87 | clearInterval(serverInformation);
88 | res.redirect('/cluster/' + cluster);
89 |
90 | //res.render('index', {href: '', dnsList: Object.keys(dnsList)});
91 | });
92 | app.get('/cluster/:clusterName', function (req, res) {
93 | "use strict";
94 | cluster = req.params.clusterName;
95 | firstTimeUse[cluster] = true;
96 | clearInterval(infoInterval);
97 | clearInterval(serverInformation);
98 | smallDnsList = dnsList[cluster];
99 | infoTime = 5000 * (smallDnsList.length + 1);
100 | res.render('index', {clusters: clusters, href: ''});
101 | });
102 | app.get('/inform', function (req, res) {
103 | clearInterval(infoInterval);
104 | var href = req.query.href.replace(/%2F/, '/').replace(/%3A/, ':');
105 | cluster = req.query.cluster.replace(/%2F/, '/').replace(/%3A/, ':');
106 | smallDnsList = dnsList[cluster];
107 | serverInformation = findInform(href, smallDnsList);
108 | res.render('index', {
109 | clusters: clusters,
110 | href: serverInformation.hostname,
111 | alias: serverInformation.alias
112 | });
113 | });
114 |
115 | var getProtocol = function (config) {
116 | return (config.protocol || 'http') + '://';
117 | };
118 |
119 | var buildBaseUrl = function (config) {
120 | return getProtocol(config) + config.username + ':' + config.password + '@' + config.hostname + "/_status?format=xml";
121 | };
122 |
123 | var refreshServer = function () {
124 | var url = buildBaseUrl(serverInformation);
125 | request({url: url, timeout: 5000}, function (error, response, body) {
126 | if (!error && response.statusCode === 200) {
127 | body = xml.parser(body).monit;
128 | serverInfo.emit('serverInfo', {
129 | platform: body.platform,
130 | server: body.server,
131 | dns: serverInformation.hostname,
132 | alias: serverInformation.alias
133 | });
134 | } else {
135 | console.error(error.message);
136 | serverInfo.emit('serverInfo', {
137 | platform: {},
138 | server: {},
139 | dns: serverInformation.hostname,
140 | message: 'Your server is not available!'
141 | });
142 | }
143 | });
144 | };
145 |
146 | serverInfo.on('connection', function (socket) {
147 | clearInterval(infoInterval);
148 | clearInterval(serverInformation);
149 | var url = buildBaseUrl(serverInformation) + "/_status?format=xml";
150 | request({url: url, timeout: 5000}, function (error, response, body) {
151 | if (!error && response.statusCode === 200) {
152 | body = xml.parser(body).monit;
153 | serverInfo.emit('serverInfo', {
154 | platform: body.platform,
155 | server: body.server,
156 | dns: serverInformation.hostname,
157 | alias: serverInformation.alias
158 | });
159 | } else {
160 | console.error(error.message);
161 | serverInfo.emit('serverInfo', {
162 | platform: {},
163 | server: {},
164 | dns: serverInformation.hostname,
165 | message: 'Your server is not available!'
166 | });
167 | }
168 | });
169 | serverInterval = setInterval(refreshServer, 5000);
170 | });
171 |
172 |
173 | var info = io.of('/info').on('connection', function (socket) {
174 | clearInterval(infoInterval);
175 | clearInterval(serverInformation);
176 | totalArray = cache.use(cluster);
177 | if (firstTimeUse[cluster] && totalArray) {
178 | socket.emit('data', {data: totalArray});
179 | cache.remove(cluster);
180 | firstTimeUse[cluster] = false;
181 | } else {
182 | totalArray = [];
183 | smallDnsList.forEach(function (dns, index, list) {
184 | var url = buildBaseUrl(dns);
185 | request({url: url, timeout: 5000}, function (error, response, body) {
186 | if (!error && response.statusCode === 200) {
187 | totalArray.push({body: xml.parser(body), id: index, dns: dns.hostname, alias: dns.alias});
188 | } else {
189 | console.error(error.message);
190 | totalArray.push({
191 | body: {monit: {service: []}},
192 | id: index,
193 | dns: dns.hostname,
194 | message: 'Your server is not available!'
195 | });
196 | }
197 | if (totalArray.length === list.length) {
198 | socket.emit('data', {data: totalArray});
199 | cache.add(cluster, totalArray);
200 | totalArray = [];
201 | }
202 | });
203 | });
204 | }
205 | socket.on('sendData', function (data) {
206 | var information = findInform(data.href.split('/')[0], smallDnsList);
207 |
208 | request.post({
209 | url: getProtocol(information) + information.username + ":" + information.password + "@" + data.href,
210 | headers: {'content-type': 'application/x-www-form-urlencoded'},
211 | body: 'action=' + data.action
212 | }, function (error, response, body) {
213 | if (!error && response.statusCode === 200) {
214 | info.emit('good', {body: body});
215 | } else {
216 | console.error(error.message);
217 | info.emit('bad', {body: body});
218 | }
219 | });
220 | });
221 | infoInterval = setInterval(refresh, infoTime);
222 | });
223 |
224 |
225 | var refresh = function () {
226 | totalArray = cache.use(cluster);
227 | if (firstTimeUse[cluster] && totalArray) {
228 | info.emit('data', {data: totalArray});
229 | cache.remove(cluster);
230 | firstTimeUse[cluster] = false;
231 | } else {
232 | totalArray = [];
233 | smallDnsList.forEach(function (dns, index, list) {
234 | var url = buildBaseUrl(dns);
235 | request({url: url, timeout: 5000}, function (error, response, body) {
236 | if (!error && response.statusCode === 200) {
237 | totalArray.push({body: xml.parser(body), id: index, dns: dns.hostname, alias: dns.alias});
238 | } else {
239 | console.error(error.message);
240 | totalArray.push({
241 | body: {monit: {service: []}},
242 | id: index,
243 | dns: dns.hostname,
244 | message: 'Your server is not available!'
245 | });
246 | }
247 | if (totalArray.length === list.length) {
248 | info.emit('data', {data: totalArray});
249 | totalArray = [];
250 | }
251 | });
252 | });
253 | }
254 | };
255 |
256 | server.listen(app.get('port'), function () {
257 | console.log("Express server listening on port " + app.get('port'));
258 | });
259 |
260 | process.on('uncaughtException', function (exception) {
261 | // handle or ignore error
262 | console.log(exception);
263 | });
264 |
265 |
--------------------------------------------------------------------------------
/public/javascripts/main.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function () {
2 | var url = document.URL.split('/');
3 | url.length = 3;
4 | url = url.join('/');
5 | var socketInfo = io.connect(url + '/info'),
6 | table = $('', {
7 | "class": "table table-bordered table-hover"
8 | }),
9 | content = $('.content');
10 | var isLocalStorageAvailable = function () {
11 | "use strict";
12 | if (window.localStorage) {
13 | return true;
14 | } else {
15 | return false;
16 | }
17 | },
18 | getUptime = function (seconds) {
19 | var kof = Math.floor(seconds/86400),
20 | div = seconds - kof*86400,
21 | days = (kof > 0) ? kof : 0,
22 | hours,
23 | minutes;
24 | kof = Math.floor(div/3600);
25 | hours = (kof > 0) ? kof : 0;
26 | div -= kof*3600;
27 | kof = Math.floor(div/60);
28 | minutes = (kof > 0) ? kof : 0;
29 | minutes = Math.floor(minutes);
30 | return "" + days + "d :" + hours + "h :" + minutes + "m";
31 | },
32 | buildActionMenu = function (href) {
33 | var block = $(' | ');
34 | block.append($('', {
35 | "class": "tooltips",
36 | "data-original-title": "Start process",
37 | "data-placement": "top",
38 | "data-delay": {show: 300, hide: 200},
39 | "href": "#"
40 | }).append($('', {
41 | "class": "border icon-play",
42 | "data-href": href,
43 | "data-action": "start"
44 | }))).append($('', {
45 | "class": "tooltips",
46 | "data-original-title": "Stop process",
47 | "data-placement": "top",
48 | "data-delay": {show: 300, hide: 200},
49 | "href": "#"
50 | }).append($('', {
51 | "class": "border icon-stop",
52 | "data-href": href,
53 | "data-action": "stop"
54 | }))).append($('', {
55 | "class": "tooltips",
56 | "data-original-title": "Restart process",
57 | "data-placement": "top",
58 | "data-delay": {show: 300, hide: 200},
59 | "href": "#"
60 | }).append($('', {
61 | "class": "border icon-refresh",
62 | "data-href": href,
63 | "data-action": "restart"
64 | }))).append($('', {
65 | "class": "tooltips",
66 | "data-original-title": "Unwatch process",
67 | "data-placement": "top",
68 | "data-delay": {show: 300, hide: 200},
69 | "href": "#"
70 | }).append($('', {
71 | "class": "border icon-eye-close",
72 | "data-href": href,
73 | "data-action": "unmonitor"
74 | })));
75 | return block;
76 | },
77 | buildTable = function (data, table) {
78 | var dns = data.dns,
79 | alias = data.alias || dns,
80 | id = data.id,
81 | processes = data.body.monit.service,
82 | length = processes.length,
83 | row,
84 | count = 0;
85 | row = table.find('#' + id);
86 | if (data.message !== undefined) {
87 | row.append($(' | ',
88 | {
89 | "colspan": 4,
90 | "text": dns
91 | })).append($(' | ',
92 | {
93 | "colspan": 4,
94 | "text": data.message
95 | }));
96 | row.addClass('error');
97 | } else {
98 | $(' | ').append($('', {"class": "inform",
99 | "href": dns,
100 | "text": alias})).appendTo(row);
101 | for (var i = 0; i < length; i += 1) {
102 | /* disk */
103 | if (processes[i].type == 0) {
104 | $(' | ', {text: processes[i].name, "class": "process-name"}).appendTo(row);
105 | if (processes[i].collected_sec !== undefined) {
106 | $(' | ', {text: processes[i].pid}).appendTo(row);
107 | $(' | ', {text: "Accessible", "class": 'status'}).appendTo(row);
108 | $(' | ', {text: ""}).appendTo(row);
109 | $(' | ', {text: processes[i].block.percent + '%'}).appendTo(row);
110 | $(' | ', {text: processes[i].inode.percent + '%'}).appendTo(row);
111 | $(buildActionMenu(dns + '/' + processes[i].name)).appendTo(row);
112 | } else {
113 | row.addClass('error');
114 | $(' | ').appendTo(row);
115 | $(' | ', {text: 'stopped', "class": 'status'}).appendTo(row);
116 | $(' | ', {text: '0'}).appendTo(row);
117 | $(' | ', {text: '0'}).appendTo(row);
118 | $(' | ', {text: '0'}).appendTo(row);
119 | $(' | ').append($('', {
120 | "class": "tooltips",
121 | "data-original-title": "Watch process",
122 | "data-placement": "top",
123 | "data-delay": {show: 300, hide: 200},
124 | "href": "#"
125 | }).append($('', {"class": "center icon-eye-open",
126 | "data-href": dns + '/' + processes[i].name,
127 | "data-action": "monitor"}))).appendTo(row);
128 | }
129 | row.after($('
'));
130 | row = row.next();
131 | } else if (processes[i].type == 3) {
132 | $(' | ', {text: processes[i].name, "class": "process-name"}).appendTo(row);
133 | if (processes[i].uptime !== undefined) {
134 | $(' | ', {text: processes[i].pid}).appendTo(row);
135 | $(' | ', {text: 'running', "class": 'status'}).appendTo(row);
136 | $(' | ', {text: getUptime(parseInt(processes[i].uptime, 10))}).appendTo(row);
137 | $(' | ', {text: processes[i].cpu.percenttotal + '%'}).appendTo(row);
138 | $(' | ', {text: processes[i].memory.percenttotal + '% [' + processes[i].memory.kilobytetotal + 'kb]'}).appendTo(row);
139 | $(buildActionMenu(dns + '/' + processes[i].name)).appendTo(row);
140 | } else {
141 | row.addClass('error');
142 | $(' | ').appendTo(row);
143 | $(' | ', {text: 'stopped', "class": 'status'}).appendTo(row);
144 | $(' | ', {text: '0'}).appendTo(row);
145 | $(' | ', {text: '0'}).appendTo(row);
146 | $(' | ', {text: '0'}).appendTo(row);
147 | $(' | ').append($('', {
148 | "class": "tooltips",
149 | "data-original-title": "Watch process",
150 | "data-placement": "top",
151 | "data-delay": {show: 300, hide: 200},
152 | "href": "#"
153 | }).append($('', {"class": "center icon-eye-open",
154 | "data-href": dns + '/' + processes[i].name,
155 | "data-action": "monitor"}))).appendTo(row);
156 | }
157 | row.after($('
'));
158 | row = row.next();
159 | } else if (processes[i].type == 7) {
160 | /* program (this allows you to run arbitrary script and check exit status) */
161 | $(' | ', {text: processes[i].name, "class": "process-name"}).appendTo(row);
162 | if (processes[i].program.status === 0) {
163 | $(' | ').appendTo(row);
164 | $(' | ', {text: 'Status OK', "class": 'status'}).appendTo(row);
165 | $(' | ').appendTo(row);
166 | $(' | ').appendTo(row);
167 | $(' | ').appendTo(row);
168 | $(buildActionMenu(dns + '/' + processes[i].name)).appendTo(row);
169 | } else {
170 | row.addClass('error');
171 | $(' | ').appendTo(row);
172 | $(' | ', {text: 'Status Fail', "class": 'status'}).appendTo(row);
173 | $(' | ').appendTo(row);
174 | $(' | ').appendTo(row);
175 | $(' | ').appendTo(row);
176 | $(' | ').append($('', {
177 | "class": "tooltips",
178 | "data-original-title": "Watch process",
179 | "data-placement": "top",
180 | "data-delay": {show: 300, hide: 200},
181 | "href": "#"
182 | }).append($('', {"class": "center icon-eye-open",
183 | "data-href": dns + '/' + processes[i].name,
184 | "data-action": "monitor"}))).appendTo(row);
185 | }
186 | row.after($('
'));
187 | row = row.next();
188 | } else if (processes[i].type == 8) {
189 | /* network interface */
190 | $(' | ', {text: processes[i].name, "class": "process-name"}).appendTo(row);
191 | if (processes[i].state !== 1) {
192 | $(' | ', {text: processes[i].pid}).appendTo(row);
193 | $(' | ', {text: 'up', "class": 'status'}).appendTo(row);
194 | $(' | ', {text: ''}).appendTo(row);
195 | $(' | ', {text: processes[i].link.download.errors.now + ' download errors'}).appendTo(row);
196 | $(' | ', {text: processes[i].link.upload.errors.now + ' upload errors'}).appendTo(row);
197 | $(buildActionMenu(dns + '/' + processes[i].name)).appendTo(row);
198 | } else {
199 | row.addClass('error');
200 | $(' | ').appendTo(row);
201 | $(' | ', {text: 'stopped', "class": 'status'}).appendTo(row);
202 | $(' | ', {text: '0'}).appendTo(row);
203 | $(' | ', {text: '0'}).appendTo(row);
204 | $(' | ', {text: '0'}).appendTo(row);
205 | $(' | ').append($('', {
206 | "class": "tooltips",
207 | "data-original-title": "Watch process",
208 | "data-placement": "top",
209 | "data-delay": {show: 300, hide: 200},
210 | "href": "#"
211 | }).append($('', {"class": "center icon-eye-open",
212 | "data-href": dns + '/' + processes[i].name,
213 | "data-action": "monitor"}))).appendTo(row);
214 | }
215 | row.after($('
'));
216 | row = row.next();
217 | } else {
218 | count += 1;
219 | }
220 | }
221 | table.find('#' + id + ' td:first-child').attr('rowspan', length - count);
222 | }
223 | },
224 | statusChange = function (basicRow, curRow, action) {
225 | "use strict";
226 | if (isLocalStorageAvailable()) {
227 | localStorage.setItem(basicRow.find('.inform').attr('href'), curRow.find('.process-name').text() + '&' + curRow.find('.status').text());
228 | curRow.removeClass('error').addClass('success').find('.status').text('waiting for response');
229 | }
230 | },
231 | statusFromLocalStorage = function (table) {
232 | "use strict";
233 | var server, serverStatus, row, prevInform, length, i, status;
234 | for (server in localStorage) {
235 | serverStatus = server && localStorage.getItem(server);
236 | if (serverStatus) {
237 | prevInform = serverStatus.split('&');
238 | row = table.find('.inform[href="' + server + '"]').closest('tr');
239 | length = parseInt(row.find('td').eq(0).attr('rowspan'), 10);
240 | for (i = 0; i < length; i += 1, row = row.next()) {
241 | if (row.find('.process-name').text() === prevInform[0]) {
242 | status = row.find('.status');
243 | if(status.text() === prevInform[1]) {
244 | status.text('waiting for response');
245 | row.removeClass('error').addClass('success');
246 | } else {
247 | localStorage.removeItem(server);
248 | }
249 | }
250 | }
251 | }
252 | }
253 | };
254 |
255 |
256 | socketInfo.on('data', function (obj) {
257 | console.log(obj);
258 | var tbody,
259 | i,
260 | total = obj.data;
261 | table.html('Hostname | Processes | PID | Status | Uptime | Total CPU usage | Total memory usage | Actions | ');
262 | tbody = $('').appendTo(table);
263 | for (i = 0; i <= total.length; i++) {
264 | tbody.append($('
', {
265 | 'id': i,
266 | 'class': 'basic-row'
267 | }));
268 | }
269 | $(total).each(function (i, data) {
270 | buildTable(data, table);
271 | }).promise().done(function () {
272 | $('.tooltip').detach();
273 | statusFromLocalStorage(table);
274 | content.html(table);
275 | });
276 | total = [];
277 | });
278 | socketInfo.on('good', function (data) {
279 | console.log(data);
280 | });
281 | // socketInfo.on('length', function (data) {
282 | // len = data.length;
283 | // });
284 | content.delegate('.tooltips', 'mouseover', function () {
285 | "use strict";
286 | $(this).tooltip('show');
287 | });
288 | content.delegate('.tooltips', 'mouseout', function () {
289 | "use strict";
290 | $(this).tooltip('hide');
291 | });
292 | content.delegate('i', 'mousedown', function () {
293 | var self = $(this),
294 | selfClass = self.attr('class').split(' ');
295 | selfClass = selfClass.pop();
296 | self.removeClass(selfClass).addClass(selfClass + '-white');
297 | });
298 | content.delegate('i', 'mouseup', function () {
299 | var self = $(this),
300 | selfClass = self.attr('class').split(' ');
301 | selfClass = selfClass.pop();
302 | self.removeClass(selfClass).addClass(selfClass.substring(0,selfClass.indexOf('-white')));
303 | });
304 | content.delegate('i', 'click', function () {
305 | var self = $(this),
306 | href = self.data('href'),
307 | action = self.data('action');
308 | console.log(href, action);
309 | statusChange(self.closest('.basic-row'), self.closest('tr'), action);
310 | socketInfo.emit('sendData', {href: href, action: action});
311 | });
312 | content.delegate('.inform', 'click', function (e) {
313 | e.preventDefault();
314 | window.location.href = '/inform?href=' + $(this).attr('href') + '&cluster=' + document.URL.split('/')[4];
315 | });
316 | (function () {
317 | var links = $('.nav a'),
318 | name = location.pathname.split('/')[2];
319 | links.removeClass('active');
320 | $.each(links, function (i, link) {
321 | "use strict";
322 | link = $(link);
323 | if (link.text() == decodeURI(name)) {
324 | link.addClass('active');
325 | }
326 | });
327 | })();
328 | });
329 |
--------------------------------------------------------------------------------
/public/stylesheets/bootstrap-responsive.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Responsive v2.1.1
3 | *
4 | * Copyright 2012 Twitter, Inc
5 | * Licensed under the Apache License v2.0
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Designed and built with all the love in the world @twitter by @mdo and @fat.
9 | */
10 |
11 | .clearfix {
12 | *zoom: 1;
13 | }
14 |
15 | .clearfix:before,
16 | .clearfix:after {
17 | display: table;
18 | line-height: 0;
19 | content: "";
20 | }
21 |
22 | .clearfix:after {
23 | clear: both;
24 | }
25 |
26 | .hide-text {
27 | font: 0/0 a;
28 | color: transparent;
29 | text-shadow: none;
30 | background-color: transparent;
31 | border: 0;
32 | }
33 |
34 | .input-block-level {
35 | display: block;
36 | width: 100%;
37 | min-height: 30px;
38 | -webkit-box-sizing: border-box;
39 | -moz-box-sizing: border-box;
40 | box-sizing: border-box;
41 | }
42 |
43 | .hidden {
44 | display: none;
45 | visibility: hidden;
46 | }
47 |
48 | .visible-phone {
49 | display: none !important;
50 | }
51 |
52 | .visible-tablet {
53 | display: none !important;
54 | }
55 |
56 | .hidden-desktop {
57 | display: none !important;
58 | }
59 |
60 | .visible-desktop {
61 | display: inherit !important;
62 | }
63 |
64 | @media (min-width: 768px) and (max-width: 979px) {
65 | .hidden-desktop {
66 | display: inherit !important;
67 | }
68 | .visible-desktop {
69 | display: none !important ;
70 | }
71 | .visible-tablet {
72 | display: inherit !important;
73 | }
74 | .hidden-tablet {
75 | display: none !important;
76 | }
77 | }
78 |
79 | @media (max-width: 767px) {
80 | .hidden-desktop {
81 | display: inherit !important;
82 | }
83 | .visible-desktop {
84 | display: none !important;
85 | }
86 | .visible-phone {
87 | display: inherit !important;
88 | }
89 | .hidden-phone {
90 | display: none !important;
91 | }
92 | }
93 |
94 | @media (min-width: 1200px) {
95 | .row {
96 | margin-left: -30px;
97 | *zoom: 1;
98 | }
99 | .row:before,
100 | .row:after {
101 | display: table;
102 | line-height: 0;
103 | content: "";
104 | }
105 | .row:after {
106 | clear: both;
107 | }
108 | [class*="span"] {
109 | float: left;
110 | min-height: 1px;
111 | margin-left: 30px;
112 | }
113 | .container,
114 | .navbar-static-top .container,
115 | .navbar-fixed-top .container,
116 | .navbar-fixed-bottom .container {
117 | width: 1170px;
118 | }
119 | .span12 {
120 | width: 1170px;
121 | }
122 | .span11 {
123 | width: 1070px;
124 | }
125 | .span10 {
126 | width: 970px;
127 | }
128 | .span9 {
129 | width: 870px;
130 | }
131 | .span8 {
132 | width: 770px;
133 | }
134 | .span7 {
135 | width: 670px;
136 | }
137 | .span6 {
138 | width: 570px;
139 | }
140 | .span5 {
141 | width: 470px;
142 | }
143 | .span4 {
144 | width: 370px;
145 | }
146 | .span3 {
147 | width: 270px;
148 | }
149 | .span2 {
150 | width: 170px;
151 | }
152 | .span1 {
153 | width: 70px;
154 | }
155 | .offset12 {
156 | margin-left: 1230px;
157 | }
158 | .offset11 {
159 | margin-left: 1130px;
160 | }
161 | .offset10 {
162 | margin-left: 1030px;
163 | }
164 | .offset9 {
165 | margin-left: 930px;
166 | }
167 | .offset8 {
168 | margin-left: 830px;
169 | }
170 | .offset7 {
171 | margin-left: 730px;
172 | }
173 | .offset6 {
174 | margin-left: 630px;
175 | }
176 | .offset5 {
177 | margin-left: 530px;
178 | }
179 | .offset4 {
180 | margin-left: 430px;
181 | }
182 | .offset3 {
183 | margin-left: 330px;
184 | }
185 | .offset2 {
186 | margin-left: 230px;
187 | }
188 | .offset1 {
189 | margin-left: 130px;
190 | }
191 | .row-fluid {
192 | width: 100%;
193 | *zoom: 1;
194 | }
195 | .row-fluid:before,
196 | .row-fluid:after {
197 | display: table;
198 | line-height: 0;
199 | content: "";
200 | }
201 | .row-fluid:after {
202 | clear: both;
203 | }
204 | .row-fluid [class*="span"] {
205 | display: block;
206 | float: left;
207 | width: 100%;
208 | min-height: 30px;
209 | margin-left: 2.564102564102564%;
210 | *margin-left: 2.5109110747408616%;
211 | -webkit-box-sizing: border-box;
212 | -moz-box-sizing: border-box;
213 | box-sizing: border-box;
214 | }
215 | .row-fluid [class*="span"]:first-child {
216 | margin-left: 0;
217 | }
218 | .row-fluid .span12 {
219 | width: 100%;
220 | *width: 99.94680851063829%;
221 | }
222 | .row-fluid .span11 {
223 | width: 91.45299145299145%;
224 | *width: 91.39979996362975%;
225 | }
226 | .row-fluid .span10 {
227 | width: 82.90598290598291%;
228 | *width: 82.8527914166212%;
229 | }
230 | .row-fluid .span9 {
231 | width: 74.35897435897436%;
232 | *width: 74.30578286961266%;
233 | }
234 | .row-fluid .span8 {
235 | width: 65.81196581196582%;
236 | *width: 65.75877432260411%;
237 | }
238 | .row-fluid .span7 {
239 | width: 57.26495726495726%;
240 | *width: 57.21176577559556%;
241 | }
242 | .row-fluid .span6 {
243 | width: 48.717948717948715%;
244 | *width: 48.664757228587014%;
245 | }
246 | .row-fluid .span5 {
247 | width: 40.17094017094017%;
248 | *width: 40.11774868157847%;
249 | }
250 | .row-fluid .span4 {
251 | width: 31.623931623931625%;
252 | *width: 31.570740134569924%;
253 | }
254 | .row-fluid .span3 {
255 | width: 23.076923076923077%;
256 | *width: 23.023731587561375%;
257 | }
258 | .row-fluid .span2 {
259 | width: 14.52991452991453%;
260 | *width: 14.476723040552828%;
261 | }
262 | .row-fluid .span1 {
263 | width: 5.982905982905983%;
264 | *width: 5.929714493544281%;
265 | }
266 | .row-fluid .offset12 {
267 | margin-left: 105.12820512820512%;
268 | *margin-left: 105.02182214948171%;
269 | }
270 | .row-fluid .offset12:first-child {
271 | margin-left: 102.56410256410257%;
272 | *margin-left: 102.45771958537915%;
273 | }
274 | .row-fluid .offset11 {
275 | margin-left: 96.58119658119658%;
276 | *margin-left: 96.47481360247316%;
277 | }
278 | .row-fluid .offset11:first-child {
279 | margin-left: 94.01709401709402%;
280 | *margin-left: 93.91071103837061%;
281 | }
282 | .row-fluid .offset10 {
283 | margin-left: 88.03418803418803%;
284 | *margin-left: 87.92780505546462%;
285 | }
286 | .row-fluid .offset10:first-child {
287 | margin-left: 85.47008547008548%;
288 | *margin-left: 85.36370249136206%;
289 | }
290 | .row-fluid .offset9 {
291 | margin-left: 79.48717948717949%;
292 | *margin-left: 79.38079650845607%;
293 | }
294 | .row-fluid .offset9:first-child {
295 | margin-left: 76.92307692307693%;
296 | *margin-left: 76.81669394435352%;
297 | }
298 | .row-fluid .offset8 {
299 | margin-left: 70.94017094017094%;
300 | *margin-left: 70.83378796144753%;
301 | }
302 | .row-fluid .offset8:first-child {
303 | margin-left: 68.37606837606839%;
304 | *margin-left: 68.26968539734497%;
305 | }
306 | .row-fluid .offset7 {
307 | margin-left: 62.393162393162385%;
308 | *margin-left: 62.28677941443899%;
309 | }
310 | .row-fluid .offset7:first-child {
311 | margin-left: 59.82905982905982%;
312 | *margin-left: 59.72267685033642%;
313 | }
314 | .row-fluid .offset6 {
315 | margin-left: 53.84615384615384%;
316 | *margin-left: 53.739770867430444%;
317 | }
318 | .row-fluid .offset6:first-child {
319 | margin-left: 51.28205128205128%;
320 | *margin-left: 51.175668303327875%;
321 | }
322 | .row-fluid .offset5 {
323 | margin-left: 45.299145299145295%;
324 | *margin-left: 45.1927623204219%;
325 | }
326 | .row-fluid .offset5:first-child {
327 | margin-left: 42.73504273504273%;
328 | *margin-left: 42.62865975631933%;
329 | }
330 | .row-fluid .offset4 {
331 | margin-left: 36.75213675213675%;
332 | *margin-left: 36.645753773413354%;
333 | }
334 | .row-fluid .offset4:first-child {
335 | margin-left: 34.18803418803419%;
336 | *margin-left: 34.081651209310785%;
337 | }
338 | .row-fluid .offset3 {
339 | margin-left: 28.205128205128204%;
340 | *margin-left: 28.0987452264048%;
341 | }
342 | .row-fluid .offset3:first-child {
343 | margin-left: 25.641025641025642%;
344 | *margin-left: 25.53464266230224%;
345 | }
346 | .row-fluid .offset2 {
347 | margin-left: 19.65811965811966%;
348 | *margin-left: 19.551736679396257%;
349 | }
350 | .row-fluid .offset2:first-child {
351 | margin-left: 17.094017094017094%;
352 | *margin-left: 16.98763411529369%;
353 | }
354 | .row-fluid .offset1 {
355 | margin-left: 11.11111111111111%;
356 | *margin-left: 11.004728132387708%;
357 | }
358 | .row-fluid .offset1:first-child {
359 | margin-left: 8.547008547008547%;
360 | *margin-left: 8.440625568285142%;
361 | }
362 | input,
363 | textarea,
364 | .uneditable-input {
365 | margin-left: 0;
366 | }
367 | .controls-row [class*="span"] + [class*="span"] {
368 | margin-left: 30px;
369 | }
370 | input.span12,
371 | textarea.span12,
372 | .uneditable-input.span12 {
373 | width: 1156px;
374 | }
375 | input.span11,
376 | textarea.span11,
377 | .uneditable-input.span11 {
378 | width: 1056px;
379 | }
380 | input.span10,
381 | textarea.span10,
382 | .uneditable-input.span10 {
383 | width: 956px;
384 | }
385 | input.span9,
386 | textarea.span9,
387 | .uneditable-input.span9 {
388 | width: 856px;
389 | }
390 | input.span8,
391 | textarea.span8,
392 | .uneditable-input.span8 {
393 | width: 756px;
394 | }
395 | input.span7,
396 | textarea.span7,
397 | .uneditable-input.span7 {
398 | width: 656px;
399 | }
400 | input.span6,
401 | textarea.span6,
402 | .uneditable-input.span6 {
403 | width: 556px;
404 | }
405 | input.span5,
406 | textarea.span5,
407 | .uneditable-input.span5 {
408 | width: 456px;
409 | }
410 | input.span4,
411 | textarea.span4,
412 | .uneditable-input.span4 {
413 | width: 356px;
414 | }
415 | input.span3,
416 | textarea.span3,
417 | .uneditable-input.span3 {
418 | width: 256px;
419 | }
420 | input.span2,
421 | textarea.span2,
422 | .uneditable-input.span2 {
423 | width: 156px;
424 | }
425 | input.span1,
426 | textarea.span1,
427 | .uneditable-input.span1 {
428 | width: 56px;
429 | }
430 | .thumbnails {
431 | margin-left: -30px;
432 | }
433 | .thumbnails > li {
434 | margin-left: 30px;
435 | }
436 | .row-fluid .thumbnails {
437 | margin-left: 0;
438 | }
439 | }
440 |
441 | @media (min-width: 768px) and (max-width: 979px) {
442 | .row {
443 | margin-left: -20px;
444 | *zoom: 1;
445 | }
446 | .row:before,
447 | .row:after {
448 | display: table;
449 | line-height: 0;
450 | content: "";
451 | }
452 | .row:after {
453 | clear: both;
454 | }
455 | [class*="span"] {
456 | float: left;
457 | min-height: 1px;
458 | margin-left: 20px;
459 | }
460 | .container,
461 | .navbar-static-top .container,
462 | .navbar-fixed-top .container,
463 | .navbar-fixed-bottom .container {
464 | width: 724px;
465 | }
466 | .span12 {
467 | width: 724px;
468 | }
469 | .span11 {
470 | width: 662px;
471 | }
472 | .span10 {
473 | width: 600px;
474 | }
475 | .span9 {
476 | width: 538px;
477 | }
478 | .span8 {
479 | width: 476px;
480 | }
481 | .span7 {
482 | width: 414px;
483 | }
484 | .span6 {
485 | width: 352px;
486 | }
487 | .span5 {
488 | width: 290px;
489 | }
490 | .span4 {
491 | width: 228px;
492 | }
493 | .span3 {
494 | width: 166px;
495 | }
496 | .span2 {
497 | width: 104px;
498 | }
499 | .span1 {
500 | width: 42px;
501 | }
502 | .offset12 {
503 | margin-left: 764px;
504 | }
505 | .offset11 {
506 | margin-left: 702px;
507 | }
508 | .offset10 {
509 | margin-left: 640px;
510 | }
511 | .offset9 {
512 | margin-left: 578px;
513 | }
514 | .offset8 {
515 | margin-left: 516px;
516 | }
517 | .offset7 {
518 | margin-left: 454px;
519 | }
520 | .offset6 {
521 | margin-left: 392px;
522 | }
523 | .offset5 {
524 | margin-left: 330px;
525 | }
526 | .offset4 {
527 | margin-left: 268px;
528 | }
529 | .offset3 {
530 | margin-left: 206px;
531 | }
532 | .offset2 {
533 | margin-left: 144px;
534 | }
535 | .offset1 {
536 | margin-left: 82px;
537 | }
538 | .row-fluid {
539 | width: 100%;
540 | *zoom: 1;
541 | }
542 | .row-fluid:before,
543 | .row-fluid:after {
544 | display: table;
545 | line-height: 0;
546 | content: "";
547 | }
548 | .row-fluid:after {
549 | clear: both;
550 | }
551 | .row-fluid [class*="span"] {
552 | display: block;
553 | float: left;
554 | width: 100%;
555 | min-height: 30px;
556 | margin-left: 2.7624309392265194%;
557 | *margin-left: 2.709239449864817%;
558 | -webkit-box-sizing: border-box;
559 | -moz-box-sizing: border-box;
560 | box-sizing: border-box;
561 | }
562 | .row-fluid [class*="span"]:first-child {
563 | margin-left: 0;
564 | }
565 | .row-fluid .span12 {
566 | width: 100%;
567 | *width: 99.94680851063829%;
568 | }
569 | .row-fluid .span11 {
570 | width: 91.43646408839778%;
571 | *width: 91.38327259903608%;
572 | }
573 | .row-fluid .span10 {
574 | width: 82.87292817679558%;
575 | *width: 82.81973668743387%;
576 | }
577 | .row-fluid .span9 {
578 | width: 74.30939226519337%;
579 | *width: 74.25620077583166%;
580 | }
581 | .row-fluid .span8 {
582 | width: 65.74585635359117%;
583 | *width: 65.69266486422946%;
584 | }
585 | .row-fluid .span7 {
586 | width: 57.18232044198895%;
587 | *width: 57.12912895262725%;
588 | }
589 | .row-fluid .span6 {
590 | width: 48.61878453038674%;
591 | *width: 48.56559304102504%;
592 | }
593 | .row-fluid .span5 {
594 | width: 40.05524861878453%;
595 | *width: 40.00205712942283%;
596 | }
597 | .row-fluid .span4 {
598 | width: 31.491712707182323%;
599 | *width: 31.43852121782062%;
600 | }
601 | .row-fluid .span3 {
602 | width: 22.92817679558011%;
603 | *width: 22.87498530621841%;
604 | }
605 | .row-fluid .span2 {
606 | width: 14.3646408839779%;
607 | *width: 14.311449394616199%;
608 | }
609 | .row-fluid .span1 {
610 | width: 5.801104972375691%;
611 | *width: 5.747913483013988%;
612 | }
613 | .row-fluid .offset12 {
614 | margin-left: 105.52486187845304%;
615 | *margin-left: 105.41847889972962%;
616 | }
617 | .row-fluid .offset12:first-child {
618 | margin-left: 102.76243093922652%;
619 | *margin-left: 102.6560479605031%;
620 | }
621 | .row-fluid .offset11 {
622 | margin-left: 96.96132596685082%;
623 | *margin-left: 96.8549429881274%;
624 | }
625 | .row-fluid .offset11:first-child {
626 | margin-left: 94.1988950276243%;
627 | *margin-left: 94.09251204890089%;
628 | }
629 | .row-fluid .offset10 {
630 | margin-left: 88.39779005524862%;
631 | *margin-left: 88.2914070765252%;
632 | }
633 | .row-fluid .offset10:first-child {
634 | margin-left: 85.6353591160221%;
635 | *margin-left: 85.52897613729868%;
636 | }
637 | .row-fluid .offset9 {
638 | margin-left: 79.8342541436464%;
639 | *margin-left: 79.72787116492299%;
640 | }
641 | .row-fluid .offset9:first-child {
642 | margin-left: 77.07182320441989%;
643 | *margin-left: 76.96544022569647%;
644 | }
645 | .row-fluid .offset8 {
646 | margin-left: 71.2707182320442%;
647 | *margin-left: 71.16433525332079%;
648 | }
649 | .row-fluid .offset8:first-child {
650 | margin-left: 68.50828729281768%;
651 | *margin-left: 68.40190431409427%;
652 | }
653 | .row-fluid .offset7 {
654 | margin-left: 62.70718232044199%;
655 | *margin-left: 62.600799341718584%;
656 | }
657 | .row-fluid .offset7:first-child {
658 | margin-left: 59.94475138121547%;
659 | *margin-left: 59.838368402492065%;
660 | }
661 | .row-fluid .offset6 {
662 | margin-left: 54.14364640883978%;
663 | *margin-left: 54.037263430116376%;
664 | }
665 | .row-fluid .offset6:first-child {
666 | margin-left: 51.38121546961326%;
667 | *margin-left: 51.27483249088986%;
668 | }
669 | .row-fluid .offset5 {
670 | margin-left: 45.58011049723757%;
671 | *margin-left: 45.47372751851417%;
672 | }
673 | .row-fluid .offset5:first-child {
674 | margin-left: 42.81767955801105%;
675 | *margin-left: 42.71129657928765%;
676 | }
677 | .row-fluid .offset4 {
678 | margin-left: 37.01657458563536%;
679 | *margin-left: 36.91019160691196%;
680 | }
681 | .row-fluid .offset4:first-child {
682 | margin-left: 34.25414364640884%;
683 | *margin-left: 34.14776066768544%;
684 | }
685 | .row-fluid .offset3 {
686 | margin-left: 28.45303867403315%;
687 | *margin-left: 28.346655695309746%;
688 | }
689 | .row-fluid .offset3:first-child {
690 | margin-left: 25.69060773480663%;
691 | *margin-left: 25.584224756083227%;
692 | }
693 | .row-fluid .offset2 {
694 | margin-left: 19.88950276243094%;
695 | *margin-left: 19.783119783707537%;
696 | }
697 | .row-fluid .offset2:first-child {
698 | margin-left: 17.12707182320442%;
699 | *margin-left: 17.02068884448102%;
700 | }
701 | .row-fluid .offset1 {
702 | margin-left: 11.32596685082873%;
703 | *margin-left: 11.219583872105325%;
704 | }
705 | .row-fluid .offset1:first-child {
706 | margin-left: 8.56353591160221%;
707 | *margin-left: 8.457152932878806%;
708 | }
709 | input,
710 | textarea,
711 | .uneditable-input {
712 | margin-left: 0;
713 | }
714 | .controls-row [class*="span"] + [class*="span"] {
715 | margin-left: 20px;
716 | }
717 | input.span12,
718 | textarea.span12,
719 | .uneditable-input.span12 {
720 | width: 710px;
721 | }
722 | input.span11,
723 | textarea.span11,
724 | .uneditable-input.span11 {
725 | width: 648px;
726 | }
727 | input.span10,
728 | textarea.span10,
729 | .uneditable-input.span10 {
730 | width: 586px;
731 | }
732 | input.span9,
733 | textarea.span9,
734 | .uneditable-input.span9 {
735 | width: 524px;
736 | }
737 | input.span8,
738 | textarea.span8,
739 | .uneditable-input.span8 {
740 | width: 462px;
741 | }
742 | input.span7,
743 | textarea.span7,
744 | .uneditable-input.span7 {
745 | width: 400px;
746 | }
747 | input.span6,
748 | textarea.span6,
749 | .uneditable-input.span6 {
750 | width: 338px;
751 | }
752 | input.span5,
753 | textarea.span5,
754 | .uneditable-input.span5 {
755 | width: 276px;
756 | }
757 | input.span4,
758 | textarea.span4,
759 | .uneditable-input.span4 {
760 | width: 214px;
761 | }
762 | input.span3,
763 | textarea.span3,
764 | .uneditable-input.span3 {
765 | width: 152px;
766 | }
767 | input.span2,
768 | textarea.span2,
769 | .uneditable-input.span2 {
770 | width: 90px;
771 | }
772 | input.span1,
773 | textarea.span1,
774 | .uneditable-input.span1 {
775 | width: 28px;
776 | }
777 | }
778 |
779 | @media (max-width: 767px) {
780 | body {
781 | padding-right: 20px;
782 | padding-left: 20px;
783 | }
784 | .navbar-fixed-top,
785 | .navbar-fixed-bottom,
786 | .navbar-static-top {
787 | margin-right: -20px;
788 | margin-left: -20px;
789 | }
790 | .container-fluid {
791 | padding: 0;
792 | }
793 | .dl-horizontal dt {
794 | float: none;
795 | width: auto;
796 | clear: none;
797 | text-align: left;
798 | }
799 | .dl-horizontal dd {
800 | margin-left: 0;
801 | }
802 | .container {
803 | width: auto;
804 | }
805 | .row-fluid {
806 | width: 100%;
807 | }
808 | .row,
809 | .thumbnails {
810 | margin-left: 0;
811 | }
812 | .thumbnails > li {
813 | float: none;
814 | margin-left: 0;
815 | }
816 | [class*="span"],
817 | .row-fluid [class*="span"] {
818 | display: block;
819 | float: none;
820 | width: 100%;
821 | margin-left: 0;
822 | -webkit-box-sizing: border-box;
823 | -moz-box-sizing: border-box;
824 | box-sizing: border-box;
825 | }
826 | .span12,
827 | .row-fluid .span12 {
828 | width: 100%;
829 | -webkit-box-sizing: border-box;
830 | -moz-box-sizing: border-box;
831 | box-sizing: border-box;
832 | }
833 | .input-large,
834 | .input-xlarge,
835 | .input-xxlarge,
836 | input[class*="span"],
837 | select[class*="span"],
838 | textarea[class*="span"],
839 | .uneditable-input {
840 | display: block;
841 | width: 100%;
842 | min-height: 30px;
843 | -webkit-box-sizing: border-box;
844 | -moz-box-sizing: border-box;
845 | box-sizing: border-box;
846 | }
847 | .input-prepend input,
848 | .input-append input,
849 | .input-prepend input[class*="span"],
850 | .input-append input[class*="span"] {
851 | display: inline-block;
852 | width: auto;
853 | }
854 | .controls-row [class*="span"] + [class*="span"] {
855 | margin-left: 0;
856 | }
857 | .modal {
858 | position: fixed;
859 | top: 20px;
860 | right: 20px;
861 | left: 20px;
862 | width: auto;
863 | margin: 0;
864 | }
865 | .modal.fade.in {
866 | top: auto;
867 | }
868 | }
869 |
870 | @media (max-width: 480px) {
871 | .nav-collapse {
872 | -webkit-transform: translate3d(0, 0, 0);
873 | }
874 | .page-header h1 small {
875 | display: block;
876 | line-height: 20px;
877 | }
878 | input[type="checkbox"],
879 | input[type="radio"] {
880 | border: 1px solid #ccc;
881 | }
882 | .form-horizontal .control-label {
883 | float: none;
884 | width: auto;
885 | padding-top: 0;
886 | text-align: left;
887 | }
888 | .form-horizontal .controls {
889 | margin-left: 0;
890 | }
891 | .form-horizontal .control-list {
892 | padding-top: 0;
893 | }
894 | .form-horizontal .form-actions {
895 | padding-right: 10px;
896 | padding-left: 10px;
897 | }
898 | .modal {
899 | top: 10px;
900 | right: 10px;
901 | left: 10px;
902 | }
903 | .modal-header .close {
904 | padding: 10px;
905 | margin: -10px;
906 | }
907 | .carousel-caption {
908 | position: static;
909 | }
910 | }
911 |
912 | @media (max-width: 979px) {
913 | body {
914 | padding-top: 0;
915 | }
916 | .navbar-fixed-top,
917 | .navbar-fixed-bottom {
918 | position: static;
919 | }
920 | .navbar-fixed-top {
921 | margin-bottom: 20px;
922 | }
923 | .navbar-fixed-bottom {
924 | margin-top: 20px;
925 | }
926 | .navbar-fixed-top .navbar-inner,
927 | .navbar-fixed-bottom .navbar-inner {
928 | padding: 5px;
929 | }
930 | .navbar .container {
931 | width: auto;
932 | padding: 0;
933 | }
934 | .navbar .brand {
935 | padding-right: 10px;
936 | padding-left: 10px;
937 | margin: 0 0 0 -5px;
938 | }
939 | .nav-collapse {
940 | clear: both;
941 | }
942 | .nav-collapse .nav {
943 | float: none;
944 | margin: 0 0 10px;
945 | }
946 | .nav-collapse .nav > li {
947 | float: none;
948 | }
949 | .nav-collapse .nav > li > a {
950 | margin-bottom: 2px;
951 | }
952 | .nav-collapse .nav > .divider-vertical {
953 | display: none;
954 | }
955 | .nav-collapse .nav .nav-header {
956 | color: #777777;
957 | text-shadow: none;
958 | }
959 | .nav-collapse .nav > li > a,
960 | .nav-collapse .dropdown-menu a {
961 | padding: 9px 15px;
962 | font-weight: bold;
963 | color: #777777;
964 | -webkit-border-radius: 3px;
965 | -moz-border-radius: 3px;
966 | border-radius: 3px;
967 | }
968 | .nav-collapse .btn {
969 | padding: 4px 10px 4px;
970 | font-weight: normal;
971 | -webkit-border-radius: 4px;
972 | -moz-border-radius: 4px;
973 | border-radius: 4px;
974 | }
975 | .nav-collapse .dropdown-menu li + li a {
976 | margin-bottom: 2px;
977 | }
978 | .nav-collapse .nav > li > a:hover,
979 | .nav-collapse .dropdown-menu a:hover {
980 | background-color: #f2f2f2;
981 | }
982 | .navbar-inverse .nav-collapse .nav > li > a:hover,
983 | .navbar-inverse .nav-collapse .dropdown-menu a:hover {
984 | background-color: #111111;
985 | }
986 | .nav-collapse.in .btn-group {
987 | padding: 0;
988 | margin-top: 5px;
989 | }
990 | .nav-collapse .dropdown-menu {
991 | position: static;
992 | top: auto;
993 | left: auto;
994 | display: block;
995 | float: none;
996 | max-width: none;
997 | padding: 0;
998 | margin: 0 15px;
999 | background-color: transparent;
1000 | border: none;
1001 | -webkit-border-radius: 0;
1002 | -moz-border-radius: 0;
1003 | border-radius: 0;
1004 | -webkit-box-shadow: none;
1005 | -moz-box-shadow: none;
1006 | box-shadow: none;
1007 | }
1008 | .nav-collapse .dropdown-menu:before,
1009 | .nav-collapse .dropdown-menu:after {
1010 | display: none;
1011 | }
1012 | .nav-collapse .dropdown-menu .divider {
1013 | display: none;
1014 | }
1015 | .nav-collapse .nav > li > .dropdown-menu:before,
1016 | .nav-collapse .nav > li > .dropdown-menu:after {
1017 | display: none;
1018 | }
1019 | .nav-collapse .navbar-form,
1020 | .nav-collapse .navbar-search {
1021 | float: none;
1022 | padding: 10px 15px;
1023 | margin: 10px 0;
1024 | border-top: 1px solid #f2f2f2;
1025 | border-bottom: 1px solid #f2f2f2;
1026 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
1027 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
1028 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
1029 | }
1030 | .navbar-inverse .nav-collapse .navbar-form,
1031 | .navbar-inverse .nav-collapse .navbar-search {
1032 | border-top-color: #111111;
1033 | border-bottom-color: #111111;
1034 | }
1035 | .navbar .nav-collapse .nav.pull-right {
1036 | float: none;
1037 | margin-left: 0;
1038 | }
1039 | .nav-collapse,
1040 | .nav-collapse.collapse {
1041 | height: 0;
1042 | overflow: hidden;
1043 | }
1044 | .navbar .btn-navbar {
1045 | display: block;
1046 | }
1047 | .navbar-static .navbar-inner {
1048 | padding-right: 10px;
1049 | padding-left: 10px;
1050 | }
1051 | }
1052 |
1053 | @media (min-width: 980px) {
1054 | .nav-collapse.collapse {
1055 | height: auto !important;
1056 | overflow: visible !important;
1057 | }
1058 | }
1059 |
--------------------------------------------------------------------------------
/public/javascripts/bootstrap.js:
--------------------------------------------------------------------------------
1 | /* ===================================================
2 | * bootstrap-transition.js v2.1.1
3 | * http://twitter.github.com/bootstrap/javascript.html#transitions
4 | * ===================================================
5 | * Copyright 2012 Twitter, Inc.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * ========================================================== */
19 |
20 |
21 | !function ($) {
22 |
23 | $(function () {
24 |
25 | "use strict"; // jshint ;_;
26 |
27 |
28 | /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
29 | * ======================================================= */
30 |
31 | $.support.transition = (function () {
32 |
33 | var transitionEnd = (function () {
34 |
35 | var el = document.createElement('bootstrap')
36 | , transEndEventNames = {
37 | 'WebkitTransition' : 'webkitTransitionEnd'
38 | , 'MozTransition' : 'transitionend'
39 | , 'OTransition' : 'oTransitionEnd otransitionend'
40 | , 'transition' : 'transitionend'
41 | }
42 | , name
43 |
44 | for (name in transEndEventNames){
45 | if (el.style[name] !== undefined) {
46 | return transEndEventNames[name]
47 | }
48 | }
49 |
50 | }())
51 |
52 | return transitionEnd && {
53 | end: transitionEnd
54 | }
55 |
56 | })()
57 |
58 | })
59 |
60 | }(window.jQuery);/* ==========================================================
61 | * bootstrap-alert.js v2.1.1
62 | * http://twitter.github.com/bootstrap/javascript.html#alerts
63 | * ==========================================================
64 | * Copyright 2012 Twitter, Inc.
65 | *
66 | * Licensed under the Apache License, Version 2.0 (the "License");
67 | * you may not use this file except in compliance with the License.
68 | * You may obtain a copy of the License at
69 | *
70 | * http://www.apache.org/licenses/LICENSE-2.0
71 | *
72 | * Unless required by applicable law or agreed to in writing, software
73 | * distributed under the License is distributed on an "AS IS" BASIS,
74 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75 | * See the License for the specific language governing permissions and
76 | * limitations under the License.
77 | * ========================================================== */
78 |
79 |
80 | !function ($) {
81 |
82 | "use strict"; // jshint ;_;
83 |
84 |
85 | /* ALERT CLASS DEFINITION
86 | * ====================== */
87 |
88 | var dismiss = '[data-dismiss="alert"]'
89 | , Alert = function (el) {
90 | $(el).on('click', dismiss, this.close)
91 | }
92 |
93 | Alert.prototype.close = function (e) {
94 | var $this = $(this)
95 | , selector = $this.attr('data-target')
96 | , $parent
97 |
98 | if (!selector) {
99 | selector = $this.attr('href')
100 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
101 | }
102 |
103 | $parent = $(selector)
104 |
105 | e && e.preventDefault()
106 |
107 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
108 |
109 | $parent.trigger(e = $.Event('close'))
110 |
111 | if (e.isDefaultPrevented()) return
112 |
113 | $parent.removeClass('in')
114 |
115 | function removeElement() {
116 | $parent
117 | .trigger('closed')
118 | .remove()
119 | }
120 |
121 | $.support.transition && $parent.hasClass('fade') ?
122 | $parent.on($.support.transition.end, removeElement) :
123 | removeElement()
124 | }
125 |
126 |
127 | /* ALERT PLUGIN DEFINITION
128 | * ======================= */
129 |
130 | $.fn.alert = function (option) {
131 | return this.each(function () {
132 | var $this = $(this)
133 | , data = $this.data('alert')
134 | if (!data) $this.data('alert', (data = new Alert(this)))
135 | if (typeof option == 'string') data[option].call($this)
136 | })
137 | }
138 |
139 | $.fn.alert.Constructor = Alert
140 |
141 |
142 | /* ALERT DATA-API
143 | * ============== */
144 |
145 | $(function () {
146 | $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
147 | })
148 |
149 | }(window.jQuery);/* ============================================================
150 | * bootstrap-button.js v2.1.1
151 | * http://twitter.github.com/bootstrap/javascript.html#buttons
152 | * ============================================================
153 | * Copyright 2012 Twitter, Inc.
154 | *
155 | * Licensed under the Apache License, Version 2.0 (the "License");
156 | * you may not use this file except in compliance with the License.
157 | * You may obtain a copy of the License at
158 | *
159 | * http://www.apache.org/licenses/LICENSE-2.0
160 | *
161 | * Unless required by applicable law or agreed to in writing, software
162 | * distributed under the License is distributed on an "AS IS" BASIS,
163 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164 | * See the License for the specific language governing permissions and
165 | * limitations under the License.
166 | * ============================================================ */
167 |
168 |
169 | !function ($) {
170 |
171 | "use strict"; // jshint ;_;
172 |
173 |
174 | /* BUTTON PUBLIC CLASS DEFINITION
175 | * ============================== */
176 |
177 | var Button = function (element, options) {
178 | this.$element = $(element)
179 | this.options = $.extend({}, $.fn.button.defaults, options)
180 | }
181 |
182 | Button.prototype.setState = function (state) {
183 | var d = 'disabled'
184 | , $el = this.$element
185 | , data = $el.data()
186 | , val = $el.is('input') ? 'val' : 'html'
187 |
188 | state = state + 'Text'
189 | data.resetText || $el.data('resetText', $el[val]())
190 |
191 | $el[val](data[state] || this.options[state])
192 |
193 | // push to event loop to allow forms to submit
194 | setTimeout(function () {
195 | state == 'loadingText' ?
196 | $el.addClass(d).attr(d, d) :
197 | $el.removeClass(d).removeAttr(d)
198 | }, 0)
199 | }
200 |
201 | Button.prototype.toggle = function () {
202 | var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
203 |
204 | $parent && $parent
205 | .find('.active')
206 | .removeClass('active')
207 |
208 | this.$element.toggleClass('active')
209 | }
210 |
211 |
212 | /* BUTTON PLUGIN DEFINITION
213 | * ======================== */
214 |
215 | $.fn.button = function (option) {
216 | return this.each(function () {
217 | var $this = $(this)
218 | , data = $this.data('button')
219 | , options = typeof option == 'object' && option
220 | if (!data) $this.data('button', (data = new Button(this, options)))
221 | if (option == 'toggle') data.toggle()
222 | else if (option) data.setState(option)
223 | })
224 | }
225 |
226 | $.fn.button.defaults = {
227 | loadingText: 'loading...'
228 | }
229 |
230 | $.fn.button.Constructor = Button
231 |
232 |
233 | /* BUTTON DATA-API
234 | * =============== */
235 |
236 | $(function () {
237 | $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
238 | var $btn = $(e.target)
239 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
240 | $btn.button('toggle')
241 | })
242 | })
243 |
244 | }(window.jQuery);/* ==========================================================
245 | * bootstrap-carousel.js v2.1.1
246 | * http://twitter.github.com/bootstrap/javascript.html#carousel
247 | * ==========================================================
248 | * Copyright 2012 Twitter, Inc.
249 | *
250 | * Licensed under the Apache License, Version 2.0 (the "License");
251 | * you may not use this file except in compliance with the License.
252 | * You may obtain a copy of the License at
253 | *
254 | * http://www.apache.org/licenses/LICENSE-2.0
255 | *
256 | * Unless required by applicable law or agreed to in writing, software
257 | * distributed under the License is distributed on an "AS IS" BASIS,
258 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
259 | * See the License for the specific language governing permissions and
260 | * limitations under the License.
261 | * ========================================================== */
262 |
263 |
264 | !function ($) {
265 |
266 | "use strict"; // jshint ;_;
267 |
268 |
269 | /* CAROUSEL CLASS DEFINITION
270 | * ========================= */
271 |
272 | var Carousel = function (element, options) {
273 | this.$element = $(element)
274 | this.options = options
275 | this.options.slide && this.slide(this.options.slide)
276 | this.options.pause == 'hover' && this.$element
277 | .on('mouseenter', $.proxy(this.pause, this))
278 | .on('mouseleave', $.proxy(this.cycle, this))
279 | }
280 |
281 | Carousel.prototype = {
282 |
283 | cycle: function (e) {
284 | if (!e) this.paused = false
285 | this.options.interval
286 | && !this.paused
287 | && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
288 | return this
289 | }
290 |
291 | , to: function (pos) {
292 | var $active = this.$element.find('.item.active')
293 | , children = $active.parent().children()
294 | , activePos = children.index($active)
295 | , that = this
296 |
297 | if (pos > (children.length - 1) || pos < 0) return
298 |
299 | if (this.sliding) {
300 | return this.$element.one('slid', function () {
301 | that.to(pos)
302 | })
303 | }
304 |
305 | if (activePos == pos) {
306 | return this.pause().cycle()
307 | }
308 |
309 | return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
310 | }
311 |
312 | , pause: function (e) {
313 | if (!e) this.paused = true
314 | if (this.$element.find('.next, .prev').length && $.support.transition.end) {
315 | this.$element.trigger($.support.transition.end)
316 | this.cycle()
317 | }
318 | clearInterval(this.interval)
319 | this.interval = null
320 | return this
321 | }
322 |
323 | , next: function () {
324 | if (this.sliding) return
325 | return this.slide('next')
326 | }
327 |
328 | , prev: function () {
329 | if (this.sliding) return
330 | return this.slide('prev')
331 | }
332 |
333 | , slide: function (type, next) {
334 | var $active = this.$element.find('.item.active')
335 | , $next = next || $active[type]()
336 | , isCycling = this.interval
337 | , direction = type == 'next' ? 'left' : 'right'
338 | , fallback = type == 'next' ? 'first' : 'last'
339 | , that = this
340 | , e = $.Event('slide', {
341 | relatedTarget: $next[0]
342 | })
343 |
344 | this.sliding = true
345 |
346 | isCycling && this.pause()
347 |
348 | $next = $next.length ? $next : this.$element.find('.item')[fallback]()
349 |
350 | if ($next.hasClass('active')) return
351 |
352 | if ($.support.transition && this.$element.hasClass('slide')) {
353 | this.$element.trigger(e)
354 | if (e.isDefaultPrevented()) return
355 | $next.addClass(type)
356 | $next[0].offsetWidth // force reflow
357 | $active.addClass(direction)
358 | $next.addClass(direction)
359 | this.$element.one($.support.transition.end, function () {
360 | $next.removeClass([type, direction].join(' ')).addClass('active')
361 | $active.removeClass(['active', direction].join(' '))
362 | that.sliding = false
363 | setTimeout(function () { that.$element.trigger('slid') }, 0)
364 | })
365 | } else {
366 | this.$element.trigger(e)
367 | if (e.isDefaultPrevented()) return
368 | $active.removeClass('active')
369 | $next.addClass('active')
370 | this.sliding = false
371 | this.$element.trigger('slid')
372 | }
373 |
374 | isCycling && this.cycle()
375 |
376 | return this
377 | }
378 |
379 | }
380 |
381 |
382 | /* CAROUSEL PLUGIN DEFINITION
383 | * ========================== */
384 |
385 | $.fn.carousel = function (option) {
386 | return this.each(function () {
387 | var $this = $(this)
388 | , data = $this.data('carousel')
389 | , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
390 | , action = typeof option == 'string' ? option : options.slide
391 | if (!data) $this.data('carousel', (data = new Carousel(this, options)))
392 | if (typeof option == 'number') data.to(option)
393 | else if (action) data[action]()
394 | else if (options.interval) data.cycle()
395 | })
396 | }
397 |
398 | $.fn.carousel.defaults = {
399 | interval: 5000
400 | , pause: 'hover'
401 | }
402 |
403 | $.fn.carousel.Constructor = Carousel
404 |
405 |
406 | /* CAROUSEL DATA-API
407 | * ================= */
408 |
409 | $(function () {
410 | $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
411 | var $this = $(this), href
412 | , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
413 | , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
414 | $target.carousel(options)
415 | e.preventDefault()
416 | })
417 | })
418 |
419 | }(window.jQuery);/* =============================================================
420 | * bootstrap-collapse.js v2.1.1
421 | * http://twitter.github.com/bootstrap/javascript.html#collapse
422 | * =============================================================
423 | * Copyright 2012 Twitter, Inc.
424 | *
425 | * Licensed under the Apache License, Version 2.0 (the "License");
426 | * you may not use this file except in compliance with the License.
427 | * You may obtain a copy of the License at
428 | *
429 | * http://www.apache.org/licenses/LICENSE-2.0
430 | *
431 | * Unless required by applicable law or agreed to in writing, software
432 | * distributed under the License is distributed on an "AS IS" BASIS,
433 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
434 | * See the License for the specific language governing permissions and
435 | * limitations under the License.
436 | * ============================================================ */
437 |
438 |
439 | !function ($) {
440 |
441 | "use strict"; // jshint ;_;
442 |
443 |
444 | /* COLLAPSE PUBLIC CLASS DEFINITION
445 | * ================================ */
446 |
447 | var Collapse = function (element, options) {
448 | this.$element = $(element)
449 | this.options = $.extend({}, $.fn.collapse.defaults, options)
450 |
451 | if (this.options.parent) {
452 | this.$parent = $(this.options.parent)
453 | }
454 |
455 | this.options.toggle && this.toggle()
456 | }
457 |
458 | Collapse.prototype = {
459 |
460 | constructor: Collapse
461 |
462 | , dimension: function () {
463 | var hasWidth = this.$element.hasClass('width')
464 | return hasWidth ? 'width' : 'height'
465 | }
466 |
467 | , show: function () {
468 | var dimension
469 | , scroll
470 | , actives
471 | , hasData
472 |
473 | if (this.transitioning) return
474 |
475 | dimension = this.dimension()
476 | scroll = $.camelCase(['scroll', dimension].join('-'))
477 | actives = this.$parent && this.$parent.find('> .accordion-group > .in')
478 |
479 | if (actives && actives.length) {
480 | hasData = actives.data('collapse')
481 | if (hasData && hasData.transitioning) return
482 | actives.collapse('hide')
483 | hasData || actives.data('collapse', null)
484 | }
485 |
486 | this.$element[dimension](0)
487 | this.transition('addClass', $.Event('show'), 'shown')
488 | $.support.transition && this.$element[dimension](this.$element[0][scroll])
489 | }
490 |
491 | , hide: function () {
492 | var dimension
493 | if (this.transitioning) return
494 | dimension = this.dimension()
495 | this.reset(this.$element[dimension]())
496 | this.transition('removeClass', $.Event('hide'), 'hidden')
497 | this.$element[dimension](0)
498 | }
499 |
500 | , reset: function (size) {
501 | var dimension = this.dimension()
502 |
503 | this.$element
504 | .removeClass('collapse')
505 | [dimension](size || 'auto')
506 | [0].offsetWidth
507 |
508 | this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
509 |
510 | return this
511 | }
512 |
513 | , transition: function (method, startEvent, completeEvent) {
514 | var that = this
515 | , complete = function () {
516 | if (startEvent.type == 'show') that.reset()
517 | that.transitioning = 0
518 | that.$element.trigger(completeEvent)
519 | }
520 |
521 | this.$element.trigger(startEvent)
522 |
523 | if (startEvent.isDefaultPrevented()) return
524 |
525 | this.transitioning = 1
526 |
527 | this.$element[method]('in')
528 |
529 | $.support.transition && this.$element.hasClass('collapse') ?
530 | this.$element.one($.support.transition.end, complete) :
531 | complete()
532 | }
533 |
534 | , toggle: function () {
535 | this[this.$element.hasClass('in') ? 'hide' : 'show']()
536 | }
537 |
538 | }
539 |
540 |
541 | /* COLLAPSIBLE PLUGIN DEFINITION
542 | * ============================== */
543 |
544 | $.fn.collapse = function (option) {
545 | return this.each(function () {
546 | var $this = $(this)
547 | , data = $this.data('collapse')
548 | , options = typeof option == 'object' && option
549 | if (!data) $this.data('collapse', (data = new Collapse(this, options)))
550 | if (typeof option == 'string') data[option]()
551 | })
552 | }
553 |
554 | $.fn.collapse.defaults = {
555 | toggle: true
556 | }
557 |
558 | $.fn.collapse.Constructor = Collapse
559 |
560 |
561 | /* COLLAPSIBLE DATA-API
562 | * ==================== */
563 |
564 | $(function () {
565 | $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
566 | var $this = $(this), href
567 | , target = $this.attr('data-target')
568 | || e.preventDefault()
569 | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
570 | , option = $(target).data('collapse') ? 'toggle' : $this.data()
571 | $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
572 | $(target).collapse(option)
573 | })
574 | })
575 |
576 | }(window.jQuery);/* ============================================================
577 | * bootstrap-dropdown.js v2.1.1
578 | * http://twitter.github.com/bootstrap/javascript.html#dropdowns
579 | * ============================================================
580 | * Copyright 2012 Twitter, Inc.
581 | *
582 | * Licensed under the Apache License, Version 2.0 (the "License");
583 | * you may not use this file except in compliance with the License.
584 | * You may obtain a copy of the License at
585 | *
586 | * http://www.apache.org/licenses/LICENSE-2.0
587 | *
588 | * Unless required by applicable law or agreed to in writing, software
589 | * distributed under the License is distributed on an "AS IS" BASIS,
590 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
591 | * See the License for the specific language governing permissions and
592 | * limitations under the License.
593 | * ============================================================ */
594 |
595 |
596 | !function ($) {
597 |
598 | "use strict"; // jshint ;_;
599 |
600 |
601 | /* DROPDOWN CLASS DEFINITION
602 | * ========================= */
603 |
604 | var toggle = '[data-toggle=dropdown]'
605 | , Dropdown = function (element) {
606 | var $el = $(element).on('click.dropdown.data-api', this.toggle)
607 | $('html').on('click.dropdown.data-api', function () {
608 | $el.parent().removeClass('open')
609 | })
610 | }
611 |
612 | Dropdown.prototype = {
613 |
614 | constructor: Dropdown
615 |
616 | , toggle: function (e) {
617 | var $this = $(this)
618 | , $parent
619 | , isActive
620 |
621 | if ($this.is('.disabled, :disabled')) return
622 |
623 | $parent = getParent($this)
624 |
625 | isActive = $parent.hasClass('open')
626 |
627 | clearMenus()
628 |
629 | if (!isActive) {
630 | $parent.toggleClass('open')
631 | $this.focus()
632 | }
633 |
634 | return false
635 | }
636 |
637 | , keydown: function (e) {
638 | var $this
639 | , $items
640 | , $active
641 | , $parent
642 | , isActive
643 | , index
644 |
645 | if (!/(38|40|27)/.test(e.keyCode)) return
646 |
647 | $this = $(this)
648 |
649 | e.preventDefault()
650 | e.stopPropagation()
651 |
652 | if ($this.is('.disabled, :disabled')) return
653 |
654 | $parent = getParent($this)
655 |
656 | isActive = $parent.hasClass('open')
657 |
658 | if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
659 |
660 | $items = $('[role=menu] li:not(.divider) a', $parent)
661 |
662 | if (!$items.length) return
663 |
664 | index = $items.index($items.filter(':focus'))
665 |
666 | if (e.keyCode == 38 && index > 0) index-- // up
667 | if (e.keyCode == 40 && index < $items.length - 1) index++ // down
668 | if (!~index) index = 0
669 |
670 | $items
671 | .eq(index)
672 | .focus()
673 | }
674 |
675 | }
676 |
677 | function clearMenus() {
678 | getParent($(toggle))
679 | .removeClass('open')
680 | }
681 |
682 | function getParent($this) {
683 | var selector = $this.attr('data-target')
684 | , $parent
685 |
686 | if (!selector) {
687 | selector = $this.attr('href')
688 | selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
689 | }
690 |
691 | $parent = $(selector)
692 | $parent.length || ($parent = $this.parent())
693 |
694 | return $parent
695 | }
696 |
697 |
698 | /* DROPDOWN PLUGIN DEFINITION
699 | * ========================== */
700 |
701 | $.fn.dropdown = function (option) {
702 | return this.each(function () {
703 | var $this = $(this)
704 | , data = $this.data('dropdown')
705 | if (!data) $this.data('dropdown', (data = new Dropdown(this)))
706 | if (typeof option == 'string') data[option].call($this)
707 | })
708 | }
709 |
710 | $.fn.dropdown.Constructor = Dropdown
711 |
712 |
713 | /* APPLY TO STANDARD DROPDOWN ELEMENTS
714 | * =================================== */
715 |
716 | $(function () {
717 | $('html')
718 | .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
719 | $('body')
720 | .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
721 | .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
722 | .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
723 | })
724 |
725 | }(window.jQuery);/* =========================================================
726 | * bootstrap-modal.js v2.1.1
727 | * http://twitter.github.com/bootstrap/javascript.html#modals
728 | * =========================================================
729 | * Copyright 2012 Twitter, Inc.
730 | *
731 | * Licensed under the Apache License, Version 2.0 (the "License");
732 | * you may not use this file except in compliance with the License.
733 | * You may obtain a copy of the License at
734 | *
735 | * http://www.apache.org/licenses/LICENSE-2.0
736 | *
737 | * Unless required by applicable law or agreed to in writing, software
738 | * distributed under the License is distributed on an "AS IS" BASIS,
739 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
740 | * See the License for the specific language governing permissions and
741 | * limitations under the License.
742 | * ========================================================= */
743 |
744 |
745 | !function ($) {
746 |
747 | "use strict"; // jshint ;_;
748 |
749 |
750 | /* MODAL CLASS DEFINITION
751 | * ====================== */
752 |
753 | var Modal = function (element, options) {
754 | this.options = options
755 | this.$element = $(element)
756 | .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
757 | this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
758 | }
759 |
760 | Modal.prototype = {
761 |
762 | constructor: Modal
763 |
764 | , toggle: function () {
765 | return this[!this.isShown ? 'show' : 'hide']()
766 | }
767 |
768 | , show: function () {
769 | var that = this
770 | , e = $.Event('show')
771 |
772 | this.$element.trigger(e)
773 |
774 | if (this.isShown || e.isDefaultPrevented()) return
775 |
776 | $('body').addClass('modal-open')
777 |
778 | this.isShown = true
779 |
780 | this.escape()
781 |
782 | this.backdrop(function () {
783 | var transition = $.support.transition && that.$element.hasClass('fade')
784 |
785 | if (!that.$element.parent().length) {
786 | that.$element.appendTo(document.body) //don't move modals dom position
787 | }
788 |
789 | that.$element
790 | .show()
791 |
792 | if (transition) {
793 | that.$element[0].offsetWidth // force reflow
794 | }
795 |
796 | that.$element
797 | .addClass('in')
798 | .attr('aria-hidden', false)
799 | .focus()
800 |
801 | that.enforceFocus()
802 |
803 | transition ?
804 | that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
805 | that.$element.trigger('shown')
806 |
807 | })
808 | }
809 |
810 | , hide: function (e) {
811 | e && e.preventDefault()
812 |
813 | var that = this
814 |
815 | e = $.Event('hide')
816 |
817 | this.$element.trigger(e)
818 |
819 | if (!this.isShown || e.isDefaultPrevented()) return
820 |
821 | this.isShown = false
822 |
823 | $('body').removeClass('modal-open')
824 |
825 | this.escape()
826 |
827 | $(document).off('focusin.modal')
828 |
829 | this.$element
830 | .removeClass('in')
831 | .attr('aria-hidden', true)
832 |
833 | $.support.transition && this.$element.hasClass('fade') ?
834 | this.hideWithTransition() :
835 | this.hideModal()
836 | }
837 |
838 | , enforceFocus: function () {
839 | var that = this
840 | $(document).on('focusin.modal', function (e) {
841 | if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
842 | that.$element.focus()
843 | }
844 | })
845 | }
846 |
847 | , escape: function () {
848 | var that = this
849 | if (this.isShown && this.options.keyboard) {
850 | this.$element.on('keyup.dismiss.modal', function ( e ) {
851 | e.which == 27 && that.hide()
852 | })
853 | } else if (!this.isShown) {
854 | this.$element.off('keyup.dismiss.modal')
855 | }
856 | }
857 |
858 | , hideWithTransition: function () {
859 | var that = this
860 | , timeout = setTimeout(function () {
861 | that.$element.off($.support.transition.end)
862 | that.hideModal()
863 | }, 500)
864 |
865 | this.$element.one($.support.transition.end, function () {
866 | clearTimeout(timeout)
867 | that.hideModal()
868 | })
869 | }
870 |
871 | , hideModal: function (that) {
872 | this.$element
873 | .hide()
874 | .trigger('hidden')
875 |
876 | this.backdrop()
877 | }
878 |
879 | , removeBackdrop: function () {
880 | this.$backdrop.remove()
881 | this.$backdrop = null
882 | }
883 |
884 | , backdrop: function (callback) {
885 | var that = this
886 | , animate = this.$element.hasClass('fade') ? 'fade' : ''
887 |
888 | if (this.isShown && this.options.backdrop) {
889 | var doAnimate = $.support.transition && animate
890 |
891 | this.$backdrop = $('')
892 | .appendTo(document.body)
893 |
894 | if (this.options.backdrop != 'static') {
895 | this.$backdrop.click($.proxy(this.hide, this))
896 | }
897 |
898 | if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
899 |
900 | this.$backdrop.addClass('in')
901 |
902 | doAnimate ?
903 | this.$backdrop.one($.support.transition.end, callback) :
904 | callback()
905 |
906 | } else if (!this.isShown && this.$backdrop) {
907 | this.$backdrop.removeClass('in')
908 |
909 | $.support.transition && this.$element.hasClass('fade')?
910 | this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
911 | this.removeBackdrop()
912 |
913 | } else if (callback) {
914 | callback()
915 | }
916 | }
917 | }
918 |
919 |
920 | /* MODAL PLUGIN DEFINITION
921 | * ======================= */
922 |
923 | $.fn.modal = function (option) {
924 | return this.each(function () {
925 | var $this = $(this)
926 | , data = $this.data('modal')
927 | , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
928 | if (!data) $this.data('modal', (data = new Modal(this, options)))
929 | if (typeof option == 'string') data[option]()
930 | else if (options.show) data.show()
931 | })
932 | }
933 |
934 | $.fn.modal.defaults = {
935 | backdrop: true
936 | , keyboard: true
937 | , show: true
938 | }
939 |
940 | $.fn.modal.Constructor = Modal
941 |
942 |
943 | /* MODAL DATA-API
944 | * ============== */
945 |
946 | $(function () {
947 | $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
948 | var $this = $(this)
949 | , href = $this.attr('href')
950 | , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
951 | , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
952 |
953 | e.preventDefault()
954 |
955 | $target
956 | .modal(option)
957 | .one('hide', function () {
958 | $this.focus()
959 | })
960 | })
961 | })
962 |
963 | }(window.jQuery);/* ===========================================================
964 | * bootstrap-tooltip.js v2.1.1
965 | * http://twitter.github.com/bootstrap/javascript.html#tooltips
966 | * Inspired by the original jQuery.tipsy by Jason Frame
967 | * ===========================================================
968 | * Copyright 2012 Twitter, Inc.
969 | *
970 | * Licensed under the Apache License, Version 2.0 (the "License");
971 | * you may not use this file except in compliance with the License.
972 | * You may obtain a copy of the License at
973 | *
974 | * http://www.apache.org/licenses/LICENSE-2.0
975 | *
976 | * Unless required by applicable law or agreed to in writing, software
977 | * distributed under the License is distributed on an "AS IS" BASIS,
978 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
979 | * See the License for the specific language governing permissions and
980 | * limitations under the License.
981 | * ========================================================== */
982 |
983 |
984 | !function ($) {
985 |
986 | "use strict"; // jshint ;_;
987 |
988 |
989 | /* TOOLTIP PUBLIC CLASS DEFINITION
990 | * =============================== */
991 |
992 | var Tooltip = function (element, options) {
993 | this.init('tooltip', element, options)
994 | }
995 |
996 | Tooltip.prototype = {
997 |
998 | constructor: Tooltip
999 |
1000 | , init: function (type, element, options) {
1001 | var eventIn
1002 | , eventOut
1003 |
1004 | this.type = type
1005 | this.$element = $(element)
1006 | this.options = this.getOptions(options)
1007 | this.enabled = true
1008 |
1009 | if (this.options.trigger == 'click') {
1010 | this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1011 | } else if (this.options.trigger != 'manual') {
1012 | eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
1013 | eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
1014 | this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1015 | this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1016 | }
1017 |
1018 | this.options.selector ?
1019 | (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1020 | this.fixTitle()
1021 | }
1022 |
1023 | , getOptions: function (options) {
1024 | options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
1025 |
1026 | if (options.delay && typeof options.delay == 'number') {
1027 | options.delay = {
1028 | show: options.delay
1029 | , hide: options.delay
1030 | }
1031 | }
1032 |
1033 | return options
1034 | }
1035 |
1036 | , enter: function (e) {
1037 | var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1038 |
1039 | if (!self.options.delay || !self.options.delay.show) return self.show()
1040 |
1041 | clearTimeout(this.timeout)
1042 | self.hoverState = 'in'
1043 | this.timeout = setTimeout(function() {
1044 | if (self.hoverState == 'in') self.show()
1045 | }, self.options.delay.show)
1046 | }
1047 |
1048 | , leave: function (e) {
1049 | var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1050 |
1051 | if (this.timeout) clearTimeout(this.timeout)
1052 | if (!self.options.delay || !self.options.delay.hide) return self.hide()
1053 |
1054 | self.hoverState = 'out'
1055 | this.timeout = setTimeout(function() {
1056 | if (self.hoverState == 'out') self.hide()
1057 | }, self.options.delay.hide)
1058 | }
1059 |
1060 | , show: function () {
1061 | var $tip
1062 | , inside
1063 | , pos
1064 | , actualWidth
1065 | , actualHeight
1066 | , placement
1067 | , tp
1068 |
1069 | if (this.hasContent() && this.enabled) {
1070 | $tip = this.tip()
1071 | this.setContent()
1072 |
1073 | if (this.options.animation) {
1074 | $tip.addClass('fade')
1075 | }
1076 |
1077 | placement = typeof this.options.placement == 'function' ?
1078 | this.options.placement.call(this, $tip[0], this.$element[0]) :
1079 | this.options.placement
1080 |
1081 | inside = /in/.test(placement)
1082 |
1083 | $tip
1084 | .remove()
1085 | .css({ top: 0, left: 0, display: 'block' })
1086 | .appendTo(inside ? this.$element : document.body)
1087 |
1088 | pos = this.getPosition(inside)
1089 |
1090 | actualWidth = $tip[0].offsetWidth
1091 | actualHeight = $tip[0].offsetHeight
1092 |
1093 | switch (inside ? placement.split(' ')[1] : placement) {
1094 | case 'bottom':
1095 | tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
1096 | break
1097 | case 'top':
1098 | tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
1099 | break
1100 | case 'left':
1101 | tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
1102 | break
1103 | case 'right':
1104 | tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
1105 | break
1106 | }
1107 |
1108 | $tip
1109 | .css(tp)
1110 | .addClass(placement)
1111 | .addClass('in')
1112 | }
1113 | }
1114 |
1115 | , setContent: function () {
1116 | var $tip = this.tip()
1117 | , title = this.getTitle()
1118 |
1119 | $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1120 | $tip.removeClass('fade in top bottom left right')
1121 | }
1122 |
1123 | , hide: function () {
1124 | var that = this
1125 | , $tip = this.tip()
1126 |
1127 | $tip.removeClass('in')
1128 |
1129 | function removeWithAnimation() {
1130 | var timeout = setTimeout(function () {
1131 | $tip.off($.support.transition.end).remove()
1132 | }, 500)
1133 |
1134 | $tip.one($.support.transition.end, function () {
1135 | clearTimeout(timeout)
1136 | $tip.remove()
1137 | })
1138 | }
1139 |
1140 | $.support.transition && this.$tip.hasClass('fade') ?
1141 | removeWithAnimation() :
1142 | $tip.remove()
1143 |
1144 | return this
1145 | }
1146 |
1147 | , fixTitle: function () {
1148 | var $e = this.$element
1149 | if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1150 | $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
1151 | }
1152 | }
1153 |
1154 | , hasContent: function () {
1155 | return this.getTitle()
1156 | }
1157 |
1158 | , getPosition: function (inside) {
1159 | return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
1160 | width: this.$element[0].offsetWidth
1161 | , height: this.$element[0].offsetHeight
1162 | })
1163 | }
1164 |
1165 | , getTitle: function () {
1166 | var title
1167 | , $e = this.$element
1168 | , o = this.options
1169 |
1170 | title = $e.attr('data-original-title')
1171 | || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1172 |
1173 | return title
1174 | }
1175 |
1176 | , tip: function () {
1177 | return this.$tip = this.$tip || $(this.options.template)
1178 | }
1179 |
1180 | , validate: function () {
1181 | if (!this.$element[0].parentNode) {
1182 | this.hide()
1183 | this.$element = null
1184 | this.options = null
1185 | }
1186 | }
1187 |
1188 | , enable: function () {
1189 | this.enabled = true
1190 | }
1191 |
1192 | , disable: function () {
1193 | this.enabled = false
1194 | }
1195 |
1196 | , toggleEnabled: function () {
1197 | this.enabled = !this.enabled
1198 | }
1199 |
1200 | , toggle: function () {
1201 | this[this.tip().hasClass('in') ? 'hide' : 'show']()
1202 | }
1203 |
1204 | , destroy: function () {
1205 | this.hide().$element.off('.' + this.type).removeData(this.type)
1206 | }
1207 |
1208 | }
1209 |
1210 |
1211 | /* TOOLTIP PLUGIN DEFINITION
1212 | * ========================= */
1213 |
1214 | $.fn.tooltip = function ( option ) {
1215 | return this.each(function () {
1216 | var $this = $(this)
1217 | , data = $this.data('tooltip')
1218 | , options = typeof option == 'object' && option
1219 | if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1220 | if (typeof option == 'string') data[option]()
1221 | })
1222 | }
1223 |
1224 | $.fn.tooltip.Constructor = Tooltip
1225 |
1226 | $.fn.tooltip.defaults = {
1227 | animation: true
1228 | , placement: 'top'
1229 | , selector: false
1230 | , template: ''
1231 | , trigger: 'hover'
1232 | , title: ''
1233 | , delay: 0
1234 | , html: true
1235 | }
1236 |
1237 | }(window.jQuery);
1238 | /* ===========================================================
1239 | * bootstrap-popover.js v2.1.1
1240 | * http://twitter.github.com/bootstrap/javascript.html#popovers
1241 | * ===========================================================
1242 | * Copyright 2012 Twitter, Inc.
1243 | *
1244 | * Licensed under the Apache License, Version 2.0 (the "License");
1245 | * you may not use this file except in compliance with the License.
1246 | * You may obtain a copy of the License at
1247 | *
1248 | * http://www.apache.org/licenses/LICENSE-2.0
1249 | *
1250 | * Unless required by applicable law or agreed to in writing, software
1251 | * distributed under the License is distributed on an "AS IS" BASIS,
1252 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1253 | * See the License for the specific language governing permissions and
1254 | * limitations under the License.
1255 | * =========================================================== */
1256 |
1257 |
1258 | !function ($) {
1259 |
1260 | "use strict"; // jshint ;_;
1261 |
1262 |
1263 | /* POPOVER PUBLIC CLASS DEFINITION
1264 | * =============================== */
1265 |
1266 | var Popover = function (element, options) {
1267 | this.init('popover', element, options)
1268 | }
1269 |
1270 |
1271 | /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1272 | ========================================== */
1273 |
1274 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1275 |
1276 | constructor: Popover
1277 |
1278 | , setContent: function () {
1279 | var $tip = this.tip()
1280 | , title = this.getTitle()
1281 | , content = this.getContent()
1282 |
1283 | $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1284 | $tip.find('.popover-content > *')[this.options.html ? 'html' : 'text'](content)
1285 |
1286 | $tip.removeClass('fade top bottom left right in')
1287 | }
1288 |
1289 | , hasContent: function () {
1290 | return this.getTitle() || this.getContent()
1291 | }
1292 |
1293 | , getContent: function () {
1294 | var content
1295 | , $e = this.$element
1296 | , o = this.options
1297 |
1298 | content = $e.attr('data-content')
1299 | || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1300 |
1301 | return content
1302 | }
1303 |
1304 | , tip: function () {
1305 | if (!this.$tip) {
1306 | this.$tip = $(this.options.template)
1307 | }
1308 | return this.$tip
1309 | }
1310 |
1311 | , destroy: function () {
1312 | this.hide().$element.off('.' + this.type).removeData(this.type)
1313 | }
1314 |
1315 | })
1316 |
1317 |
1318 | /* POPOVER PLUGIN DEFINITION
1319 | * ======================= */
1320 |
1321 | $.fn.popover = function (option) {
1322 | return this.each(function () {
1323 | var $this = $(this)
1324 | , data = $this.data('popover')
1325 | , options = typeof option == 'object' && option
1326 | if (!data) $this.data('popover', (data = new Popover(this, options)))
1327 | if (typeof option == 'string') data[option]()
1328 | })
1329 | }
1330 |
1331 | $.fn.popover.Constructor = Popover
1332 |
1333 | $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1334 | placement: 'right'
1335 | , trigger: 'click'
1336 | , content: ''
1337 | , template: ''
1338 | })
1339 |
1340 | }(window.jQuery);/* =============================================================
1341 | * bootstrap-scrollspy.js v2.1.1
1342 | * http://twitter.github.com/bootstrap/javascript.html#scrollspy
1343 | * =============================================================
1344 | * Copyright 2012 Twitter, Inc.
1345 | *
1346 | * Licensed under the Apache License, Version 2.0 (the "License");
1347 | * you may not use this file except in compliance with the License.
1348 | * You may obtain a copy of the License at
1349 | *
1350 | * http://www.apache.org/licenses/LICENSE-2.0
1351 | *
1352 | * Unless required by applicable law or agreed to in writing, software
1353 | * distributed under the License is distributed on an "AS IS" BASIS,
1354 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1355 | * See the License for the specific language governing permissions and
1356 | * limitations under the License.
1357 | * ============================================================== */
1358 |
1359 |
1360 | !function ($) {
1361 |
1362 | "use strict"; // jshint ;_;
1363 |
1364 |
1365 | /* SCROLLSPY CLASS DEFINITION
1366 | * ========================== */
1367 |
1368 | function ScrollSpy(element, options) {
1369 | var process = $.proxy(this.process, this)
1370 | , $element = $(element).is('body') ? $(window) : $(element)
1371 | , href
1372 | this.options = $.extend({}, $.fn.scrollspy.defaults, options)
1373 | this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
1374 | this.selector = (this.options.target
1375 | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1376 | || '') + ' .nav li > a'
1377 | this.$body = $('body')
1378 | this.refresh()
1379 | this.process()
1380 | }
1381 |
1382 | ScrollSpy.prototype = {
1383 |
1384 | constructor: ScrollSpy
1385 |
1386 | , refresh: function () {
1387 | var self = this
1388 | , $targets
1389 |
1390 | this.offsets = $([])
1391 | this.targets = $([])
1392 |
1393 | $targets = this.$body
1394 | .find(this.selector)
1395 | .map(function () {
1396 | var $el = $(this)
1397 | , href = $el.data('target') || $el.attr('href')
1398 | , $href = /^#\w/.test(href) && $(href)
1399 | return ( $href
1400 | && $href.length
1401 | && [[ $href.position().top, href ]] ) || null
1402 | })
1403 | .sort(function (a, b) { return a[0] - b[0] })
1404 | .each(function () {
1405 | self.offsets.push(this[0])
1406 | self.targets.push(this[1])
1407 | })
1408 | }
1409 |
1410 | , process: function () {
1411 | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1412 | , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1413 | , maxScroll = scrollHeight - this.$scrollElement.height()
1414 | , offsets = this.offsets
1415 | , targets = this.targets
1416 | , activeTarget = this.activeTarget
1417 | , i
1418 |
1419 | if (scrollTop >= maxScroll) {
1420 | return activeTarget != (i = targets.last()[0])
1421 | && this.activate ( i )
1422 | }
1423 |
1424 | for (i = offsets.length; i--;) {
1425 | activeTarget != targets[i]
1426 | && scrollTop >= offsets[i]
1427 | && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1428 | && this.activate( targets[i] )
1429 | }
1430 | }
1431 |
1432 | , activate: function (target) {
1433 | var active
1434 | , selector
1435 |
1436 | this.activeTarget = target
1437 |
1438 | $(this.selector)
1439 | .parent('.active')
1440 | .removeClass('active')
1441 |
1442 | selector = this.selector
1443 | + '[data-target="' + target + '"],'
1444 | + this.selector + '[href="' + target + '"]'
1445 |
1446 | active = $(selector)
1447 | .parent('li')
1448 | .addClass('active')
1449 |
1450 | if (active.parent('.dropdown-menu').length) {
1451 | active = active.closest('li.dropdown').addClass('active')
1452 | }
1453 |
1454 | active.trigger('activate')
1455 | }
1456 |
1457 | }
1458 |
1459 |
1460 | /* SCROLLSPY PLUGIN DEFINITION
1461 | * =========================== */
1462 |
1463 | $.fn.scrollspy = function (option) {
1464 | return this.each(function () {
1465 | var $this = $(this)
1466 | , data = $this.data('scrollspy')
1467 | , options = typeof option == 'object' && option
1468 | if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
1469 | if (typeof option == 'string') data[option]()
1470 | })
1471 | }
1472 |
1473 | $.fn.scrollspy.Constructor = ScrollSpy
1474 |
1475 | $.fn.scrollspy.defaults = {
1476 | offset: 10
1477 | }
1478 |
1479 |
1480 | /* SCROLLSPY DATA-API
1481 | * ================== */
1482 |
1483 | $(window).on('load', function () {
1484 | $('[data-spy="scroll"]').each(function () {
1485 | var $spy = $(this)
1486 | $spy.scrollspy($spy.data())
1487 | })
1488 | })
1489 |
1490 | }(window.jQuery);/* ========================================================
1491 | * bootstrap-tab.js v2.1.1
1492 | * http://twitter.github.com/bootstrap/javascript.html#tabs
1493 | * ========================================================
1494 | * Copyright 2012 Twitter, Inc.
1495 | *
1496 | * Licensed under the Apache License, Version 2.0 (the "License");
1497 | * you may not use this file except in compliance with the License.
1498 | * You may obtain a copy of the License at
1499 | *
1500 | * http://www.apache.org/licenses/LICENSE-2.0
1501 | *
1502 | * Unless required by applicable law or agreed to in writing, software
1503 | * distributed under the License is distributed on an "AS IS" BASIS,
1504 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1505 | * See the License for the specific language governing permissions and
1506 | * limitations under the License.
1507 | * ======================================================== */
1508 |
1509 |
1510 | !function ($) {
1511 |
1512 | "use strict"; // jshint ;_;
1513 |
1514 |
1515 | /* TAB CLASS DEFINITION
1516 | * ==================== */
1517 |
1518 | var Tab = function (element) {
1519 | this.element = $(element)
1520 | }
1521 |
1522 | Tab.prototype = {
1523 |
1524 | constructor: Tab
1525 |
1526 | , show: function () {
1527 | var $this = this.element
1528 | , $ul = $this.closest('ul:not(.dropdown-menu)')
1529 | , selector = $this.attr('data-target')
1530 | , previous
1531 | , $target
1532 | , e
1533 |
1534 | if (!selector) {
1535 | selector = $this.attr('href')
1536 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1537 | }
1538 |
1539 | if ( $this.parent('li').hasClass('active') ) return
1540 |
1541 | previous = $ul.find('.active a').last()[0]
1542 |
1543 | e = $.Event('show', {
1544 | relatedTarget: previous
1545 | })
1546 |
1547 | $this.trigger(e)
1548 |
1549 | if (e.isDefaultPrevented()) return
1550 |
1551 | $target = $(selector)
1552 |
1553 | this.activate($this.parent('li'), $ul)
1554 | this.activate($target, $target.parent(), function () {
1555 | $this.trigger({
1556 | type: 'shown'
1557 | , relatedTarget: previous
1558 | })
1559 | })
1560 | }
1561 |
1562 | , activate: function ( element, container, callback) {
1563 | var $active = container.find('> .active')
1564 | , transition = callback
1565 | && $.support.transition
1566 | && $active.hasClass('fade')
1567 |
1568 | function next() {
1569 | $active
1570 | .removeClass('active')
1571 | .find('> .dropdown-menu > .active')
1572 | .removeClass('active')
1573 |
1574 | element.addClass('active')
1575 |
1576 | if (transition) {
1577 | element[0].offsetWidth // reflow for transition
1578 | element.addClass('in')
1579 | } else {
1580 | element.removeClass('fade')
1581 | }
1582 |
1583 | if ( element.parent('.dropdown-menu') ) {
1584 | element.closest('li.dropdown').addClass('active')
1585 | }
1586 |
1587 | callback && callback()
1588 | }
1589 |
1590 | transition ?
1591 | $active.one($.support.transition.end, next) :
1592 | next()
1593 |
1594 | $active.removeClass('in')
1595 | }
1596 | }
1597 |
1598 |
1599 | /* TAB PLUGIN DEFINITION
1600 | * ===================== */
1601 |
1602 | $.fn.tab = function ( option ) {
1603 | return this.each(function () {
1604 | var $this = $(this)
1605 | , data = $this.data('tab')
1606 | if (!data) $this.data('tab', (data = new Tab(this)))
1607 | if (typeof option == 'string') data[option]()
1608 | })
1609 | }
1610 |
1611 | $.fn.tab.Constructor = Tab
1612 |
1613 |
1614 | /* TAB DATA-API
1615 | * ============ */
1616 |
1617 | $(function () {
1618 | $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1619 | e.preventDefault()
1620 | $(this).tab('show')
1621 | })
1622 | })
1623 |
1624 | }(window.jQuery);/* =============================================================
1625 | * bootstrap-typeahead.js v2.1.1
1626 | * http://twitter.github.com/bootstrap/javascript.html#typeahead
1627 | * =============================================================
1628 | * Copyright 2012 Twitter, Inc.
1629 | *
1630 | * Licensed under the Apache License, Version 2.0 (the "License");
1631 | * you may not use this file except in compliance with the License.
1632 | * You may obtain a copy of the License at
1633 | *
1634 | * http://www.apache.org/licenses/LICENSE-2.0
1635 | *
1636 | * Unless required by applicable law or agreed to in writing, software
1637 | * distributed under the License is distributed on an "AS IS" BASIS,
1638 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1639 | * See the License for the specific language governing permissions and
1640 | * limitations under the License.
1641 | * ============================================================ */
1642 |
1643 |
1644 | !function($){
1645 |
1646 | "use strict"; // jshint ;_;
1647 |
1648 |
1649 | /* TYPEAHEAD PUBLIC CLASS DEFINITION
1650 | * ================================= */
1651 |
1652 | var Typeahead = function (element, options) {
1653 | this.$element = $(element)
1654 | this.options = $.extend({}, $.fn.typeahead.defaults, options)
1655 | this.matcher = this.options.matcher || this.matcher
1656 | this.sorter = this.options.sorter || this.sorter
1657 | this.highlighter = this.options.highlighter || this.highlighter
1658 | this.updater = this.options.updater || this.updater
1659 | this.$menu = $(this.options.menu).appendTo('body')
1660 | this.source = this.options.source
1661 | this.shown = false
1662 | this.listen()
1663 | }
1664 |
1665 | Typeahead.prototype = {
1666 |
1667 | constructor: Typeahead
1668 |
1669 | , select: function () {
1670 | var val = this.$menu.find('.active').attr('data-value')
1671 | this.$element
1672 | .val(this.updater(val))
1673 | .change()
1674 | return this.hide()
1675 | }
1676 |
1677 | , updater: function (item) {
1678 | return item
1679 | }
1680 |
1681 | , show: function () {
1682 | var pos = $.extend({}, this.$element.offset(), {
1683 | height: this.$element[0].offsetHeight
1684 | })
1685 |
1686 | this.$menu.css({
1687 | top: pos.top + pos.height
1688 | , left: pos.left
1689 | })
1690 |
1691 | this.$menu.show()
1692 | this.shown = true
1693 | return this
1694 | }
1695 |
1696 | , hide: function () {
1697 | this.$menu.hide()
1698 | this.shown = false
1699 | return this
1700 | }
1701 |
1702 | , lookup: function (event) {
1703 | var items
1704 |
1705 | this.query = this.$element.val()
1706 |
1707 | if (!this.query || this.query.length < this.options.minLength) {
1708 | return this.shown ? this.hide() : this
1709 | }
1710 |
1711 | items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
1712 |
1713 | return items ? this.process(items) : this
1714 | }
1715 |
1716 | , process: function (items) {
1717 | var that = this
1718 |
1719 | items = $.grep(items, function (item) {
1720 | return that.matcher(item)
1721 | })
1722 |
1723 | items = this.sorter(items)
1724 |
1725 | if (!items.length) {
1726 | return this.shown ? this.hide() : this
1727 | }
1728 |
1729 | return this.render(items.slice(0, this.options.items)).show()
1730 | }
1731 |
1732 | , matcher: function (item) {
1733 | return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1734 | }
1735 |
1736 | , sorter: function (items) {
1737 | var beginswith = []
1738 | , caseSensitive = []
1739 | , caseInsensitive = []
1740 | , item
1741 |
1742 | while (item = items.shift()) {
1743 | if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1744 | else if (~item.indexOf(this.query)) caseSensitive.push(item)
1745 | else caseInsensitive.push(item)
1746 | }
1747 |
1748 | return beginswith.concat(caseSensitive, caseInsensitive)
1749 | }
1750 |
1751 | , highlighter: function (item) {
1752 | var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
1753 | return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
1754 | return '' + match + ''
1755 | })
1756 | }
1757 |
1758 | , render: function (items) {
1759 | var that = this
1760 |
1761 | items = $(items).map(function (i, item) {
1762 | i = $(that.options.item).attr('data-value', item)
1763 | i.find('a').html(that.highlighter(item))
1764 | return i[0]
1765 | })
1766 |
1767 | items.first().addClass('active')
1768 | this.$menu.html(items)
1769 | return this
1770 | }
1771 |
1772 | , next: function (event) {
1773 | var active = this.$menu.find('.active').removeClass('active')
1774 | , next = active.next()
1775 |
1776 | if (!next.length) {
1777 | next = $(this.$menu.find('li')[0])
1778 | }
1779 |
1780 | next.addClass('active')
1781 | }
1782 |
1783 | , prev: function (event) {
1784 | var active = this.$menu.find('.active').removeClass('active')
1785 | , prev = active.prev()
1786 |
1787 | if (!prev.length) {
1788 | prev = this.$menu.find('li').last()
1789 | }
1790 |
1791 | prev.addClass('active')
1792 | }
1793 |
1794 | , listen: function () {
1795 | this.$element
1796 | .on('blur', $.proxy(this.blur, this))
1797 | .on('keypress', $.proxy(this.keypress, this))
1798 | .on('keyup', $.proxy(this.keyup, this))
1799 |
1800 | if ($.browser.chrome || $.browser.webkit || $.browser.msie) {
1801 | this.$element.on('keydown', $.proxy(this.keydown, this))
1802 | }
1803 |
1804 | this.$menu
1805 | .on('click', $.proxy(this.click, this))
1806 | .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1807 | }
1808 |
1809 | , move: function (e) {
1810 | if (!this.shown) return
1811 |
1812 | switch(e.keyCode) {
1813 | case 9: // tab
1814 | case 13: // enter
1815 | case 27: // escape
1816 | e.preventDefault()
1817 | break
1818 |
1819 | case 38: // up arrow
1820 | e.preventDefault()
1821 | this.prev()
1822 | break
1823 |
1824 | case 40: // down arrow
1825 | e.preventDefault()
1826 | this.next()
1827 | break
1828 | }
1829 |
1830 | e.stopPropagation()
1831 | }
1832 |
1833 | , keydown: function (e) {
1834 | this.suppressKeyPressRepeat = !~$.inArray(e.keyCode, [40,38,9,13,27])
1835 | this.move(e)
1836 | }
1837 |
1838 | , keypress: function (e) {
1839 | if (this.suppressKeyPressRepeat) return
1840 | this.move(e)
1841 | }
1842 |
1843 | , keyup: function (e) {
1844 | switch(e.keyCode) {
1845 | case 40: // down arrow
1846 | case 38: // up arrow
1847 | break
1848 |
1849 | case 9: // tab
1850 | case 13: // enter
1851 | if (!this.shown) return
1852 | this.select()
1853 | break
1854 |
1855 | case 27: // escape
1856 | if (!this.shown) return
1857 | this.hide()
1858 | break
1859 |
1860 | default:
1861 | this.lookup()
1862 | }
1863 |
1864 | e.stopPropagation()
1865 | e.preventDefault()
1866 | }
1867 |
1868 | , blur: function (e) {
1869 | var that = this
1870 | setTimeout(function () { that.hide() }, 150)
1871 | }
1872 |
1873 | , click: function (e) {
1874 | e.stopPropagation()
1875 | e.preventDefault()
1876 | this.select()
1877 | }
1878 |
1879 | , mouseenter: function (e) {
1880 | this.$menu.find('.active').removeClass('active')
1881 | $(e.currentTarget).addClass('active')
1882 | }
1883 |
1884 | }
1885 |
1886 |
1887 | /* TYPEAHEAD PLUGIN DEFINITION
1888 | * =========================== */
1889 |
1890 | $.fn.typeahead = function (option) {
1891 | return this.each(function () {
1892 | var $this = $(this)
1893 | , data = $this.data('typeahead')
1894 | , options = typeof option == 'object' && option
1895 | if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1896 | if (typeof option == 'string') data[option]()
1897 | })
1898 | }
1899 |
1900 | $.fn.typeahead.defaults = {
1901 | source: []
1902 | , items: 8
1903 | , menu: ''
1904 | , item: ''
1905 | , minLength: 1
1906 | }
1907 |
1908 | $.fn.typeahead.Constructor = Typeahead
1909 |
1910 |
1911 | /* TYPEAHEAD DATA-API
1912 | * ================== */
1913 |
1914 | $(function () {
1915 | $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1916 | var $this = $(this)
1917 | if ($this.data('typeahead')) return
1918 | e.preventDefault()
1919 | $this.typeahead($this.data())
1920 | })
1921 | })
1922 |
1923 | }(window.jQuery);
1924 | /* ==========================================================
1925 | * bootstrap-affix.js v2.1.1
1926 | * http://twitter.github.com/bootstrap/javascript.html#affix
1927 | * ==========================================================
1928 | * Copyright 2012 Twitter, Inc.
1929 | *
1930 | * Licensed under the Apache License, Version 2.0 (the "License");
1931 | * you may not use this file except in compliance with the License.
1932 | * You may obtain a copy of the License at
1933 | *
1934 | * http://www.apache.org/licenses/LICENSE-2.0
1935 | *
1936 | * Unless required by applicable law or agreed to in writing, software
1937 | * distributed under the License is distributed on an "AS IS" BASIS,
1938 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1939 | * See the License for the specific language governing permissions and
1940 | * limitations under the License.
1941 | * ========================================================== */
1942 |
1943 |
1944 | !function ($) {
1945 |
1946 | "use strict"; // jshint ;_;
1947 |
1948 |
1949 | /* AFFIX CLASS DEFINITION
1950 | * ====================== */
1951 |
1952 | var Affix = function (element, options) {
1953 | this.options = $.extend({}, $.fn.affix.defaults, options)
1954 | this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
1955 | this.$element = $(element)
1956 | this.checkPosition()
1957 | }
1958 |
1959 | Affix.prototype.checkPosition = function () {
1960 | if (!this.$element.is(':visible')) return
1961 |
1962 | var scrollHeight = $(document).height()
1963 | , scrollTop = this.$window.scrollTop()
1964 | , position = this.$element.offset()
1965 | , offset = this.options.offset
1966 | , offsetBottom = offset.bottom
1967 | , offsetTop = offset.top
1968 | , reset = 'affix affix-top affix-bottom'
1969 | , affix
1970 |
1971 | if (typeof offset != 'object') offsetBottom = offsetTop = offset
1972 | if (typeof offsetTop == 'function') offsetTop = offset.top()
1973 | if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
1974 |
1975 | affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
1976 | false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
1977 | 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
1978 | 'top' : false
1979 |
1980 | if (this.affixed === affix) return
1981 |
1982 | this.affixed = affix
1983 | this.unpin = affix == 'bottom' ? position.top - scrollTop : null
1984 |
1985 | this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
1986 | }
1987 |
1988 |
1989 | /* AFFIX PLUGIN DEFINITION
1990 | * ======================= */
1991 |
1992 | $.fn.affix = function (option) {
1993 | return this.each(function () {
1994 | var $this = $(this)
1995 | , data = $this.data('affix')
1996 | , options = typeof option == 'object' && option
1997 | if (!data) $this.data('affix', (data = new Affix(this, options)))
1998 | if (typeof option == 'string') data[option]()
1999 | })
2000 | }
2001 |
2002 | $.fn.affix.Constructor = Affix
2003 |
2004 | $.fn.affix.defaults = {
2005 | offset: 0
2006 | }
2007 |
2008 |
2009 | /* AFFIX DATA-API
2010 | * ============== */
2011 |
2012 | $(window).on('load', function () {
2013 | $('[data-spy="affix"]').each(function () {
2014 | var $spy = $(this)
2015 | , data = $spy.data()
2016 |
2017 | data.offset = data.offset || {}
2018 |
2019 | data.offsetBottom && (data.offset.bottom = data.offsetBottom)
2020 | data.offsetTop && (data.offset.top = data.offsetTop)
2021 |
2022 | $spy.affix(data)
2023 | })
2024 | })
2025 |
2026 |
2027 | }(window.jQuery);
--------------------------------------------------------------------------------
/public/javascripts/jquery-1.8.0.min.js:
--------------------------------------------------------------------------------
1 | /*! jQuery v@1.8.0 jquery.com | jquery.org/license */
2 | (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;ba",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;jq&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;ai){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,""],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X","
"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>$2>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1>$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/