Browse Source

New webpack project to generate a static website

transifex
Nicolas Pomepuy 4 years ago
parent
commit
40b05d1f13
  1. 1
      buildsystem/network-sharing-server/.gitignore
  2. BIN
      buildsystem/network-sharing-server/asset/resource/android-chrome-192x192.png
  3. BIN
      buildsystem/network-sharing-server/asset/resource/android-chrome-512x512.png
  4. BIN
      buildsystem/network-sharing-server/asset/resource/apple-touch-icon.png
  5. BIN
      buildsystem/network-sharing-server/asset/resource/favicon-16x16.png
  6. BIN
      buildsystem/network-sharing-server/asset/resource/favicon-32x32.png
  7. BIN
      buildsystem/network-sharing-server/asset/resource/favicon.ico
  8. BIN
      buildsystem/network-sharing-server/asset/resource/icon.png
  9. 1
      buildsystem/network-sharing-server/asset/static/site.webmanifest
  10. 28
      buildsystem/network-sharing-server/asset/templates/log_template-mat.html.temp
  11. 115
      buildsystem/network-sharing-server/html/index.html
  12. 12
      buildsystem/network-sharing-server/js/app.js
  13. 10122
      buildsystem/network-sharing-server/package-lock.json
  14. 32
      buildsystem/network-sharing-server/package.json
  15. 85
      buildsystem/network-sharing-server/scss/app.scss
  16. 10
      buildsystem/network-sharing-server/scss/my-theme.scss
  17. 73
      buildsystem/network-sharing-server/webpack.config.js

1
buildsystem/network-sharing-server/.gitignore

@ -0,0 +1 @@
node_modules

BIN
buildsystem/network-sharing-server/asset/resource/android-chrome-192x192.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
buildsystem/network-sharing-server/asset/resource/android-chrome-512x512.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
buildsystem/network-sharing-server/asset/resource/apple-touch-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
buildsystem/network-sharing-server/asset/resource/favicon-16x16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

BIN
buildsystem/network-sharing-server/asset/resource/favicon-32x32.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
buildsystem/network-sharing-server/asset/resource/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
buildsystem/network-sharing-server/asset/resource/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

1
buildsystem/network-sharing-server/asset/static/site.webmanifest

