mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-06-03 19:58:27 +02:00
Added eslit and circle.yml
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"node": true,
|
||||||
|
"es6": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"quotes": [2, "single"],
|
||||||
|
"strict": [2, "never"],
|
||||||
|
"no-multi-spaces": false,
|
||||||
|
"no-alert": false,
|
||||||
|
"key-spacing": false,
|
||||||
|
"curly": false,
|
||||||
|
"no-octal-escape": false
|
||||||
|
},
|
||||||
|
"globals": {
|
||||||
|
"$": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,6 +50,10 @@ module.exports = function(grunt) {
|
|||||||
watch: ['app/server']
|
watch: ['app/server']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
eslint: {
|
||||||
|
src: ["app"]
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -58,6 +62,7 @@ module.exports = function(grunt) {
|
|||||||
grunt.loadNpmTasks('grunt-nodemon');
|
grunt.loadNpmTasks('grunt-nodemon');
|
||||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-eslint');
|
||||||
|
|
||||||
grunt.registerTask('build', ['browserify:pro', 'uglify']);
|
grunt.registerTask('build', ['browserify:pro', 'uglify']);
|
||||||
grunt.registerTask('debug', ['browserify:dev']);
|
grunt.registerTask('debug', ['browserify:dev']);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
var angular = angular;
|
||||||
|
|
||||||
// initialize angular application
|
// initialize angular application
|
||||||
var app = angular.module('chat', []);
|
var app = angular.module('chat', []);
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ module.exports = function($scope, socket, servers) {
|
|||||||
password: $scope.password,
|
password: $scope.password,
|
||||||
hostname: $scope.ip,
|
hostname: $scope.ip,
|
||||||
port: $scope.port || 25565
|
port: $scope.port || 25565
|
||||||
}, function(response) {
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,26 +1,16 @@
|
|||||||
module.exports = function() {
|
module.exports = function() {
|
||||||
|
|
||||||
// initialize servers store if doesn't exist
|
// initialize servers store if doesn't exist
|
||||||
localStorage.servers = localStorage.servers || "[]";
|
localStorage.servers = localStorage.servers || '[]';
|
||||||
|
|
||||||
// function to save servers into localStorage
|
|
||||||
function save() {
|
|
||||||
localStorage.servers = JSON.stringify(servers);
|
|
||||||
}
|
|
||||||
|
|
||||||
// default servers
|
|
||||||
var defaultServers = [
|
|
||||||
{name: 'LattyCraft', ip: 'us.latty.info', port: 25565}
|
|
||||||
];
|
|
||||||
|
|
||||||
// load servers from localstorage
|
// load servers from localstorage
|
||||||
var servers = JSON.parse(localStorage.servers);
|
var servers = JSON.parse(localStorage.servers);
|
||||||
|
|
||||||
|
|
||||||
// if no servers are saved, load the default ones
|
// function to save servers into localStorage
|
||||||
if (!servers || servers.length === 0) {
|
function save() {
|
||||||
servers = defaultServers;
|
localStorage.servers = JSON.stringify(servers);
|
||||||
save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
module.exports = function() {
|
module.exports = function() {
|
||||||
|
|
||||||
|
var io = io;
|
||||||
|
|
||||||
var socket = io(window.location.host);
|
var socket = io(window.location.host);
|
||||||
return socket;
|
return socket;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
module.exports = function() {
|
module.exports = function() {
|
||||||
|
|
||||||
var connected = "connected";
|
var createjs = createjs;
|
||||||
var error = "error";
|
|
||||||
|
|
||||||
createjs.Sound.registerSound("/sounds/connected.mp3", connected);
|
var connected = 'connected';
|
||||||
|
|
||||||
|
createjs.Sound.registerSound('/sounds/connected.mp3', connected);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
connected: function() {
|
connected: function() {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ var parseExtra = require('../parsers/extra');
|
|||||||
|
|
||||||
module.exports = function(jsonMsg) {
|
module.exports = function(jsonMsg) {
|
||||||
|
|
||||||
var buffer = '';
|
var username, msg, sender, broadcast, connected, max, current, pages, player, victim, killer, achievement;
|
||||||
var color = stringToCode(jsonMsg.color);
|
var color = stringToCode(jsonMsg.color);
|
||||||
|
|
||||||
switch (jsonMsg.translate) {
|
switch (jsonMsg.translate) {
|
||||||
@@ -95,6 +95,8 @@ module.exports = function(jsonMsg) {
|
|||||||
|
|
||||||
function parseAdmin(command) {
|
function parseAdmin(command) {
|
||||||
|
|
||||||
|
var player, gamemode;
|
||||||
|
|
||||||
switch (command.translate) {
|
switch (command.translate) {
|
||||||
|
|
||||||
case 'commands.downfall.success':
|
case 'commands.downfall.success':
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ var events = require('../../bot');
|
|||||||
|
|
||||||
module.exports = function(socket) {
|
module.exports = function(socket) {
|
||||||
|
|
||||||
socket.on('server:connect', function(data, response) {
|
socket.on('server:connect', function(data) {
|
||||||
|
|
||||||
if (socket.mcbot) {
|
if (socket.mcbot) {
|
||||||
socket.emit('buffer:error', 'Pleae disconnect before connecting again');
|
socket.emit('buffer:error', 'Pleae disconnect before connecting again');
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
module.exports = function escapeHtml(unsafe) {
|
module.exports = function escapeHtml(unsafe) {
|
||||||
return unsafe
|
return unsafe
|
||||||
.replace(/&/g, "&")
|
.replace(/&/g, '&')
|
||||||
.replace(/</g, "<")
|
.replace(/</g, '<')
|
||||||
.replace(/>/g, ">")
|
.replace(/>/g, '>')
|
||||||
.replace(/"/g, """)
|
.replace(/"/g, '"')
|
||||||
.replace(/'/g, "'");
|
.replace(/'/g, ''');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
machine:
|
||||||
|
node:
|
||||||
|
version: 0.10.32
|
||||||
|
dependencies:
|
||||||
|
pre:
|
||||||
|
- npm install grunt-cli -g
|
||||||
+2
-1
@@ -9,6 +9,7 @@
|
|||||||
"express": "^4.12.3",
|
"express": "^4.12.3",
|
||||||
"grunt": "^0.4.5",
|
"grunt": "^0.4.5",
|
||||||
"grunt-browserify": "^3.7.0",
|
"grunt-browserify": "^3.7.0",
|
||||||
|
"grunt-contrib-eslint": "0.0.5",
|
||||||
"grunt-contrib-uglify": "^0.9.1",
|
"grunt-contrib-uglify": "^0.9.1",
|
||||||
"grunt-contrib-watch": "^0.6.1",
|
"grunt-contrib-watch": "^0.6.1",
|
||||||
"grunt-nodemon": "^0.4.0",
|
"grunt-nodemon": "^0.4.0",
|
||||||
@@ -18,7 +19,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "grunt eslint",
|
||||||
"start": "node app/server"
|
"start": "node app/server"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user