This repository was archived by the owner on Jun 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraid.js
More file actions
46 lines (37 loc) · 1.54 KB
/
raid.js
File metadata and controls
46 lines (37 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$('#PartyForm option:selected').attr('selected', '');
$('#PartyForm option:first').attr('selected', 'selected');
var load = "<select id='load_local_gear' class='select'><option value='-1'>Please select...</option>";
var playerId = $('a[href^="/character/achievement/index/id/"]').attr('href').split('/').pop();
var savedGears = localStorage["gear_names_"+playerId] || "{}";
savedGears = eval("("+savedGears+")");
$.each(savedGears ,function(id, gearName){
load += '<option value="'+id+'">'+gearName+'</option>';
});
load += '</select>'
$('#PartyForm .config select').after(load);
$('#load_local_gear').change(function(){
if($(this).val() === "-1")
return;
var gearInfo = localStorage["estiah_gear_"+$(this).val()];
gearInfo = eval("("+gearInfo+")");
var deckCardList = [];
$.each(gearInfo["charm_hash"], function(id, count){
deckCardList.push({'id':id, 'count':count});
});
var params = {'DeckName': gearInfo["deckName"],
'DeckId': $("#PartyForm select:eq(0)").val(),
'DeckCardlist':deckCardList
}
$.ajax({
async: false,
type: "POST",
data: {'json': $.toJSON(params)},
url: "http://www.estiah.com/json/character/deck/save",
success: function(data){
if(data["success"] === true){
$("#PartyForm select:eq(0) option:selected").attr('label', gearInfo["deckName"]);
$("#PartyForm select:eq(0) option:selected").text(gearInfo["deckName"]);
}else alert("Something is wrong.");
}
});
});