removed disconnect button for example
This commit is contained in:
		
							parent
							
								
									6c13be376f
								
							
						
					
					
						commit
						acfce06912
					
				@ -1,7 +1,6 @@
 | 
				
			|||||||
<!DOCTYPE html>
 | 
					<!DOCTYPE html>
 | 
				
			||||||
<html>
 | 
					<html>
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
  <button id="button">Disconnect</button>
 | 
					 | 
				
			||||||
  <h1 id="contenteditable" contentEditable></h1>
 | 
					  <h1 id="contenteditable" contentEditable></h1>
 | 
				
			||||||
  <textarea style="width:80%;" rows=40 id="textfield"></textarea>
 | 
					  <textarea style="width:80%;" rows=40 id="textfield"></textarea>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -7,7 +7,7 @@ Y({
 | 
				
			|||||||
    namespace: 'offlineEditingDemo'
 | 
					    namespace: 'offlineEditingDemo'
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  connector: {
 | 
					  connector: {
 | 
				
			||||||
    name: 'webrtc',
 | 
					    name: 'websockets-client',
 | 
				
			||||||
    room: 'offlineEditingDemo',
 | 
					    room: 'offlineEditingDemo',
 | 
				
			||||||
    debug: true
 | 
					    debug: true
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
@ -38,15 +38,4 @@ Y({
 | 
				
			|||||||
  if (textpromise == null) {
 | 
					  if (textpromise == null) {
 | 
				
			||||||
    yconfig.root.set('text', Y.Text)
 | 
					    yconfig.root.set('text', Y.Text)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  // We also provide a button for disconnecting/reconnecting the shared element
 | 
					 | 
				
			||||||
  var button = document.querySelector('#button')
 | 
					 | 
				
			||||||
  button.onclick = function () {
 | 
					 | 
				
			||||||
    if (button.innerText === 'Disconnect') {
 | 
					 | 
				
			||||||
      yconfig.disconnect()
 | 
					 | 
				
			||||||
      button.innerText = 'Reconnect'
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
      yconfig.reconnect()
 | 
					 | 
				
			||||||
      button.innerText = 'Disconnect'
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user