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

updating to get sharing button #1

Open
wants to merge 9 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on: push
name: Build Angular
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v1

- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: openhistorymap/ohm-map/ohm-map
tag_with_ref: true
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"angular.enable-strict-mode-prompt": false
}
5 changes: 4 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,8 @@
}
}
},
"defaultProject": "ohm-map"
"defaultProject": "ohm-map",
"cli": {
"analytics": false
}
}
77 changes: 77 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"@modalnodes/mn-configurator": "0.0.4",
"@modalnodes/mn-docker": "0.0.3",
"@modalnodes/mn-registry": "0.0.3",
"ngx-capture": "^0.12.1",
"ngx-matomo": "^0.1.4",
"ol": "^6.4.3",
"rxjs": "~6.5.5",
"tslib": "^2.0.0",
Expand Down
3 changes: 3 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';

import { MnDockerService } from '@modalnodes/mn-docker';
import { HttpClient } from '@angular/common/http';
import { MatomoInjector } from 'ngx-matomo';

import env from '../assets/env.json';

Expand All @@ -15,8 +16,10 @@ declare const mapboxgl;
export class AppComponent implements OnInit {

constructor(
private matomoInjector: MatomoInjector
) {}

ngOnInit() {
this.matomoInjector.init('//tracker.openhistorymap.org/', 2);
}
}
8 changes: 7 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MnConfiguratorModule } from '@modalnodes/mn-configurator';
import { MnDockerModule } from '@modalnodes/mn-docker';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { MatomoModule } from 'ngx-matomo';

import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
Expand All @@ -12,6 +13,8 @@ import { StyleSelectorComponent } from './style-selector/style-selector.componen
import { DecimaldatePipe } from './decimaldate.pipe';
import { NicedatePipe } from './nicedate.pipe';
import { DateComponent } from './date/date.component';
import {ClipboardModule} from '@angular/cdk/clipboard';
import { ShareDirective } from './share.directive';

@NgModule({
declarations: [
Expand All @@ -20,15 +23,18 @@ import { DateComponent } from './date/date.component';
StyleSelectorComponent,
DecimaldatePipe,
NicedatePipe,
DateComponent
DateComponent,
ShareDirective
],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
ClipboardModule,
MnDockerModule,
MnConfiguratorModule,
SharedModule,
MatomoModule
],
providers: [],
bootstrap: [AppComponent]
Expand Down
1 change: 0 additions & 1 deletion src/app/decimaldate.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,4 @@ export class DecimaldatePipe implements PipeTransform {
ret.setMilliseconds(rest);
return ret;
}

}
61 changes: 49 additions & 12 deletions src/app/map/map.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<mat-toolbar color="primary">
<button mat-button mat-icon-button (click)="lbar.toggle()"><mat-icon>info</mat-icon></button>
<button mat-button mat-icon-button (click)="lbar.toggle()"><mat-icon>menu</mat-icon></button>
<h1>OpenHistoryMap</h1>
<span class="spacer"></span>
<span class="spacer"></span>
Expand All @@ -8,15 +8,18 @@ <h1>OpenHistoryMap</h1>
<ohm-style-selector (styleChange)="changeStyle($event)"></ohm-style-selector>
<button mat-button mat-icon-button class="hidesmall" (click)="info()"><mat-icon>help</mat-icon></button>
<span class="spacer"></span>
<button mat-button class="hidesmall" (click)="selectDate()">{{atDate|decimaldate|date:'d/M/y G - hh:mm:ss'|nicedate}}</button>
<button mat-button class="hidesmall" mat-icon-button (click)="startstop()"><mat-icon>{{startstopicon}}</mat-icon></button>
<button mat-button class="hidesmall" mat-icon-button [matMenuTriggerFor]="menu"><mat-icon>speed</mat-icon></button>
<button mat-button class="hidesmall">{{atDate|decimaldate|date:'d/M/y G - hh:mm:ss'|nicedate}}</button>
<button mat-button class="hidesmall" disabled mat-icon-button (click)="startstop()"><mat-icon>{{startstopicon}}</mat-icon></button>
<button mat-button class="hidesmall" disabled mat-icon-button [matMenuTriggerFor]="menu"><mat-icon>speed</mat-icon></button>

