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: 2a1d355f9da22b90aec9f59955d86e0d9d3f01cc (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/favicon.ico" />
    <link rel="stylesheet" href="/dist/style.css" />
    <style>
      @import url('https://nextcloud.github.io/server/apps/theming/css/default.css');
      @import url('https://nextcloud.github.io/server/core/css/server.css');
      body {
        position: absolute;
        height: unset;
        background-color: var(--color-main-background);
      }
    </style>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Test the package</title>
  </head>
  <body>
    <div id="app"></div>
	<script>
		// mock some required objects
		function t(app, string) {
			return string
		}
		OC = {
			webroot: '/dist/OC_WEBROOT',
			config: {},
			isUserAdmin() {
				return true
			}
		}
	</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>