From ac3b95716e889b6cc2d6caa63b4727aa016f6ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Wed, 6 Feb 2019 10:33:16 +0100 Subject: [PATCH] add new collab test --- .../Routes/Collaboration3/Collab.js | 24 +++ .../Routes/Collaboration3/index.vue | 176 ++++++++++++++++++ examples/Components/Subnavigation/index.vue | 3 + examples/main.js | 7 + 4 files changed, 210 insertions(+) create mode 100644 examples/Components/Routes/Collaboration3/Collab.js create mode 100644 examples/Components/Routes/Collaboration3/index.vue diff --git a/examples/Components/Routes/Collaboration3/Collab.js b/examples/Components/Routes/Collaboration3/Collab.js new file mode 100644 index 000000000..21dc7255f --- /dev/null +++ b/examples/Components/Routes/Collaboration3/Collab.js @@ -0,0 +1,24 @@ +import { Extension } from 'tiptap' +import { collab } from 'prosemirror-collab' + +export default class CollabExtension extends Extension { + get name() { + return 'collab' + } + + get defaultOptions() { + return { + version: 0, + clientID: Math.floor(Math.random() * 0xFFFFFFFF), + } + } + + get plugins() { + return [ + collab({ + version: this.options.version, + clientID: this.options.clientID, + }), + ] + } +} diff --git a/examples/Components/Routes/Collaboration3/index.vue b/examples/Components/Routes/Collaboration3/index.vue new file mode 100644 index 000000000..cac658d83 --- /dev/null +++ b/examples/Components/Routes/Collaboration3/index.vue @@ -0,0 +1,176 @@ + + + diff --git a/examples/Components/Subnavigation/index.vue b/examples/Components/Subnavigation/index.vue index e49ef25b3..1ff9f9057 100644 --- a/examples/Components/Subnavigation/index.vue +++ b/examples/Components/Subnavigation/index.vue @@ -54,6 +54,9 @@ Collaboration 2 + + Collaboration 3 + diff --git a/examples/main.js b/examples/main.js index 22ea43971..cd1249367 100644 --- a/examples/main.js +++ b/examples/main.js @@ -138,6 +138,13 @@ const routes = [ githubUrl: 'https://github.com/scrumpy/tiptap/tree/master/examples/Components/Routes/Collaboration2', }, }, + { + path: '/collaboration3', + component: () => import('Components/Routes/Collaboration3'), + meta: { + githubUrl: 'https://github.com/scrumpy/tiptap/tree/master/examples/Components/Routes/Collaboration3', + }, + }, ] const router = new VueRouter({