<span class="spacer hidesmall"></span>
<span class="spacer hidesmall"></span>
<span class="spacer hidesmall"></span>
<span class="spacer hidesmall"></span>
<button mat-button mat-icon-button (click)="rbar.toggle()" class="hidesmall"><mat-icon>menu</mat-icon></button>
<button mat-button mat-icon-button (click)="copy_url()" class="hidesmall"><mat-icon>share</mat-icon></button>
<button disabled mat-button mat-icon-button (click)="rbar.toggle()" class="hidesmall"><mat-icon>menu</mat-icon></button>
<button disabled mat-button mat-icon-button (click)="pbar.toggle()" class="hidesmall"><mat-icon>person</mat-icon></button>
<button disabled mat-button mat-icon-button (click)="ibar.toggle()" class="hidesmall"><mat-icon>location_on</mat-icon></button>

</mat-toolbar>

Expand All @@ -26,12 +29,22 @@ <h1>OpenHistoryMap</h1>

</div>
<mat-nav-list>
<mat-list-item>About</mat-list-item>
<mat-list-item>How to join</mat-list-item>
<mat-list-item>How to help</mat-list-item>
<mat-list-item>Donate</mat-list-item>
<a target="_blank" href="https://www.openhistorymap.org/" mat-list-item>OHM Home</a>
<a target="_blank" href="https://blog.openhistorymap.org/" mat-list-item>OHM Blog</a>
<a target="_blank" href="https://index.openhistorymap.org/" mat-list-item>OHM Index</a>
<a target="_blank" href="https://www.openhistorymap.org/about/" mat-list-item>About OHM</a>
<a target="_blank" href="https://www.openhistorymap.org/help/" mat-list-item>How to help/donate to OHM</a>
</mat-nav-list>
</mat-sidenav>
<mat-sidenav class="sidebar" mode="over" #ibar position="end">
<mat-toolbar>
<h1>What is here</h1>
</mat-toolbar>

<mat-list *ngFor="let event of selectedFeatures">
<a mat-list-item (click)="goTimeSpace(event.ohm_from, event.geom)">{{event.properties.name}}</a>
</mat-list>
</mat-sidenav>
<mat-sidenav class="sidebar" mode="over" #rbar position="end">
<mat-toolbar color="primary">
<h1>Events</h1>
Expand All @@ -41,11 +54,35 @@ <h1>Events</h1>
<a mat-list-item (click)="goTimeSpace(event.ohm_from, event.geom)">{{event.properties.name}}</a>
</mat-list>
</mat-sidenav>
<mat-sidenav-content>
<mat-sidenav class="sidebar" mode="over" #pbar position="end">
<mat-toolbar color="primary">
<h1>Ephemeral</h1>
</mat-toolbar>

<mat-list *ngFor="let event of (events|async)">
<a mat-list-item (click)="goTimeSpace(event.ohm_from, event.geom)">{{event.properties.name}}</a>
</mat-list>
</mat-sidenav>
<mat-sidenav class="sidebar" mode="over" #sharebar position="end">
<mat-toolbar color="primary">
<h1>Sharing</h1>
<span class="spacer"></span>
<button mat-button mat-icon-button (click)="sharebar.close()" class="hidesmall"><mat-icon>close</mat-icon></button>
</mat-toolbar>

<mat-list>
<a share="https://www.facebook.com/sharer/sharer.php?u={{share_link}}" mat-list-item><mat-icon>facebook</mat-icon> Share on Facebook</a>
<a share="" mat-list-item><mat-icon>twitter</mat-icon> Share on Twitter</a>
<a share="" mat-list-item><mat-icon></mat-icon> Share on Linkedin</a>
<a share="" mat-list-item><mat-icon>class</mat-icon> Share on Classroom</a>
</mat-list>

</mat-sidenav>
<mat-sidenav-content #screen>

<mat-menu #menu="matMenu">
<button mat-menu-item (click)="setSpeed(4000)">Slow</button>
<button mat-menu-item (click)="setSpeed(2000)">Medium</button>
<button mat-menu-item (click)="setSpeed(5)">Slow</button>
<button mat-menu-item (click)="setSpeed(50)">Medium</button>
<button mat-menu-item (click)="setSpeed(500)">High</button>
</mat-menu>
<div class="row">
Expand Down
7 changes: 7 additions & 0 deletions src/app/map/map.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@
width: 256px;
background-color: #3f51b5;
color: white;
a{
color:white;
}
}

.info{
padding: 16px;
color:white;
a, a:hover, a:visited{
color:white;
}
}