From 824cbbb1cd4ca23324f8692e1ac994fa75f200c1 Mon Sep 17 00:00:00 2001 From: "ScreenyMcScreenface\\Ryan" Date: Tue, 8 Aug 2017 10:08:52 +0800 Subject: [PATCH] unknown --- index.html | 426 ------------------------------------------------- js/models.js | 61 +++++++ js/services.js | 4 +- 3 files changed, 64 insertions(+), 427 deletions(-) delete mode 100644 index.html create mode 100644 js/models.js diff --git a/index.html b/index.html deleted file mode 100644 index 5cc899f..0000000 --- a/index.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - Interactive Game of Thrones Map - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-

- Spoiler Control - -

-
- - - -
-
-
- - -
- - - - -
- - - - - - - - - - -
-
-
- - - -
-

- Characters - -

- -
- - - -
-

- Options - -

-
    -
  • - Character Paths - - -
  • -
  • - House Heraldry - - -
  • - Geographic Regions - - -
  • - Political Allegiances - - -
  • -
- - -
- -
-

- About Quatrermaester.info - -

-

This is a map of the world depicted in the novel series A Song of Ice & Fire and the TV adaptation, A Game of Thrones. The website is designed to display useful information on top of the map layer and link to additional details on the Westeros.org wiki site.

-

If you haven't finished reading the novels or watching the shows, you can hide any details that might spoil the plot. Simply drag the slider in the top-right corner to the last chapter or episode that you've completed. You can move the slider with arrow buttons in order to animate the characters' paths. Keep in mind that the slider only controls this map; any page you may open on the wiki site may contain spoilers.

- -

The map layer used in this website was drawn by theMountainGoat, based on previous work by Tear of the Cartographer's Guild. The map interface is built on the Google Maps API, through the angular-google-maps directive. It displays custom tiles generated by GMap Image Cutter Version 1.42. Intellectual property of A Song of Ice and Fire, this map and all locations belong to George R.R. Martin. If you find any errors in the map data, please let me know.

-

You may notice that this map is contradicted, in places, by the maps shown in The Lands of Ice and Fire. Since the maps in that collection are clearly copyrighted material, I have no intention of copying them directly and I'm going to remain cautious in pulling details from them to correct this website. You can find low-resolution versions of the official maps on the artist's website or in Random House's iOS & Android apps.

- -

Other Resources

- -
- -
-

- Editor - -

- - - - - - - - - - -
{{path.key}}{{point.location}}{{point.latitude | number:4}}{{point.longitude | number:4}}
- -
- - - - - - - - - -
{{polygon.key}}{{point.latitude | number:4}}{{point.longitude | number:4}}
- -
- - - - - - - - - -
{{point.latitude | number:4}}{{point.longitude | number:4}}
- -
- -
- -
-

Ruling Sovereigns

- - - -
- - - diff --git a/js/models.js b/js/models.js new file mode 100644 index 0000000..8594d5e --- /dev/null +++ b/js/models.js @@ -0,0 +1,61 @@ +angular.module('quartermaester') + +.factory('User', function (Organisation) { + + /** + * Constructor, with class name + */ + function User(firstName, lastName, role, organisation) { + // Public properties, assigned to the instance ('this') + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + this.organisation = organisation; + } + + /** + * Public method, assigned to prototype + */ + User.prototype.getFullName = function () { + return this.firstName + ' ' + this.lastName; + }; + + /** + * Private property + */ + var possibleRoles = ['admin', 'editor', 'guest']; + + /** + * Private function + */ + function checkRole(role) { + return possibleRoles.indexOf(role) !== -1; + } + + /** + * Static property + * Using copy to prevent modifications to private property + */ + User.possibleRoles = angular.copy(possibleRoles); + + /** + * Static method, assigned to class + * Instance ('this') is not available in static context + */ + User.build = function (data) { + if (!checkRole(data.role)) { + return; + } + return new User( + data.first_name, + data.last_name, + data.role, + Organisation.build(data.organisation) // another model + ); + }; + + /** + * Return the constructor function + */ + return User; +}) diff --git a/js/services.js b/js/services.js index 9ecc94c..d48c22e 100644 --- a/js/services.js +++ b/js/services.js @@ -347,10 +347,12 @@ angular.module('quartermaester') } function characterPathModel(path, index) { - var reMatch = /([\w\_]+)\-\d+/.exec(path.key); + var reMatch = /([\w\_\(\)]+)\-\d+/.exec(path.key); + //console.log(reMatch[1]); var matchingCharacter = $filter('filter')(qmData.characters, {key: reMatch[1]})[0]; var firstChapter = getChapterId(path.firstChapter); var firstEpisode = getEpisodeId(path.firstEpisode); + console.log(path.key, qmData.waypointArrays[path.key]); var waypoints = qmData.waypointArrays[path.key].map(waypointModel); var icons = []; if (path.arrows=="TRUE") icons.push({