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 4c17efceea
commit f7fc937d26
15 changed files with 12003 additions and 74 deletions

View File

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

View File

@ -58,11 +58,11 @@ module.exports = {
} }
}, },
{ {
test: /\.(eot|ttf|otf|woff|woff2)(\?.*)?$/, test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader', loader: 'url-loader',
options: { options: {
limit: 10000, 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: { module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
}, },
watchOptions: {
ignored: ['uploads', 'node_modules']
},
// cheap-module-eval-source-map is faster for development // cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool, devtool: config.dev.devtool,
@ -31,7 +28,8 @@ const devWebpackConfig = merge(baseWebpackConfig, {
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
], ],
}, },
// hot: true, disableHostCheck: true,
hot: true,
contentBase: false, // since we use CopyWebpackPlugin. contentBase: false, // since we use CopyWebpackPlugin.
compress: true, compress: true,
host: HOST || config.dev.host, host: HOST || config.dev.host,
@ -43,7 +41,6 @@ const devWebpackConfig = merge(baseWebpackConfig, {
publicPath: config.dev.assetsPublicPath, publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable, proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin quiet: true, // necessary for FriendlyErrorsPlugin
disableHostCheck: true,
watchOptions: { watchOptions: {
poll: config.dev.poll, poll: config.dev.poll,
} }

View File

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

View File

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

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <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="icon" href="/api/static/assets/favicon.ico" type="image/ico"/>
<link rel="shortcut icon" href="/api/static/assets/favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="/api/static/assets/favicon.ico" type="image/x-icon"/>
@ -14,6 +14,6 @@
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected, somewhere around here --> <!-- built files will be auto injected -->
</body> </body>
</html> </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", "version": "1.0.0",
"description": "A Vue.js project", "description": "client2",
"author": "Max G <admin@internet.com>", "author": "max",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", "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", "start": "npm run dev",
"build": "node build/build.js" "build": "node build/build.js"
}, },
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.19.2",
"es6-promise": "^4.2.6", "es6-promise": "^4.2.8",
"pell": "^1.0.6",
"postcss-loader": "^2.1.6",
"raw-loader": "^0.5.1",
"socket.io-client": "^2.3.0",
"vue": "^2.5.2", "vue": "^2.5.2",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vuex": "^3.1.0" "vuex": "^3.1.3"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^7.1.2", "autoprefixer": "^7.1.2",
@ -38,7 +33,6 @@
"file-loader": "^1.1.4", "file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1", "friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1", "html-webpack-plugin": "^2.30.1",
"ip": "^1.1.5",
"node-notifier": "^5.1.2", "node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0", "optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.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-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 400; 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; 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 */ /* latin */
@ -11,7 +11,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 700; 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; 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" id="InputNotes"
class="master-note-edit" class="master-note-edit"
@keyup.esc="close" @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']}" :style="{ 'background-color':styleObject['noteBackground'], 'color':styleObject['noteText']}"
> >
@ -202,6 +202,8 @@
</div> </div>
</side-slide-menu> </side-slide-menu>
<div class="full-focus-shade"></div>
</div> </div>
</template> </template>
@ -252,7 +254,7 @@
colorPickerLocation: null, colorPickerLocation: null,
tinymce: null, //Initialized editor instance fullFocusEditor: true, //Initialized editor instance
//Settings vars //Settings vars
showAllSettings: true, showAllSettings: true,
@ -1160,6 +1162,10 @@
left: 50%; left: 50%;
right: 0%; right: 0%;
} }
.master-note-edit.position-1.full-focus {
left: 20%;
right: 20%;
}
.master-note-edit.position-2 { .master-note-edit.position-2 {
left: 0%; left: 0%;
right: 50%; right: 50%;
@ -1179,13 +1185,9 @@
@keyframes size-down { @keyframes size-down {
0% { 0% {
/*opacity: 1;*/
/*top: 0;*/
top: 0; top: 0;
} }
100% { 100% {
/*opacity: 0;*/
/*top: 30vh;*/
top: 150vh; top: 150vh;
} }
} }

View File

@ -63,30 +63,35 @@
<div class="tool-bar" @click.self="cardClicked"> <div class="tool-bar" @click.self="cardClicked">
<div class="icon-bar"> <div class="icon-bar">
<!-- {{$helpers.timeAgo(note.updated)}} --> <!-- {{$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-if="note.tags">
<span v-for="tag in (note.tags.split(','))" class="little-tag">{{ tag }}</span> <span v-for="tag in (note.tags.split(','))" class="little-tag">{{ tag }}</span>
</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) }" --> <!-- :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }" -->
<span class="float-right" :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="teeny-button" data-tooltip="Tags" data-inverted v-on:click="toggleTags(true)">
<i class="tags icon"></i> <i class="tags icon"></i>
</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 class="pin icon"></i>
</i> </i>
@ -103,7 +108,7 @@
</div> </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"> <div class="ui basic segment">
<note-tag-edit :noteId="note.id" :key="'display-tags-for-note-'+note.id"/> <note-tag-edit :noteId="note.id" :key="'display-tags-for-note-'+note.id"/>
</div> </div>
@ -161,6 +166,13 @@
this.$bus.$emit('update_single_note', this.note.id) 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){ toggleTags(state){
this.showTagSlideMenu = state this.showTagSlideMenu = state
@ -243,7 +255,7 @@
border-radius: 5px; border-radius: 5px;
padding: 0px 0px 0px 4px; padding: 0px 0px 0px 4px;
text-align: center; text-align: center;
margin: 0 0 0 5px; margin: 0 0 3px 5px;
display: inline-block; display: inline-block;
min-width: 30px; min-width: 30px;
color: var(--text_color); color: var(--text_color);
@ -296,7 +308,8 @@
.note-title-display-card { .note-title-display-card {
position: relative; position: relative;
/*box-shadow: 0 1px 2px 0 rgba(34,36,38,.15);*/ /*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; margin: 5px;
/*padding: 0.7em 1em;*/ /*padding: 0.7em 1em;*/
border-radius: .28571429rem; border-radius: .28571429rem;
@ -315,7 +328,7 @@
} }
.note-title-display-card:hover { .note-title-display-card:hover {
/*box-shadow: 0 3px 6px -0 rgba(34,36,38,.50);*/ /*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 { .icon-bar {
display: inline-block; display: inline-block;

View File

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

View File

@ -71,6 +71,12 @@ router.post('/setpinned', function (req, res) {
res.send(results) 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 // Share Note Actions