diff --git a/gulpfile.js b/gulpfile.js index 251dca56..ad6419cf 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -17,9 +17,8 @@ var stylish = require('jshint-stylish'); var _src = { GULP: './gulpfile.js', ICON: './public/img/notifications/logo.png', - // JS_CONFIG: './src/main/conf/build.js', // path to requirejs config file - JS_SRC: './js/**/*.js', - JS_LIBS: './js/lib/**/*.js', + JS_SRC: './js/**/*', + JS_LIBS: './js/lib/**/*', JS_BUILD: './build_js', JS_DIST: './public/js', PACKAGE: './package.json' diff --git a/js/app/map/map.js b/js/app/map/map.js index 71c191e7..fd5a7cdc 100644 --- a/js/app/map/map.js +++ b/js/app/map/map.js @@ -465,6 +465,16 @@ define([ if(!system){ + // set system name or alias + var systemName = data.name; + + if( + data.alias && + data.alias !== '' + ){ + systemName = data.alias; + } + // get system info classes var effectBasicClass = Util.getEffectInfoForSystem('effect', 'class'); var effectName = Util.getEffectInfoForSystem(data.effect, 'name'); @@ -476,42 +486,42 @@ define([ id: systemId, class: config.systemClass }).append( - // system head - $('
', { - class: config.systemHeadClass - }).append( - // System name is editable - $('', { - href: '#', - class: config.systemHeadNameClass - }) - ).append( - // System locked status - $('', { - class: ['fa', 'fa-lock', 'fa-fw'].join(' ') - }).attr('title', 'locked') - ).append( - // System effect color - $('', { - class: ['fa', 'fa-square ', 'fa-fw', effectBasicClass, effectClass].join(' ') - }).attr('title', effectName) - ).append( - // expand option - $('', { - class: ['fa', 'fa-angle-down ', config.systemHeadExpandClass].join(' ') - }) - ).prepend( - $('', { - class: [config.systemSec, secClass].join(' '), - text: data.security - }) - ) - ).append( - // system body - $('
', { - class: config.systemBodyClass - }) - ).data('name', data.name); + // system head + $('
', { + class: config.systemHeadClass + }).append( + // System name is editable + $('', { + href: '#', + class: config.systemHeadNameClass + }).attr('data-value', systemName) + ).append( + // System locked status + $('', { + class: ['fa', 'fa-lock', 'fa-fw'].join(' ') + }).attr('title', 'locked') + ).append( + // System effect color + $('', { + class: ['fa', 'fa-square ', 'fa-fw', effectBasicClass, effectClass].join(' ') + }).attr('title', effectName) + ).append( + // expand option + $('', { + class: ['fa', 'fa-angle-down ', config.systemHeadExpandClass].join(' ') + }) + ).prepend( + $('', { + class: [config.systemSec, secClass].join(' '), + text: data.security + }) + ) + ).append( + // system body + $('
', { + class: config.systemBodyClass + }) + ); // set initial system position system.css({ @@ -530,7 +540,6 @@ define([ newPosX !== currentPosX || newPosY !== currentPosY ){ - // change position with animation system.velocity( { @@ -558,23 +567,18 @@ define([ } ); } + + // set system alias + var alias = system.getSystemInfo(['alias']); + + if(alias !== data.alias){ + // alias changed + system.find('.' + config.systemHeadNameClass).editable('setValue', data.alias); + } } - // set system name or alias - var systemName = data.name; - - if( - data.alias && - data.alias !== '' - ){ - systemName = data.alias; - } - - system.find('.' + config.systemHeadNameClass).attr('data-value', systemName); - // set system status system.setSystemStatus(data.status.name); - system.data('id', parseInt(data.id)); system.data('systemId', parseInt(data.systemId)); system.data('name', data.name); @@ -1103,6 +1107,7 @@ define([ headElement.editable({ mode: 'popup', type: 'text', + name: 'alias', title: 'System alias', placement: 'top', onblur: 'submit', @@ -2658,7 +2663,14 @@ define([ switch(info[i]){ case 'alias': // get current system alias - systemInfo.push( $(this).find('.' + config.systemHeadNameClass).text() ); + var systemHeadNameElement = $(this).find('.' + config.systemHeadNameClass); + var alias = ''; + if( systemHeadNameElement.hasClass('editable') ){ + // xEditable is initiated + alias = systemHeadNameElement.editable('getValue', true); + } + + systemInfo.push(alias ); break; default: systemInfo.push('bad system query'); diff --git a/js/app/page.js b/js/app/page.js index 19027e52..9d7368e0 100644 --- a/js/app/page.js +++ b/js/app/page.js @@ -966,7 +966,7 @@ define([ var timer = function(){ // change status on first timer iteration - if(programStatusCounter === Init.timer['PROGRAM_STATUS_VISIBLE']){ + if(programStatusCounter === Init.timer.PROGRAM_STATUS_VISIBLE){ statusElement.velocity('stop').velocity('fadeOut', { duration: Init.animationSpeed.headerLink, @@ -992,7 +992,7 @@ define([ }; if(! programStatusInterval){ - programStatusCounter = Init.timer['PROGRAM_STATUS_VISIBLE']; + programStatusCounter = Init.timer.PROGRAM_STATUS_VISIBLE; programStatusInterval = setInterval(timer, 1000); } } diff --git a/js/app/ui/header.js b/js/app/ui/header.js index b1aeb211..1dd7bfb0 100644 --- a/js/app/ui/header.js +++ b/js/app/ui/header.js @@ -60,7 +60,7 @@ define([ } } - for(var m = 0; k < connectionCount; m++) { + for(var m = 0; m < connectionCount; m++) { if(!placed) { if(getDistance(p1, p2) < getDistance(p1, closest[m])) { closest[m] = p2; diff --git a/js/app/util.js b/js/app/util.js index 5e63115c..3aabafb2 100644 --- a/js/app/util.js +++ b/js/app/util.js @@ -631,21 +631,21 @@ define([ // make sure the delay timer is valid! // if this is called for the first time -> set CURRENT_DELAY if( - Init.timer[updateKey]['CURRENT_DELAY'] === undefined || - Init.timer[updateKey]['CURRENT_DELAY'] <= 0 + Init.timer[updateKey].CURRENT_DELAY === undefined || + Init.timer[updateKey].CURRENT_DELAY <= 0 ){ - Init.timer[updateKey]['CURRENT_DELAY'] = Init.timer[updateKey]['DELAY']; + Init.timer[updateKey].CURRENT_DELAY = Init.timer[updateKey].DELAY; } // in/decrease the trigger delay if( value === parseInt(value, 10) && - ( Init.timer[updateKey]['CURRENT_DELAY'] ) + value > 0 + ( Init.timer[updateKey].CURRENT_DELAY ) + value > 0 ){ - Init.timer[updateKey]['CURRENT_DELAY'] += value; + Init.timer[updateKey].CURRENT_DELAY += value; } - return Init.timer[updateKey]['CURRENT_DELAY']; + return Init.timer[updateKey].CURRENT_DELAY; }; /** diff --git a/package.json b/package.json index 59a08584..b03b07fe 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,10 @@ { - "name": "pathfinder", - "version": "1.0.0", - "description": "System mapping tool for EVE ONLINE", + "name": "pathfinder-eve", + "version": "0.0.10", + "engines" : { + "node" : "4.0.x" + }, + "description": "Pathfinder is a system mapping tool for EVE ONLINE", "main": "index.php", "dependencies": { "requirejs": "^2.1.20" @@ -16,7 +19,6 @@ "gulp-plumber": "^1.0.1", "jshint": "^2.8.0", "jshint-stylish": "^2.0.1", - "requirejs": "^2.1.20", "run-sequence": "^1.1.2" }, "scripts": { @@ -27,15 +29,18 @@ "url": "git+https://github.com/exodus4d/pathfinder.git" }, "keywords": [ - "Pathfinder", - "Exodus 4D", - "EVE ONLINE", - "Wormhole" + "pathfinder", + "exodus 4d", + "eve online", + "wormhole", + "mapping" ], - "author": "Exodus 4D", - "license": "ISC", + "author": "Exodus 4D (https://github.com/exodus4d)", + "license": "MIT", "bugs": { - "url": "https://github.com/exodus4d/pathfinder/issues" + "url": "https://github.com/exodus4d/pathfinder/issues", + "email" : "pathfinder@exodus4d.de" }, - "homepage": "https://github.com/exodus4d/pathfinder#readme" + "homepage": "https://github.com/exodus4d/pathfinder#readme", + "private": true }