commit 8a4693a46f2520a90dcd4be0757d1f04151d4839 Author: buttle Date: Fri Oct 22 11:00:33 2021 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..16acd49 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist +package-lock.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..da72f9c --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "archive-list", + "version": "1.0.0", + "description": "List arc-hive collections for Omeka", + "main": "webpack.config.js", + "devDependencies": { + "babel-loader": "^8.2.3", + "vue": "^2.6.14", + "vue-loader": "^15.9.8", + "vue-style-loader": "^4.1.3", + "vue-template-compiler": "^2.6.14", + "webpack-cli": "^4.9.1" + }, + "scripts": { + "build": "webpack --config webpack.config.js --mode development", + "build-prod": "webpack --config webpack.config.js --mode production" + } +} diff --git a/src/components/archiveList.vue b/src/components/archiveList.vue new file mode 100644 index 0000000..763e2b9 --- /dev/null +++ b/src/components/archiveList.vue @@ -0,0 +1,47 @@ + + + + + + + + + diff --git a/src/loaders/archiveListLoader.js b/src/loaders/archiveListLoader.js new file mode 100644 index 0000000..cfdfeea --- /dev/null +++ b/src/loaders/archiveListLoader.js @@ -0,0 +1,39 @@ +/* +This file is part of LiberaForms. + +# SPDX-FileCopyrightText: 2021 LiberaForms.org +# SPDX-License-Identifier: AGPL-3.0-or-later +*/ + +import Vue from "vue"; +//import VueMq from 'vue-mq' +import ArchiveList from "../components/archiveList.vue"; + +//import 'es6-promise/auto' +//import store from "../store.js" +//import i18n from "../i18n.js" +export const bus = new Vue(); + +var ComponentClass = Vue.extend(ArchiveList) +/* + .use(VueMq, { + breakpoints: { // default breakpoints - customize this + sm: 450, + md: 1250, + lg: Infinity, + }, + defaultBreakpoint: 'sm' // customize this for SSR + }) +*/ +document.querySelectorAll("[data-vue-component=archive-list]") + .forEach((element) => { + new ComponentClass({ + components: {'ArchiveList': ArchiveList}, + /* + propsData: { ...element.dataset }, + props: ["endpoint", "language", "csrf_token"], + store: store, + i18n: i18n, + */ + }).$mount(element); + }); diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..e0b9357 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,40 @@ + +const { dirname } = require("path"); +const VueLoaderPlugin = require("vue-loader/lib/plugin"); + +module.exports = { + entry: { + "archive-list": "./src/loaders/archiveListLoader.js", + }, + optimization: { + minimize: true + }, + output: { + filename: "dist/[name].js", + path: __dirname, + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: "vue-loader", + }, + // this will apply to both plain `.js` files + // AND `