fix(assets): sync via yarn
This commit is contained in:
parent
09e127a047
commit
25e6710a24
36
.gitignore
vendored
Normal file
36
.gitignore
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
# SPDX-License-Identifier: EUPL-1.2
|
||||
# Authors: see README.md
|
||||
|
||||
# logs
|
||||
*.log
|
||||
|
||||
# Composer
|
||||
vendor/*
|
||||
|
||||
# Node modules
|
||||
node_modules
|
||||
|
||||
# Macintosh OS
|
||||
/.DS_Store
|
||||
|
||||
# Eclipse IDE
|
||||
/.buildpath
|
||||
/.project
|
||||
/.settings/
|
||||
|
||||
# PHPStorm IDE
|
||||
/.idea
|
||||
/**.iml
|
||||
|
||||
# vscode IDE
|
||||
/*.vscode
|
||||
|
||||
# Docker
|
||||
/*.db
|
||||
/docker-compose.local.yml
|
||||
|
||||
# archive files
|
||||
/*.zip
|
||||
/*.bz2
|
||||
/*.gz
|
||||
/archives/
|
13
css/vendor/knacss/LICENSE
vendored
Normal file
13
css/vendor/knacss/LICENSE
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
File diff suppressed because one or more lines are too long
@ -20,11 +20,11 @@
|
||||
<link rel="icon" type="image/x-icon" href="{{ index.favicon ? index.favicon|url : theme_url ~ "/img/favicon.svg" }}" />
|
||||
|
||||
<!-- Core theme CSS -->
|
||||
<link href="{{ theme_url }}/css/knacss.css" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ theme_url }}/css/vendor/knacss/knacss.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ theme_url }}/css/style.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- JS-->
|
||||
<script src="{{ theme_url }}/js/modernizr-3.3.1-custom.min.js" type="text/javascript"></script>
|
||||
<script src="{{ theme_url }}/js/vendor/modernizr/modernizr.min.js" type="text/javascript"></script>
|
||||
<script src="{{ theme_url }}/js/utils.js" type="text/javascript"></script>
|
||||
<script src="{{ theme_url }}/js/pico.js" type="text/javascript"></script>
|
||||
|
||||
|
@ -76,7 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{{ theme_url }}/js/modernizr-3.3.1-custom.min.js" type="text/javascript"></script>
|
||||
<script src="{{ theme_url }}/js/vendor/modernizr/modernizr.min.js" type="text/javascript"></script>
|
||||
<script src="{{ theme_url }}/js/utils.js" type="text/javascript"></script>
|
||||
<script src="{{ theme_url }}/js/pico.js" type="text/javascript"></script>
|
||||
|
||||
|
87
js/extract-files-from-node-modules.js
Normal file
87
js/extract-files-from-node-modules.js
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: EUPL-1.2
|
||||
* Authors: see README.md
|
||||
*/
|
||||
|
||||
// Extract files that we need from the node_modules folder
|
||||
// The extracted files are integrated to the repository, so production server don't need to
|
||||
// have node installed
|
||||
|
||||
// Include fs and path module
|
||||
|
||||
const fs = require('fs-extra')
|
||||
const path = require('path')
|
||||
|
||||
const basePath = path.join(__dirname, '../')
|
||||
|
||||
function copySync(src, dest, opts) {
|
||||
if (fs.existsSync(src)) {
|
||||
fs.copySync(path.join(basePath, src), path.join(basePath, dest), opts)
|
||||
} else {
|
||||
console.log(`${src} is not existing !`)
|
||||
}
|
||||
}
|
||||
|
||||
// function mergeFilesSync(sources, dest) {
|
||||
// const fullDest = path.join(basePath, dest)
|
||||
// if (!fs.existsSync(fullDest)) {
|
||||
// fs.mkdirSync(path.dirname(fullDest), { recursive: true })
|
||||
// } else {
|
||||
// fs.unlinkSync(fullDest)
|
||||
// }
|
||||
// sources.forEach((file) => {
|
||||
// const fullSrc = path.join(basePath, file)
|
||||
// if (!fs.existsSync(fullSrc)) {
|
||||
// console.log(`${fullSrc} is not existing !`)
|
||||
// } else {
|
||||
// fs.appendFileSync(fullDest, fs.readFileSync(fullSrc))
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
// knacss
|
||||
copySync(
|
||||
'node_modules/knacss/css/knacss-mini/knacss.css',
|
||||
'css/vendor/knacss/knacss.min.css',
|
||||
{ overwrite: true }
|
||||
)
|
||||
copySync(
|
||||
'node_modules/knacss/LICENSE',
|
||||
'css/vendor/knacss/LICENSE',
|
||||
{ overwrite: true }
|
||||
)
|
||||
|
||||
// modernizr
|
||||
const modernizr = require("modernizr")
|
||||
|
||||
modernizr.build({
|
||||
"minify": true,
|
||||
"options": [
|
||||
"setClasses"
|
||||
],
|
||||
"feature-detects": [
|
||||
"test/requestanimationframe",
|
||||
"test/css/transitions",
|
||||
"test/dom/classlist"
|
||||
]
|
||||
}, function (result) {
|
||||
let src = 'js/vendor/modernizr'
|
||||
let currentPath = path.join(basePath, src)
|
||||
if (!fs.existsSync(currentPath)) {
|
||||
fs.mkdirSync(currentPath,{recursive :true})
|
||||
}
|
||||
fs.writeFileSync(path.join(currentPath, 'modernizr.min.js'), result);// the build
|
||||
});
|
||||
copySync(
|
||||
'node_modules/modernizr/LICENSE',
|
||||
'js/vendor/modernizr/LICENSE',
|
||||
{ overwrite: true }
|
||||
)
|
||||
|
||||
// example
|
||||
// mergeFilesSync(
|
||||
// [
|
||||
// 'node_modules/file1.js',
|
||||
// 'node_modules/file2.js',
|
||||
// ],
|
||||
// 'javascripts/vendor/output-file.js');
|
3
js/modernizr-3.3.1-custom.min.js
vendored
3
js/modernizr-3.3.1-custom.min.js
vendored
@ -1,3 +0,0 @@
|
||||
/*! modernizr 3.3.1 (Custom Build) | MIT *
|
||||
* https://modernizr.com/download/?-classlist-csstransitions-requestanimationframe !*/
|
||||
!function(e,n,t){function r(e,n){return typeof e===n}function i(){var e,n,t,i,o,s,a;for(var f in y)if(y.hasOwnProperty(f)){if(e=[],n=y[f],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;t<n.options.aliases.length;t++)e.push(n.options.aliases[t].toLowerCase());for(i=r(n.fn,"function")?n.fn():n.fn,o=0;o<e.length;o++)s=e[o],a=s.split("."),1===a.length?Modernizr[a[0]]=i:(!Modernizr[a[0]]||Modernizr[a[0]]instanceof Boolean||(Modernizr[a[0]]=new Boolean(Modernizr[a[0]])),Modernizr[a[0]][a[1]]=i),C.push((i?"":"no-")+a.join("-"))}}function o(e){return e.replace(/([a-z])-([a-z])/g,function(e,n,t){return n+t.toUpperCase()}).replace(/^-/,"")}function s(e,n){return!!~(""+e).indexOf(n)}function a(e,n){return function(){return e.apply(n,arguments)}}function f(e,n,t){var i;for(var o in e)if(e[o]in n)return t===!1?e[o]:(i=n[e[o]],r(i,"function")?a(i,t||n):i);return!1}function l(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):T?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}function u(e){return e.replace(/([A-Z])/g,function(e,n){return"-"+n.toLowerCase()}).replace(/^ms-/,"-ms-")}function d(){var e=n.body;return e||(e=l(T?"svg":"body"),e.fake=!0),e}function p(e,t,r,i){var o,s,a,f,u="modernizr",p=l("div"),c=d();if(parseInt(r,10))for(;r--;)a=l("div"),a.id=i?i[r]:u+(r+1),p.appendChild(a);return o=l("style"),o.type="text/css",o.id="s"+u,(c.fake?c:p).appendChild(o),c.appendChild(p),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(n.createTextNode(e)),p.id=u,c.fake&&(c.style.background="",c.style.overflow="hidden",f=w.style.overflow,w.style.overflow="hidden",w.appendChild(c)),s=t(p,e),c.fake?(c.parentNode.removeChild(c),w.style.overflow=f,w.offsetHeight):p.parentNode.removeChild(p),!!s}function c(n,r){var i=n.length;if("CSS"in e&&"supports"in e.CSS){for(;i--;)if(e.CSS.supports(u(n[i]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var o=[];i--;)o.push("("+u(n[i])+":"+r+")");return o=o.join(" or "),p("@supports ("+o+") { #modernizr { position: absolute; } }",function(e){return"absolute"==getComputedStyle(e,null).position})}return t}function m(e,n,i,a){function f(){d&&(delete P.style,delete P.modElem)}if(a=r(a,"undefined")?!1:a,!r(i,"undefined")){var u=c(e,i);if(!r(u,"undefined"))return u}for(var d,p,m,v,h,y=["modernizr","tspan","samp"];!P.style&&y.length;)d=!0,P.modElem=l(y.shift()),P.style=P.modElem.style;for(m=e.length,p=0;m>p;p++)if(v=e[p],h=P.style[v],s(v,"-")&&(v=o(v)),P.style[v]!==t){if(a||r(i,"undefined"))return f(),"pfx"==n?v:!0;try{P.style[v]=i}catch(g){}if(P.style[v]!=h)return f(),"pfx"==n?v:!0}return f(),!1}function v(e,n,t,i,o){var s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+_.join(s+" ")+s).split(" ");return r(n,"string")||r(n,"undefined")?m(a,n,i,o):(a=(e+" "+E.join(s+" ")+s).split(" "),f(a,n,t))}function h(e,n,r){return v(e,t,t,n,r)}var y=[],g={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,n){var t=this;setTimeout(function(){n(t[e])},0)},addTest:function(e,n,t){y.push({name:e,fn:n,options:t})},addAsyncTest:function(e){y.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=g,Modernizr=new Modernizr;var C=[],w=n.documentElement;Modernizr.addTest("classlist","classList"in w);var x="Moz O ms Webkit",_=g._config.usePrefixes?x.split(" "):[];g._cssomPrefixes=_;var S=function(n){var r,i=prefixes.length,o=e.CSSRule;if("undefined"==typeof o)return t;if(!n)return!1;if(n=n.replace(/^@/,""),r=n.replace(/-/g,"_").toUpperCase()+"_RULE",r in o)return"@"+n;for(var s=0;i>s;s++){var a=prefixes[s],f=a.toUpperCase()+"_"+r;if(f in o)return"@-"+a.toLowerCase()+"-"+n}return!1};g.atRule=S;var E=g._config.usePrefixes?x.toLowerCase().split(" "):[];g._domPrefixes=E;var T="svg"===w.nodeName.toLowerCase(),z={elem:l("modernizr")};Modernizr._q.push(function(){delete z.elem});var P={style:z.elem.style};Modernizr._q.unshift(function(){delete P.style}),g.testAllProps=v;var b=g.prefixed=function(e,n,t){return 0===e.indexOf("@")?S(e):(-1!=e.indexOf("-")&&(e=o(e)),n?v(e,n,t):v(e,"pfx"))};Modernizr.addTest("requestanimationframe",!!b("requestAnimationFrame",e),{aliases:["raf"]}),g.testAllProps=h,Modernizr.addTest("csstransitions",h("transition","all",!0)),i(),delete g.addTest,delete g.addAsyncTest;for(var L=0;L<Modernizr._q.length;L++)Modernizr._q[L]();e.Modernizr=Modernizr}(window,document);
|
1
js/vendor/modernizr/LICENSE
vendored
Normal file
1
js/vendor/modernizr/LICENSE
vendored
Normal file
@ -0,0 +1 @@
|
||||
/*! Modernizr 3.12.0 | MIT */
|
3
js/vendor/modernizr/modernizr.min.js
vendored
Normal file
3
js/vendor/modernizr/modernizr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
11
package.json
Normal file
11
package.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"scripts": {
|
||||
"postinstall": "node ./js/extract-files-from-node-modules.js"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"fs-extra": "^11.1.0",
|
||||
"knacss": "https://github.com/alsacreations/KNACSS",
|
||||
"modernizr": "^3.12.0"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user