зеркало из https://github.com/nextcloud/text.git
62 строки
1.4 KiB
HTML
62 строки
1.4 KiB
HTML
<!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, ImageResolver, IMAGE_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, {
|
|
[IMAGE_RESOLVER]: { get: () => this.$imageResolver },
|
|
})
|
|
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.$imageResolver = new ImageResolver({
|
|
currentDirectory: '/dir/',
|
|
shareToken: 'SHARE_TOKEN',
|
|
user: { uid: 'USER_UID' },
|
|
fileId: '4173',
|
|
})
|
|
},
|
|
})
|
|
app.$mount('#app')
|
|
</script>
|
|
</body>
|
|
</html>
|