diff --git a/_assets/.editorconfig b/.editorconfig similarity index 100% rename from _assets/.editorconfig rename to .editorconfig diff --git a/_assets/_old/js/common_old.js b/_assets/_old/js/common_old.js index 4fc09a5e..6ab995cb 100644 --- a/_assets/_old/js/common_old.js +++ b/_assets/_old/js/common_old.js @@ -1,7 +1,5 @@ 'use strict' -var data = (window.data || window.alert('Something is wrong, please refresh!')) - var tempID = '_fm_internal_temporary_id' var templates = {} @@ -9,8 +7,6 @@ var selectedItems = [] var overlay var clickOverlay - - // Sends a costum event to itself Document.prototype.sendCostumEvent = function (text) { this.dispatchEvent(new window.CustomEvent(text)) diff --git a/_assets/_old/js/listing.js b/_assets/_old/js/listing.js index 097b3f65..e6610a2b 100644 --- a/_assets/_old/js/listing.js +++ b/_assets/_old/js/listing.js @@ -350,9 +350,6 @@ document.addEventListener('DOMContentLoaded', event => { let items = document.getElementsByClassName('item') if (user.AllowNew) { - buttons.upload.addEventListener('click', (event) => { - document.getElementById('upload-input').click() - }) buttons.new.addEventListener('click', listing.newFileButton) } diff --git a/_assets/_old/templates/actions.tmpl b/_assets/_old/templates/actions.tmpl index 0d50c9e1..41b3e6be 100644 --- a/_assets/_old/templates/actions.tmpl +++ b/_assets/_old/templates/actions.tmpl @@ -1,91 +1,33 @@ -{{ define "right-side-actions" }} - {{ template "info-button" }} -{{ end }} - {{ define "right" }} {{- if not .IsEditor }} - - {{- if eq .Display "mosaic" }}view_list{{ else }}view_module{{ end }} - Switch view - - - {{- end }} + +{{- end }} - {{- if and (.User.AllowNew) (not .IsEditor) }} - - {{- end }} - - - - - {{ end }} - -{{ define "left-side-actions" }} - -{{ end }} - {{ define "left" }} - {{- if and (not .IsDir) (.User.AllowEdit) }} - {{- if .Editor}} +{{- if and (not .IsDir) (.User.AllowEdit) }} +{{- if .Editor}} - {{- if eq .Data.Mode "markdown" }} - - {{- end }} +{{- if eq .Data.Mode "markdown" }} + +{{- end }} - {{- if eq .Data.Visual true }} - - {{- end }} +{{- if eq .Data.Visual true }} + +{{- end }} - {{/* end if editor */}} +{{/* end if editor */}} - - {{- end }} - - {{/* end if not dir and AllowEdit */}} - {{- end }} - - {{- if and .IsDir .User.AllowEdit }} - - - - - - {{- end }} - {{ end }} \ No newline at end of file + +{{- end }} diff --git a/_assets/build/webpack.prod.conf.js b/_assets/build/webpack.prod.conf.js index e084e9cb..8cba2668 100644 --- a/_assets/build/webpack.prod.conf.js +++ b/_assets/build/webpack.prod.conf.js @@ -2,7 +2,7 @@ var fs = require('fs') var path = require('path') var utils = require('./utils') var webpack = require('webpack') -var config = require('../config') +var config = require('./config') var merge = require('webpack-merge') var baseWebpackConfig = require('./webpack.base.conf') var CopyWebpackPlugin = require('copy-webpack-plugin') @@ -52,7 +52,7 @@ var webpackConfig = merge(baseWebpackConfig, { // you can customize output by editing /index.html // see https://github.com/ampedandwired/html-webpack-plugin new HtmlWebpackPlugin({ - filename: config.prod.index, + filename: config.build.index, template: 'index.html', inject: true, minify: { diff --git a/_assets/index.html b/_assets/index.html index fe6e4260..420eddf7 100644 --- a/_assets/index.html +++ b/_assets/index.html @@ -42,6 +42,7 @@ showHelp: false, showDelete: false, showRename: false, + showMove: false, listing: { selected: [], multiple: false diff --git a/_assets/src/App.vue b/_assets/src/App.vue index 08191c7f..67caad42 100644 --- a/_assets/src/App.vue +++ b/_assets/src/App.vue @@ -6,7 +6,12 @@
+ + + + +
@@ -22,10 +27,10 @@
- +
- +
@@ -59,6 +64,11 @@ import Listing from './components/Listing' import InfoButton from './components/InfoButton' import InfoPrompt from './components/InfoPrompt' import DeleteButton from './components/DeleteButton' +import RenameButton from './components/RenameButton' +import UploadButton from './components/UploadButton' +import DownloadButton from './components/DownloadButton' +import SwitchButton from './components/SwitchViewButton' +import MoveButton from './components/MoveButton' import css from './css.js' function updateColumnSizes () { @@ -75,6 +85,7 @@ window.addEventListener('keydown', (event) => { window.info.showInfo = false window.info.showDelete = false window.info.showRename = false + window.info.showMove = false // Unselect all files and folders. if (window.info.req.kind === 'listing') { @@ -123,18 +134,38 @@ window.addEventListener('keydown', (event) => { export default { name: 'app', - components: { Search, Preview, Listing, InfoButton, InfoPrompt, Help, DeleteButton }, + components: { + Search, + Preview, + Listing, + InfoButton, + InfoPrompt, + Help, + DeleteButton, + RenameButton, + DownloadButton, + UploadButton, + SwitchButton, + MoveButton + }, mounted: function () { updateColumnSizes() window.addEventListener('resize', updateColumnSizes) - window.history.replaceState({ url: window.location.pathname, name: document.title }, document.title, window.location.pathname) + window.history.replaceState({ + url: window.location.pathname, + name: document.title + }, document.title, window.location.pathname) }, data: function () { return window.info }, methods: { showOverlay: function () { - return this.showInfo || this.showHelp + return this.showInfo || this.showHelp || this.showDelete || this.showRename || this.showMove + }, + showUpload: function () { + if (this.req.kind === 'editor') return false + return this.user.allowNew } } } diff --git a/_assets/src/components/DeleteButton.vue b/_assets/src/components/DeleteButton.vue index 0e553bc7..559b6fb4 100644 --- a/_assets/src/components/DeleteButton.vue +++ b/_assets/src/components/DeleteButton.vue @@ -1,5 +1,5 @@