Skip to content

Commit

Permalink
Merge pull request #94 from sfeir-open-source/feat/88-remove-fontawesome
Browse files Browse the repository at this point in the history
feat: #88 remove fontawesome
Closes #88
  • Loading branch information
GildasMorel authored Oct 8, 2020
2 parents 49964f8 + cdfcc16 commit 1ba650c
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 102 deletions.
1 change: 0 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"module-resolver",
{
"alias": {
"@src": "./src",
"@event-bus": "./src/common/event-bus",
"@services": "./src/common/services",
"@client": "./src/client",
Expand Down
1 change: 0 additions & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"target": "es2020",
"baseUrl": ".",
"paths": {
"@src/*": ["src/*"],
"@event-bus/*": ["src/common/event-bus/*"],
"@services/*": ["src/common/services/*"],
"@client/*": ["src/client/*"],
Expand Down
5 changes: 0 additions & 5 deletions package-lock.json

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

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
"clean": "rm -rf .cache dist",
"create-tunnels": "node src/environment/create-tunnels",
"get-started": "node src/environment/get-started",
"start": "npx npm-run-all --parallel create-tunnels tc-server tc-showcase start-controller-after-server when-controller-is-started",
"start": "npx npm-run-all --parallel create-tunnels tc-server tc-showcase start-controller-after-server when-controller-is-started",
"start-controller-after-server": "wait-on tcp:3001 && wait-on tcp:3002 && npm run tc-controller-and-component",
"when-controller-is-started": "wait-on tcp:3000 && npm run get-started",
"build": "npx npm-run-all --parallel build-*",
"test": "npx mocha",
"coverage": "npx nyc npm test",
"lint": "eslint --fix . --cache",
Expand Down Expand Up @@ -106,7 +105,6 @@
}
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.1",
"@webcomponents/webcomponentsjs": "^2.4.3",
"bulma": "^0.9.0",
"colors": "^1.4.0",
Expand All @@ -125,7 +123,6 @@
"wait-on": "^4.0.2"
},
"_moduleAliases": {
"@src": "src",
"@event-bus": "src/common/event-bus",
"@services": "src/common/services",
"@client": "src/client",
Expand Down
8 changes: 4 additions & 4 deletions src/client/layouts/on-stage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
require('./index.css');
require('bulma/css/bulma.min.css');
require('lit-fontawesome/css/font.css');
require('../../web-components/slide-view/slide-view.js');
require('../../web-components/clock/clock.js');
require('../../web-components/menu-navigation/menu-navigation.js');
require('../../web-components/menu-plugins/menu-plugins.js');
require('@client/web-components/slide-view/slide-view.js');
require('@client/web-components/clock/clock.js');
require('@client/web-components/menu-navigation/menu-navigation.js');
require('@client/web-components/menu-plugins/menu-plugins.js');

import { TCController } from '@client/tc-controller/tc-controller.js';
import config from '@config/config.json';
Expand Down
18 changes: 9 additions & 9 deletions src/client/layouts/presenter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
require('./index.css');
require('bulma/css/bulma.min.css');
require('lit-fontawesome/css/font.css');
require('../../web-components/slide-view/slide-view.js');
require('../../web-components/url-form/url-form.js');
require('../../web-components/clock/clock.js');
require('../../web-components/timer/timer.js');
require('../../web-components/notes/notes.js');
require('../../web-components/menu-navigation/menu-navigation.js');
require('../../web-components/menu-plugins/menu-plugins.js');
require('../../../plugins/input/touch-pointer/components/touch-pointer-settings.js');
require('../../../plugins/input/touch-pointer/components/touch-pointer-mask.js');
require('@client/web-components/slide-view/slide-view.js');
require('@client/web-components/url-form/url-form.js');
require('@client/web-components/clock/clock.js');
require('@client/web-components/timer/timer.js');
require('@client/web-components/notes/notes.js');
require('@client/web-components/menu-navigation/menu-navigation.js');
require('@client/web-components/menu-plugins/menu-plugins.js');
require('@plugins/input/touch-pointer/components/touch-pointer-settings.js');
require('@plugins/input/touch-pointer/components/touch-pointer-mask.js');

import { TCController } from '@client/tc-controller/tc-controller.js';
import config from '@config/config.json';
Expand Down
63 changes: 2 additions & 61 deletions src/client/tc-controller/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,68 +20,9 @@ <h1 class="title">
<h2 class="subtitle">
Choose a view
</h2>
<div class="columns">
<div class="column is-one-fifth">
<a href="on-stage.html">
<div id="onStageButton" class="card">
<div class="card-content has-text-centered">
<p class="title">
<i class="fas fa-chalkboard"></i>
</p>
<p class="subtitle">
Stage view
</p>
</div>
</div>
</a>
</div>
<div class="column is-one-fifth is-hidden-tablet">
<!-- Mobile version -->
<a href="presenter-mobile.html">
<div class="card">
<div class="card-content has-text-centered" onclick="window.location.href = '../layouts/presenter/presenter-mobile.html'">
<p class="title">
<i class="fas fa-chalkboard-teacher"></i>
</p>
<p class="subtitle">
Presenter view
</p>
</div>
</div>
</a>
</div>
<div class="column is-one-fifth is-hidden-mobile">
<!-- Desktop version -->
<a href="presenter.html">
<div class="card">
<div class="card-content has-text-centered" onclick="window.location.href = '../layouts/presenter/presenter.html'">
<p class="title">
<i class="fas fa-chalkboard-teacher"></i>
</p>
<p class="subtitle">
Presenter view
</p>
</div>
</div>
</a>
</div>
</div>
<tc-view-selector></tc-view-selector>
<br /><br />
<div id="qrCodeSection">
<h2 class="subtitle">
Or take control from another device
</h2>
<div class="columns">
<div class="column is-one-third">
<div class="card">
<div class="card-content has-text-centered">
<canvas id="qrCode" aria-label="Use this QRCode to connect to TalkControl from your mobile"></canvas><br />
<span id="textCode"></span>
</div>
</div>
</div>
</div>
</div>
<tc-remote-control></tc-remote-control>
</div>
</div>
</section>
Expand Down
18 changes: 4 additions & 14 deletions src/client/tc-controller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@

require('./index.css');
require('bulma/css/bulma.min.css');
require('@fortawesome/fontawesome-free/js/all.min.js');
require('../web-components/url-form/url-form.js');

import config from '@config/config.json';
const QRCode = require('qrcode');
require('lit-fontawesome/css/font.css');
require('@client/web-components/url-form/url-form.js');
require('@client/web-components/view-selector/view-selector');
require('@client/web-components/remote-control/remote-control');

window.addEventListener('DOMContentLoaded', function() {
if (config.tcController.urls.external) {
QRCode.toCanvas(document.getElementById('qrCode'), config.tcController.urls.external);
document.getElementById(
'textCode'
).innerHTML = `<a href="${config.tcController.urls.external}" title="Use this url to connect to TalkControl from another device">${config.tcController.urls.external}</a>`;
} else {
document.getElementById('qrCodeSection').classList.add('is-hidden');
}

document.querySelector('tc-url-form').classList.remove('is-hidden');

addEventListener('url-form-editing', () => {
Expand Down
59 changes: 59 additions & 0 deletions src/client/web-components/remote-control/remote-control.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import '@webcomponents/webcomponentsjs/webcomponents-loader';
import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter';
import { bulmaStyles } from '@granite-elements/granite-lit-bulma/granite-lit-bulma';
import { LitElement, html } from 'lit-element';
import Fontawesome from 'lit-fontawesome';
import config from '@config/config.json';
const QRCode = require('qrcode');

class RemoteControl extends LitElement {
static get properties() {
return {};
}

static get styles() {
return [
bulmaStyles,
Fontawesome
];
}

constructor() {
super();
}

firstUpdated() {
super.firstUpdated();

if (config.tcController.urls.external) {
QRCode.toCanvas(this.shadowRoot.getElementById('qrCode'), config.tcController.urls.external);
this.shadowRoot.getElementById(
'textCode'
).innerHTML = `<a href="${config.tcController.urls.external}" title="Use this url to connect to TalkControl from another device">${config.tcController.urls.external}</a>`;
} else {
this.shadowRoot.getElementById('qrCodeSection').classList.add('is-hidden');
}
}

render() {
return html`
<div id="qrCodeSection">
<h2 class="subtitle">
Or take control from another device
</h2>
<div class="columns">
<div class="column is-one-third">
<div class="card">
<div class="card-content has-text-centered">
<canvas id="qrCode" aria-label="Use this QRCode to connect to TalkControl from your mobile"></canvas><br />
<span id="textCode"></span>
</div>
</div>
</div>
</div>
</div>
`;
}
}

customElements.define('tc-remote-control', RemoteControl);
79 changes: 79 additions & 0 deletions src/client/web-components/view-selector/view-selector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import '@webcomponents/webcomponentsjs/webcomponents-loader';
import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter';
import { bulmaStyles } from '@granite-elements/granite-lit-bulma/granite-lit-bulma';
import { LitElement, html } from 'lit-element';
import Fontawesome from 'lit-fontawesome';

class ViewSelector extends LitElement {
static get properties() {
return {};
}

static get styles() {
return [
bulmaStyles,
Fontawesome
];
}

constructor() {
super();
}

firstUpdated() {
super.firstUpdated();
}

render() {
return html`
<div class="columns">
<div class="column is-one-fifth">
<a href="on-stage.html">
<div id="onStageButton" class="card">
<div class="card-content has-text-centered">
<p class="title">
<i class="fas fa-chalkboard"></i>
</p>
<p class="subtitle">
Stage view
</p>
</div>
</div>
</a>
</div>
<div class="column is-one-fifth is-hidden-tablet">
<!-- Mobile version -->
<a href="presenter-mobile.html">
<div class="card">
<div class="card-content has-text-centered" onclick="window.location.href = 'presenter-mobile.html'">
<p class="title">
<i class="fas fa-chalkboard-teacher"></i>
</p>
<p class="subtitle">
Presenter view
</p>
</div>
</div>
</a>
</div>
<div class="column is-one-fifth is-hidden-mobile">
<!-- Desktop version -->
<a href="presenter.html">
<div class="card">
<div class="card-content has-text-centered" onclick="window.location.href = 'presenter.html'">
<p class="title">
<i class="fas fa-chalkboard-teacher"></i>
</p>
<p class="subtitle">
Presenter view
</p>
</div>
</div>
</a>
</div>
</div>
`;
}
}

customElements.define('tc-view-selector', ViewSelector);
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ module.exports = {
},
resolve: {
alias: {
'@config': path.resolve(__dirname, './config/'),
'@client': path.resolve(__dirname, './src/client/'),
'@event-bus': path.resolve(__dirname, './src/common/event-bus/'),
'@services': path.resolve(__dirname, './src/common/services/'),
'@plugins': path.resolve(__dirname, './src/plugins/')
'@client': path.resolve(__dirname, './src/client/'),
'@plugins': path.resolve(__dirname, './src/plugins/'),
'@config': path.resolve(__dirname, './config/')
},
extensions: ['.js', '.json']
},
Expand Down

0 comments on commit 1ba650c

Please sign in to comment.