Replace cd.js
This commit is contained in:
parent
589f4bc2bf
commit
93543c0389
28
cd.js
28
cd.js
@ -2,6 +2,26 @@ const fflog = "https://www.fflogs.com:443/v1/report/fights/";
|
|||||||
const api = "?api_key=";
|
const api = "?api_key=";
|
||||||
|
|
||||||
var indexViewModel;
|
var indexViewModel;
|
||||||
|
var classColors = {
|
||||||
|
"Scholar": "#4c49b2",
|
||||||
|
"WhiteMage": "#c7bf8e",
|
||||||
|
"Astrologian": "#8c501e",
|
||||||
|
"Paladin": "#8aa8a8",
|
||||||
|
"Gunbreaker": "#6c6433",
|
||||||
|
"Warrior": "#610e0a",
|
||||||
|
"DarkKnight": "#241011",
|
||||||
|
"Ninja": "#b30000",
|
||||||
|
"Dragoon": "#3b4ba0",
|
||||||
|
"Monk": "#c58d1c",
|
||||||
|
"Samurai": "#9e6d35",
|
||||||
|
"RedMage": "#47132a",
|
||||||
|
"BlackMage": "#261947",
|
||||||
|
"Summoner": "#59922b",
|
||||||
|
"Dancer": "#ceb8ab",
|
||||||
|
"Machinist": "#6c6433",
|
||||||
|
"Barde": "#6d8432"
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
// Do stuff when HTML parsing is ready
|
// Do stuff when HTML parsing is ready
|
||||||
$(() => {
|
$(() => {
|
||||||
@ -9,7 +29,7 @@ $(() => {
|
|||||||
function IndexViewModel() {
|
function IndexViewModel() {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.apiKey = ko.observable(localStorage.getItem("apikey"));
|
self.apiKey = ko.observable(localStorage.getItem("apikey"));
|
||||||
self.logID = ko.observable("");
|
self.logID = ko.observable(localStorage.getItem("fflogid"));
|
||||||
self.fights = ko.observableArray();
|
self.fights = ko.observableArray();
|
||||||
self.friendlies = ko.observableArray();
|
self.friendlies = ko.observableArray();
|
||||||
self.displayFightPicker = ko.observable(false);
|
self.displayFightPicker = ko.observable(false);
|
||||||
@ -33,11 +53,17 @@ $(() => {
|
|||||||
self.apiKeyChanged = function() {
|
self.apiKeyChanged = function() {
|
||||||
console.log("Setting apiKey to ",self.apiKey());
|
console.log("Setting apiKey to ",self.apiKey());
|
||||||
localStorage.setItem("apikey",self.apiKey());
|
localStorage.setItem("apikey",self.apiKey());
|
||||||
|
localStorage.setItem("fflogid", self.logID());
|
||||||
};
|
};
|
||||||
|
|
||||||
self.fightChanged = function() {
|
self.fightChanged = function() {
|
||||||
console.log("Fight has changed to ",self.selectedFight());
|
console.log("Fight has changed to ",self.selectedFight());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.textColor = function(job) {
|
||||||
|
console.log(job.type)
|
||||||
|
return classColors[job.type];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
indexViewModel = new IndexViewModel();
|
indexViewModel = new IndexViewModel();
|
||||||
ko.applyBindings(indexViewModel);
|
ko.applyBindings(indexViewModel);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user