mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Small fixes, and removing unused variables
This commit is contained in:
		| @@ -2,9 +2,9 @@ | |||||||
|   "name": "zoff", |   "name": "zoff", | ||||||
|   "version": "2.0.2", |   "version": "2.0.2", | ||||||
|   "description": "Zoff, the shared YouTube based radio services", |   "description": "Zoff, the shared YouTube based radio services", | ||||||
|   "main": "server/index.js", |   "main": "server/app.js", | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "start": "gulp build && node server/index.js", |     "start": "gulp build && node server/app.js", | ||||||
|     "test": "echo \"Error: no test specified\" && exit 1" |     "test": "echo \"Error: no test specified\" && exit 1" | ||||||
|   }, |   }, | ||||||
|   "repository": { |   "repository": { | ||||||
|   | |||||||
| @@ -1,13 +1,8 @@ | |||||||
| var express = require('express'), | var cluster = require('cluster'), | ||||||
|     cluster = require('cluster'), |  | ||||||
|     net = require('net'), |     net = require('net'), | ||||||
|     socketio = require('socket.io'), |     path = require('path'), | ||||||
|     socket_redis = require('socket.io-redis'); |     publicPath = path.join(__dirname, 'public'), | ||||||
|  |     http = require('http'); | ||||||
|     var path = require('path'); |  | ||||||
|     var publicPath = path.join(__dirname, 'public'); |  | ||||||
|  |  | ||||||
|     var http = require('http'); |  | ||||||
|  |  | ||||||
| var port = 8080, | var port = 8080, | ||||||
|     num_processes = require('os').cpus().length; |     num_processes = require('os').cpus().length; | ||||||
| @@ -37,7 +32,7 @@ if (cluster.isMaster) { | |||||||
|     // Helper function for getting a worker index based on IP address. |     // Helper function for getting a worker index based on IP address. | ||||||
|     // This is a hot path so it should be really fast. The way it works |     // This is a hot path so it should be really fast. The way it works | ||||||
|     // is by converting the IP address to a number by removing non numeric |     // is by converting the IP address to a number by removing non numeric | ||||||
|   // characters, then compressing it to the number of slots we have. |     // characters, then compressing it to the number of slots we have. | ||||||
|     // |     // | ||||||
|     // Compared against "real" hashing (from the sticky-session code) and |     // Compared against "real" hashing (from the sticky-session code) and | ||||||
|     // "real" IP number conversion, this function is on par in terms of |     // "real" IP number conversion, this function is on par in terms of | ||||||
| @@ -110,28 +105,13 @@ if (cluster.isMaster) { | |||||||
|  |  | ||||||
|     var socketIO = app.socketIO; |     var socketIO = app.socketIO; | ||||||
|     var redis = require('socket.io-redis'); |     var redis = require('socket.io-redis'); | ||||||
|     socketIO.adapter(redis({ host: 'localhost', port: 6379 })); |     try { | ||||||
|     //socketIO.set( 'origins', '*localhost:8080' ); |         socketIO.adapter(redis({ host: 'localhost', port: 6379 })); | ||||||
|  |     } catch(e) { | ||||||
|  |         console.log("No redis-server to connect to.."); | ||||||
|  |     } | ||||||
|     socketIO.listen(server); |     socketIO.listen(server); | ||||||
|  |  | ||||||
|     // Tell Socket.IO to use the redis adapter. By default, the redis |  | ||||||
|     // server is assumed to be on localhost:6379. You don't have to |  | ||||||
|     // specify them explicitly unless you want to change them. |  | ||||||
|     //io.adapter(socket_redis({ host: 'localhost', port: 6379 })); |  | ||||||
|  |  | ||||||
|     // Here you might use Socket.IO middleware for authorization etc. |  | ||||||
|  |  | ||||||
|     /*io.on('connection', function(socket) { |  | ||||||
|         console.log('New client connection detected on process ' + process.pid); |  | ||||||
|  |  | ||||||
|         socket.emit('welcome', {message: 'Welcome to BlueFrog Chat Room'}); |  | ||||||
|         socket.on('new.message', function(message) { |  | ||||||
|             socket.emit('new.message', message); |  | ||||||
|         }) |  | ||||||
|  |  | ||||||
|     });*/ |  | ||||||
|  |  | ||||||
|  |  | ||||||
|     // Listen to messages sent from the master. Ignore everything else. |     // Listen to messages sent from the master. Ignore everything else. | ||||||
|     process.on('message', function(message, connection) { |     process.on('message', function(message, connection) { | ||||||
|         if (message !== 'sticky-session:connection') { |         if (message !== 'sticky-session:connection') { | ||||||
|   | |||||||
| @@ -825,18 +825,7 @@ var List = { | |||||||
|     show: function() { |     show: function() { | ||||||
|         if(!Helper.mobilecheck()) |         if(!Helper.mobilecheck()) | ||||||
|         { |         { | ||||||
|             /*if(showToggle){ |             $("#channel-share-modal").modal("open"); | ||||||
|                 showToggle=false; |  | ||||||
|                 $("#toptitle").empty(); |  | ||||||
|                 $("#chan").addClass("bigChan"); |  | ||||||
|                 //$("#chan").html("zoff.me/"+encodeURI(chan)); |  | ||||||
|                 $("#chan").html("zoff.me/"+chan.toLowerCase()); |  | ||||||
|             }else{ |  | ||||||
|                 showToggle=true; |  | ||||||
|                 $("#toptitle").html("Zoff"); |  | ||||||
|                 $("#chan").removeClass("bigChan"); |  | ||||||
|                 $("#chan").html(chan); |  | ||||||
|             }*/$("#channel-share-modal").modal("open"); |  | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,7 +1,6 @@ | |||||||
| var chan 				  		= window.chan === undefined ? $("#chan").html() : window.chan; | var chan 				  		= window.chan === undefined ? $("#chan").html() : window.chan; | ||||||
| var w_p 				  		= true; | var w_p 				  		= true; | ||||||
| var hasadmin			  		= 0; | var hasadmin			  		= 0; | ||||||
| var showToggle 			  		= true; |  | ||||||
| var list_html 			  		= $("#list-song-html").html(); | var list_html 			  		= $("#list-song-html").html(); | ||||||
| var unseen 			   	  		= false; | var unseen 			   	  		= false; | ||||||
| var api_key 		   	  		= "***REMOVED***"; | var api_key 		   	  		= "***REMOVED***"; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user