angular.module('quartermaester') .factory('qmCsv', function($q, $http, $filter, fCsv) { var csvLocation = (window.location.protocol=="file:") ? "https://raw.githubusercontent.com/carpiediem/carpiediem.github.io/master/quartermaester/data/" : "data/"; return { loadData: loadData, getEpisodeId: getEpisodeId, //getChapterId: getChapterId }; /////////////////////////////// function loadData() { return $q.all([ getFile('books.csv'), getFile('chapters.csv'), getFile('seasons.csv'), getFile('episodes.csv'), getFile('houses.csv'), getFile('characters.csv'), getFile('regions.csv'), getFile('loyaltyRanges.csv'), getFile('towns.csv'), getFile('borders.csv'), getFile('loyaltyRangeEdges.csv'), getFile('stops.csv'), getFile('waypoints.csv'), getFile('paths.csv'), getFile('belligerents.csv') ]).spread(parseData); } function parseData(books, chapters, seasons, episodes, houses, characters, regions, loyaltyRanges, towns, borders, loyaltyRangeEdges, stops, waypoints, paths, belligerents) { var qmData = { borderArrays: {}, lrEdgeArrays: {}, waypointArrays: {}, bookLookup: {} }; for (var i=0; i inputArray[i].timing[slider.show][1]) continue; if (typeof options !== "undefined" && typeof inputArray[i].character.key !== "undefined") { if (!options.characters[ inputArray[i].character.key ]) continue; } outputArray.push(inputArray[i]); } return outputArray; } }) .directive('qmList', function ($window) { return { restrict: 'A', link: function (scope, elem, attrs) { var winHeight = $window.innerHeight; // var listHeight = attrs.qmList ? 41*parseInt(attrs.qmList, 10) : 0; // if (listHeight>winHeight) elem.css('height', winHeight - 48 + 'px'); elem.css('height', winHeight - 55 + 'px'); } }; });