Compare commits
5 Commits
05e9a05c5e
...
9bdea31ee8
Author | SHA1 | Date |
---|---|---|
|
9bdea31ee8 | |
|
c170e69d9b | |
|
449bec0bb4 | |
|
673b293891 | |
|
dc3dbb9f64 |
|
@ -0,0 +1,11 @@
|
||||||
|
# editorconfig.org
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
|
@ -0,0 +1 @@
|
||||||
|
node_modules
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"commonjs": true,
|
||||||
|
"es6": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"globals": {
|
||||||
|
"bootstrap": "readonly"
|
||||||
|
},
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2018,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"no-console": 0,
|
||||||
|
"quotes": ["error", "single"],
|
||||||
|
"comma-dangle": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"arrays": "always-multiline",
|
||||||
|
"objects": "always-multiline",
|
||||||
|
"imports": "always-multiline",
|
||||||
|
"exports": "always-multiline",
|
||||||
|
"functions": "ignore"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
node_modules
|
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
"extends": "stylelint-config-standard-scss",
|
||||||
|
"rules": {
|
||||||
|
"no-empty-source": null,
|
||||||
|
"scss/comment-no-empty": null,
|
||||||
|
"max-line-length": null,
|
||||||
|
"scss/at-extend-no-missing-placeholder": null,
|
||||||
|
"scss/dollar-variable-colon-space-after": null,
|
||||||
|
"scss/dollar-variable-empty-line-before": null,
|
||||||
|
"media-feature-range-notation": null,
|
||||||
|
"color-function-notation": null,
|
||||||
|
"alpha-value-notation": null,
|
||||||
|
"selector-id-pattern": null,
|
||||||
|
"selector-class-pattern": null,
|
||||||
|
"scss/no-global-function-names": null,
|
||||||
|
"number-max-precision": null,
|
||||||
|
"hue-degree-notation": null,
|
||||||
|
"value-no-vendor-prefix": null,
|
||||||
|
"property-no-vendor-prefix": null,
|
||||||
|
"at-rule-no-unknown": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"ignoreAtRules": [
|
||||||
|
"extend",
|
||||||
|
"at-root",
|
||||||
|
"debug",
|
||||||
|
"warn",
|
||||||
|
"error",
|
||||||
|
"if",
|
||||||
|
"else",
|
||||||
|
"for",
|
||||||
|
"each",
|
||||||
|
"while",
|
||||||
|
"mixin",
|
||||||
|
"include",
|
||||||
|
"content",
|
||||||
|
"return",
|
||||||
|
"function",
|
||||||
|
"tailwind",
|
||||||
|
"apply",
|
||||||
|
"responsive",
|
||||||
|
"variants",
|
||||||
|
"screen"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
10
README.md
10
README.md
|
@ -38,10 +38,20 @@ Le logiciel est grandement inspiré de l'outil [signaturepdf](https://github.com
|
||||||
## Technologies
|
## Technologies
|
||||||
|
|
||||||
Le projet utilise :
|
Le projet utilise :
|
||||||
|
- [Node](https://nodejs.org/fr) pour le téléchargement des dépendances avec [NPM](https://www.npmjs.com/)
|
||||||
- [Hugo](https://gohugo.io/) pour la génération du site statique ainsi que son déploiement
|
- [Hugo](https://gohugo.io/) pour la génération du site statique ainsi que son déploiement
|
||||||
- [Bootstrap](https://getbootstrap.com/) pour le design du site (MIT)
|
- [Bootstrap](https://getbootstrap.com/) pour le design du site (MIT)
|
||||||
- [PDF.js](https://mozilla.github.io/pdf.js/) pour le rendu des PDFs (Apache-2.0)
|
- [PDF.js](https://mozilla.github.io/pdf.js/) pour le rendu des PDFs (Apache-2.0)
|
||||||
|
|
||||||
|
## Commandes
|
||||||
|
|
||||||
|
Il faut avoir Node.js (dernière LTS) d'installé sur son ordinateur pour importer les dépendances et lancer la construction du site.
|
||||||
|
|
||||||
|
- Installation des dépendances : `npm install`
|
||||||
|
- Lancement du site en mode développement : `npm run start`
|
||||||
|
- Lancement des tests : `npm run test`
|
||||||
|
- Construction du site : `npm run build`
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Logiciel libre sous license AGPL V3
|
Logiciel libre sous license AGPL V3
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const pdfFileField = document.getElementById("pdfFile")
|
const pdfFileField = document.getElementById('pdfFile')
|
||||||
const pdfModal = document.getElementById("pdfModal")
|
const pdfModal = document.getElementById('pdfModal')
|
||||||
const pdfModalLabel = document.getElementById("pdfModalLabel")
|
const pdfModalLabel = document.getElementById('pdfModalLabel')
|
||||||
const pdfModalContent = document.getElementById("pdfModalContent")
|
const pdfModalContent = document.getElementById('pdfModalContent')
|
||||||
|
|
||||||
// FILE
|
// FILE
|
||||||
|
|
||||||
|
@ -10,11 +10,11 @@ function pdfFileGetName() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function pdfFileClear() {
|
function pdfFileClear() {
|
||||||
pdfFileField.value = ""
|
pdfFileField.value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
async function pdfFileToBlob() {
|
async function pdfFileToBlob() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve) => {
|
||||||
const fr = new FileReader()
|
const fr = new FileReader()
|
||||||
const file = pdfFileField.files[0]
|
const file = pdfFileField.files[0]
|
||||||
fr.readAsArrayBuffer(file)
|
fr.readAsArrayBuffer(file)
|
||||||
|
@ -30,12 +30,12 @@ async function pdfFileToBlob() {
|
||||||
function pdfModalShow() {
|
function pdfModalShow() {
|
||||||
pdfModalLabelUpdate();
|
pdfModalLabelUpdate();
|
||||||
pdfModalContentclear()
|
pdfModalContentclear()
|
||||||
new bootstrap.Modal("#pdfModal").show()
|
new bootstrap.Modal('#pdfModal').show()
|
||||||
pdfModalContentLoad()
|
pdfModalContentLoad()
|
||||||
}
|
}
|
||||||
|
|
||||||
function pdfModalContentclear() {
|
function pdfModalContentclear() {
|
||||||
pdfModalContent.innerHTML = ""
|
pdfModalContent.innerHTML = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
async function pdfModalContentLoad() {
|
async function pdfModalContentLoad() {
|
||||||
|
@ -69,7 +69,7 @@ async function pdfModalContentLoad() {
|
||||||
// Render PDF page into canvas context
|
// Render PDF page into canvas context
|
||||||
var renderContext = {
|
var renderContext = {
|
||||||
canvasContext: context,
|
canvasContext: context,
|
||||||
viewport: viewport
|
viewport: viewport,
|
||||||
};
|
};
|
||||||
var renderTask = page.render(renderContext);
|
var renderTask = page.render(renderContext);
|
||||||
renderTask.promise.then(function () {
|
renderTask.promise.then(function () {
|
||||||
|
@ -92,11 +92,11 @@ function pdfModalLabelUpdate() {
|
||||||
// START
|
// START
|
||||||
|
|
||||||
async function start() {
|
async function start() {
|
||||||
pdfFileField.addEventListener('change', async function(event) {
|
pdfFileField.addEventListener('change', async function() {
|
||||||
pdfModalShow()
|
pdfModalShow()
|
||||||
})
|
})
|
||||||
|
|
||||||
pdfModal.addEventListener('hidden.bs.modal', event => {
|
pdfModal.addEventListener('hidden.bs.modal', () => {
|
||||||
pdfFileClear()
|
pdfFileClear()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ body {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-bottom-color: #fff;
|
border-bottom-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bd-placeholder-img {
|
.bd-placeholder-img {
|
||||||
font-size: 1.125rem;
|
font-size: 1.125rem;
|
||||||
text-anchor: middle;
|
text-anchor: middle;
|
||||||
|
@ -78,7 +79,7 @@ body {
|
||||||
|
|
||||||
.bi {
|
.bi {
|
||||||
vertical-align: -.125em;
|
vertical-align: -.125em;
|
||||||
fill: currentColor;
|
fill: currentcolor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-scroller {
|
.nav-scroller {
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
{{ $defaultLanguage := (index (first 1 (where site.Home.AllTranslations "Permalink" .Permalink)) 0).Language.Lang }}
|
||||||
|
<html lang="{{ $defaultLanguage }}">
|
||||||
|
<head>
|
||||||
|
<title>{{ i18n "title" }}</title>
|
||||||
|
<meta name="description" content="{{ i18n "description" }}">
|
||||||
|
<link rel="canonical" href="{{ .Permalink }}"/>
|
||||||
|
<meta name="robots" content="noindex">
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<noscript>
|
||||||
|
<meta http-equiv="refresh" content="0; url={{ .Permalink }}"/>
|
||||||
|
</noscript>
|
||||||
|
<script>
|
||||||
|
;(function () {
|
||||||
|
// Only do i18n at root,
|
||||||
|
// otherwise, redirect immediately
|
||||||
|
if (window.location.pathname !== '/') {
|
||||||
|
window.location.replace('{{ .Permalink }}')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var getFirstBrowserLanguage = function () {
|
||||||
|
var nav = window.navigator,
|
||||||
|
browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'],
|
||||||
|
i,
|
||||||
|
language
|
||||||
|
|
||||||
|
if (Array.isArray(nav.languages)) {
|
||||||
|
for (i = 0; i < nav.languages.length; i++) {
|
||||||
|
language = nav.languages[i]
|
||||||
|
if (language && language.length) {
|
||||||
|
return language
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// support for other well known properties in browsers
|
||||||
|
for (i = 0; i < browserLanguagePropertyKeys.length; i++) {
|
||||||
|
language = nav[browserLanguagePropertyKeys[i]]
|
||||||
|
if (language && language.length) {
|
||||||
|
return language
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return '{{ $defaultLanguage }}'
|
||||||
|
}
|
||||||
|
|
||||||
|
var preferLang = getFirstBrowserLanguage()
|
||||||
|
{{ range $index, $elem := site.Home.AllTranslations }}
|
||||||
|
{{ if ne $index 0 }}else {{end}}if (preferLang.indexOf('{{ $elem.Lang }}') !== -1) {
|
||||||
|
window.location.replace('{{ $elem.Permalink }}')
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
|
else {
|
||||||
|
{{- range site.Home.AllTranslations -}}
|
||||||
|
{{- if eq $defaultLanguage .Lang }}
|
||||||
|
window.location.replace('{{ .Permalink }}')
|
||||||
|
{{ end -}}
|
||||||
|
{{ end -}}
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>{{ i18n "title" }}</h1>
|
||||||
|
<p>You should be rerouted in a jiff, if not, <a href="{{ .Permalink }}">click here</a>.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
File diff suppressed because it is too large
Load Diff
23
package.json
23
package.json
|
@ -5,19 +5,34 @@
|
||||||
"author": "Weko",
|
"author": "Weko",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"prebuild": "npm run clean",
|
||||||
|
"build": "node_modules/.bin/hugo/hugo --gc --minify",
|
||||||
|
"prestart": "npm run clean",
|
||||||
|
"start": "node_modules/.bin/hugo/hugo server --bind=0.0.0.0 --disableFastRender",
|
||||||
|
"clean": "rm -rf public resources",
|
||||||
|
"lint": "npm run -s lint:scripts && npm run -s lint:styles",
|
||||||
|
"lint:scripts": "eslint assets/scripts",
|
||||||
|
"lint:styles": "stylelint \"assets/styles/**/*.{css,sass,scss,sss,less}\"",
|
||||||
|
"test": "npm run -s lint",
|
||||||
|
"postinstall": "hugo-installer --version otherDependencies.hugo --extended --destination node_modules/.bin/hugo"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"devDependencies": {
|
||||||
"@fullhuman/postcss-purgecss": "^5.0.0",
|
"@fullhuman/postcss-purgecss": "^5.0.0",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
"bootstrap": "^5.2.3",
|
"bootstrap": "^5.2.3",
|
||||||
"bootstrap-icons": "^1.10.5",
|
|
||||||
"cssnano": "^6.0.1",
|
"cssnano": "^6.0.1",
|
||||||
"cssnano-preset-advanced": "^6.0.1",
|
"cssnano-preset-advanced": "^6.0.1",
|
||||||
"esbuild": "^0.17.19",
|
"esbuild": "^0.17.19",
|
||||||
|
"eslint": "^8.40.0",
|
||||||
|
"hugo-installer": "^4.0.1",
|
||||||
"pdfjs-dist": "^3.6.172",
|
"pdfjs-dist": "^3.6.172",
|
||||||
"postcss": "^8.4.23",
|
"postcss": "^8.4.23",
|
||||||
"postcss-cli": "^10.1.0"
|
"postcss-cli": "^10.1.0",
|
||||||
|
"stylelint": "^15.6.2",
|
||||||
|
"stylelint-config-standard-scss": "^9.0.0"
|
||||||
|
},
|
||||||
|
"otherDependencies": {
|
||||||
|
"hugo": "0.111.3"
|
||||||
},
|
},
|
||||||
"comments": {
|
"comments": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
Loading…
Reference in New Issue