yjs/doc/class/PeerJsConnector.html

296 lines
6.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>Yatta! API</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Yatta!'>
Yatta!
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>PeerJsConnector</span>
</div>
</div>
<div id='content'>
<h1>
Class:
PeerJsConnector
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;Connectors&#47;PeerJsConnector.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>PeerJs is a Framework that enables you to connect to other peers. You just need the
user-id of the peer (browser/client). And then you can connect to it.</p>
</div>
<div class='tags'>
<h3>See also:</h3>
<ul class='see'>
<li>
<a href='http://peerjs.com'>http:&#47;&#47;peerjs.com</a>
</li>
</ul>
</div>
<h2>Instance Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#connectToPeer-dynamic'>
#
(void)
<b>connectToPeer</b><span>(id)</span>
</a>
</span>
<span class='desc'>
Connect the Framework to another peer.
</span>
</li>
<li>
<span class='signature'>
<a href='#getAllConnectionIds-dynamic'>
#
(Array&lt;String&gt;)
<b>getAllConnectionIds</b><span>()</span>
</a>
</span>
<span class='desc'>
Receive the id of every connected peer.
</span>
</li>
<li>
<span class='signature'>
<a href='#addConnection-dynamic'>
#
(void)
<b>addConnection</b><span>(conn)</span>
</a>
</span>
<span class='desc'>
Adds an existing connection to this connector.
</span>
</li>
</ul>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-dynamic'>
#
(void)
<b>constructor</b><span>(engine, HB, execution_listener, yatta)</span>
<br>
</p>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>engine</span>
<span class='type'>
(
<tt>Engine</tt>
)
</span>
&mdash;
<span class='desc'>The transformation engine </span>
</li>
<li>
<span class='name'>HB</span>
<span class='type'>
(
<tt>HistoryBuffer</tt>
)
</span>
</li>
<li>
<span class='name'>execution_listener</span>
<span class='type'>
(
<tt>Array&lt;Function&gt;</tt>
)
</span>
&mdash;
<span class='desc'>You must ensure that whenever an operation is executed, every function in this Array is called. </span>
</li>
<li>
<span class='name'>yatta</span>
<span class='type'>
(
<tt>Yatta</tt>
)
</span>
&mdash;
<span class='desc'>The Yatta framework. </span>
</li>
</ul>
</div>
</div>
</div>
<h2>Instance Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='connectToPeer-dynamic'>
#
(void)
<b>connectToPeer</b><span>(id)</span>
<br>
</p>
<div class='docstring'>
<p>Connect the Framework to another peer. Therefore you have to receive his
user_id. If the other peer is connected to other peers, the PeerJsConnector
will automatically connect to them too.</p><p>Transmitting the user_id is your job.
See <a href="../../examples/TextEditing/">TextEditing</a> for a nice example
on how to do that with urls.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>id</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>Connection id </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getAllConnectionIds-dynamic'>
#
(Array&lt;String&gt;)
<b>getAllConnectionIds</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Receive the id of every connected peer.</p>
</div>
<div class='tags'>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Array&lt;String&gt;</tt>
)
&mdash;
<span class='desc'>A list of Peer-Ids </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='addConnection-dynamic'>
#
(void)
<b>addConnection</b><span>(conn)</span>
<br>
</p>
<div class='docstring'>
<p>Adds an existing connection to this connector.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>conn</span>
<span class='type'>
(
<tt>PeerJsConnection</tt>
)
</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
September 26, 14 11:52:44 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>