├── static
├── js
│ ├── game
│ │ ├── utils.js
│ │ ├── data
│ │ │ ├── data.js
│ │ │ ├── types.js
│ │ │ └── resources.js
│ │ ├── entities
│ │ │ ├── entities.js
│ │ │ ├── particles.js
│ │ │ ├── shams.js
│ │ │ ├── bases.js
│ │ │ └── player.js
│ │ └── hud
│ │ │ └── hud.js
│ ├── vendor
│ │ ├── jquery
│ │ │ ├── jquery.ajax-progress.js
│ │ │ └── jquery.min.js
│ │ └── require.js
│ └── main.js
├── favicon.ico
├── assets
│ ├── ui
│ │ ├── bg.jpg
│ │ ├── mute.png
│ │ ├── starworld1.gif
│ │ ├── starworld2.gif
│ │ ├── starworld3.gif
│ │ └── starworld4.gif
│ ├── audio
│ │ ├── epic.ogg
│ │ ├── sham.wav
│ │ ├── shoot.wav
│ │ └── explosion.wav
│ ├── sprites
│ │ ├── bullet.png
│ │ ├── bullet2.png
│ │ ├── player.png
│ │ └── shamheads.png
│ └── fonts
│ │ └── Museo300-Regular.otf
├── index.html
└── css
│ ├── main.css
│ └── vendor
│ └── normalize.css
├── .gitignore
├── package.json
├── config.json
├── README.md
└── bin
└── shiv
/static/js/game/utils.js:
--------------------------------------------------------------------------------
1 | define({});
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | \#*#
3 | *.sublime-*
4 | node_modules/
--------------------------------------------------------------------------------
/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/favicon.ico
--------------------------------------------------------------------------------
/static/assets/ui/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/ui/bg.jpg
--------------------------------------------------------------------------------
/static/assets/ui/mute.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/ui/mute.png
--------------------------------------------------------------------------------
/static/assets/audio/epic.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/audio/epic.ogg
--------------------------------------------------------------------------------
/static/assets/audio/sham.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/audio/sham.wav
--------------------------------------------------------------------------------
/static/assets/audio/shoot.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/audio/shoot.wav
--------------------------------------------------------------------------------
/static/assets/ui/starworld1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/ui/starworld1.gif
--------------------------------------------------------------------------------
/static/assets/ui/starworld2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/ui/starworld2.gif
--------------------------------------------------------------------------------
/static/assets/ui/starworld3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/ui/starworld3.gif
--------------------------------------------------------------------------------
/static/assets/ui/starworld4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/ui/starworld4.gif
--------------------------------------------------------------------------------
/static/assets/audio/explosion.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/audio/explosion.wav
--------------------------------------------------------------------------------
/static/assets/sprites/bullet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/sprites/bullet.png
--------------------------------------------------------------------------------
/static/assets/sprites/bullet2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/sprites/bullet2.png
--------------------------------------------------------------------------------
/static/assets/sprites/player.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/sprites/player.png
--------------------------------------------------------------------------------
/static/assets/sprites/shamheads.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/sprites/shamheads.png
--------------------------------------------------------------------------------
/static/assets/fonts/Museo300-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/englercj/shiv/master/static/assets/fonts/Museo300-Regular.otf
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "shiv",
3 | "version": "0.0.1",
4 | "description": "tehehe",
5 | "dependencies": {
6 | "riak-js": "0.9.x",
7 | "express": "3.x"
8 | }
9 | }
--------------------------------------------------------------------------------
/static/js/game/data/data.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'game/data/types',
3 | 'game/data/resources'
4 | ], function(types, resources) {
5 | return {
6 | types: types,
7 | resources: resources
8 | };
9 | });
--------------------------------------------------------------------------------
/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "server": {
3 | "host": "0.0.0.0",
4 | "port": 8001
5 | },
6 | "riak": {
7 | "host": "192.168.1.144",
8 | "port": 8098,
9 | "scores": {
10 | "bucket": "scores"
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/static/js/game/entities/entities.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'game/entities/bases',
3 | 'game/entities/player',
4 | 'game/entities/shams',
5 | 'game/entities/particles'
6 | ], function(bases, player, particles) {
7 | return {
8 | bases: bases,
9 | player: player,
10 | particles: particles
11 | };
12 | });
--------------------------------------------------------------------------------
/static/js/vendor/jquery/jquery.ajax-progress.js:
--------------------------------------------------------------------------------
1 | (function($, window, undefined) {
2 | //patch ajax settings to call a progress callback
3 | var oldXHR = $.ajaxSettings.xhr;
4 | $.ajaxSettings.xhr = function() {
5 | var xhr = oldXHR();
6 | if(xhr instanceof window.XMLHttpRequest) {
7 | xhr.addEventListener('progress', this.progress, false);
8 | }
9 |
10 | return xhr;
11 | };
12 | })(jQuery, window);
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SHam InVadorz (shiv)
2 |
3 | A small fun game designed to congratulate one of my coworkers. As the previous winner of the "Innovation Award"
4 | it was my duty to come up with a creative way to pass the award onto someone new. Chris Sham is the recipient
5 | of the award this time around, and this game is dedicated to him.
6 |
7 | ## Run the game
8 |
9 | For a quick setup you can use the built in webserver:
10 |
11 | ```shell
12 | git clone https://github.com/englercj/shiv.git
13 | cd shiv &&
14 | npm install &&
15 | ./bin/shiv
16 | ```
17 |
18 | Then visit `yoursite.com:8001` to play.
--------------------------------------------------------------------------------
/static/js/game/data/types.js:
--------------------------------------------------------------------------------
1 | define({
2 | /////////////////////////////////////////////////////////
3 | // Entity Types
4 | ///////////////////
5 | //Extend the base types defined by GrapeFruit with a few more, but still maintain
6 | // compatability with the GF ones.
7 | /////////////////////////////////////////////////////////
8 | ENTITY: {
9 | PLAYER: 'player',
10 | ENEMY: 'enemy',
11 | BOSS: 'boss',
12 | FRIENDLY: 'friendly',
13 | NEUTRAL: 'neutral',
14 | COLLECTABLE: 'collectable',
15 | BEAM: 'beam',
16 | PROJECTILE: 'projectile'
17 | },
18 |
19 | /////////////////////////////////////////////////////////
20 | // Z Indexes
21 | ///////////////////
22 | //These are the components used to create different spells
23 | /////////////////////////////////////////////////////////
24 | ZINDEX: {
25 | BACKGROUND: 0,
26 | CHARACTER: 10,
27 | PARTICLE: 20
28 | }
29 | });
--------------------------------------------------------------------------------
/static/js/game/entities/particles.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'game/data/types',
3 | 'game/utils',
4 | 'game/entities/bases'
5 | ], function(types, utils, bases) {
6 | var Bullet = gf.entityPool.add('bullet', bases.Projectile.extend({
7 | init: function(pos, settings) {
8 | settings = settings || {};
9 |
10 | //overwrite base defaults
11 | settings.damage = settings.damage || 1;
12 | settings.texture = settings.texture || gf.resources.bullet_sprite.data;
13 | settings.size = settings.size || [4, 16];
14 | //settings.hitSize = settings.hitSize || [40, 20];
15 |
16 | //call base constructor
17 | this._super(pos, settings);
18 | }
19 | })),
20 |
21 | Laser = gf.entityPool.add('laser', bases.Beam.extend({
22 | init: function(post, settings) {
23 | settings = settings || {};
24 |
25 | settings.damage = settings.damage || 2;
26 | //settings.texture = settings.texture || gf.resources.bullet_sprite.data;
27 | settings.size = settings.size || [16, 1000];
28 | //settings.hitSize = settings.hitSize || [40, 20];
29 | }
30 | }))
31 |
32 | return {
33 | Bullet: Bullet,
34 | Laser: Laser
35 | };
36 | });
--------------------------------------------------------------------------------
/static/js/game/data/resources.js:
--------------------------------------------------------------------------------
1 | define([], function() {
2 | return [
3 | {
4 | name: 'player_sprite',
5 | type: gf.types.RESOURCE.TEXTURE,
6 | src: '/assets/sprites/player.png'
7 | },
8 | {
9 | name: 'bullet_sprite',
10 | type: gf.types.RESOURCE.TEXTURE,
11 | src: '/assets/sprites/bullet.png'
12 | },
13 | {
14 | name: 'bullet2_sprite',
15 | type: gf.types.RESOURCE.TEXTURE,
16 | src: '/assets/sprites/bullet2.png'
17 | },
18 | {
19 | name: 'shamhead_sprite',
20 | type: gf.types.RESOURCE.TEXTURE,
21 | src: '/assets/sprites/shamheads.png'
22 | },
23 | {
24 | name: 'explosion_sound',
25 | type: gf.types.RESOURCE.AUDIO,
26 | src: '/assets/audio/explosion.wav'
27 | },
28 | {
29 | name: 'shamhead_sound',
30 | type: gf.types.RESOURCE.AUDIO,
31 | src: '/assets/audio/sham.wav'
32 | },
33 | {
34 | name: 'shoot_sound',
35 | type: gf.types.RESOURCE.AUDIO,
36 | src: '/assets/audio/shoot.wav'
37 | },
38 | {
39 | name: 'bg_music',
40 | type: gf.types.RESOURCE.MUSIC,
41 | src: '/assets/audio/epic.ogg'
42 | }
43 | ];
44 | });
--------------------------------------------------------------------------------
/bin/shiv:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | var path = require('path'),
4 | express = require('express'),
5 | riak = require('riak-js'),
6 | config = require(path.join('..', 'config.json')),
7 | app = express(),
8 | db = riak.getClient(config.riak),
9 | PORT = process.env.SHIV_PORT || 8001;
10 |
11 | app.use(express.bodyParser());
12 | app.use(express.static(path.join(__dirname, '..', 'static')));
13 | app.use(app.router);
14 |
15 | app.get('/_store/top/:num?', function(req, res) {
16 | db.mapreduce
17 | .add(config.riak.scores.bucket)
18 | .map('Riak.mapValuesJson')
19 | .reduce('Riak.filterNotFound')
20 | .reduce(function(value, count, arg) {
21 | return value.sort(function(a, b) {
22 | return b.score - a.score;
23 | }).slice(0, 5);
24 | }, parseInt(req.params.num, 10) || 10)
25 | .run(function(err, scores) {
26 | try {
27 | if(err)
28 | res.send({ error: err });
29 | else
30 | res.send(scores);
31 | } catch(e) {
32 | if(e.code == 'ECONNRESET') {
33 | console.log('Error sending response, connection reset. Is riak down?');
34 | }
35 | else console.log('Error sending response:', e);
36 | }
37 | });
38 | });
39 |
40 | app.put('/_store/score', function(req, res) {
41 | var key = req.body.name + '_' + req.body.score;
42 | db.save(config.riak.scores.bucket, key, req.body, function(err) {
43 | res.json({ error: err });
44 | });
45 | });
46 |
47 | app.listen(config.server.port, config.server.host, function() {
48 | console.log('listening on %s:%s', config.server.host, config.server.port);
49 | });
--------------------------------------------------------------------------------
/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | SHam InVadorz
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
Stats submitted successfully
55 |
Unable to submit stats to server, try again later
56 |
Please enter your name
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/static/js/game/hud/hud.js:
--------------------------------------------------------------------------------
1 | define([
2 | ], function() {
3 | var items = {
4 | HealthBar: gf.HudItem.extend({
5 | init: function(x, y, settings) {
6 | this._super(x, y, settings);
7 | },
8 | update: function() {
9 | if(!this.dirty) return;
10 |
11 | this.$val.css('width', this.$elm.width() * this.value);
12 |
13 | this.dirty = false;
14 | return this;
15 | },
16 | _createElement: function(x, y) {
17 | this._super(x, y);
18 | this.$elm = $(this.elm);
19 | this.$elm.addClass('gf-hud-health');
20 |
21 | this.$elm.css({
22 | position: 'fixed',
23 | bottom: 0,
24 | top: '',
25 | left: ''
26 | });
27 |
28 | this.$val = $('', {
29 | 'class': 'gf-hud-item gf-hud-health-value ' + this.name
30 | }).appendTo(this.$elm);
31 | }
32 | }),
33 | Bossbar: gf.HudItem.extend({
34 | init: function(x, y, settings) {
35 | this._super(x, y, settings);
36 | },
37 | update: function() {
38 | if(!this.dirty) return;
39 |
40 | this.$val.css('width', this.$elm.width() * this.value);
41 |
42 | this.dirty = false;
43 | return this;
44 | },
45 | _createElement: function(x, y) {
46 | this._super(x, y);
47 | this.$elm = $(this.elm);
48 | this.$elm.addClass('gf-hud-bossbar');
49 |
50 | this.$elm.css({
51 | position: 'fixed',
52 | top: 0,
53 | left: '50%',
54 | width: 512,
55 | marginLeft: -256
56 | });
57 |
58 | this.$val = $('', {
59 | 'class': 'gf-hud-item gf-hud-bossbar-value ' + this.name
60 | }).appendTo(this.$elm);
61 | }
62 | }),
63 | Text: gf.HudItem.extend({
64 | init: function(x, y, settings) {
65 | this.title = 'Title';
66 |
67 | this._super(x, y, settings);
68 | },
69 | update: function() {
70 | if(!this.dirty) return;
71 |
72 | this.$elm.text(this.title + ': ' + this.value);
73 |
74 | this.dirty = false;
75 | return this;
76 | },
77 | _createElement: function(x, y) {
78 | this._super(x, y);
79 | this.$elm = $(this.elm);
80 | this.$elm.addClass('gf-hud-text');
81 | }
82 | }),
83 | MusicMute: gf.HudItem.extend({
84 | init: function(x, y, settings) {
85 | this._super(x, y, settings);
86 | this.dirty = false;
87 | },
88 | onClick: function() {
89 | this.setValue(!this.value);
90 | this.update();
91 | },
92 | update: function() {
93 | if(!this.dirty) return;
94 |
95 | if(this.value === true) {
96 | gf.audio.pauseAll();
97 | this.$elm.addClass('paused');
98 | } else {
99 | gf.audio.playAll();
100 | this.$elm.removeClass('paused');
101 | }
102 | },
103 | _createElement: function(x, y) {
104 | this._super(x, y);
105 | this.$elm = $(this.elm);
106 | this.$elm.addClass('gf-hud-mute');
107 | }
108 | })
109 | };
110 |
111 | return items;
112 | });
--------------------------------------------------------------------------------
/static/css/main.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "Museo";
3 | src: url(/assets/fonts/Museo300-Regular.otf) format("opentype");
4 | }
5 |
6 | body {
7 | font-family: "Museo";
8 | background:left top url(../assets/ui/bg.jpg) repeat #EBEBEB;
9 | color: black;
10 | font-family: Verdana,sans-serif;
11 | margin: 0;
12 | }
13 |
14 | h1 {
15 | font-size: 1.4em;
16 | }
17 |
18 | .error { color: red; }
19 | .success { color: green; }
20 | .ajaxResp, .noname { display: none; }
21 |
22 | .hidden { display: none; }
23 |
24 | .neon { font-family: "Museo"; color:#fff; }
25 | .neon.pink { text-shadow: 0 0 10px #FFFFFF, 0 0 20px #FFFFFF, 0 0 30px #FFFFFF, 0 0 40px #FF00DE, 0 0 70px #FF00DE, 0 0 80px #FF00DE, 0 0 100px #FF00DE, 0 0 150px #FF00DE; }
26 | .neon.blue { text-shadow: 0 0 5px #FFFFFF, 0 0 10px #FFFFFF, 0 0 15px #FFFFFF, 0 0 20px #2393ff, 0 0 30px #2393ff, 0 0 40px #2393ff, 0 0 50px #2393ff, 0 0 60px #2393ff; }
27 |
28 | button, .button {
29 | border: solid 3px #2393ff;
30 | border-radius: 5px;
31 | background: transparent;
32 | padding: 5px 20px;
33 | font-size: 1.2em;
34 | margin: 0;
35 | color: #fff;
36 | text-shadow: 0 0 5px #FFFFFF,
37 | 0 0 10px #FFFFFF,
38 | 0 0 15px #FFFFFF,
39 | 0 0 20px #2393ff,
40 | 0 0 25px #2393ff,
41 | 0 0 30px #2393ff,
42 | 0 0 35px #2393ff,
43 | 0 0 40px #2393ff;
44 | }
45 |
46 | button:hover, .button:hover {
47 | border-width: 2px;
48 | margin: 1px;
49 | text-shadow: 0 0 5px #FFFFFF,
50 | 0 0 10px #FFFFFF,
51 | 0 0 15px #FFFFFF;
52 | }
53 |
54 | #overlay {
55 | display: none;
56 | position: absolute;
57 | left: 0;
58 | top: 0;
59 | width: 100%;
60 | height: 100%;
61 | text-align: center;
62 | z-index: 9000;
63 |
64 | background: #111;
65 | opacity: 0.5;
66 | }
67 |
68 | #finish {
69 |
70 | display: none;
71 | position: absolute;
72 | left: 50%;
73 | top: 300px;
74 | width: 300px;
75 | margin-left: -150px;
76 | z-index: 9001;
77 |
78 | background-color: #000;
79 | opacity: 1;
80 | border: 2px solid #2393ff;
81 | border-radius: 5px;
82 | padding: 25px;
83 | color: #fff;
84 | }
85 |
86 | #finish label {
87 | display: inline-block;
88 | width: 100px;
89 | margin-right: 10px;
90 | text-align: right;
91 | }
92 |
93 | #finish .title { text-align: center; margin-top: 0; font-size: 3em; }
94 |
95 | #finish input {
96 | border: 1px solid #2393ff;
97 | border-radius: 3px;
98 | background: #000;
99 | color: #fff;
100 | padding: 2px;
101 | }
102 |
103 | /* HUD */
104 | .gf-hud {
105 | color: #FFF;
106 | font-style: italic;
107 | text-align: center;
108 | }
109 |
110 | .gf-hud-item.gf-hud-health {
111 | border-top: solid 1px #CCC;
112 | border-radius: 4px 4px 0 0;
113 | width: 100%;
114 | height: 32px;
115 | }
116 |
117 | .gf-hud-item.gf-hud-health-value {
118 | background: rgb(200, 0, 15);
119 | border-radius: 4px 4px 0 0;
120 | height: 32px;
121 | }
122 |
123 | .gf-hud-item.gf-hud-bossbar {
124 | border-bottom: solid 1px #CCC;
125 | border-radius: 0 0 4px 4px;
126 | height: 32px;
127 | }
128 |
129 | .gf-hud-item.gf-hud-bossbar-value {
130 | background: rgb(15, 0, 200);
131 | border-radius: 0 0 4px 4px;
132 | height: 32px;
133 | }
134 |
135 | .gf-hud-item.gf-hud-mute {
136 | width: 17px;
137 | height: 16px;
138 | background: left top url(/assets/ui/mute.png) no-repeat transparent;
139 | cursor: pointer;
140 | }
141 |
142 | .gf-hud-item.gf-hud-mute.paused {
143 | background-position: -17px top;
144 | }
145 |
146 | /* Main game area */
147 | #game-container {
148 | display: block;
149 | position: absolute;
150 | height: 100%;
151 | width: 100%;
152 | overflow: visible;
153 | text-align: center;
154 | visibility: visible;
155 | -moz-user-select: none;
156 | -webkit-user-select: none;
157 | -ms-user-select: none;
158 | }
159 |
160 | #game {
161 | height: 100%;
162 | width: 100%;
163 | background:center top url(/assets/ui/starworld1.gif) #000;
164 | -moz-user-select: none;
165 | -webkit-user-select: none;
166 | -ms-user-select: none;
167 | }
168 |
169 | #game canvas {
170 | height: 768px;
171 | left: 0;
172 | margin: 0;
173 | position: absolute;
174 | top: 0;
175 | width: 1024px;
176 | }
177 |
178 | /* Menu */
179 | #menu {
180 | position: absolute;
181 | height: 100%;
182 | width: 700px;
183 | top: 0;
184 | left: 50%;
185 | margin-left: -350px;
186 | text-align: center;
187 | z-index: 7;
188 | }
189 |
190 | #menu > h1 { font-size: 5.0em; }
191 | #menu > h2 { font-size: 1.5em; }
192 |
193 | #leaderboard {
194 | margin: 0;
195 | padding: 0;
196 |
197 | counter-reset: li;
198 | list-style: none;
199 | }
200 |
201 | #leaderboard > li > span:before {
202 | content: counter(li) ")";
203 | counter-increment: li;
204 | position: relative;
205 | left: -0.5em;
206 | text-shadow: 0 0 5px #FFFFFF,
207 | 0 0 10px #FFFFFF,
208 | 0 0 15px #FFFFFF,
209 | 0 0 20px #2393ff,
210 | 0 0 25px #2393ff,
211 | 0 0 30px #2393ff,
212 | 0 0 35px #2393ff,
213 | 0 0 40px #2393ff;
214 | }
215 |
216 | #roundText {
217 | position: absolute;
218 | display: block;
219 | width: 100%;
220 | text-align: center;
221 | top: 200px;
222 |
223 | font-size: 5em;
224 | }
225 |
226 | #gl-error { margin: 0.5em; }
--------------------------------------------------------------------------------
/static/js/game/entities/shams.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'game/data/types',
3 | 'game/utils',
4 | 'game/entities/bases'
5 | ], function(types, utils, bases) {
6 | var Sham = gf.entityPool.add('sham', bases.Enemy.extend({
7 | init: function(pos, settings) {
8 | settings = settings || {};
9 |
10 | settings.name = settings.name || 'Sham';
11 |
12 | //sprite size
13 | settings.size = settings.size || [88, 88];
14 |
15 | //hitbox size
16 | settings.hitSize = settings.hitSize || [64, 64];
17 |
18 | //texture
19 | settings.texture = settings.texture || gf.resources.shamhead_sprite.data;
20 |
21 | //acceleration
22 | settings.accel = settings.accel || [25, 25];
23 |
24 | //default distance to travel before expiring
25 | this.distance = new gf.THREE.Vector2(0, 1200);
26 |
27 | //how likely this sham is to fire a weapon
28 | this.fireRate = 0.10;
29 |
30 | //call base constructor
31 | this._super(pos, settings);
32 |
33 | //distance this has traveled
34 | this._traveled = new gf.THREE.Vector2(0, 0);
35 |
36 | //add animations
37 | this.addAnimation('normal', [0]);
38 | this.addAnimation('die', {
39 | frames: [8, 9, 10, 11, 12, 13, 14, 15],
40 | duration: 350,
41 | loop: false
42 | });
43 | this.setActiveAnimation('normal');
44 | },
45 | update: function() {
46 | this.velocity.x = 0;
47 | this.velocity.y = -this.accel.y * gf.game._delta;
48 |
49 | this._traveled.sub(this.velocity);
50 |
51 | if(this._traveled.x >= this.distance.x && this._traveled.y >= this.distance.y) {
52 | this.die();
53 | } else {
54 | this.fire();
55 |
56 | //update movement
57 | this.updateMovement();
58 | }
59 |
60 | this._super();
61 | },
62 | fire: function() {
63 | var rand = (Math.random() * gf.game._delta) / this.fireRate;
64 |
65 | if((rand * 10000) < 1) {
66 | var p = new gf.entityPool.create('bullet', {
67 | scale: 1,
68 | accel: [0, -6],
69 | texture: gf.resources.bullet2_sprite.data,
70 | position: this._mesh.position.clone(),
71 | owner: this
72 | });
73 |
74 | gf.game.addObject(p);
75 | p.shoot();
76 | }
77 | },
78 | onCollision: function(obj) {
79 | if(obj.type === types.ENTITY.PLAYER) {
80 | obj.die(this);
81 | }
82 |
83 | this._super(obj);
84 | }
85 | }));
86 |
87 | var Shamboss = gf.entityPool.add('shamboss', bases.Boss.extend({
88 | init: function(pos, settings) {
89 | settings = settings || {};
90 |
91 | var $c = $(gf.game._cont);
92 | pos[1] -= $c.height() / 4.75;
93 |
94 | settings.name = settings.name || 'Shamboss';
95 |
96 | //sprite size
97 | settings.size = settings.size || [88, 88];
98 |
99 | //hitbox size
100 | settings.hitSize = settings.hitSize || [64, 64];
101 |
102 | //texture
103 | settings.texture = settings.texture || gf.resources.shamhead_sprite.data;
104 |
105 | //acceleration
106 | settings.accel = settings.accel || [50, 10];
107 |
108 | //scale up
109 | settings.scale = settings.scale || 2.5;
110 |
111 | //how likely this sham is to fire a weapon
112 | this.fireRate = 0.10;
113 |
114 | //call base constructor
115 | this._super(pos, settings);
116 |
117 | //top, right, bottom, left
118 | this.max = [
119 | $c.height() / 3.5, //top
120 | $c.width() / 2.5, //right
121 | $c.height() / 6.5, //bottom
122 | $c.width() / -2.5 //left
123 | ];
124 |
125 | //add animations
126 | this.addAnimation('normal', [0]);
127 | this.addAnimation('die', {
128 | frames: [8, 9, 10, 11, 12, 13, 14, 15],
129 | duration: 1000,
130 | loop: false
131 | });
132 | this.setActiveAnimation('normal');
133 |
134 | gf.HUD.setItemValue('bossbar', 1);
135 | },
136 | update: function() {
137 | this.velocity.x = -this.accel.x * gf.game._delta;
138 | this.velocity.y = -this.accel.y * gf.game._delta;
139 |
140 | var nx = this._mesh.position.x + this.velocity.x,
141 | ny = this._mesh.position.y + this.velocity.y;
142 |
143 | if(nx > this.max[1] || nx < this.max[3]) this.accel.x = -this.accel.x;
144 | if(ny > this.max[0] || ny < this.max[2]) this.accel.y = -this.accel.y;
145 |
146 | this.fire();
147 |
148 | //update movement
149 | this.updateMovement();
150 |
151 | this._super();
152 | },
153 | fire: function() {
154 | var rand = (Math.random() * gf.game._delta) / this.fireRate;
155 |
156 | if((rand * 10000) < 1) {
157 | var p = new gf.entityPool.create('bullet', {
158 | scale: 1,
159 | accel: [0, -7],
160 | texture: gf.resources.bullet2_sprite.data,
161 | position: this._mesh.position.clone(),
162 | owner: this
163 | });
164 |
165 | gf.game.addObject(p);
166 | p.shoot();
167 | }
168 | },
169 | takeDamage: function(dmg, attacker) {
170 | var nh = this.health - dmg < 0 ? 0 : this.health - dmg;
171 | gf.HUD.setItemValue('bossbar', nh / this.maxHealth);
172 | this._super(dmg, attacker);
173 | },
174 | onCollision: function(obj) {
175 | if(obj.type === types.ENTITY.PLAYER) {
176 | obj.die(this);
177 | }
178 |
179 | this._super(obj);
180 | }
181 | }));
182 |
183 | return {
184 | Sham: Sham,
185 | Shamboss: Shamboss
186 | };
187 | });
--------------------------------------------------------------------------------
/static/js/game/entities/bases.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'game/data/types',
3 | 'game/utils'
4 | ], function(types, utils) {
5 | var bases = {};
6 |
7 | //Some base classes
8 | bases.Projectile = gf.Sprite.extend({
9 | init: function(pos, settings) {
10 | settings = settings || {};
11 |
12 | //overwrite base default
13 | settings.accel = settings.accel || [0, 9];
14 |
15 | //override type
16 | settings.type = settings.type || types.ENTITY.PROJECTILE;
17 |
18 | //default distance to travel before expiring
19 | this.distance = new gf.THREE.Vector2(0, 1000);
20 |
21 | //who owns the projectile
22 | this.owner = null;
23 |
24 | //what spell is the projectile
25 | this.spell = null;
26 |
27 | //damage of this projectile
28 | this.damage = 0;
29 |
30 | //call base constructor
31 | this._super(pos, settings);
32 |
33 | //set the index of characters
34 | this.zIndex = types.ZINDEX.PARTICLE;
35 |
36 | //distance this has traveled
37 | this._traveled = new gf.THREE.Vector2(0, 0);
38 | this._expired = false;
39 | },
40 | update: function() {
41 | //update projectile movement
42 | this.updateMovement();
43 |
44 | this._traveled.add(this.velocity);
45 |
46 | if(this._traveled.x >= this.distance.x && this._traveled.y >= this.distance.y && !this._expired)
47 | this.expire();
48 |
49 | this._super();
50 | },
51 | shoot: function() {
52 | //sprites are rotated by specifying the rotation (they are 2D)
53 | //this._mesh.rotation = rads;
54 | //the hitbox is a plane, so we need to say to rotate around the z axis
55 | //this._hitboxMesh.rotation.z = rads;
56 |
57 | this.velocity.copy(this.accel);
58 | //console.log(this.velocity);
59 | },
60 | expire: function() {
61 | var self = this;
62 |
63 | this._expired = true;
64 | this.velocity.set(0, 0);
65 | this.isCollidable = false;
66 | gf.game.removeObject(self);
67 | },
68 | onCollision: function(obj) {
69 | this._super();
70 |
71 | if(this.owner.id !== obj.id) {
72 | this.expire();
73 | }
74 | },
75 | });
76 |
77 | bases.Beam = gf.Sprite.extend({
78 | init: function(pos, settings) {
79 | settings = settings || {};
80 |
81 | //override type
82 | settings.type = settings.type || types.ENTITY.BEAM;
83 |
84 | //who owns the beam
85 | this.owner = null;
86 |
87 | //what spell is the beam
88 | this.spell = null;
89 |
90 | //damage/sec of this beam
91 | this.damage = 0;
92 |
93 | //max length of the beam
94 | this.maxLength = gf.game._renderer.domElement.width + 10;
95 |
96 | //call base constructor
97 | this._super(pos, settings);
98 |
99 | //set the index of particles
100 | this.zIndex = types.ZINDEX.PARTICLE;
101 | },
102 | onCollision: function(obj) {
103 | }
104 | });
105 |
106 | bases.Ship = gf.Sprite.extend({
107 | init: function(pos, settings) {
108 | //is this entity attacking?
109 | this.attacking = false;
110 |
111 | //maximum health of this entity
112 | this.maxHealth = 1;
113 |
114 | //current health of this entity
115 | this.health = 1;
116 |
117 | //current inventory of the entity
118 | this.inventory = {};
119 |
120 | //loot of the entity that is dropped when it dies
121 | this.loot = [];
122 |
123 | this.points = 0;
124 | this.score = 0;
125 |
126 | //call base constructor
127 | this._super(pos, settings);
128 |
129 | //set the index of characters
130 | this.zIndex = types.ZINDEX.CHARACTER;
131 | },
132 | update: function() {
133 | //check for collisions with other entities
134 | var objs = gf.game.checkCollisions(this);
135 |
136 | for(var i = 0, il = objs.length; i < il; ++i) {
137 | var ent = objs[i].entity;
138 | if(ent.owner && ent.owner.id !== this.id && ent.owner.type !== this.type && ent.damage) {
139 | switch(ent.type) {
140 | case types.ENTITY.PROJECTILE:
141 | this.takeDamage(ent.damage, ent.owner);
142 | break;
143 |
144 | case types.ENTITY.BEAM:
145 | this.takeDamage(ent.damage * gf.game._delta, ent.owner);
146 | break;
147 | }
148 | }
149 | }
150 |
151 | this._super();
152 | },
153 | takeDamage: function(dmg, attacker) {
154 | this.health -= dmg;
155 |
156 | attacker.onDoDamage(this);
157 |
158 | this.setActiveAnimation('damage');
159 |
160 | if(this.health <= 0)
161 | this.die(attacker);
162 | },
163 | die: function(killer) {
164 | if(this.dead) return;
165 |
166 | this.velocity.set(0, 0);
167 | this.accel.set(0, 0);
168 | this.isCollidable = false;
169 | this.dead = true;
170 |
171 | if(killer) killer.onKill(this);
172 |
173 | if(this.anim.die) {
174 | var self = this;
175 | self.setActiveAnimation('die', function(forced) {
176 | gf.event.publish('entity.die', self);
177 | gf.game.removeObject(self);
178 | });
179 | } else {
180 | gf.event.publish('entity.die', this);
181 | gf.game.removeObject(this);
182 | }
183 | },
184 | onKill: function(victim) {},
185 | onDoDamage: function(victim) {}
186 | });
187 |
188 | bases.Enemy = bases.Ship.extend({
189 | init: function(pos, settings) {
190 | settings = settings || {};
191 |
192 | //player type
193 | settings.type = settings.type || types.ENTITY.ENEMY;
194 |
195 | settings.accel = settings.accel || [125, 125];
196 |
197 | settings.points = 5;
198 |
199 | //call base constructor
200 | this._super(pos, settings);
201 | }
202 | });
203 |
204 | bases.Boss = bases.Ship.extend({
205 | init: function(pos, settings) {
206 | settings = settings || {};
207 |
208 | //player type
209 | settings.type = settings.type || types.ENTITY.BOSS;
210 |
211 | settings.accel = settings.accel || [100, 100];
212 |
213 | //maximum health of this entity
214 | settings.maxHealth = 30;
215 |
216 | //current health of this entity
217 | settings.health = 30;
218 |
219 | settings.points = 1000;
220 |
221 | //call base constructor
222 | this._super(pos, settings);
223 | }
224 | });
225 |
226 | return bases;
227 | });
--------------------------------------------------------------------------------
/static/js/game/entities/player.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'game/data/types',
3 | 'game/utils',
4 | 'game/entities/bases'
5 | ], function(types, utils, bases) {
6 | var Player = gf.entityPool.add('player', bases.Ship.extend({
7 | init: function(pos, settings) {
8 | settings = settings || {};
9 |
10 | //player type
11 | settings.type = settings.type || gf.types.ENTITY.PLAYER;
12 |
13 | //set name of Bando
14 | settings.name = settings.name || 'PAT';
15 |
16 | //sprite size
17 | settings.size = settings.size || [48, 48];
18 |
19 | //sprite size
20 | settings.hitSize = settings.hitSize || [42, 42];
21 |
22 | //texture
23 | settings.texture = settings.texture || gf.resources.player_sprite.data;
24 |
25 | //acceleration
26 | settings.accel = settings.accel || [300, 300];
27 |
28 | //maximum health of this entity
29 | settings.maxHealth = 2;
30 |
31 | //current health of this entity
32 | settings.health = 2;
33 |
34 | this.max = new gf.THREE.Vector2(200, 200);
35 |
36 | //call base constructor
37 | this._super(pos, settings);
38 |
39 | //bind the keyboard
40 | this.bindKeys();
41 |
42 | this.addAnimation('normal', { frames: [0, 1], duration: 200, loop: true });
43 | this.addAnimation('move_left', { frames: [8, 9], duration: 200, loop: true });
44 | this.addAnimation('move_right', { frames: [16, 17], duration: 200, loop: true });
45 | this.addAnimation('die', { frames: [24, 25, 26, 27, 28, 29, 30, 31], duration: 800, loop: false });
46 |
47 | this.setActiveAnimation('normal');
48 |
49 | this.shootWait = 85;
50 | this.shootReady = true;
51 | this.stats = {
52 | shots: 0,
53 | hits: 0,
54 | kills: 0,
55 | accuracy: 0
56 | };
57 |
58 | //make the camera track this entity
59 | //gf.game.cameraTrack(this);
60 | },
61 | update: function() {
62 | //check if the player is moving, and update the velocity
63 | this.checkMovement();
64 |
65 | //update player movement
66 | this.updateMovement();
67 |
68 | this._super();
69 | },
70 | checkMovement: function() {
71 | if(gf.controls.isActionActive('move_left')) {
72 | this.velocity.x = -this.accel.x * gf.game._delta;
73 | }
74 | else if(gf.controls.isActionActive('move_right')) {
75 | this.velocity.x = this.accel.x * gf.game._delta;
76 | }
77 | else {
78 | this.velocity.x = 0;
79 | }
80 |
81 | if(gf.controls.isActionActive('move_down')) {
82 | this.velocity.y = -this.accel.y * gf.game._delta;
83 | }
84 | else if(gf.controls.isActionActive('move_up')) {
85 | this.velocity.y = this.accel.y * gf.game._delta;
86 | }
87 | else {
88 | this.velocity.y = 0;
89 | }
90 |
91 | //ensure we stay in the box
92 | var nx = this._mesh.position.x + this.velocity.x,
93 | ny = this._mesh.position.y + this.velocity.y;
94 |
95 | if(nx < -this.max.x || nx > this.max.x)
96 | this.velocity.x = 0;
97 |
98 | if(ny < -this.max.y || ny > this.max.y)
99 | this.velocity.y = 0;
100 |
101 | //update animation
102 | if(this.dead) return;
103 |
104 | if(gf.controls.isActionActive('move_left')) {
105 | if(!this.isActiveAnimation('move_left'))
106 | this.setActiveAnimation('move_left');
107 | } else if(gf.controls.isActionActive('move_right')) {
108 | if(!this.isActiveAnimation('move_right'))
109 | this.setActiveAnimation('move_right');
110 | } else {
111 | if(!this.isActiveAnimation('normal'))
112 | this.setActiveAnimation('normal');
113 | }
114 | },
115 | takeDamage: function(dmg, attacker) {
116 | var nh = this.health - dmg < 0 ? 0 : this.health - dmg;
117 | gf.HUD.setItemValue('health', nh / this.maxHealth);
118 | this._super(dmg, attacker);
119 | },
120 | die: function(killer) {
121 | if(this.dead) return;
122 |
123 | if(!gf.HUD.getItemValue('mute'))
124 | gf.audio.play('explosion_sound');
125 |
126 | this.velocity.set(0, 0);
127 | this.accel.set(0, 0);
128 | this.isCollidable = false;
129 | this.dead = true;
130 |
131 | if(killer) killer.onKill(this);
132 |
133 | if(this.anim.die) {
134 | var self = this;
135 | self.setActiveAnimation('die', function(forced) {
136 | //gf.game.removeObject(self);
137 | gf.event.publish('entity.die', self);
138 | });
139 | } else {
140 | //gf.game.removeObject(this);
141 | gf.event.publish('entity.die', this);
142 | }
143 | },
144 | onKill: function(victim) {
145 | if(!gf.HUD.getItemValue('mute'))
146 | gf.audio.play('shamhead_sound');
147 | this.stats.kills++;
148 | this.score += victim.points;
149 | gf.HUD.setItemValue('score', this.score);
150 | },
151 | onDoDamage: function(victim) {
152 | this.stats.hits++;
153 | this.stats.accuracy = this.stats.hits / this.stats.shots;
154 | gf.HUD.setItemValue('accuracy', (this.stats.accuracy * 100).toFixed(2) + '%');
155 | },
156 | //cast spell based on components
157 | onFire: function(action, down) {
158 | if(!down) return;
159 |
160 | if(!this.shootReady) return;
161 |
162 | if(!gf.HUD.getItemValue('mute'))
163 | gf.audio.play('shoot_sound');
164 |
165 | setTimeout(this._shootCooldown.bind(this), this.shootWait);
166 | this.shootReady = false;
167 | this.stats.shots++;
168 | this.stats.accuracy = this.stats.hits / this.stats.shots;
169 | gf.HUD.setItemValue('accuracy', (this.stats.accuracy * 100).toFixed(2) + '%');
170 |
171 | var p = new gf.entityPool.create('bullet', {
172 | scale: 1,
173 | position: this._mesh.position.clone(),
174 | owner: this
175 | });
176 |
177 | gf.game.addObject(p);
178 | p.shoot();
179 | },
180 | onBomb: function(action, down) {
181 | if(!down) return;
182 |
183 | console.log('Havent got there yet!');
184 | },
185 | bindKeys: function() {
186 | gf.controls.bindKey(gf.types.KEY.W, 'move_up');
187 | gf.controls.bindKey(gf.types.KEY.A, 'move_left');
188 | gf.controls.bindKey(gf.types.KEY.S, 'move_down');
189 | gf.controls.bindKey(gf.types.KEY.D, 'move_right');
190 |
191 | gf.controls.bindKey(gf.types.KEY.UP, 'move_up');
192 | gf.controls.bindKey(gf.types.KEY.LEFT, 'move_left');
193 | gf.controls.bindKey(gf.types.KEY.DOWN, 'move_down');
194 | gf.controls.bindKey(gf.types.KEY.RIGHT, 'move_right');
195 |
196 | gf.controls.bindKey(gf.types.KEY.NUMPAD0, 'fire', this.onFire.bind(this));
197 | gf.controls.bindKey(gf.types.KEY.DELETE, 'fire', this.onFire.bind(this));
198 | gf.controls.bindKey(gf.types.KEY.SPACE, 'fire', this.onFire.bind(this));
199 | gf.controls.bindKey(gf.types.KEY.NUMPAD_DOT, 'bomb', this.onBomb.bind(this));
200 | gf.controls.bindKey(gf.types.KEY.B, 'bomb', this.onBomb.bind(this));
201 | },
202 | unbindKeys: function() {
203 | gf.controls.unbindKey(gf.types.KEY.W, 'move_up');
204 | gf.controls.unbindKey(gf.types.KEY.A, 'move_left');
205 | gf.controls.unbindKey(gf.types.KEY.S, 'move_down');
206 | gf.controls.unbindKey(gf.types.KEY.D, 'move_right');
207 |
208 | gf.controls.unbindKey(gf.types.KEY.UP, 'move_up');
209 | gf.controls.unbindKey(gf.types.KEY.LEFT, 'move_left');
210 | gf.controls.unbindKey(gf.types.KEY.DOWN, 'move_down');
211 | gf.controls.unbindKey(gf.types.KEY.RIGHT, 'move_right');
212 |
213 | gf.controls.unbindKey(gf.types.KEY.NUMPAD0, 'fire');
214 | gf.controls.unbindKey(gf.types.KEY.DELETE, 'fire');
215 | gf.controls.unbindKey(gf.types.KEY.SPACE, 'fire', this.onFire.bind(this));
216 | gf.controls.unbindKey(gf.types.KEY.NUMPAD_DOT, 'bomb');
217 | gf.controls.unbindKey(gf.types.KEY.B, 'bomb');
218 | },
219 | _shootCooldown: function() {
220 | this.shootReady = true;
221 | }
222 | }));
223 |
224 | return Player;
225 | });
--------------------------------------------------------------------------------
/static/js/main.js:
--------------------------------------------------------------------------------
1 | (function($, window, undefined) {
2 | require.config({
3 | urlArgs: "nocache=" + (new Date()).getTime()
4 | });
5 |
6 | require([
7 | 'game/data/data',
8 | 'game/entities/entities',
9 | 'game/hud/hud'
10 | ], function(data, entities, hud) {
11 | //turn on some debugging properties
12 | //gf.debug.showFps = true; //show the FPS box
13 | //gf.debug.showInfo = true; //show detailed debug info
14 | //gf.debug.showOutline = true; //show the outline of an entity (size)
15 | //gf.debug.showHitbox = true; //show the outline of an entity hitbox
16 | //gf.debug.accessTiledUniforms = true;//gf.debug.tiledUniforms with an array of shader uniforms used by the TiledMapLayer object
17 | //gf.debug.showGamepadInfo = true; //show the gamepad state
18 | //gf.debug.showMapColliders = true; //show the map colliders
19 |
20 | var bgCurrent, bgInv, roundTo, enemyDie, lastStats;
21 |
22 | $(function() {
23 | //initialize the renderer
24 | gf.game.init('game', {
25 | gravity: 0,
26 | friction: [0, 0]
27 | });
28 |
29 | //load resources
30 | gf.event.subscribe(gf.types.EVENT.LOADER_COMPLETE, function() {
31 | //play some MUSIKA
32 | gf.audio.play('bg_music', { loop: true, volume: 0.5 });
33 | gf.HUD.init();
34 | gf.HUD.addItem('mute', new hud.MusicMute(10, 10, { value: false }));
35 |
36 | $('#play').on('click', function() {
37 | $('#menu').fadeOut(function() {
38 | playGame();
39 | });
40 | });
41 | });
42 |
43 | gf.event.subscribe(gf.types.EVENT.LOADER_ERROR, function(err, resource) { console.log(err, resource); });
44 | gf.loader.load(data.resources);
45 |
46 | $('#submitStats').on('click', submitStats);
47 | $('#replayGame').on('click', replayGame);
48 |
49 |
50 | $.ajax({
51 | type: 'GET',
52 | url: '/_store/top/5',
53 | cache: false,
54 | success: function(resp) {
55 | var $board = $('#leaderboard').empty();
56 | if(resp.error)
57 | $board.html('Unable to load leaderboard: ' + resp.error + '');
58 | else {
59 | var html = '';
60 | resp.forEach(function(stat) {
61 | html += '';
62 | html += stat.name + ' - ' + stat.score + ' points';
63 | html += '';
64 | });
65 | $board.html(html);
66 | }
67 | },
68 | error: function(resp) {
69 | $('.ajaxResp.error').show();
70 | }
71 | });
72 |
73 | $('#initMsg').hide();
74 | $('#play').show();
75 |
76 | $(window).on('resize', onWinResize);
77 | });
78 |
79 | function submitStats() {
80 | var name = $('#name').val();
81 |
82 | $('.noname.error').hide();
83 | $('.ajaxResp').hide();
84 |
85 | if(!name) return $('.noname.error').show();
86 |
87 | lastStats.name = name;
88 |
89 | $.ajax({
90 | type: 'PUT',
91 | url: '/_store/score',
92 | data: lastStats,
93 | success: function(resp) {
94 | if(resp.error)
95 | $('.ajaxResp.error').show();
96 | else
97 | $('.ajaxResp.success').show();
98 | },
99 | error: function(resp) {
100 | $('.ajaxResp.error').show();
101 | }
102 | });
103 | }
104 |
105 | function replayGame() {
106 | $('#finish').hide();
107 | $('#overlay').hide();
108 |
109 | gf.HUD.removeItem('bossbar');
110 |
111 | gf.event.unsubscribe('entity.die', enemyDie);
112 | gf.game.removeObject(gf.game.player);
113 |
114 | playGame(true);
115 | }
116 |
117 | function playGame(replay) {
118 | //initialize HUD
119 | if(!replay) initHud();
120 |
121 | //initialize player
122 | initPlayer();
123 | if(!replay) {
124 | gf.event.subscribe('entity.die', function(ent) {
125 | if(ent.type == gf.types.ENTITY.PLAYER) {
126 | gameOver(true);
127 | }
128 | });
129 | }
130 |
131 | var rounds = [
132 | //rows, cols, moveSpeed, fireRate
133 | [2, 5, 'sham', 25, 0.10, 'Round 1'],
134 | [3, 10, 'sham', 50, 0.25, 'Round 2'],
135 | [4, 15, 'sham', 75, 0.40, 'Round 3'],
136 | [5, 20, 'sham', 100, 0.55, 'Round 4'],
137 | [1, 1, 'shamboss', 75, 5, 'Sham Boss!']
138 | ];
139 |
140 | doRound(0);
141 | function doRound(i) {
142 | if(i === rounds.length) {
143 | return gameOver();
144 | }
145 |
146 | clearTimeout(roundTo);
147 | gf.HUD.setItemValue('round', i + 1);
148 | var args = Array.apply(null, rounds[i]);
149 | args.push(function() {
150 | roundTo = setTimeout(doRound.bind(null, i + 1), 1000);
151 | });
152 |
153 | $('#roundText').text(args[5]).show().delay(2500).fadeOut('slow', function() {
154 | playRound.apply(null, args);
155 | });
156 | }
157 |
158 | bgCurrent = 0;
159 | bgInv = setInterval(bgScroll, 50);
160 | function bgScroll() {
161 | bgCurrent += 1;
162 | $('#game').css('backgroundPosition', '0 ' + bgCurrent + 'px');
163 | }
164 |
165 | //start render loop
166 | if(!replay) gf.game.render();
167 | }
168 |
169 | function playRound(rows, cols, ent, moveSpeed, fireRate, text, cb) {
170 | if(ent == 'shamboss')
171 | gf.HUD.addItem('bossbar', new hud.Bossbar(0, 0, { value: 0 }));
172 |
173 | //initialize enemy
174 | var enemies = initEnemies.apply(null, arguments);
175 |
176 | enemyDie = function(ent) {
177 | var i = enemies.indexOf(ent.id);
178 |
179 | enemies.splice(i, 1);
180 |
181 | if(enemies.length === 0) {
182 | gf.event.unsubscribe('entity.die', enemyDie);
183 | if(cb) cb();
184 | }
185 | };
186 | gf.event.subscribe('entity.die', enemyDie);
187 | }
188 |
189 | function initHud() {
190 | gf.HUD.addItem('round', new hud.Text(10, 0, { title: 'Round', value: 0 }));
191 | gf.HUD.addItem('score', new hud.Text(10, 25, { title: 'Score', value: 0 }));
192 | gf.HUD.addItem('accuracy', new hud.Text(10, 50, { title: 'Accuracy', value: 0 }));
193 | gf.HUD.addItem('health', new hud.HealthBar(0, 735, { value: 1 }));
194 |
195 | var its = ['round', 'score', 'accuracy'];
196 | for(var i = 0; i < its.length; ++i) {
197 | var s = gf.HUD.items[its[i]];
198 | s.$elm.css('right', s.$elm.css('left'));
199 | s.$elm.css('left', '');
200 | }
201 | }
202 |
203 | function initPlayer() {
204 | //initialize the player and add to game
205 | var player = window.player = gf.entityPool.create('player', {
206 | position: [0, 0]
207 | });
208 |
209 | gf.HUD.setItemValue('health', 1);
210 | gf.game.addObject(player);
211 | onWinResize();
212 | }
213 |
214 | function onWinResize() {
215 | var $c = $(gf.game._cont);
216 | if(gf.game.player)
217 | gf.game.player.max.set(($c.width() / 2) - 16, ($c.height() / 2) - 32);
218 | }
219 |
220 | function initEnemies(rows, cols, ent, moveSpeed, fireRate) {
221 | var ids = [],
222 | size = [64, 70];
223 |
224 | for(var x = 0; x < cols; ++x) {
225 | for(var y = 0; y < rows; ++y) {
226 | var sham = gf.entityPool.create(ent, {
227 | position: [
228 | (x * size[0]) - (cols * (size[0] / 2.2)),
229 | (y * size[1]) + 400
230 | ],
231 | accel: [moveSpeed * 5, moveSpeed],
232 | fireRate: fireRate
233 | });
234 | ids.push(sham.id);
235 | gf.game.addObject(sham);
236 | }
237 | }
238 |
239 | return ids;
240 | }
241 |
242 | function gameOver(lost) {
243 | if(!gf.game.player) return;
244 |
245 | gf.game.player.unbindKeys();
246 |
247 | var $fin = $('#finish'),
248 | ent = gf.game.player;
249 |
250 | lastStats = ent.stats;
251 | lastStats.score = ent.score;
252 |
253 | if(lost) {
254 | $fin.find('.title').text('You Lose!');
255 | $fin.find('.lose').show();
256 | $fin.addClass('lose');
257 | } else {
258 | $fin.find('.title').text('You Win!');
259 | $fin.find('.win').show();
260 | $fin.addClass('win');
261 | }
262 |
263 | $fin.find('.score').text(ent.score + ' points');
264 | $fin.find('.accuracy').text((ent.stats.accuracy * 100).toFixed(2) + '%');
265 | $fin.find('.kills').text(ent.stats.kills + ' destroyed');
266 | $fin.show();
267 | $('#overlay').show();
268 |
269 | //clear Entities
270 | clearTimeout(roundTo);
271 | clearInterval(bgInv);
272 | $.each(gf.game.objects, function(k, v) {
273 | gf.game.removeObject(v);
274 | });
275 | }
276 | });
277 | })(jQuery, window);
--------------------------------------------------------------------------------
/static/css/vendor/normalize.css:
--------------------------------------------------------------------------------
1 | /*! normalize.css v1.0.1 | MIT License | git.io/normalize */
2 |
3 | /* ==========================================================================
4 | HTML5 display definitions
5 | ========================================================================== */
6 |
7 | /*
8 | * Corrects `block` display not defined in IE 6/7/8/9 and Firefox 3.
9 | */
10 |
11 | article,
12 | aside,
13 | details,
14 | figcaption,
15 | figure,
16 | footer,
17 | header,
18 | hgroup,
19 | nav,
20 | section,
21 | summary {
22 | display: block;
23 | }
24 |
25 | /*
26 | * Corrects `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
27 | */
28 |
29 | audio,
30 | canvas,
31 | video {
32 | display: inline-block;
33 | *display: inline;
34 | *zoom: 1;
35 | }
36 |
37 | /*
38 | * Prevents modern browsers from displaying `audio` without controls.
39 | * Remove excess height in iOS 5 devices.
40 | */
41 |
42 | audio:not([controls]) {
43 | display: none;
44 | height: 0;
45 | }
46 |
47 | /*
48 | * Addresses styling for `hidden` attribute not present in IE 7/8/9, Firefox 3,
49 | * and Safari 4.
50 | * Known issue: no IE 6 support.
51 | */
52 |
53 | [hidden] {
54 | display: none;
55 | }
56 |
57 | /* ==========================================================================
58 | Base
59 | ========================================================================== */
60 |
61 | /*
62 | * 1. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using
63 | * `em` units.
64 | * 2. Prevents iOS text size adjust after orientation change, without disabling
65 | * user zoom.
66 | */
67 |
68 | html {
69 | font-size: 100%; /* 1 */
70 | -webkit-text-size-adjust: 100%; /* 2 */
71 | -ms-text-size-adjust: 100%; /* 2 */
72 | }
73 |
74 | /*
75 | * Addresses `font-family` inconsistency between `textarea` and other form
76 | * elements.
77 | */
78 |
79 | html,
80 | button,
81 | input,
82 | select,
83 | textarea {
84 | font-family: sans-serif;
85 | }
86 |
87 | /*
88 | * Addresses margins handled incorrectly in IE 6/7.
89 | */
90 |
91 | body {
92 | margin: 0;
93 | }
94 |
95 | /* ==========================================================================
96 | Links
97 | ========================================================================== */
98 |
99 | /*
100 | * Addresses `outline` inconsistency between Chrome and other browsers.
101 | */
102 |
103 | a:focus {
104 | outline: thin dotted;
105 | }
106 |
107 | /*
108 | * Improves readability when focused and also mouse hovered in all browsers.
109 | */
110 |
111 | a:active,
112 | a:hover {
113 | outline: 0;
114 | }
115 |
116 | /* ==========================================================================
117 | Typography
118 | ========================================================================== */
119 |
120 | /*
121 | * Addresses font sizes and margins set differently in IE 6/7.
122 | * Addresses font sizes within `section` and `article` in Firefox 4+, Safari 5,
123 | * and Chrome.
124 | */
125 |
126 | h1 {
127 | font-size: 2em;
128 | margin: 0.67em 0;
129 | }
130 |
131 | h2 {
132 | font-size: 1.5em;
133 | margin: 0.83em 0;
134 | }
135 |
136 | h3 {
137 | font-size: 1.17em;
138 | margin: 1em 0;
139 | }
140 |
141 | h4 {
142 | font-size: 1em;
143 | margin: 1.33em 0;
144 | }
145 |
146 | h5 {
147 | font-size: 0.83em;
148 | margin: 1.67em 0;
149 | }
150 |
151 | h6 {
152 | font-size: 0.75em;
153 | margin: 2.33em 0;
154 | }
155 |
156 | /*
157 | * Addresses styling not present in IE 7/8/9, Safari 5, and Chrome.
158 | */
159 |
160 | abbr[title] {
161 | border-bottom: 1px dotted;
162 | }
163 |
164 | /*
165 | * Addresses style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
166 | */
167 |
168 | b,
169 | strong {
170 | font-weight: bold;
171 | }
172 |
173 | blockquote {
174 | margin: 1em 40px;
175 | }
176 |
177 | /*
178 | * Addresses styling not present in Safari 5 and Chrome.
179 | */
180 |
181 | dfn {
182 | font-style: italic;
183 | }
184 |
185 | /*
186 | * Addresses styling not present in IE 6/7/8/9.
187 | */
188 |
189 | mark {
190 | background: #ff0;
191 | color: #000;
192 | }
193 |
194 | /*
195 | * Addresses margins set differently in IE 6/7.
196 | */
197 |
198 | p,
199 | pre {
200 | margin: 1em 0;
201 | }
202 |
203 | /*
204 | * Corrects font family set oddly in IE 6, Safari 4/5, and Chrome.
205 | */
206 |
207 | code,
208 | kbd,
209 | pre,
210 | samp {
211 | font-family: monospace, serif;
212 | _font-family: 'courier new', monospace;
213 | font-size: 1em;
214 | }
215 |
216 | /*
217 | * Improves readability of pre-formatted text in all browsers.
218 | */
219 |
220 | pre {
221 | white-space: pre;
222 | white-space: pre-wrap;
223 | word-wrap: break-word;
224 | }
225 |
226 | /*
227 | * Addresses CSS quotes not supported in IE 6/7.
228 | */
229 |
230 | q {
231 | quotes: none;
232 | }
233 |
234 | /*
235 | * Addresses `quotes` property not supported in Safari 4.
236 | */
237 |
238 | q:before,
239 | q:after {
240 | content: '';
241 | content: none;
242 | }
243 |
244 | /*
245 | * Addresses inconsistent and variable font size in all browsers.
246 | */
247 |
248 | small {
249 | font-size: 80%;
250 | }
251 |
252 | /*
253 | * Prevents `sub` and `sup` affecting `line-height` in all browsers.
254 | */
255 |
256 | sub,
257 | sup {
258 | font-size: 75%;
259 | line-height: 0;
260 | position: relative;
261 | vertical-align: baseline;
262 | }
263 |
264 | sup {
265 | top: -0.5em;
266 | }
267 |
268 | sub {
269 | bottom: -0.25em;
270 | }
271 |
272 | /* ==========================================================================
273 | Lists
274 | ========================================================================== */
275 |
276 | /*
277 | * Addresses margins set differently in IE 6/7.
278 | */
279 |
280 | dl,
281 | menu,
282 | ol,
283 | ul {
284 | margin: 1em 0;
285 | }
286 |
287 | dd {
288 | margin: 0 0 0 40px;
289 | }
290 |
291 | /*
292 | * Addresses paddings set differently in IE 6/7.
293 | */
294 |
295 | menu,
296 | ol,
297 | ul {
298 | padding: 0 0 0 40px;
299 | }
300 |
301 | /*
302 | * Corrects list images handled incorrectly in IE 7.
303 | */
304 |
305 | nav ul,
306 | nav ol {
307 | list-style: none;
308 | list-style-image: none;
309 | }
310 |
311 | /* ==========================================================================
312 | Embedded content
313 | ========================================================================== */
314 |
315 | /*
316 | * 1. Removes border when inside `a` element in IE 6/7/8/9 and Firefox 3.
317 | * 2. Improves image quality when scaled in IE 7.
318 | */
319 |
320 | img {
321 | border: 0; /* 1 */
322 | -ms-interpolation-mode: bicubic; /* 2 */
323 | }
324 |
325 | /*
326 | * Corrects overflow displayed oddly in IE 9.
327 | */
328 |
329 | svg:not(:root) {
330 | overflow: hidden;
331 | }
332 |
333 | /* ==========================================================================
334 | Figures
335 | ========================================================================== */
336 |
337 | /*
338 | * Addresses margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
339 | */
340 |
341 | figure {
342 | margin: 0;
343 | }
344 |
345 | /* ==========================================================================
346 | Forms
347 | ========================================================================== */
348 |
349 | /*
350 | * Corrects margin displayed oddly in IE 6/7.
351 | */
352 |
353 | form {
354 | margin: 0;
355 | }
356 |
357 | /*
358 | * Define consistent border, margin, and padding.
359 | */
360 |
361 | fieldset {
362 | border: 1px solid #c0c0c0;
363 | margin: 0 2px;
364 | padding: 0.35em 0.625em 0.75em;
365 | }
366 |
367 | /*
368 | * 1. Corrects color not being inherited in IE 6/7/8/9.
369 | * 2. Corrects text not wrapping in Firefox 3.
370 | * 3. Corrects alignment displayed oddly in IE 6/7.
371 | */
372 |
373 | legend {
374 | border: 0; /* 1 */
375 | padding: 0;
376 | white-space: normal; /* 2 */
377 | *margin-left: -7px; /* 3 */
378 | }
379 |
380 | /*
381 | * 1. Corrects font size not being inherited in all browsers.
382 | * 2. Addresses margins set differently in IE 6/7, Firefox 3+, Safari 5,
383 | * and Chrome.
384 | * 3. Improves appearance and consistency in all browsers.
385 | */
386 |
387 | button,
388 | input,
389 | select,
390 | textarea {
391 | font-size: 100%; /* 1 */
392 | margin: 0; /* 2 */
393 | vertical-align: baseline; /* 3 */
394 | *vertical-align: middle; /* 3 */
395 | }
396 |
397 | /*
398 | * Addresses Firefox 3+ setting `line-height` on `input` using `!important` in
399 | * the UA stylesheet.
400 | */
401 |
402 | button,
403 | input {
404 | line-height: normal;
405 | }
406 |
407 | /*
408 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
409 | * and `video` controls.
410 | * 2. Corrects inability to style clickable `input` types in iOS.
411 | * 3. Improves usability and consistency of cursor style between image-type
412 | * `input` and others.
413 | * 4. Removes inner spacing in IE 7 without affecting normal text inputs.
414 | * Known issue: inner spacing remains in IE 6.
415 | */
416 |
417 | button,
418 | html input[type="button"], /* 1 */
419 | input[type="reset"],
420 | input[type="submit"] {
421 | -webkit-appearance: button; /* 2 */
422 | cursor: pointer; /* 3 */
423 | *overflow: visible; /* 4 */
424 | }
425 |
426 | /*
427 | * Re-set default cursor for disabled elements.
428 | */
429 |
430 | button[disabled],
431 | input[disabled] {
432 | cursor: default;
433 | }
434 |
435 | /*
436 | * 1. Addresses box sizing set to content-box in IE 8/9.
437 | * 2. Removes excess padding in IE 8/9.
438 | * 3. Removes excess padding in IE 7.
439 | * Known issue: excess padding remains in IE 6.
440 | */
441 |
442 | input[type="checkbox"],
443 | input[type="radio"] {
444 | box-sizing: border-box; /* 1 */
445 | padding: 0; /* 2 */
446 | *height: 13px; /* 3 */
447 | *width: 13px; /* 3 */
448 | }
449 |
450 | /*
451 | * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
452 | * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
453 | * (include `-moz` to future-proof).
454 | */
455 |
456 | input[type="search"] {
457 | -webkit-appearance: textfield; /* 1 */
458 | -moz-box-sizing: content-box;
459 | -webkit-box-sizing: content-box; /* 2 */
460 | box-sizing: content-box;
461 | }
462 |
463 | /*
464 | * Removes inner padding and search cancel button in Safari 5 and Chrome
465 | * on OS X.
466 | */
467 |
468 | input[type="search"]::-webkit-search-cancel-button,
469 | input[type="search"]::-webkit-search-decoration {
470 | -webkit-appearance: none;
471 | }
472 |
473 | /*
474 | * Removes inner padding and border in Firefox 3+.
475 | */
476 |
477 | button::-moz-focus-inner,
478 | input::-moz-focus-inner {
479 | border: 0;
480 | padding: 0;
481 | }
482 |
483 | /*
484 | * 1. Removes default vertical scrollbar in IE 6/7/8/9.
485 | * 2. Improves readability and alignment in all browsers.
486 | */
487 |
488 | textarea {
489 | overflow: auto; /* 1 */
490 | vertical-align: top; /* 2 */
491 | }
492 |
493 | /* ==========================================================================
494 | Tables
495 | ========================================================================== */
496 |
497 | /*
498 | * Remove most spacing between table cells.
499 | */
500 |
501 | table {
502 | border-collapse: collapse;
503 | border-spacing: 0;
504 | }
505 |
--------------------------------------------------------------------------------
/static/js/vendor/require.js:
--------------------------------------------------------------------------------
1 | /*
2 | RequireJS 2.1.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
3 | Available via the MIT or new BSD license.
4 | see: http://github.com/jrburke/requirejs for details
5 | */
6 | var requirejs,require,define;
7 | (function(W){function D(b){return M.call(b)==="[object Function]"}function E(b){return M.call(b)==="[object Array]"}function t(b,c){if(b){var d;for(d=0;d-1;d-=1)if(b[d]&&c(b[d],d,b))break}}function A(b,c){for(var d in b)if(b.hasOwnProperty(d)&&c(b[d],d))break}function O(b,c,d,g){c&&A(c,function(c,j){if(d||!F.call(b,j))g&&typeof c!=="string"?(b[j]||(b[j]={}),O(b[j],c,d,g)):b[j]=c});return b}function r(b,c){return function(){return c.apply(b,
8 | arguments)}}function X(b){if(!b)return b;var c=W;t(b.split("."),function(b){c=c[b]});return c}function G(b,c,d,g){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=g;if(d)c.originalError=d;return c}function ba(){if(H&&H.readyState==="interactive")return H;N(document.getElementsByTagName("script"),function(b){if(b.readyState==="interactive")return H=b});return H}var g,s,u,y,q,B,H,I,Y,Z,ca=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,da=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
9 | $=/\.js$/,ea=/^\.\//;s=Object.prototype;var M=s.toString,F=s.hasOwnProperty,fa=Array.prototype.splice,v=!!(typeof window!=="undefined"&&navigator&&document),aa=!v&&typeof importScripts!=="undefined",ga=v&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,R=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",w={},n={},P=[],J=!1;if(typeof define==="undefined"){if(typeof requirejs!=="undefined"){if(D(requirejs))return;n=requirejs;requirejs=void 0}typeof require!=="undefined"&&
10 | !D(require)&&(n=require,require=void 0);g=requirejs=function(b,c,d,p){var i,j="_";!E(b)&&typeof b!=="string"&&(i=b,E(c)?(b=c,c=d,d=p):b=[]);if(i&&i.context)j=i.context;(p=w[j])||(p=w[j]=g.s.newContext(j));i&&p.configure(i);return p.require(b,c,d)};g.config=function(b){return g(b)};g.nextTick=typeof setTimeout!=="undefined"?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.1.1";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=v;s=g.s={contexts:w,newContext:function(b){function c(a,
11 | f,x){var e,m,b,c,d,h,i,g=f&&f.split("/");e=g;var j=k.map,l=j&&j["*"];if(a&&a.charAt(0)===".")if(f){e=k.pkgs[f]?g=[f]:g.slice(0,g.length-1);f=a=e.concat(a.split("/"));for(e=0;f[e];e+=1)if(m=f[e],m===".")f.splice(e,1),e-=1;else if(m==="..")if(e===1&&(f[2]===".."||f[0]===".."))break;else e>0&&(f.splice(e-1,2),e-=2);e=k.pkgs[f=a[0]];a=a.join("/");e&&a===f+"/"+e.main&&(a=f)}else a.indexOf("./")===0&&(a=a.substring(2));if(x&&(g||l)&&j){f=a.split("/");for(e=f.length;e>0;e-=1){b=f.slice(0,e).join("/");if(g)for(m=
12 | g.length;m>0;m-=1)if(x=j[g.slice(0,m).join("/")])if(x=x[b]){c=x;d=e;break}if(c)break;!h&&l&&l[b]&&(h=l[b],i=e)}!c&&h&&(c=h,d=i);c&&(f.splice(0,d,c),a=f.join("/"))}return a}function d(a){v&&t(document.getElementsByTagName("script"),function(f){if(f.getAttribute("data-requiremodule")===a&&f.getAttribute("data-requirecontext")===h.contextName)return f.parentNode.removeChild(f),!0})}function p(a){var f=k.paths[a];if(f&&E(f)&&f.length>1)return d(a),f.shift(),h.require.undef(a),h.require([a]),!0}function i(a){var f,
13 | b=a?a.indexOf("!"):-1;b>-1&&(f=a.substring(0,b),a=a.substring(b+1,a.length));return[f,a]}function j(a,f,b,e){var m,K,d=null,g=f?f.name:null,j=a,l=!0,k="";a||(l=!1,a="_@r"+(M+=1));a=i(a);d=a[0];a=a[1];d&&(d=c(d,g,e),K=o[d]);a&&(d?k=K&&K.normalize?K.normalize(a,function(a){return c(a,g,e)}):c(a,g,e):(k=c(a,g,e),a=i(k),d=a[0],k=a[1],b=!0,m=h.nameToUrl(k)));b=d&&!K&&!b?"_unnormalized"+(N+=1):"";return{prefix:d,name:k,parentMap:f,unnormalized:!!b,url:m,originalName:j,isDefine:l,id:(d?d+"!"+k:k)+b}}function n(a){var f=
14 | a.id,b=l[f];b||(b=l[f]=new h.Module(a));return b}function q(a,f,b){var e=a.id,m=l[e];if(F.call(o,e)&&(!m||m.defineEmitComplete))f==="defined"&&b(o[e]);else n(a).on(f,b)}function z(a,f){var b=a.requireModules,e=!1;if(f)f(a);else if(t(b,function(f){if(f=l[f])f.error=a,f.events.error&&(e=!0,f.emit("error",a))}),!e)g.onError(a)}function s(){P.length&&(fa.apply(C,[C.length-1,0].concat(P)),P=[])}function u(a,f,b){var e=a.map.id;a.error?a.emit("error",a.error):(f[e]=!0,t(a.depMaps,function(e,c){var d=e.id,
15 | g=l[d];g&&!a.depMatched[c]&&!b[d]&&(f[d]?(a.defineDep(c,o[d]),a.check()):u(g,f,b))}),b[e]=!0)}function w(){var a,f,b,e,m=(b=k.waitSeconds*1E3)&&h.startTime+b<(new Date).getTime(),c=[],g=[],i=!1,j=!0;if(!S){S=!0;A(l,function(b){a=b.map;f=a.id;if(b.enabled&&(a.isDefine||g.push(b),!b.error))if(!b.inited&&m)p(f)?i=e=!0:(c.push(f),d(f));else if(!b.inited&&b.fetched&&a.isDefine&&(i=!0,!a.prefix))return j=!1});if(m&&c.length)return b=G("timeout","Load timeout for modules: "+c,null,c),b.contextName=h.contextName,
16 | z(b);j&&t(g,function(a){u(a,{},{})});if((!m||e)&&i)if((v||aa)&&!T)T=setTimeout(function(){T=0;w()},50);S=!1}}function y(a){n(j(a[0],null,!0)).init(a[1],a[2])}function B(a){var a=a.currentTarget||a.srcElement,b=h.onScriptLoad;a.detachEvent&&!R?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=h.onScriptError;a.detachEvent&&!R||a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function I(){var a;for(s();C.length;)if(a=C.shift(),a[0]===
17 | null)return z(G("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));else y(a)}var S,U,h,L,T,k={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{},map:{},config:{}},l={},V={},C=[],o={},Q={},M=1,N=1;L={require:function(a){return a.require?a.require:a.require=h.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?a.exports:a.exports=o[a.map.id]={}},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return k.config&&
18 | k.config[a.map.id]||{}},exports:o[a.map.id]}}};U=function(a){this.events=V[a.id]||{};this.map=a;this.shim=k.shim[a.id];this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};U.prototype={init:function(a,b,c,e){e=e||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=r(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=c;this.inited=!0;this.ignore=e.ignore;e.enabled||this.enabled?this.enable():this.check()}},
19 | defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;h.startTime=(new Date).getTime();var a=this.map;if(this.shim)h.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],r(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=this.map.url;Q[a]||(Q[a]=!0,h.load(this.map.id,a))},check:function(){if(this.enabled&&
20 | !this.enabling){var a,b,c=this.map.id;b=this.depExports;var e=this.exports,m=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(D(m)){if(this.events.error)try{e=h.execCb(c,m,b,e)}catch(d){a=d}else e=h.execCb(c,m,b,e);if(this.map.isDefine)if((b=this.module)&&b.exports!==void 0&&b.exports!==this.exports)e=b.exports;else if(e===void 0&&this.usingExports)e=this.exports;if(a)return a.requireMap=this.map,
21 | a.requireModules=[this.map.id],a.requireType="define",z(this.error=a)}else e=m;this.exports=e;if(this.map.isDefine&&!this.ignore&&(o[c]=e,g.onResourceLoad))g.onResourceLoad(h,this.map,this.depMaps);delete l[c];this.defined=!0}this.defining=!1;if(this.defined&&!this.defineEmitted)this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=j(a.prefix);this.depMaps.push(d);q(d,"defined",r(this,function(e){var m,
22 | d;d=this.map.name;var x=this.map.parentMap?this.map.parentMap.name:null,i=h.makeRequire(a.parentMap,{enableBuildCallback:!0,skipMap:!0});if(this.map.unnormalized){if(e.normalize&&(d=e.normalize(d,function(a){return c(a,x,!0)})||""),e=j(a.prefix+"!"+d,this.map.parentMap),q(e,"defined",r(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=l[e.id]){this.depMaps.push(e);if(this.events.error)d.on("error",r(this,function(a){this.emit("error",a)}));d.enable()}}else m=r(this,
23 | function(a){this.init([],function(){return a},null,{enabled:!0})}),m.error=r(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];A(l,function(a){a.map.id.indexOf(b+"_unnormalized")===0&&delete l[a.map.id]});z(a)}),m.fromText=r(this,function(b,e){var f=a.name,c=j(f),d=J;e&&(b=e);d&&(J=!1);n(c);try{g.exec(b)}catch(x){throw Error("fromText eval for "+f+" failed: "+x);}d&&(J=!0);this.depMaps.push(c);h.completeLoad(f);i([f],m)}),e.load(a.name,i,m,k)}));h.enable(d,this);this.pluginMaps[d.id]=
24 | d},enable:function(){this.enabling=this.enabled=!0;t(this.depMaps,r(this,function(a,b){var c,e;if(typeof a==="string"){a=j(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=L[a.id]){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",r(this,function(a){this.defineDep(b,a);this.check()}));this.errback&&q(a,"error",this.errback)}c=a.id;e=l[c];!L[c]&&e&&!e.enabled&&h.enable(a,this)}));A(this.pluginMaps,r(this,function(a){var b=l[a.id];b&&!b.enabled&&
25 | h.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){t(this.events[a],function(a){a(b)});a==="error"&&delete this.events[a]}};h={config:k,contextName:b,registry:l,defined:o,urlFetched:Q,defQueue:C,Module:U,makeModuleMap:j,nextTick:g.nextTick,configure:function(a){a.baseUrl&&a.baseUrl.charAt(a.baseUrl.length-1)!=="/"&&(a.baseUrl+="/");var b=k.pkgs,c=k.shim,e={paths:!0,config:!0,map:!0};A(a,function(a,b){e[b]?
26 | b==="map"?O(k[b],a,!0,!0):O(k[b],a,!0):k[b]=a});if(a.shim)A(a.shim,function(a,b){E(a)&&(a={deps:a});if(a.exports&&!a.exportsFn)a.exportsFn=h.makeShimExports(a);c[b]=a}),k.shim=c;if(a.packages)t(a.packages,function(a){a=typeof a==="string"?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(ea,"").replace($,"")}}),k.pkgs=b;A(l,function(a,b){if(!a.inited&&!a.map.unnormalized)a.map=j(b)});if(a.deps||a.callback)h.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;
27 | a.init&&(b=a.init.apply(W,arguments));return b||X(a.exports)}},makeRequire:function(a,f){function d(e,c,i){var k,p;if(f.enableBuildCallback&&c&&D(c))c.__requireJsBuild=!0;if(typeof e==="string"){if(D(c))return z(G("requireargs","Invalid require call"),i);if(a&&L[e])return L[e](l[a.id]);if(g.get)return g.get(h,e,a);k=j(e,a,!1,!0);k=k.id;return!F.call(o,k)?z(G("notloaded",'Module name "'+k+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):o[k]}I();h.nextTick(function(){I();p=
28 | n(j(null,a));p.skipMap=f.skipMap;p.init(e,c,i,{enabled:!0});w()});return d}f=f||{};O(d,{isBrowser:v,toUrl:function(b){var d=b.lastIndexOf("."),f=null;d!==-1&&(f=b.substring(d,b.length),b=b.substring(0,d));return h.nameToUrl(c(b,a&&a.id,!0),f)},defined:function(b){b=j(b,a,!1,!0).id;return F.call(o,b)},specified:function(b){b=j(b,a,!1,!0).id;return F.call(o,b)||F.call(l,b)}});if(!a)d.undef=function(b){s();var c=j(b,a,!0),d=l[b];delete o[b];delete Q[c.url];delete V[b];if(d){if(d.events.defined)V[b]=
29 | d.events;delete l[b]}};return d},enable:function(a){l[a.id]&&n(a).enable()},completeLoad:function(a){var b,c,d=k.shim[a]||{},g=d.exports;for(s();C.length;){c=C.shift();if(c[0]===null){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);y(c)}c=l[a];if(!b&&!o[a]&&c&&!c.inited)if(k.enforceDefine&&(!g||!X(g)))if(p(a))return;else return z(G("nodefine","No define call for "+a,null,[a]));else y([a,d.deps||[],d.exportsFn]);w()},nameToUrl:function(a,b){var c,d,i,h,j,l;if(g.jsExtRegExp.test(a))h=a+(b||"");else{c=
30 | k.paths;d=k.pkgs;h=a.split("/");for(j=h.length;j>0;j-=1)if(l=h.slice(0,j).join("/"),i=d[l],l=c[l]){E(l)&&(l=l[0]);h.splice(0,j,l);break}else if(i){c=a===i.name?i.location+"/"+i.main:i.location;h.splice(0,j,c);break}h=h.join("/");h+=b||(/\?/.test(h)?"":".js");h=(h.charAt(0)==="/"||h.match(/^[\w\+\.\-]+:/)?"":k.baseUrl)+h}return k.urlArgs?h+((h.indexOf("?")===-1?"?":"&")+k.urlArgs):h},load:function(a,b){g.load(h,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if(a.type===
31 | "load"||ga.test((a.currentTarget||a.srcElement).readyState))H=null,a=B(a),h.completeLoad(a.id)},onScriptError:function(a){var b=B(a);if(!p(b.id))return z(G("scripterror","Script error",a,[b.id]))}};h.require=h.makeRequire();return h}};g({});t(["toUrl","undef","defined","specified"],function(b){g[b]=function(){var c=w._;return c.require[b].apply(c,arguments)}});if(v&&(u=s.head=document.getElementsByTagName("head")[0],y=document.getElementsByTagName("base")[0]))u=s.head=y.parentNode;g.onError=function(b){throw b;
32 | };g.load=function(b,c,d){var g=b&&b.config||{},i;if(v)return i=g.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),i.type=g.scriptType||"text/javascript",i.charset="utf-8",i.async=!0,i.setAttribute("data-requirecontext",b.contextName),i.setAttribute("data-requiremodule",c),i.attachEvent&&!(i.attachEvent.toString&&i.attachEvent.toString().indexOf("[native code")<0)&&!R?(J=!0,i.attachEvent("onreadystatechange",b.onScriptLoad)):(i.addEventListener("load",
33 | b.onScriptLoad,!1),i.addEventListener("error",b.onScriptError,!1)),i.src=d,I=i,y?u.insertBefore(i,y):u.appendChild(i),I=null,i;else aa&&(importScripts(d),b.completeLoad(c))};v&&N(document.getElementsByTagName("script"),function(b){if(!u)u=b.parentNode;if(q=b.getAttribute("data-main")){if(!n.baseUrl)B=q.split("/"),Y=B.pop(),Z=B.length?B.join("/")+"/":"./",n.baseUrl=Z,q=Y;q=q.replace($,"");n.deps=n.deps?n.deps.concat(q):[q];return!0}});define=function(b,c,d){var g,i;typeof b!=="string"&&(d=c,c=b,b=
34 | null);E(c)||(d=c,c=[]);!c.length&&D(d)&&d.length&&(d.toString().replace(ca,"").replace(da,function(b,d){c.push(d)}),c=(d.length===1?["require"]:["require","exports","module"]).concat(c));if(J&&(g=I||ba()))b||(b=g.getAttribute("data-requiremodule")),i=w[g.getAttribute("data-requirecontext")];(i?i.defQueue:P).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(n)}})(this);
35 |
--------------------------------------------------------------------------------
/static/js/vendor/jquery/jquery.min.js:
--------------------------------------------------------------------------------
1 | /*! jQuery v1.8.2 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 bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(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.2",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.toLowerCase()===b.toLowerCase()},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 a!=null?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)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=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,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.guid++: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.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.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=0)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=0)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;j=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&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 bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;be.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)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},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.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]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}: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){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),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!e.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},header:function(a){return T.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:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.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},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.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=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),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(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)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(f=0;(h=t[f])!=null;f++)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,[f+1,0].concat(r)),f+=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.chrome?b.webkit=!0: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=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=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 b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(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]=bY(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=bR.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]=bY(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 bU&&(f=bU[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(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}: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]),bQ.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&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(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 bQ.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+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?: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||ch.test(this.nodeName)||cg.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(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\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)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/