Updated to later version of vue cli to improve build process

* Updated some simples styles
* Added archive button to main notes
fixes #21
This commit is contained in:
Max G 2020-03-11 03:47:07 +00:00
parent 282cbfe7bc
commit 3ed26bcc03
15 changed files with 12003 additions and 74 deletions

View File

@ -1,6 +1,6 @@
# client
# client2
> A Vue.js project
> client2
## Build Setup

View File

@ -58,11 +58,11 @@ module.exports = {
}
},
{
test: /\.(eot|ttf|otf|woff|woff2)(\?.*)?$/,
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[ext]')
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]

View File

@ -17,9 +17,6 @@ const devWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
watchOptions: {
ignored: ['uploads', 'node_modules']
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
@ -31,7 +28,8 @@ const devWebpackConfig = merge(baseWebpackConfig, {
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
// hot: true,
disableHostCheck: true,
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
@ -43,7 +41,6 @@ const devWebpackConfig = merge(baseWebpackConfig, {
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
disableHostCheck: true,
watchOptions: {
poll: config.dev.poll,
}

View File

@ -4,4 +4,4 @@ const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
})

View File

@ -13,13 +13,13 @@ module.exports = {
proxyTable: {},
// Various Dev Server settings
host: '0.0.0.0',//'localhost', // can be overwritten by process.env.HOST
host: '0.0.0.0', // can be overwritten by process.env.HOST
port: 8444, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
/**
* Source Maps

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="/api/static/assets/favicon.ico" type="image/ico"/>
<link rel="shortcut icon" href="/api/static/assets/favicon.ico" type="image/x-icon"/>
@ -14,6 +14,6 @@
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected, somewhere around here -->
<!-- built files will be auto injected -->
</body>
</html>

11918
client/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,20 @@
{
"name": "client",
"name": "client2",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "Max G <admin@internet.com>",
"description": "client2",
"author": "max",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"watch": "webpack-dev-server --watch --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.18.0",
"es6-promise": "^4.2.6",
"pell": "^1.0.6",
"postcss-loader": "^2.1.6",
"raw-loader": "^0.5.1",
"socket.io-client": "^2.3.0",
"axios": "^0.19.2",
"es6-promise": "^4.2.8",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuex": "^3.1.0"
"vuex": "^3.1.3"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
@ -38,7 +33,6 @@
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"ip": "^1.1.5",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",

View File

@ -1,22 +0,0 @@
{
"base": "semantic/",
"paths": {
"source": {
"config": "src/theme.config",
"definitions": "src/definitions/",
"site": "src/site/",
"themes": "src/themes/"
},
"output": {
"packaged": "dist/",
"uncompressed": "dist/components/",
"compressed": "dist/components/",
"themes": "dist/themes/"
},
"clean": "dist/"
},
"permission": false,
"autoInstall": false,
"rtl": false,
"version": "2.4.2"
}

View File

@ -3,7 +3,7 @@
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(/static/fonts/roboto-latin.woff2) format('woff2');
src: local('Roboto'), local('Roboto-Regular'), url(/api/static/assets/roboto-latin.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@ -11,7 +11,7 @@
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(/static/fonts/roboto-latin-bold.woff2) format('woff2');
src: local('Roboto Bold'), local('Roboto-Bold'), url(/api/static/assets/roboto-latin-bold.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

View File

@ -4,7 +4,7 @@
id="InputNotes"
class="master-note-edit"
@keyup.esc="close"
:class="[{ 'size-down':(sizeDown == true) }, 'position-'+position ]"
:class="[{ 'size-down':(sizeDown == true), 'full-focus':(fullFocusEditor) }, 'position-'+position ]"
:style="{ 'background-color':styleObject['noteBackground'], 'color':styleObject['noteText']}"
>
@ -202,6 +202,8 @@
</div>
</side-slide-menu>
<div class="full-focus-shade"></div>
</div>
</template>
@ -252,7 +254,7 @@
colorPickerLocation: null,
tinymce: null, //Initialized editor instance
fullFocusEditor: true, //Initialized editor instance
//Settings vars
showAllSettings: true,
@ -1160,6 +1162,10 @@
left: 50%;
right: 0%;
}
.master-note-edit.position-1.full-focus {
left: 20%;
right: 20%;
}
.master-note-edit.position-2 {
left: 0%;
right: 50%;
@ -1179,13 +1185,9 @@
@keyframes size-down {
0% {
/*opacity: 1;*/
/*top: 0;*/
top: 0;
}
100% {
/*opacity: 0;*/
/*top: 30vh;*/
top: 150vh;
}
}

View File

@ -63,30 +63,35 @@
<div class="tool-bar" @click.self="cardClicked">
<div class="icon-bar">
<!-- {{$helpers.timeAgo(note.updated)}} -->
<span v-if="note.pinned == 1" data-position="top left" data-tooltip="Pinned" data-inverted>
<i class="green pin icon"></i>
</span>
<span v-if="note.archived == 1" data-position="top left" data-tooltip="Archived" data-inverted>
<i class="green archive icon"></i>
</span>
<span v-if="note.tags">
<span v-for="tag in (note.tags.split(','))" class="little-tag">{{ tag }}</span>
</span>
<span v-if="note.pinned == 1" data-position="top right" data-tooltip="Pinned" data-inverted="">
<i class="green pin icon"></i>
</span>
<span v-if="note.archived == 1" data-position="top right" data-tooltip="Archived" data-inverted="">
<i class="green archive icon"></i>
</span>
<!-- :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }" -->
<span class="float-right" :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }">
<!-- <span class="teeny-button" data-tooltip="Archive" data-inverted>
<i class="archive icon"></i>
</span> -->
<i class="teeny-button" data-tooltip="Tags" data-inverted v-on:click="toggleTags(true)">
<i class="tags icon"></i>
</i>
<i class="teeny-button" data-tooltip="Pin" data-inverted v-on:click="pinNote">
<i class="teeny-button"
data-tooltip="Archive"
:data-tooltip="note.archived ? 'Un-Archive':'Archive' "
data-inverted v-on:click="archiveNote">
<i class="archive icon"></i>
</i>
<i class="teeny-button"
:data-tooltip="note.pinned ? 'Un-Pin':'Pin' "
data-inverted v-on:click="pinNote">
<i class="pin icon"></i>
</i>
@ -103,7 +108,7 @@
</div>
<side-slide-menu v-if="showTagSlideMenu" v-on:close="toggleTags(false)">
<side-slide-menu v-if="showTagSlideMenu" v-on:close="toggleTags(false)" :full-shadow="true">
<div class="ui basic segment">
<note-tag-edit :noteId="note.id" :key="'display-tags-for-note-'+note.id"/>
</div>
@ -161,6 +166,13 @@
this.$bus.$emit('update_single_note', this.note.id)
})
},
archiveNote(){
let postData = {'archived': !this.note.archived, 'noteId':this.note.id}
axios.post('/api/note/setarchived', postData)
.then(data => {
this.$bus.$emit('update_single_note', this.note.id)
})
},
toggleTags(state){
this.showTagSlideMenu = state
@ -243,7 +255,7 @@
border-radius: 5px;
padding: 0px 0px 0px 4px;
text-align: center;
margin: 0 0 0 5px;
margin: 0 0 3px 5px;
display: inline-block;
min-width: 30px;
color: var(--text_color);
@ -296,7 +308,8 @@
.note-title-display-card {
position: relative;
/*box-shadow: 0 1px 2px 0 rgba(34,36,38,.15);*/
box-shadow: 0 0px 5px 1px rgba(34,36,38,0);
/*box-shadow: 0 0px 5px 1px rgba(34,36,38,0);*/
box-shadow: 0 1px 2px 0 rgba(34,36,38,.15);
margin: 5px;
/*padding: 0.7em 1em;*/
border-radius: .28571429rem;
@ -315,7 +328,7 @@
}
.note-title-display-card:hover {
/*box-shadow: 0 3px 6px -0 rgba(34,36,38,.50);*/
box-shadow: 0 0px 5px 1px rgba(34,36,38,0.3);
/*box-shadow: 0 0px 5px 1px rgba(34,36,38,0.3);*/
}
.icon-bar {
display: inline-block;

View File

@ -33,6 +33,12 @@
overflow: hidden;
cursor: pointer;
}
.slide-shadow.full-shadow {
right: 0;
background-color: rgba(0,0,0,0.3);
}
.note-menu {
height: 43px;
}
@ -88,7 +94,7 @@
</div>
<div class="slide-shadow" v-on:click="close"></div>
<div class="slide-shadow" :class="{'full-shadow':fullShadow}" v-on:click="close"></div>
</div>
</transition>
@ -97,7 +103,7 @@
<script>
export default {
name: 'SideSlideMenu',
props: [ 'name', 'styleObject' ],
props: [ 'name', 'styleObject', 'fullShadow' ],
components: {
'nm-button':require('@/components/NoteMenuButtonComponent.vue').default
},

View File

@ -217,6 +217,21 @@ Note.setPinned = (userId, noteId, pinnedBoolean) => {
})
}
Note.setArchived = (userId, noteId, archivedBoolead) => {
return new Promise((resolve, reject) => {
const archived = archivedBoolead ? 1:0
//Update other note attributes
return db.promise()
.query('UPDATE note SET archived = ? WHERE id = ? AND user_id = ? LIMIT 1',
[archived, noteId, userId])
.then((rows, fields) => {
resolve(true)
})
})
}
//
// Delete a note and all its remaining parts
//

View File

@ -71,6 +71,12 @@ router.post('/setpinned', function (req, res) {
res.send(results)
})
})
router.post('/setarchived', function (req, res) {
Notes.setArchived(userId, req.body.noteId, req.body.archived)
.then( results => {
res.send(results)
})
})
//
// Share Note Actions