PageRenderTime 61ms CodeModel.GetById 20ms RepoModel.GetById 2ms app.codeStats 1ms

/js/lib/Socket.IO-node/support/socket.io-client/lib/io.js

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
JavaScript | 25 lines | 13 code | 4 blank | 8 comment | 6 complexity | ad63504949cabfd0daa360efd64673a7 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. /**
  2. * Socket.IO client
  3. *
  4. * @author Guillermo Rauch <guillermo@learnboost.com>
  5. * @license The MIT license.
  6. * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
  7. */
  8. var io = this.io = {
  9. version: '0.6.2',
  10. setPath: function(path){
  11. if (window.console && console.error) console.error('io.setPath will be removed. Please set the variable WEB_SOCKET_SWF_LOCATION pointing to WebSocketMain.swf');
  12. this.path = /\/$/.test(path) ? path : path + '/';
  13. WEB_SOCKET_SWF_LOCATION = path + 'lib/vendor/web-socket-js/WebSocketMain.swf';
  14. }
  15. };
  16. if ('jQuery' in this) jQuery.io = this.io;
  17. if (typeof window != 'undefined'){
  18. // WEB_SOCKET_SWF_LOCATION = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//cdn.socket.io/' + this.io.version + '/WebSocketMain.swf';
  19. if (typeof WEB_SOCKET_SWF_LOCATION === 'undefined')
  20. WEB_SOCKET_SWF_LOCATION = '/socket.io/lib/vendor/web-socket-js/WebSocketMain.swf';
  21. }