mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 13:13:08 +02:00
wip
This commit is contained in:
parent
2f3f97a12c
commit
62fd58fbc8
5 changed files with 41 additions and 19 deletions
|
@ -83,6 +83,7 @@
|
||||||
"autwh": "0.0.1",
|
"autwh": "0.0.1",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"body-parser": "1.18.2",
|
"body-parser": "1.18.2",
|
||||||
|
"cache-loader": "^1.2.0",
|
||||||
"cafy": "3.2.1",
|
"cafy": "3.2.1",
|
||||||
"chai": "4.1.2",
|
"chai": "4.1.2",
|
||||||
"chai-http": "3.0.0",
|
"chai-http": "3.0.0",
|
||||||
|
@ -117,7 +118,7 @@
|
||||||
"gulp-typescript": "3.2.4",
|
"gulp-typescript": "3.2.4",
|
||||||
"gulp-uglify": "3.0.0",
|
"gulp-uglify": "3.0.0",
|
||||||
"gulp-util": "3.0.8",
|
"gulp-util": "3.0.8",
|
||||||
"hard-source-webpack-plugin": "^0.5.18",
|
"hard-source-webpack-plugin": "0.6.0-alpha.8",
|
||||||
"highlight.js": "9.12.0",
|
"highlight.js": "9.12.0",
|
||||||
"html-minifier": "^3.5.9",
|
"html-minifier": "^3.5.9",
|
||||||
"inquirer": "5.0.1",
|
"inquirer": "5.0.1",
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
<ul class="me-nu">
|
<ul class="me-nu">
|
||||||
<li v-for="(item, i) in menu" :key="i" :class="item.type">
|
<li v-for="(item, i) in menu" :key="i" :class="item.type">
|
||||||
<template v-if="item.type == 'item'">
|
<template v-if="item.type == 'item'">
|
||||||
<p @click="click(item)"><span class="icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}</p>
|
<p @click="click(item)"><span :class="$style.icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}</p>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="item.type == 'link'">
|
<template v-if="item.type == 'link'">
|
||||||
<a :href="item.href" :target="item.target" @click="click(item)"><span class="icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}</a>
|
<a :href="item.href" :target="item.target" @click="click(item)"><span :class="$style.icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}</a>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.type == 'nest'">
|
<template v-else-if="item.type == 'nest'">
|
||||||
<p><span class="icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}...<span class="caret">%fa:caret-right%</span></p>
|
<p><span :class="$style.icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}...<span class="caret">%fa:caret-right%</span></p>
|
||||||
<me-nu :menu="item.menu" @x="click"/>
|
<me-nu :menu="item.menu" @x="click"/>
|
||||||
</template>
|
</template>
|
||||||
</li>
|
</li>
|
||||||
|
@ -41,7 +41,7 @@ export default Vue.extend({
|
||||||
li
|
li
|
||||||
display block
|
display block
|
||||||
|
|
||||||
&:empty
|
&.divider
|
||||||
margin-top $padding
|
margin-top $padding
|
||||||
padding-top $padding
|
padding-top $padding
|
||||||
border-top solid 1px #eee
|
border-top solid 1px #eee
|
||||||
|
@ -51,11 +51,14 @@ export default Vue.extend({
|
||||||
cursor default
|
cursor default
|
||||||
|
|
||||||
> .caret
|
> .caret
|
||||||
|
position absolute
|
||||||
|
top 0
|
||||||
|
right 8px
|
||||||
|
|
||||||
> *
|
> *
|
||||||
position absolute
|
|
||||||
top 0
|
|
||||||
right 8px
|
|
||||||
line-height $item-height
|
line-height $item-height
|
||||||
|
width 28px
|
||||||
|
text-align center
|
||||||
|
|
||||||
&:hover > ul
|
&:hover > ul
|
||||||
visibility visible
|
visibility visible
|
||||||
|
@ -80,12 +83,6 @@ export default Vue.extend({
|
||||||
*
|
*
|
||||||
pointer-events none
|
pointer-events none
|
||||||
|
|
||||||
> .icon
|
|
||||||
> *
|
|
||||||
width 28px
|
|
||||||
margin-left -28px
|
|
||||||
text-align center
|
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
> p, a
|
> p, a
|
||||||
text-decoration none
|
text-decoration none
|
||||||
|
@ -112,3 +109,11 @@ export default Vue.extend({
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style lang="stylus" module>
|
||||||
|
.icon
|
||||||
|
> *
|
||||||
|
width 28px
|
||||||
|
margin-left -28px
|
||||||
|
text-align center
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
const loaderUtils = require('loader-utils');
|
const loaderUtils = require('loader-utils');
|
||||||
|
|
||||||
function trim(text) {
|
function trim(text, g) {
|
||||||
return text.substring(1, text.length - 2);
|
return text.substring(1, text.length - (g ? 2 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = function(src) {
|
module.exports = function(src) {
|
||||||
this.cacheable();
|
this.cacheable();
|
||||||
const options = loaderUtils.getOptions(this);
|
const options = loaderUtils.getOptions(this);
|
||||||
const search = options.search;
|
const search = options.search;
|
||||||
|
const g = search[search.length - 1] == 'g';
|
||||||
const replace = global[options.replace];
|
const replace = global[options.replace];
|
||||||
if (typeof search != 'string' || search.length == 0) console.error('invalid search');
|
if (typeof search != 'string' || search.length == 0) console.error('invalid search');
|
||||||
if (typeof replace != 'function') console.error('invalid replacer:', replace, this.request);
|
if (typeof replace != 'function') console.error('invalid replacer:', replace, this.request);
|
||||||
src = src.replace(new RegExp(trim(search), 'g'), replace);
|
src = src.replace(new RegExp(trim(search, g), g ? 'g' : ''), replace);
|
||||||
this.callback(null, src);
|
this.callback(null, src);
|
||||||
return src;
|
return src;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,7 @@ const isProduction = env === 'production';
|
||||||
|
|
||||||
export default (version, lang) => {
|
export default (version, lang) => {
|
||||||
const plugins = [
|
const plugins = [
|
||||||
new HardSourceWebpackPlugin(),
|
//new HardSourceWebpackPlugin(),
|
||||||
consts(lang)
|
consts(lang)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
* webpack configuration
|
* webpack configuration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const minify = require('html-minifier').minify;
|
||||||
import I18nReplacer from '../src/common/build/i18n';
|
import I18nReplacer from '../src/common/build/i18n';
|
||||||
import { pattern as faPattern, replacement as faReplacement } from '../src/common/build/fa';
|
import { pattern as faPattern, replacement as faReplacement } from '../src/common/build/fa';
|
||||||
const constants = require('../src/const.json');
|
const constants = require('../src/const.json');
|
||||||
|
@ -13,6 +14,14 @@ import version from '../src/version';
|
||||||
|
|
||||||
global['faReplacement'] = faReplacement;
|
global['faReplacement'] = faReplacement;
|
||||||
|
|
||||||
|
global['collapseSpacesReplacement'] = html => {
|
||||||
|
return minify(html, {
|
||||||
|
collapseWhitespace: true,
|
||||||
|
collapseInlineTagWhitespace: true,
|
||||||
|
keepClosingSlash: true
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = Object.keys(langs).map(lang => {
|
module.exports = Object.keys(langs).map(lang => {
|
||||||
// Chunk name
|
// Chunk name
|
||||||
const name = lang;
|
const name = lang;
|
||||||
|
@ -44,7 +53,7 @@ module.exports = Object.keys(langs).map(lang => {
|
||||||
rules: [{
|
rules: [{
|
||||||
test: /\.vue$/,
|
test: /\.vue$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
use: [{
|
use: [/*'cache-loader', */{
|
||||||
loader: 'vue-loader',
|
loader: 'vue-loader',
|
||||||
options: {
|
options: {
|
||||||
cssSourceMap: false,
|
cssSourceMap: false,
|
||||||
|
@ -76,6 +85,12 @@ module.exports = Object.keys(langs).map(lang => {
|
||||||
search: faPattern.toString(),
|
search: faPattern.toString(),
|
||||||
replace: 'faReplacement'
|
replace: 'faReplacement'
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
loader: 'replace',
|
||||||
|
query: {
|
||||||
|
search: /^<template>([\s\S]+?)\r?\n<\/template>/.toString(),
|
||||||
|
replace: 'collapseSpacesReplacement'
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
test: /\.styl$/,
|
test: /\.styl$/,
|
||||||
|
|
Loading…
Reference in a new issue