Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | 11x 11x 11x 1x 11x 11x 11x 11x 11x 11x 11x 8x 17x 5x 5x 17x 17x 17x 15x 30x 30x 15x 15x 15x 2x 17x 17x 17x 17x 17x 17x 17x 17x 17x 17x 2x 2x 2x 1x 10x 10x 10x 10x 1x 9x 1x 1x 8x 1x 7x 1x 6x 3x 3x 3x 3x 3x 2x 2x 1x 1x 1x 1x 3x 3x 1x 2x 1x 1x 9x 5x 9x 14x 14x 1x 1x 1x 1x 1x 9x | /*
* Part of Pleiar.no - a collection of tools for nurses
*
* Copyright (C) Eskild Hustvedt 2017-2018
* Copyright (C) Fagforbundet 2019
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// @flow
import * as React from 'react';
import { Handle404 } from './shared';
import { MainContainer, PageTitle } from './layout';
import { Row, Col } from 'reactstrap';
import { Switch, Route, Redirect, Link } from 'react-router-dom';
import { Markdown } from './markdown';
import type { Match as RouterMatch } from 'react-router-dom';
import auth from '../auth';
import device from '../helper.device';
import { appInstall } from '../mobile-appinstall';
import { ExternalLink } from './shared/links';
import PleiarSearcher from '../searcher';
import MedSearcher from '../med-synonym-searcher';
import IOSShareIcon from 'react-feather/dist/icons/share';
import IOSPlusIcon from 'react-feather/dist/icons/plus-square';
import FFHomeIcon from 'react-feather/dist/icons/home';
import FBMoreDots from 'react-feather/dist/icons/more-horizontal';
import OperaMoreDots from 'react-feather/dist/icons/more-vertical';
import SysInfo from '../helper.sysinfo';
import { quizDataManager } from "../quiz-manager";
import type { SystemInfoType } from '../helper.sysinfo';
// $FlowIssue[cannot-resolve-module] - Flow doesn't understand markdown imports
import friProgramvare from '../../data/sider/fri-programvare.md';
// $FlowIssue[cannot-resolve-module] - Flow doesn't understand markdown imports
import personvern from '../../data/sider/personvern.md';
// $FlowIssue[cannot-resolve-module] - Flow doesn't understand markdown imports
import resources from '../../data/sider/flerefagtilbud.md';
// $FlowIssue[cannot-resolve-module] - Flow doesn't understand markdown imports
import aboutApp from '../../data/sider/ompleiar.md';
// Let flow know about our GIT_REVISION globals (from webpack)
declare var GIT_REVISION:string;
declare var GIT_REVISION_FULL:string;
declare var GIT_REVISION_DATA:string;
/**
* This provides various system information, useful for debugging
*/
class AboutSystem extends React.PureComponent<{||}, {|bodyClass: string | null|}>
{
constructor () // eslint-disable-line
{
super();
this.state = {
bodyClass: null
};
const update = () =>
{
this.forceUpdate();
};
// Refresh ourself if something updates
Eif (!appInstall.canInstall())
{
appInstall.listen(update);
}
Eif (!MedSearcher.hasInitialized())
{
MedSearcher.onInitialize(update);
}
Eif (!quizDataManager.hasInitialized())
{
quizDataManager.onInitialize(update);
}
if (!PleiarSearcher.hasInitialized())
{
PleiarSearcher.onInitialize(update);
}
}
// eslint-disable-next-line require-jsdoc
render(): React.Node
{
setTimeout( () =>
{
Eif(document.body !== null)
{
this.setState({
bodyClass: document.body.getAttribute('class')
});
}
},1);
const SystemInfo : SystemInfoType = SysInfo.getSystemInfo();
const sources = [];
if(SystemInfo.sources.length > 0)
{
for (const source of SystemInfo.sources)
{
const { src, rel } = source;
if (source.type == "script")
{
sources.push(<code key={src}>{src}</code>);
}
else Eif(rel)
{
sources.push(<code key={src+rel}>{src+' ('+rel+')'}</code>);
}
}
}
else
{
sources.push('(klarte ikke hente kildeliste)');
}
let appVersion: string | React.Node = GIT_REVISION_FULL;
Eif(appVersion !== "(git)")
{
appVersion = <ExternalLink sameWindow={true} href={"https://gitlab.com/fagforbundet/pleiar.no/tree/"+GIT_REVISION_FULL}>
<span className="d-none d-sm-inline-block">{GIT_REVISION_FULL}</span>
<span className="d-sm-none">{GIT_REVISION}</span>
</ExternalLink>;
}
const breakPoints = [
<span key="xs" className="d-inline-block">xs </span>,
<span key="sm" className="d-none d-sm-inline-block">sm </span>,
<span key="md" className="d-none d-md-inline-block">md </span>,
<span key="lg" className="d-none d-lg-inline-block">lg </span>,
<span key="xl" className="d-none d-xl-inline-block">xl </span>,
];
const moreData = [];
const appInstallMode = appInstall.mode();
Iif(device.isAppMode() === false && device.isMobileDevice() === true && appInstallMode === "chrome")
{
let installState: string = "klar til installering";
if(! appInstall.canInstall())
{
installState = "ikke klar";
}
moreData.push(<span key="installState"><b>Status for installasjon</b>: {installState}</span>);
moreData.push(<br key="installStateNewline" />);
}
let authInfo: React.Node;
Eif(auth.isAuthenticated())
{
authInfo = <span>innlogget <Link to="/auth/logout">(logg ut)</Link></span>;
}
else
{
authInfo = <span>ikke innlogget</span>;
}
return <Row>
<PageTitle title="Systeminformasjon" />
<Col className="systemInfo">
<h2>System<wbr />­informasjon</h2>
<b>{device.isAppMode() ? 'Motor' : 'Nettleser' }</b>: {SystemInfo.UA}<br />
<b>Plattform</b>: {SystemInfo.platform} {appInstallMode !== null ? ( "("+appInstallMode+")" ) : "" }<br />
<b>Appversjon</b>: {appVersion}<br />
<b>Dataversjon</b>: {GIT_REVISION_DATA}<br />
<b>Status for autentisering</b>: {authInfo}<br />
<b>Inndata</b>:
{" "}{device.isTouchScreen() ? "touch" : "nøyaktig" }
<span className="inputMediaQueries">
{" - "}
<span className="hover"><span className="yes">hover:hover,</span><span className="no">hover:none,</span></span>
{" "}<span className="pointer">{" "}<span className="fine">pointer:fine</span><span className="coarse">pointer:coarse</span><span className="none">pointer:none</span></span>
</span>
<br />
<b>Modus</b>: {device.isAppMode() ? "app" : (device.isMobileDevice() ? "mobil-web" : "web" ) }<br />
<b>PleiarSearcher status</b>: {SystemInfo.pleiarSearcherStatus}<br />
<b>MedSearcher status</b>: {SystemInfo.medSearcherStatus}<br />
<b>QuizDataManager status</b>: {SystemInfo.quizDataManagerStatus}<br />
<b>Motor-flagg</b>: {SystemInfo.featuresDetected.length > 0 ? SystemInfo.featuresDetected.join(', ') : '(ingen)'}<br />
<b>body-flagg</b>: {this.state.bodyClass ? this.state.bodyClass : "(ingen)"}<br />
<b>Synlige brytepunkt</b>: {breakPoints} ({SystemInfo.dimensions.w}x{SystemInfo.dimensions.h})<br />
<b>Lokal tid</b>: {(new Date).toLocaleString()} ({Math.round((new Date).getTime()/1000)})<br />
<b>URL:</b> {location.href}<br />
<b>Referrer:</b> {document.referrer ? document.referrer : "(ingen)"}<br />
<b>Service worker</b>: {SystemInfo.serviceWorkerStatus}<br />
{moreData}
<br />
<b>Kildefiler:</b><br />
<div className="sourceFiles">{sources}</div>
</Col>
</Row>;
}
}
/**
* The Pleiar.no privacy information page
*/
class AboutPrivacy extends React.PureComponent<{||}>
{
// eslint-disable-next-line require-jsdoc
render(): React.Node
{
return <Row>
<Col>
<PageTitle title="Personvern" />
<Markdown content={personvern} />
</Col>
</Row>;
}
}
/**
* The Pleiar.no free software infromation page
*/
class AboutFreeSoftware extends React.PureComponent<{||}>
{
// eslint-disable-next-line require-jsdoc
render(): React.Node
{
return <Row>
<Col>
<PageTitle title="Fri programvare" />
<Markdown content={friProgramvare} />
</Col>
</Row>;
}
}
/**
* The Pleiar.no free software infromation page
*/
class AboutPleiarNo extends React.PureComponent<{||}>
{
// eslint-disable-next-line require-jsdoc
render(): React.Node
{
return <Row>
<Col>
<PageTitle title="om" />
<Markdown content={aboutApp} />
</Col>
</Row>;
}
}
/**
* Renders an info page with links to more resources
*/
class OtherFFResources extends React.PureComponent<{||}>
{
// eslint-disable-next-line require-jsdoc
render(): React.Node
{
return <Row>
<Col>
<PageTitle title="Flere fagtilbud fra Fagforbundet" />
<Markdown content={resources} />
</Col>
</Row>;
}
}
/**
* Displays "app" installation instructions in supported browsers on supported
* platforms
*/
class InstallApp extends React.PureComponent<{||}>
{
// eslint-disable-next-line require-jsdoc
render(): React.Node
{
const mode = appInstall.mode();
let renderAppInfoBlurb: boolean = true;
const components: Array<React.Node> = [<h3 key="header">Installer app</h3>];
if(mode === "firefox-android")
{
components.push(<div key="ff-android-instructions">
For å installere Pleiar.no som app, trykk på <FFHomeIcon /> i adresselinja øverst på skjermen og velg så «legg til på startskjermen». Hvis du bruker Firefox Focus må du bytte til vanlig Firefox (eller Chrome) for å kunne installere appen.
</div>);
}
else if(mode === "ios-other")
{
renderAppInfoBlurb = false;
components.push(<div key="ios-other-instructions">
På iPhone og iPad er det bare Safari som kan installere apper. For å installere appversjonen av pleiar.no må du åpne sida i Safari.
</div>);
}
else if(mode === "safari-ios")
{
components.push(<div key="ios-safari-instructions">
Trykk på <IOSShareIcon /> nederst på skjermen. Scroll litt ned i menyen som kommer opp og velg <b><IOSPlusIcon />Legg til på hjemskjermen</b>. Ser du ikke <IOSShareIcon />? Prøv å scrolle opp og ned på skjermen for å få menylinja til å vises.
</div>);
}
else if(mode === "samsung")
{
components.push(<div key="samsung-android-instructions">
For å installere Pleiar.no som app, trykk på <IOSPlusIcon /> i adresselinja øverst på skjermen.<br /><br />
Samsung Internett støtter app-installasjon kun hvis den er installert fra Galaxy Apps. Hvis du ikke får opp <IOSPlusIcon /> knappen, prøv å bruke en annen nettleser som f.eks. <ExternalLink href="https://play.google.com/store/apps/details?id=com.android.chrome">Chrome</ExternalLink> eller <ExternalLink href="https://play.google.com/store/apps/details?id=org.mozilla.firefox">Firefox</ExternalLink>.
</div>);
}
else if(mode === "facebook-android" || mode === "facebook-ios" || mode === "android-webview")
{
renderAppInfoBlurb = false;
let openIn: string = "";
let name: string = "Facebook-vindu";
let nameFrom: string = "Facebook-vinduet";
if(mode === "facebook-android" || mode === "android-webview")
{
openIn = '"Åpne med Chrome" (eller "Åpne med Firefox", "Åpne med nettleser" eller lignende)';
if(mode === "android-webview")
{
name = "begrenset nettleser-vindu";
nameFrom = "begrensede nettleser-vinduer";
}
}
else Eif(mode === "facebook-ios")
{
openIn = '"Åpne med Safari"';
}
components.push(<div key="facebook-iab-instructions">
Du har pleiar.no åpent i et {name}. Det er desverre ikke mulig å installere apper fra {nameFrom}. Trykk på <FBMoreDots /> oppe til høyre og velg {openIn}. I vinduet som kommer opp kan du velge å installere appen.
</div>);
}
else if(mode === "chrome" && !appInstall.canInstallWithAppInstallEvent())
{
components.push(<div key="chrome-problem">
<b>En feil oppstod</b> under forsøket på å installere appen.
Dette kan bety at appen allerede er installert.<br /><br />
Hvis appen <i>ikke</i> er installert kan du installere den
manuelt ved å trykke på <OperaMoreDots /> øvers på skjermen (du
må kanskje scrolle opp for at knappen skal bli synlig) for så å
velge «Legg til på hjemskjermen».<br /><br />
Hvis du fremdeles ikke får installert appen, ta kontakt
med oss på <ExternalLink sameWindow={true}
href="mailto:kontakt@pleiar.no">e-post
(kontakt@pleiar.no)</ExternalLink> så skal vi feilsøke problemet.
</div>);
}
else if(mode === "opera")
{
components.push(<div key="opera-instructions">
For å installere Pleiar.no som app, scroll opp for å få adresselinja til å bli synlig. Trykk så på <OperaMoreDots /> øverst på skjermen og velg «Legg til på > Startskjerm».
</div>);
}
else
{
return <Redirect to="/" />;
}
if(renderAppInfoBlurb)
{
components.push(<div key="blurb" className="mt-2">
Appversjonen av Pleiar.no fungerer uansett om du har internett eller ikke, og oppdaterer seg selv.
</div>);
}
return components;
}
}
/**
* Root of the about component.
*/
class About extends React.PureComponent<{|match: RouterMatch|}>
{
// eslint-disable-next-line require-jsdoc
render(): React.Node
{
const match = this.props.match;
return <MainContainer app="about" small={true}>
<Switch>
<Route path={match.path} exact render={ () => { return <AboutPleiarNo />; }} />
<Route path={match.path+'/personvern'} render={() => {return <AboutPrivacy />; }} />
<Route path={match.path+'/friprogramvare'} render={() => {return <AboutFreeSoftware />; }} />
<Route path={match.path+'/system'} render={() => {return <AboutSystem />; }} />
<Route path={match.path+'/flerefagtilbud'} render={ () => { return <OtherFFResources />; }} />
<Route path={match.path+'/app'} render={ () => { return <InstallApp />; }} />
<Handle404 />
</Switch>
</MainContainer>;
}
}
// Test-only exports
export { AboutPrivacy, AboutFreeSoftware, AboutPleiarNo, About, AboutSystem, InstallApp };
// Public exports
export default About;
|