Skip to content

Commit

Permalink
Merge 15955ce into 0f3891c
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Jul 31, 2020
2 parents 0f3891c + 15955ce commit d2deac3
Show file tree
Hide file tree
Showing 18 changed files with 1,952 additions and 2,701 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ coverage/

cypress/screenshots
cypress/snapshots
vendor
14 changes: 7 additions & 7 deletions js/viewer.js → js/viewer-main.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/viewer-main.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion js/viewer.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion lib/Listener/LoadViewerScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ public function handle(Event $event): void {
return;
}

Util::addScript(Application::APP_ID, 'viewer');
Util::addScript(Application::APP_ID, 'viewer-main');
}
}
4,397 changes: 1,840 additions & 2,557 deletions package-lock.json

Large diffs are not rendered by default.

53 changes: 27 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"license": "agpl",
"private": true,
"scripts": {
"dev": "NODE_ENV=development webpack --config webpack.dev.js",
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.dev.js",
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.prod.js",
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.js",
"dev": "NODE_ENV=development webpack --progress --config webpack.js",
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.js",
"lint": "eslint --ext .js,.vue src",
"lint:fix": "eslint --ext .js,.vue src --fix",
"stylelint": "stylelint src",
Expand All @@ -37,9 +37,9 @@
"wait-on": "wait-on -i 500 -t 300000"
},
"dependencies": {
"@nextcloud/auth": "^1.2.3",
"@nextcloud/auth": "^1.3.0",
"@nextcloud/axios": "^1.3.2",
"@nextcloud/router": "^1.0.2",
"@nextcloud/router": "^1.1.0",
"@nextcloud/vue": "^1.5.0",
"camelcase": "^6.0.0",
"core-js": "^3.6.5",
Expand All @@ -62,42 +62,43 @@
"node": ">=10.0.0"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/core": "^7.10.4",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.9.6",
"@babel/preset-env": "^7.10.4",
"@nextcloud/browserslist-config": "^1.0.0",
"@nextcloud/eslint-config": "^1.0.0",
"@nextcloud/eslint-config": "^2.2.0",
"@nextcloud/eslint-plugin": "^1.4.0",
"@nextcloud/webpack-vue-config": "^1.1.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"babel-loader-exclude-node-modules-except": "^1.0.3",
"browserslist-config-nextcloud": "0.1.0",
"css-loader": "^3.5.3",
"css-loader": "^3.6.0",
"cypress": "^3.8.3",
"cypress-image-snapshot": "^3.1.1",
"eslint": "^5.16.0",
"eslint-config-standard": "^12.0.0",
"eslint-import-resolver-webpack": "^0.12.1",
"eslint-loader": "^3.0.4",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^10.0.0",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.1",
"eslint-import-resolver-webpack": "^0.12.2",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^5.2.3",
"eslint-plugin-vue": "^6.2.2",
"file-loader": "^6.0.0",
"jest": "^24.9.0",
"node-sass": "^4.14.0",
"node-sass": "^4.14.1",
"sass-loader": "^8.0.2",
"stylelint": "^8.4.0",
"stylelint-config-recommended-scss": "^3.3.0",
"stylelint-scss": "^3.17.1",
"stylelint-webpack-plugin": "^0.10.5",
"stylelint": "^13.6.1",
"stylelint-config-recommended-scss": "^4.2.0",
"stylelint-scss": "^3.18.0",
"stylelint-webpack-plugin": "^2.1.0",
"url-loader": "^4.1.0",
"vue-loader": "^15.9.2",
"vue-loader": "^15.9.3",
"vue-template-compiler": "^2.6.11",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-merge": "^4.2.2",
"webpack-node-externals": "^1.7.2"
"webpack-cli": "^3.3.12",
"webpack-merge": "^5.0.9"
}
}
2 changes: 1 addition & 1 deletion src/components/Images.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default {
},
},
watch: {
active: function(val, old) {
active(val, old) {
// the item was hidden before and is now the current view
if (val === true && old === false) {
this.resetZoom()
Expand Down
2 changes: 1 addition & 1 deletion src/components/Videos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default {
},
watch: {
active: function(val, old) {
active(val, old) {
// the item was hidden before and is now the current view
if (val === true && old === false) {
this.player.play()
Expand Down
4 changes: 2 additions & 2 deletions src/mixins/Mime.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default {
},

watch: {
active: function(val, old) {
active(val, old) {
// the item was hidden before and is now the current view
if (val === true && old === false) {
// just in case the file was preloaded, let's warn the viewer
Expand All @@ -115,7 +115,7 @@ export default {
}
},
// update image size on sidebar toggle
isSidebarShown: function() {
isSidebarShown() {
// wait for transition to complete (100ms)
setTimeout(this.updateHeightWidth, 200)
},
Expand Down
2 changes: 1 addition & 1 deletion src/models/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

export default function(fileInfo, mime, component) {
const data = {
mime: mime,
mime,
modal: component,
failed: false,
loaded: false,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/davUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const getRootPath = function() {
if (getCurrentUser()) {
return generateRemoteUrl(`dav/files/${getCurrentUser().uid}`)
} else {
return generateRemoteUrl(`webdav`).replace('/remote.php', '/public.php')
return generateRemoteUrl('webdav').replace('/remote.php', '/public.php')
}
}

Expand Down
32 changes: 16 additions & 16 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export default {
// make sure any late external app can register handlers
// should not happens if external apps do not wait for
// the DOMContentLoaded event!
handlers: function() {
handlers() {
// make sure the viewer is done registering handlers
// so we only register handlers added AFTER the init
// of the viewer
Expand All @@ -217,7 +217,7 @@ export default {
}
},
file: function(path) {
file(path) {
// we got a valid path! Load file...
if (path.trim() !== '') {
console.info('Opening viewer for file ', path)
Expand All @@ -228,7 +228,7 @@ export default {
}
},
files: function(fileList) {
files(fileList) {
// the files list changed, let's update the current opened index
const currentIndex = fileList.findIndex(file => file.basename === this.currentFile.basename)
if (currentIndex > -1) {
Expand All @@ -240,7 +240,7 @@ export default {
},
// user reached the end of list
isEndOfList: async function(isEndOfList) {
async isEndOfList(isEndOfList) {
if (!isEndOfList) {
return
}
Expand All @@ -256,7 +256,7 @@ export default {
}
},
sidebarFile: function(file) {
sidebarFile(file) {
// TODO: implement sidebar event bus
if (file === '') {
this.hideAppsSidebar()
Expand Down Expand Up @@ -385,7 +385,7 @@ export default {
this.currentFile = new File(fileInfo, mime, this.components[mime])
this.updatePreviousNext()
} else {
console.error(`The following file could not be displayed`, fileName, fileInfo)
console.error('The following file could not be displayed', fileName, fileInfo)
this.close()
}
Expand Down Expand Up @@ -459,13 +459,13 @@ export default {
registerHandler(handler) {
// checking if handler is not already registered
if (handler.id && this.registeredHandlers.indexOf(handler.id) > -1) {
console.error(`The following handler is already registered`, handler)
console.error('The following handler is already registered', handler)
return
}
// checking valid handler id
if (!handler.id || handler.id.trim() === '' || typeof handler.id !== 'string') {
console.error(`The following handler doesn't have a valid id`, handler)
console.error('The following handler doesn\'t have a valid id', handler)
return
}
Expand All @@ -476,13 +476,13 @@ export default {
// Nothing available to process! Failure
if (!(handler.mimes && Array.isArray(handler.mimes)) && !handler.mimesAliases) {
console.error(`The following handler doesn't have a valid mime array`, handler)
console.error('The following handler doesn\'t have a valid mime array', handler)
return
}
// checking valid handler component data
if ((!handler.component || typeof handler.component !== 'object')) {
console.error(`The following handler doesn't have a valid component`, handler)
console.error('The following handler doesn\'t have a valid component', handler)
return
}
Expand All @@ -494,7 +494,7 @@ export default {
handler.mimes.forEach(mime => {
// checking valid mime
if (this.components[mime]) {
console.error(`The following mime is already registered`, mime, handler)
console.error('The following mime is already registered', mime, handler)
return
}
Expand All @@ -517,7 +517,7 @@ export default {
Object.keys(handler.mimesAliases).forEach(mime => {
if (handler.mimesAliases && typeof handler.mimesAliases !== 'object') {
console.error(`The following handler doesn't have a valid mimesAliases object`, handler)
console.error('The following handler doesn\'t have a valid mimesAliases object', handler)
return
}
Expand All @@ -527,11 +527,11 @@ export default {
// checking valid mime
if (this.components[mime]) {
console.error(`The following mime is already registered`, mime, handler)
console.error('The following mime is already registered', mime, handler)
return
}
if (!this.components[alias]) {
console.error(`The requested alias does not exists`, alias, mime, handler)
console.error('The requested alias does not exists', alias, mime, handler)
return
}
Expand All @@ -553,7 +553,7 @@ export default {
OCA.Files.fileActions.registerAction({
name: 'view',
displayName: t('viewer', 'View'),
mime: mime,
mime,
permissions: OC.PERMISSION_READ,
actionHandler: (name, { dir }) => {
// replace potential leading double slashes
Expand Down Expand Up @@ -702,7 +702,7 @@ export default {
// force white icon
.icon-menu-sidebar-white-forced {
background-image: url('~Assets/menu-sidebar-white.svg');
background-image: url('../assets/menu-sidebar-white.svg');
}
.file-view {
Expand Down
18 changes: 12 additions & 6 deletions .stylelintrc.js → stylelint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,26 @@ module.exports = {
'rule-empty-line-before': [
'always',
{
ignore: ['after-comment', 'inside-block']
}
ignore: ['after-comment', 'inside-block'],
},
],
'declaration-empty-line-before': [
'never',
{
ignore: ['after-declaration']
}
ignore: ['after-declaration'],
},
],
'comment-empty-line-before': null,
'selector-type-case': null,
'selector-list-comma-newline-after': null,
'no-descending-specificity': null,
'string-quotes': 'single'
'string-quotes': 'single',
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: ['v-deep'],
},
],
},
plugins: ['stylelint-scss']
plugins: ['stylelint-scss'],
}
67 changes: 0 additions & 67 deletions webpack.common.js

This file was deleted.

Loading

0 comments on commit d2deac3

Please sign in to comment.