Răsfoiți Sursa

convenient examples and merge with master

Michelle Bu 12 ani în urmă
părinte
comite
35dcd0959a
7 a modificat fișierele cu 7 adăugiri și 6 ștergeri
  1. 1 1
      changelog.md
  2. 1 1
      dist/peer.js
  3. 0 0
      dist/peer.min.js
  4. 1 1
      docs/api.md
  5. 2 1
      examples/chat.html
  6. 1 1
      examples/helloworld.html
  7. 1 1
      lib/peer.js

+ 1 - 1
changelog.md

@@ -1,7 +1,7 @@
 # PeerJS Changelog
 
 ## Version 0.2.1 (Pending)
-* **Warning**: this build changes the error of type `peer-destroyed` to `peer-disconnected`.
+* **Warning**: this build changes the error of type `peer-destroyed` to `server-disconnected`.
 * Browser detection added. If an incompatible browser is detected, the `browser-incompatible` error is emitted from the `Peer`.
 * Added a `.disconnect()` method to `Peer`, which can be called to close connections to the PeerServer (but not any active DataConnections).
 

+ 1 - 1
dist/peer.js

@@ -1419,7 +1419,7 @@ Peer.prototype._cleanup = function() {
  * is waiting for an ID. */
 Peer.prototype.connect = function(peer, options) {
   if (this.disconnected) {
-    this._warn('peer-disconnected', 'This Peer has been disconnected from the server and');
+    this._warn('server-disconnected', 'This Peer has been disconnected from the server and can no longer make connections.');
     return;
   }
 

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/peer.min.js


+ 1 - 1
docs/api.md

@@ -99,7 +99,7 @@ The `error` object also has a `type` parameter that may be helpful in responding
   * `socket-error`: An error from the underlying socket.
   * `socket-closed`: The underlying socket closed unexpectedly.
 * (The Peer object is destroyed after one of the errors above are emitted.)
-* `peer-disconnected`: A Peer that has been disconnected is being used to try to connect.
+* `server-disconnected`: A Peer that has been disconnected is being used to try to connect.
 
 ### Event: 'close'
 

+ 2 - 1
examples/chat.html

@@ -9,9 +9,10 @@
 
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> 
 <script type="text/javascript" src="http://cdn.peerjs.com/0/peer.js"></script>
+<script type="text/javascript" src="../dist/peer.js"></script>
 <script>
 // Connect to PeerJS, have server assign an ID instead of providing one
-var peer = new Peer({key: 'lwjd5qra8257b9', debug: true});
+peer = new Peer({key: 'lwjd5qra8257b9', debug: true});
 
 // Show this peer's ID.
 peer.on('open', function(id){

+ 1 - 1
examples/helloworld.html

@@ -7,12 +7,12 @@
 
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> 
 <script type="text/javascript" src="http://cdn.peerjs.com/0/peer.js"></script>
+<script src="../dist/peer.js"></script>
 <script>
   // This is a very simple code example. See chat.html for a more involved
   // example.
 
   $(document).ready(function() {
-    var peer1, peer2, peerId1;
 
     // Create a new Peer with our demo API key, with debug set to true so we can
     // see what's going on.

+ 1 - 1
lib/peer.js

@@ -247,7 +247,7 @@ Peer.prototype._cleanup = function() {
  * is waiting for an ID. */
 Peer.prototype.connect = function(peer, options) {
   if (this.disconnected) {
-    this._warn('peer-disconnected', 'This Peer has been disconnected from the server and');
+    this._warn('server-disconnected', 'This Peer has been disconnected from the server and can no longer make connections.');
     return;
   }
 

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff