|
@@ -196,6 +196,43 @@ $(function() {
|
196
|
196
|
query.map = level;
|
197
|
197
|
}
|
198
|
198
|
|
|
199
|
+ var difficulty = $('select[name=search_difficulty]').val();
|
|
200
|
+ if (difficulty != 'any') {
|
|
201
|
+ query.difficulty = difficulty;
|
|
202
|
+ }
|
|
203
|
+
|
|
204
|
+ var type = $('select[name=search_type]').val();
|
|
205
|
+ if (type != 'any') {
|
|
206
|
+ query.type = type;
|
|
207
|
+ }
|
|
208
|
+
|
|
209
|
+ query.classes = '';
|
|
210
|
+ $.each($('#search_classes img'), function() {
|
|
211
|
+ if (!$(this).hasClass('disabled')) {
|
|
212
|
+ if (query.classes.length > 0) { query.classes += ','; }
|
|
213
|
+ query.classes += this.id.replace('search_', '');
|
|
214
|
+ }
|
|
215
|
+ });
|
|
216
|
+
|
|
217
|
+ query.mode = '';
|
|
218
|
+ if ($('input[name=search_hc]').is(':checked')) {
|
|
219
|
+ query.mode += ',hardcore';
|
|
220
|
+ }
|
|
221
|
+ if ($('input[name=search_mm]').is(':checked')) {
|
|
222
|
+ query.mode += ',mixed';
|
|
223
|
+ }
|
|
224
|
+ if ($('input[name=search_ps]').is(':checked')) {
|
|
225
|
+ query.mode += ',strategy';
|
|
226
|
+ }
|
|
227
|
+
|
|
228
|
+ if (query.mode.length == 0) {
|
|
229
|
+ delete query.mode;
|
|
230
|
+ } else {
|
|
231
|
+ query.mode = query.mode.substr(1);
|
|
232
|
+ }
|
|
233
|
+
|
|
234
|
+ query.limit = 100;
|
|
235
|
+
|
199
|
236
|
doSearch(query);
|
200
|
237
|
return false;
|
201
|
238
|
}
|
|
@@ -214,12 +251,29 @@ $(function() {
|
214
|
251
|
var body = $('#searchresults tbody');
|
215
|
252
|
$.each(data, function() {
|
216
|
253
|
this.difficulty = this.difficulty || 'unknown';
|
|
254
|
+ this.type = (this.type && this.type != 'none') ? this.type : 'unknown';
|
217
|
255
|
|
218
|
256
|
var tr = $('<tr>');
|
219
|
257
|
tr.append($('<td>').append($('<a>').attr('href', '#' + this.id).text(this.id).click(hideSearch)));
|
220
|
258
|
tr.append($('<td>').text(levels[this.level - 1] ? levels[this.level - 1].name : 'Unknown!'));
|
221
|
259
|
tr.append($('<td>').addClass(this.difficulty).text(this.difficulty));
|
222
|
260
|
tr.append($('<td>').addClass(this.type).text(this.type));
|
|
261
|
+ tr.append($('<td>').html(getModesHTML(this.mode)));
|
|
262
|
+
|
|
263
|
+ var classes = this.classes;
|
|
264
|
+ var td = $('<td>');
|
|
265
|
+ $.each(['huntress', 'apprentice', 'monk', 'squire'], function(k, v) {
|
|
266
|
+ var url = v == 'apprentice' ? 'mage' : v;
|
|
267
|
+ var img = $('<img>').attr('src', 'res/images/classes/' + url + '_icon.png')
|
|
268
|
+ .attr('alt', v);
|
|
269
|
+ if ($.inArray(v, classes) == -1) {
|
|
270
|
+ img.addClass('disabled');
|
|
271
|
+ }
|
|
272
|
+ td.append(img);
|
|
273
|
+ });
|
|
274
|
+
|
|
275
|
+ tr.append(td);
|
|
276
|
+
|
223
|
277
|
body.append(tr);
|
224
|
278
|
});
|
225
|
279
|
}
|
|
@@ -233,6 +287,23 @@ $(function() {
|
233
|
287
|
var thisLevel;
|
234
|
288
|
var layout;
|
235
|
289
|
|
|
290
|
+ function getModesHTML(modes) {
|
|
291
|
+ var res = '';
|
|
292
|
+ modes && $.each(modes, function() {
|
|
293
|
+ if (this == "hardcore") {
|
|
294
|
+ res = '<abbr title="Hardcore">hc</abbr> ' + res;
|
|
295
|
+ } else if (this == "mixed") {
|
|
296
|
+ res = '<abbr title="Mixed mode">mm</abbr> ' + res;
|
|
297
|
+ } else if (this == "strategy") {
|
|
298
|
+ res = '<abbr title="Pure strategy">ps</abbr> ' + res;
|
|
299
|
+ } else if (this == "none") {
|
|
300
|
+ res = 'none';
|
|
301
|
+ }
|
|
302
|
+ });
|
|
303
|
+
|
|
304
|
+ return res || 'unknown';
|
|
305
|
+ }
|
|
306
|
+
|
236
|
307
|
function updateDefenseUnits() {
|
237
|
308
|
var used = 0;
|
238
|
309
|
|
|
@@ -391,21 +462,9 @@ $(function() {
|
391
|
462
|
$('#difficulty').text(difficulty).removeClass().addClass(difficulty);
|
392
|
463
|
|
393
|
464
|
var type = layout.type && layout.type != 'none' ? layout.type : "unknown";
|
394
|
|
- var modes = '';
|
395
|
|
- layout.mode && $.each(layout.mode, function() {
|
396
|
|
- if (this == "hardcore") {
|
397
|
|
- modes = '<abbr title="Hardcore">hc</abbr> ' + modes;
|
398
|
|
- } else if (this == "mixed") {
|
399
|
|
- modes = '<abbr title="Mixed mode">mm</abbr> ' + modes;
|
400
|
|
- } else if (this == "strategy") {
|
401
|
|
- modes = '<abbr title="Pure strategy">ps</abbr> ' + modes;
|
402
|
|
- } else if (this == "none") {
|
403
|
|
- modes = 'none';
|
404
|
|
- }
|
405
|
|
- });
|
406
|
465
|
|
407
|
466
|
$('#type').text(type);
|
408
|
|
- $('#modes').html(modes == '' ? 'unknown' : modes);
|
|
467
|
+ $('#modes').html(getModesHTML(layout.mode));
|
409
|
468
|
|
410
|
469
|
$('#du_total').text(thisLevel.du);
|
411
|
470
|
}
|