From 9dc29c865ca85d6c6e7ca6a40dce7ee242f29f49 Mon Sep 17 00:00:00 2001 From: Russell Champoux Date: Tue, 24 Mar 2015 15:54:02 -0400 Subject: [PATCH] Changed spec, fixed price in crb wondrous --- grimoire-core.js | 7 +++++-- jasmine/spec/grimoireSpec.js | 2 +- sources/CRB/Wondrous Items.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/grimoire-core.js b/grimoire-core.js index 43f4deb..a9c636a 100644 --- a/grimoire-core.js +++ b/grimoire-core.js @@ -74,14 +74,17 @@ WEIGHTS[QUALITIES.MAJOR] = { //Contains all the source info var Grimoire = function(config) { // jshint ignore:line var self = this; + config = config || {}; this.chance = (config && config.chance ? config.chance : config && config.seed ? new Chance(config.seed) : new Chance()); this.SOURCES = []; $.ajaxSetup({ - async: false //A project that works now is better than one that doesn't exist. + async: (config.async !== undefined) ? config.async : true + //A project that works now is better than one that doesn't exist. //I MUST come back and revisit this with promises later }); - $.getJSON('./data/sources.json', function(sources) { + var baseDir = config.baseDir ? config.baseDir : './sources/'; + $.getJSON(baseDir + 'sources.json', function(sources) { sources.sources.forEach(function(url) { $.getJSON(url, function(source) { console.log('loaded '+ url); diff --git a/jasmine/spec/grimoireSpec.js b/jasmine/spec/grimoireSpec.js index 2da2cce..e985802 100644 --- a/jasmine/spec/grimoireSpec.js +++ b/jasmine/spec/grimoireSpec.js @@ -2,7 +2,7 @@ 'use strict'; describe('Sources', function() { - var grimoire = new Grimoire(); + var grimoire = new Grimoire({async: false, baseDir: './sources/'}); it('should load sources', function() { expect(grimoire.SOURCES).toBeTruthy(); }); diff --git a/sources/CRB/Wondrous Items.json b/sources/CRB/Wondrous Items.json index 87a1ebd..e60066a 100644 --- a/sources/CRB/Wondrous Items.json +++ b/sources/CRB/Wondrous Items.json @@ -250,7 +250,7 @@ { "name" : "Tome of clear thought +1", "cost" : 27500, "url" : "" }, { "name" : "Tome of leadership and influence +1", "cost" : 27500, "url" : "" }, - { "name" : "Tome of understanding +1", "cost" : 2750, "url" : "" }], + { "name" : "Tome of understanding +1", "cost" : 27500, "url" : "" }], "major": [ { "name" : "Dimensional shackles", "cost" : 28000, "url" : "#dimensional-shackles" },