Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.html - github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 88da39dfb1dc406a15f30160b7244ce4b0203c91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/favicon.ico" />
    <link rel="stylesheet" href="/dist/style.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Test the package</title>
  </head>
  <body>
    <div id="app"></div>
	<script>
	OC = { webroot: '/OC_WEBROOT' }
	</script>
    <script type="module">
	    import { RichTextReader, AttachmentResolver, ATTACHMENT_RESOLVER } from './src/package.js'
		import Vue from 'vue'
		import content from './src/tests/fixtures/basic.md?raw'
		const app = new Vue({
			data() {
				return {
					content
				}
			},
			provide() {
				const val = {}
				Object.defineProperties(val, {
					[ATTACHMENT_RESOLVER]: { get: () => this.$attachmentResolver },
				})
				return val
			},
			render: (h) => h('div', [
				h('textarea', {
					style: {
						width: '100%',
						height: '20vh',
						padding: '0px',
					},
					on: {
						input: function (event) {
							app.content = event.target.value
						},
					},
				}, [app.content]),
				h(RichTextReader, {
					props: { content: app.content }
				}),
			]),
			created() {
				this.$attachmentResolver = new AttachmentResolver({
					currentDirectory: '/dir/',
					shareToken: 'SHARE_TOKEN',
					user: { uid: 'USER_UID' },
					fileId: '4173',
				})
			},
		})
	    app.$mount('#app')
    </script>
  </body>
</html>