-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Flow, refactor code to use classes, improve build system
- Loading branch information
Showing
54 changed files
with
3,009 additions
and
1,991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"exclude": "node_modules/**", | ||
"presets": [ | ||
"@babel/preset-flow" | ||
], | ||
"sourceMap": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// @flow | ||
/* | ||
* Copyright (C) 2016-2018 Alexander Krivács Schrøder <[email protected]> | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// @flow | ||
/* | ||
* Copyright (C) 2016-2018 Alexander Krivács Schrøder <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import type { ItemType } from './itemData'; | ||
|
||
export type ComicEditorDataMissing = { | ||
first: ?number; | ||
previous: ?number; | ||
next: ?number; | ||
last: ?number; | ||
any: boolean; | ||
} | ||
|
||
export type ComicEditorData = { | ||
missing: { | ||
cast: ComicEditorDataMissing; | ||
location: ComicEditorDataMissing; | ||
storyline: ComicEditorDataMissing; | ||
title: ComicEditorDataMissing; | ||
tagline: ComicEditorDataMissing; | ||
any: boolean; | ||
} | ||
}; | ||
|
||
export type ComicItem = { | ||
first: ?number; | ||
previous: ?number; | ||
first: ?number; | ||
last: ?number; | ||
id: number; | ||
shortName: string; | ||
name: string; | ||
type: ItemType; | ||
color: string; | ||
}; | ||
|
||
export type ComicData = { | ||
comic: number; | ||
hasData: boolean; | ||
publishDate: ?string; | ||
isAccuratePublishDate: ?boolean; | ||
title: ?string; | ||
tagline: ?string; | ||
isGuestComic: ?boolean; | ||
isNonCanon: ?boolean; | ||
news: ?string; | ||
previous: ?number; | ||
next: ?number; | ||
editorData?: ComicEditorData; | ||
items: Array<ComicItem>; | ||
allItems?: Array<ComicItem>; | ||
}; | ||
|
||
export type ComicItemRepository = { | ||
[string]: ComicItem[]; | ||
|
||
cast?: ComicItem[]; | ||
location?: ComicItem[]; | ||
storyline?: ComicItem[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// @flow | ||
/* | ||
* Copyright (C) 2016-2018 Alexander Krivács Schrøder <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
export type ItemType = 'cast' | 'location' | 'storyline'; | ||
|
||
export type ItemBaseData = { | ||
id: number; | ||
shortName: string; | ||
name: string; | ||
type: ItemType; | ||
} | ||
|
||
export type ItemBaseDataWithColor = ItemBaseData & { | ||
color: string; | ||
} | ||
|
||
export type ItemData = ItemBaseDataWithColor & { | ||
first: number; | ||
last: number; | ||
appearances: number; | ||
totalComics: number; | ||
presence: number; | ||
hasImage: boolean; | ||
}; | ||
|
||
export type ItemRelationData = ItemBaseDataWithColor & { | ||
count: number; | ||
percentage: number; | ||
}; | ||
|
||
export type DecoratedItemData = ItemData & { | ||
highlightColor: string; | ||
locations: ItemRelationData[]; | ||
friends: ItemRelationData[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// @flow | ||
/* | ||
* Copyright (C) 2016-2018 Alexander Krivács Schrøder <[email protected]> | ||
* | ||
|
@@ -15,6 +16,8 @@ | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import type { AngularModule } from 'angular'; | ||
|
||
import config from './config'; | ||
import run from './run'; | ||
|
||
|
@@ -25,6 +28,7 @@ import titleController from './controllers/titleController'; | |
import colorService from './services/colorService'; | ||
import comicService from './services/comicService'; | ||
import eventFactory from './services/eventFactory'; | ||
import eventService from './services/eventService'; | ||
import messageReportingService from './services/messageReportingService'; | ||
import styleService from './services/styleService'; | ||
|
||
|
@@ -47,7 +51,7 @@ import qcSetTaglineDirective from './directives/qcSetTaglineDirective'; | |
import qcSettingsDirective from './directives/qcSettingsDirective'; | ||
import qcSetTitleDirective from './directives/qcSetTitleDirective'; | ||
|
||
export default function (app) { | ||
export default function (app: AngularModule) { | ||
config(app); | ||
run(app); | ||
|
||
|
@@ -58,6 +62,7 @@ export default function (app) { | |
colorService(app); | ||
comicService(app); | ||
eventFactory(app); | ||
eventService(app); | ||
messageReportingService(app); | ||
styleService(app); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// @flow | ||
/* | ||
* Copyright (C) 2016-2018 Alexander Krivács Schrøder <[email protected]> | ||
* | ||
|
@@ -15,17 +16,23 @@ | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import GM from 'greasemonkey'; | ||
import angular from 'angular'; | ||
import type { AngularModule } from 'angular'; | ||
|
||
import settings from './../settings'; | ||
|
||
import decorateHttpService from './decorateHttpService'; | ||
import decorateScope from './decorateScope'; | ||
|
||
export default function (app) { | ||
export default function (app: AngularModule) { | ||
// Set up routing and do other configuration | ||
app.config(['$stateProvider', '$urlRouterProvider', | ||
'$locationProvider', '$provide', '$logProvider', | ||
function ($stateProvider, $urlRouterProvider, $locationProvider, | ||
$provide, $logProvider) { | ||
decorateHttpService($provide); | ||
decorateScope($provide); | ||
|
||
$stateProvider.state('homepage', { | ||
url: '^/$', | ||
|
@@ -44,6 +51,6 @@ export default function (app) { | |
|
||
$locationProvider.html5Mode(true); | ||
|
||
$logProvider.debugEnabled(settings.showDebugLogs); | ||
$logProvider.debugEnabled(settings.values.showDebugLogs); | ||
}]); | ||
} |
Oops, something went wrong.