@ -0,0 +1 @@
{"name":"","short_name":"","icons":[{"src":"images/android_chrome_192.png","sizes":"192x192","type":"image/png"},{"src":"images/android_chrome_512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}

28
buildsystem/network-sharing-server/asset/templates/log_template-mat.html.temp

@ -0,0 +1,28 @@
<!--
- *************************************************************************
- log_template-mat.html.temp
- **************************************************************************
- Copyright © 2022 VLC authors and VideoLAN
- Author: Nicolas POMEPUY
- 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 2 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- ***************************************************************************
-
-
-->
<tr class="mdc-data-table__row">
<th class="mdc-data-table__cell" scope="row">%%FILE_NAME_SHORT%%</th>
<td class="mdc-data-table__cell"><a href="download?file=%%FILE_NAME%%"><button class="material-icons mdc-icon-button" aria-label="download">download</button></a></td>
</tr>

115
buildsystem/network-sharing-server/html/index.html

@ -0,0 +1,115 @@
<!--
~ *************************************************************************
~ index.html
~ **************************************************************************
~ Copyright © 2022 VLC authors and VideoLAN
~ Author: Nicolas POMEPUY
~ 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 2 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, write to the Free Software
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
~ ***************************************************************************
~
~
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>{%ns_network_sharing%}</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="apple-touch-icon" sizes="180x180" href="images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<script src="style-bundle.js"></script>
</head>
<body>
<main>
<header class="mdc-top-app-bar">
<div class="mdc-top-app-bar__row">
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
<button class="material-icons mdc-top-app-bar__navigation-icon mdc-icon-button" aria-label="Open navigation menu">
<div class="mdc-icon-button__ripple"></div>
menu
</button>
<a href="http://www.videolan.org" target="_blank">
<img class="mdc-top-app-bar__navigation-icon" aria-label="Open navigation menu"
src="images/icon.png" />
</a>
<span class="mdc-top-app-bar__title">{%ns_network_sharing%}</span>
</section>
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" role="toolbar">
<button class="material-icons mdc-top-app-bar__action-item mdc-icon-button"
aria-label="Options"><div class="mdc-icon-button__ripple"></div>more_vert
</button>
</section>
</div>
</header>
<main class="mdc-top-app-bar--fixed-adjust">
<div class="mdc-layout-grid">
<div class="mdc-layout-grid__inner">
<div class="mdc-layout-grid__cell"></div>
<div class="mdc-layout-grid__cell">
<div class="mdc-data-table">
<div class="mdc-data-table__table-container">
<table class="mdc-data-table__table" aria-label="Dessert calories">
<thead>
<tr class="mdc-data-table__header-row">
<th class="mdc-data-table__header-cell" role="columnheader" scope="col">
{%ns_log_file%}
</th>
<th class="mdc-data-table__header-cell mdc-data-table__header-cell--numeric"
role="columnheader" scope="col">{%download_on_device%}
</th>
</tr>
</thead>
<tbody class="mdc-data-table__content">
{*logs*}
</tbody>
</table>
</div>
</div>
</div>
<div class="mdc-layout-grid__cell"></div>
</div>
</div>
</main>
<footer class="footer">
<div class="footer__content">
<p class="mdc-typography--body1">VLC for Android is free, open-source software published by
<a href="http://www.videolan.org" target="_blank">VideoLAN</a>. <br />Modification
and redistribution is subject to both the <a href="http://opensource.org/licenses/GPL-2.0"
target="_blank">GPLv2 (or
later)</a> and the <a href="http://opensource.org/licenses/MPL-2.0" target="_blank">MPLv2</a> as
well as further rights
reserved by the VideoLAN non-profit organization.<br />You can find more information
about licensing in the About dialog within the app.<br />VideoLAN, VLC and VLC media
player are internationally registered trademarks of the <a href="http://www.videolan.org/videolan/"
target="_blank">VideoLAN non-profit
organization</a>.
</p>
</div>
</footer>
</main>
<link rel="stylesheet" href="bundle.css">
</body>
</html>

12
buildsystem/network-sharing-server/js/app.js

@ -0,0 +1,12 @@
import {MDCRipple} from '@material/ripple';
import {MDCTopAppBar} from '@material/top-app-bar';
import {MDCDataTable} from '@material/data-table';
import icon from "../asset/resource/icon.png"
import android_chrome_192 from "../asset/resource/android-chrome-192x192.png"
import android_chrome_512 from "../asset/resource/android-chrome-512x512.png"
import favicon from "../asset/resource/favicon.ico"
import favicon_16 from "../asset/resource/favicon-16x16.png"
import favicon_32 from "../asset/resource/favicon-32x32.png"
import index from "../html/index.html"

10122
buildsystem/network-sharing-server/package-lock.json

File diff suppressed because it is too large

32
buildsystem/network-sharing-server/package.json

@ -0,0 +1,32 @@
{
"name": "vlc-android-network-sharing-server",
"version": "1.0.0",
"description": "VLC for Android network sharing server",
"main": "index.js",
"author": "VideoLAN",
"license": "LGPL-3.0-or-later",
"scripts": {
"build": "webpack",
"start": "webpack-dev-server"
},
"devDependencies": {
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"extract-loader": "^5.1.0",
"file-loader": "^6.2.0",
"html-loader": "^4.2.0",
"sass": "^1.53.0",
"sass-loader": "^13.0.2",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1"
},
"dependencies": {
"@material/button": "^14.0.0",
"@material/data-table": "^14.0.0",
"@material/icon-button": "^14.0.0",
"@material/layout-grid": "^14.0.0",
"@material/top-app-bar": "^14.0.0",
"@material/typography": "^14.0.0"
}
}

85
buildsystem/network-sharing-server/scss/app.scss

@ -0,0 +1,85 @@
@use "@material/theme" with (
$primary: #ff610a,
$secondary: #ff610a,
$on-primary: #ffffff,
$on-secondary: #ffffff,
$background: #ff0000,
);
@use "@material/top-app-bar/mdc-top-app-bar";
@use "@material/button/styles";
@use "@material/button";
@use "@material/data-table/data-table";
@use "@material/layout-grid/mdc-layout-grid";
@use "@material/icon-button";
@use "@material/typography";
@import "my-theme";
@import "@material/icon-button/mdc-icon-button";
@include data-table.core-styles;
@include data-table.theme-baseline;
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre,
form, fieldset, input, textarea, p, blockquote, th, td, nav, header, footer {
margin: 0;
padding: 0;
}
main {
min-height: calc(100vh - var(--navbar-height));
display:flex;
flex-direction:column;
justify-content:space-between;
}
:root {
--footer-height: 40px;
}
.footer {
background-color: $mdc-theme-primary;
padding: 8px;
position: fixed;
bottom : 0;
left : 0;
right : 0;
height: var(--navbar-height);
color: #fff;
color: var(--mdc-theme-on-primary, #fff);
}
// This sets all <h1>,...,<h6> elements with Material headline1,...,headline6 typography styles
// Check out the MDC Web documentation for how to use MDC Typography Sass mixins:
// https://github.com/material-components/material-components-web/tree/master/packages/mdc-typography
body {
background: $mdc-theme--background;
color: $mdc-theme-on-surface;
}
h1 {
@include typography.typography(headline1);
}
h2 {
@include typography.typography(headline2);
}
h3 {
@include typography.typography(headline3);
}
h4 {
@include typography.typography(headline4);
}
h5 {
@include typography.typography(headline5);
}
h6 {
@include typography.typography(headline6);
}
// This sets all <p> elements with Material body1 typography styles
p {
@include typography.typography(body1);
}

10
buildsystem/network-sharing-server/scss/my-theme.scss

@ -0,0 +1,10 @@
// Material Theming
@import url('https://fonts.googleapis.com/css?family=Fira+Sans&display=swap');
$mdc-typography-family: 'Fira Sans';
$mdc-theme-primary: #ff610a;
$mdc-theme-on-primary: #ffffff;
$mdc-theme-surface: #222222;
$mdc-theme--background: #222222;
$mdc-theme-on-surface: #ffffff;

73
buildsystem/network-sharing-server/webpack.config.js

@ -0,0 +1,73 @@
var path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = [{
mode: "production",
entry: ['./scss/app.scss', './js/app.js'],
output: {
// This is necessary for webpack to compile
// But we never use style-bundle.js
filename: 'style-bundle.js',
path: path.join(__dirname, "../../application/vlc-android/assets/web/public"),
assetModuleFilename: 'images/[name][ext]'
},
plugins: [
new CopyPlugin({
patterns: [
{ from: "asset/static", to: "" },
{ from: "asset/templates", to: "" },
],
}),
],
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: 'file-loader',
options: {
name: 'bundle.css',
},
},
{
loader: "extract-loader",
options: {
publicPath: path.join(__dirname, "public"),
}
},
{
loader: 'css-loader',
options: {
url: false
}
},
{
loader: 'sass-loader',
options: {
// Prefer Dart Sass
implementation: require('sass'),
// See https://github.com/webpack-contrib/sass-loader/issues/804
webpackImporter: false,
sassOptions: {
includePaths: ['./node_modules']
},
}
}
]
},
{
test: /\.html$/i,
type: 'asset/resource',
generator: {
filename: '[name][ext]'
}
},
{
test: /\.(png|svg|jpg|jpeg|gif|ico)$/i,
type: 'asset/resource',
},
]
},
}];
Loading…
Cancel
Save