Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes to make testing easier #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h3 i18n>What is this website ?</h3>
<li>You can cycle between various overlays. each overlay will hightlight different buildings</li>
<li>You can save your blueprints</li>
<li>You can share your blueprints, by exporting png images for each overlay</li>
<li>Or by sharing a link that will directly open your blueprint! <a href="https://blueprintnotincluded.com/b/5de2666b7c0edb5515e65315" target="blueprint_link">click here to open my SPOM in a new tab!</a></li>
<li>Or by sharing a link that will directly open your blueprint! <a href="/b/5de2666b7c0edb5515e65315" target="blueprint_link">click here to open my SPOM in a new tab!</a></li>
</ul>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class DialogShareUrlComponent implements OnInit {

get url() {
return this.blueprintService.id != null ?
BlueprintService.baseUrl + 'b/' + this.blueprintService.id : ''
BlueprintService.baseUrl + '/b/' + this.blueprintService.id : ''
}

ngOnInit() {
Expand Down
28 changes: 14 additions & 14 deletions src/app/module-blueprint/services/blueprint-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import * as yaml from 'node_modules/js-yaml/lib/js-yaml';
export class BlueprintService implements IObsBlueprintChange
{
//static baseUrl: string = 'blueprintnotincluded.com/';
static baseUrl: string = 'https://blueprintnotincluded.com/';
static baseUrl: string = location.origin;

id: string;
name: string;
// TODO observable when modified, to be subscribed by the canvas
// TODO not sure getter setters are useful
blueprint_: Blueprint;
get blueprint() { return this.blueprint_; }
set blueprint(value: Blueprint) {
set blueprint(value: Blueprint) {
this.blueprint_ = value;
//this.observersBlueprintChanged.map((observer) => { observer.blueprintChanged(this.blueprint_); })
//this.observersBlueprintChanged.map((observer) => { observer.blueprintChanged(this.blueprint_); })
}
thumbnail: string;
thumbnailStyle: Display;
Expand Down Expand Up @@ -92,7 +92,7 @@ export class BlueprintService implements IObsBlueprintChange
let newBlueprint = new Blueprint();
this.name = templateJson.friendlyname;
newBlueprint.importFromBni(templateJson);

this.observersBlueprintChanged.map((observer) => { observer.blueprintChanged(newBlueprint); })
}

Expand All @@ -106,7 +106,7 @@ export class BlueprintService implements IObsBlueprintChange
{
let newBlueprint = new Blueprint();
newBlueprint.importFromBinary(template);

this.observersBlueprintChanged.map((observer) => { observer.blueprintChanged(newBlueprint); })
}

Expand All @@ -130,7 +130,7 @@ export class BlueprintService implements IObsBlueprintChange
reset() {
this.id = null;
this.likedByMe = false;
}
}

suppressChanges: boolean;
undoStates: MdbBlueprint[];
Expand Down Expand Up @@ -181,7 +181,7 @@ export class BlueprintService implements IObsBlueprintChange
// If we are in the middle of the states, doing anythings scraps the further redos
if (this.undoIndex < this.undoStates.length - 1) this.undoStates.splice(this.undoIndex + 1);


let newState = this.blueprint.toMdbBlueprint();
/*if (this.undoStates.length > 0) {
let oldState = this.undoStates[this.undoStates.length - 1];
Expand All @@ -191,8 +191,8 @@ export class BlueprintService implements IObsBlueprintChange
}
else */this.undoStates.push(newState);




while (this.undoStates.length > 50) this.undoStates.splice(0, 1);

Expand Down Expand Up @@ -250,10 +250,10 @@ export class BlueprintService implements IObsBlueprintChange

return request;
}
getBlueprints(olderThan: Date, filterUserId: string, filterName: string, getDuplicates: boolean) {

getBlueprints(olderThan: Date, filterUserId: string, filterName: string, getDuplicates: boolean) {
let parameterOlderThan = 'olderthan='+olderThan.getTime().toString();

let parameterFilterUserId = '';
if (filterUserId != null) parameterFilterUserId = '&filterUserId='+filterUserId;

Expand All @@ -265,7 +265,7 @@ export class BlueprintService implements IObsBlueprintChange

let parameters = parameterOlderThan+parameterFilterUserId+parameterGetDuplicates+parameterFilterName;

let request = this.authService.isLoggedIn() ?
let request = this.authService.isLoggedIn() ?
this.http.get('/api/getblueprintsSecure?'+parameters, { headers: { Authorization: `Bearer ${this.authService.getToken()}` }}) :
this.http.get('/api/getblueprints?'+parameters) ;

Expand Down Expand Up @@ -349,4 +349,4 @@ export interface ExportImageOptions {
gridLines: boolean;
selectedOverlays: Overlay[];
pixelsPerTile: number;
}
}