add source file info to examples
This commit is contained in:
		
							parent
							
								
									3ddff186c2
								
							
						
					
					
						commit
						ab3dba5b06
					
				@ -17,6 +17,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<div id="content" contenteditable=""></div>
 | 
					<div id="content" contenteditable=""></div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
 | 
					  <!-- The actual source file for the following code is found in ./dom.js. Run `npm run watch` to compile the files -->
 | 
				
			||||||
  <script class="code-js" src="./build/dom.js">
 | 
					  <script class="code-js" src="./build/dom.js">
 | 
				
			||||||
    import * as Y from 'yjs/index.js'
 | 
					    import * as Y from 'yjs/index.js'
 | 
				
			||||||
    import { WebsocketProvider } from 'yjs/provider/websocket.js'
 | 
					    import { WebsocketProvider } from 'yjs/provider/websocket.js'
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,9 @@ import * as Y from '../index.js'
 | 
				
			|||||||
import { WebsocketProvider } from '../provider/websocket.js'
 | 
					import { WebsocketProvider } from '../provider/websocket.js'
 | 
				
			||||||
import { DomBinding } from '../bindings/dom.js'
 | 
					import { DomBinding } from '../bindings/dom.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const provider = new WebsocketProvider('wss://api.yjs.website')
 | 
					import * as conf from './exampleConfig.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const provider = new WebsocketProvider(conf.serverAddress)
 | 
				
			||||||
const ydocument = provider.get('dom')
 | 
					const ydocument = provider.get('dom')
 | 
				
			||||||
const type = ydocument.define('xml', Y.XmlFragment)
 | 
					const type = ydocument.define('xml', Y.XmlFragment)
 | 
				
			||||||
const binding = new DomBinding(type, document.querySelector('#content'), { scrollingElement: document.scrollingElement })
 | 
					const binding = new DomBinding(type, document.querySelector('#content'), { scrollingElement: document.scrollingElement })
 | 
				
			||||||
 | 
				
			|||||||
@ -48,6 +48,7 @@
 | 
				
			|||||||
<div id="editor" style="margin-bottom: 23px"></div>
 | 
					<div id="editor" style="margin-bottom: 23px"></div>
 | 
				
			||||||
<div style="display: none" id="content"></div>
 | 
					<div style="display: none" id="content"></div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
 | 
					  <!-- The actual source file for the following code is found in ./prosemirror.js. Run `npm run watch` to compile the files -->
 | 
				
			||||||
  <script class="code-js" src="./build/prosemirror.js">
 | 
					  <script class="code-js" src="./build/prosemirror.js">
 | 
				
			||||||
import * as Y from 'yjs'
 | 
					import * as Y from 'yjs'
 | 
				
			||||||
import { WebsocketProvider } from '../provider/websocket.js'
 | 
					import { WebsocketProvider } from '../provider/websocket.js'
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,8 @@
 | 
				
			|||||||
import * as Y from '../index.js'
 | 
					import * as Y from '../index.js'
 | 
				
			||||||
import { WebsocketProvider } from '../provider/websocket.js'
 | 
					import { WebsocketProvider } from '../provider/websocket.js'
 | 
				
			||||||
import { prosemirrorPlugin, cursorPlugin } from '../bindings/prosemirror'
 | 
					import { prosemirrorPlugin, cursorPlugin } from '../bindings/prosemirror.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import * as conf from './exampleConfig.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { EditorState } from 'prosemirror-state'
 | 
					import { EditorState } from 'prosemirror-state'
 | 
				
			||||||
import { EditorView } from 'prosemirror-view'
 | 
					import { EditorView } from 'prosemirror-view'
 | 
				
			||||||
@ -8,7 +10,7 @@ import { DOMParser } from 'prosemirror-model'
 | 
				
			|||||||
import { schema } from 'prosemirror-schema-basic'
 | 
					import { schema } from 'prosemirror-schema-basic'
 | 
				
			||||||
import { exampleSetup } from 'prosemirror-example-setup'
 | 
					import { exampleSetup } from 'prosemirror-example-setup'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const provider = new WebsocketProvider('wss://api.yjs.website')
 | 
					const provider = new WebsocketProvider(conf.serverAddress)
 | 
				
			||||||
const ydocument = provider.get('prosemirror')
 | 
					const ydocument = provider.get('prosemirror')
 | 
				
			||||||
const type = ydocument.define('prosemirror', Y.XmlFragment)
 | 
					const type = ydocument.define('prosemirror', Y.XmlFragment)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -13,6 +13,7 @@
 | 
				
			|||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
 | 
					  <!-- The actual source file for the following code is found in ./quill.js. Run `npm run watch` to compile the files -->
 | 
				
			||||||
  <script class="code-js" src="./build/quill.js">
 | 
					  <script class="code-js" src="./build/quill.js">
 | 
				
			||||||
import * as Y from 'yjs'
 | 
					import * as Y from 'yjs'
 | 
				
			||||||
import { WebsocketProvider } from 'yjs/provider/websocket.js'
 | 
					import { WebsocketProvider } from 'yjs/provider/websocket.js'
 | 
				
			||||||
 | 
				
			|||||||
@ -2,9 +2,11 @@ import * as Y from '../index.js'
 | 
				
			|||||||
import { WebsocketProvider } from '../provider/websocket.js'
 | 
					import { WebsocketProvider } from '../provider/websocket.js'
 | 
				
			||||||
import { QuillBinding } from '../bindings/quill.js'
 | 
					import { QuillBinding } from '../bindings/quill.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import * as conf from './exampleConfig.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import Quill from 'quill'
 | 
					import Quill from 'quill'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const provider = new WebsocketProvider('wss://api.yjs.website')
 | 
					const provider = new WebsocketProvider(conf.serverAddress)
 | 
				
			||||||
const ydocument = provider.get('quill')
 | 
					const ydocument = provider.get('quill')
 | 
				
			||||||
const ytext = ydocument.define('quill', Y.Text)
 | 
					const ytext = ydocument.define('quill', Y.Text)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -10,6 +10,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<textarea style="width:80%;" rows=40 autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
 | 
					<textarea style="width:80%;" rows=40 autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
 | 
					  <!-- The actual source file for the following code is found in ./textarea.js. Run `npm run watch` to compile the files -->
 | 
				
			||||||
  <script class="code-js" src="./build/textarea.js">
 | 
					  <script class="code-js" src="./build/textarea.js">
 | 
				
			||||||
import * as Y from 'yjs'
 | 
					import * as Y from 'yjs'
 | 
				
			||||||
import { WebsocketProvider } from 'yjs/provider/websocket.js'
 | 
					import { WebsocketProvider } from 'yjs/provider/websocket.js'
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,9 @@ import * as Y from '../index.js'
 | 
				
			|||||||
import { WebsocketProvider } from '../provider/websocket.js'
 | 
					import { WebsocketProvider } from '../provider/websocket.js'
 | 
				
			||||||
import { TextareaBinding } from '../bindings/textarea.js'
 | 
					import { TextareaBinding } from '../bindings/textarea.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const provider = new WebsocketProvider('wss://api.yjs.website')
 | 
					import * as conf from './exampleConfig.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const provider = new WebsocketProvider(conf.serverAddress)
 | 
				
			||||||
const ydocument = provider.get('textarea')
 | 
					const ydocument = provider.get('textarea')
 | 
				
			||||||
const type = ydocument.define('textarea', Y.Text)
 | 
					const type = ydocument.define('textarea', Y.Text)
 | 
				
			||||||
const textarea = document.querySelector('textarea')
 | 
					const textarea = document.querySelector('textarea')
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user