21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Mark Friedrich
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
146
app/lib/base.php
146
app/lib/base.php
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -45,7 +45,7 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
//@{ Framework details
|
||||
const
|
||||
PACKAGE='Fat-Free Framework',
|
||||
VERSION='3.6.0-Release';
|
||||
VERSION='3.6.1-Dev';
|
||||
//@}
|
||||
|
||||
//@{ HTTP status codes (RFC 2616)
|
||||
@@ -96,7 +96,7 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
//! Mapped PHP globals
|
||||
GLOBALS='GET|POST|COOKIE|REQUEST|SESSION|FILES|SERVER|ENV',
|
||||
//! HTTP verbs
|
||||
VERBS='GET|HEAD|POST|PUT|PATCH|DELETE|CONNECT',
|
||||
VERBS='GET|HEAD|POST|PUT|PATCH|DELETE|CONNECT|OPTIONS',
|
||||
//! Default directory permissions
|
||||
MODE=0755,
|
||||
//! Syntax highlighting stylesheet
|
||||
@@ -128,6 +128,8 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
$init,
|
||||
//! Language lookup sequence
|
||||
$languages,
|
||||
//! Mutex locks
|
||||
$locks=[],
|
||||
//! Default fallback language
|
||||
$fallback='en';
|
||||
|
||||
@@ -1009,10 +1011,11 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
$country=@constant('ISO::CC_'.strtolower($parts[1])))
|
||||
$locale.='-'.$country;
|
||||
}
|
||||
$locales[]=$locale;
|
||||
$locale=str_replace('-','_',$locale);
|
||||
$locales[]=$locale.'.'.ini_get('default_charset');
|
||||
$locales[]=$locale;
|
||||
}
|
||||
setlocale(LC_ALL,str_replace('-','_',$locales));
|
||||
setlocale(LC_ALL,$locales);
|
||||
return implode(',',$this->languages);
|
||||
}
|
||||
|
||||
@@ -1160,7 +1163,7 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
return isset($headers['Client-IP'])?
|
||||
$headers['Client-IP']:
|
||||
(isset($headers['X-Forwarded-For'])?
|
||||
$headers['X-Forwarded-For']:
|
||||
explode(',',$headers['X-Forwarded-For'])[0]:
|
||||
(isset($_SERVER['REMOTE_ADDR'])?
|
||||
$_SERVER['REMOTE_ADDR']:''));
|
||||
}
|
||||
@@ -1182,7 +1185,7 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
$trace=array_filter(
|
||||
$trace,
|
||||
function($frame) use($debug) {
|
||||
return $debug && isset($frame['file']) &&
|
||||
return isset($frame['file']) &&
|
||||
($frame['file']!=__FILE__ || $debug>1) &&
|
||||
(empty($frame['function']) ||
|
||||
!preg_match('/^(?:(?:trigger|user)_error|'.
|
||||
@@ -1372,7 +1375,7 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
if (($handler=$this->hive['ONREROUTE']) &&
|
||||
$this->call($handler,[$url,$permanent])!==FALSE)
|
||||
return;
|
||||
if ($url[0]=='/') {
|
||||
if ($url[0]=='/' && (empty($url[1]) || $url[1]!='/')) {
|
||||
$port=$this->hive['PORT'];
|
||||
$port=in_array($port,[80,443])?'':':'.$port;
|
||||
$url=$this->hive['SCHEME'].'://'.
|
||||
@@ -1383,7 +1386,7 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
$this->status($permanent?301:302);
|
||||
die;
|
||||
}
|
||||
$this->mock('GET '.$url);
|
||||
$this->mock('GET '.$url.' [cli]');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1470,7 +1473,7 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
'(?P<\3>[^\/\?]+)',
|
||||
$wild).'\/?$/'.$case.'um',$url,$args);
|
||||
foreach (array_keys($args) as $key) {
|
||||
if (preg_match('/_\d+/',$key)) {
|
||||
if (preg_match('/^_\d+$/',$key)) {
|
||||
if (empty($args['*']))
|
||||
$args['*']=$args[$key];
|
||||
else {
|
||||
@@ -1509,7 +1512,7 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
array_multisort($paths,SORT_DESC,$keys,$vals);
|
||||
$this->hive['ROUTES']=array_combine($keys,$vals);
|
||||
// Convert to BASE-relative URL
|
||||
$req=$this->rel(urldecode($this->hive['PATH']));
|
||||
$req=urldecode($this->hive['PATH']);
|
||||
if ($cors=(isset($this->hive['HEADERS']['Origin']) &&
|
||||
$this->hive['CORS']['origin'])) {
|
||||
$cors=$this->hive['CORS'];
|
||||
@@ -1529,8 +1532,7 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
$route=$routes[$ptr];
|
||||
if (!$route)
|
||||
continue;
|
||||
if ($this->hive['VERB']!='OPTIONS' &&
|
||||
isset($route[$this->hive['VERB']])) {
|
||||
if (isset($route[$this->hive['VERB']])) {
|
||||
if ($this->hive['VERB']=='GET' &&
|
||||
preg_match('/.+\/$/',$this->hive['PATH']))
|
||||
$this->reroute(substr($this->hive['PATH'],0,-1).
|
||||
@@ -1622,7 +1624,8 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
else
|
||||
echo $body;
|
||||
}
|
||||
return $result;
|
||||
if ($result || $this->hive['VERB']!='OPTIONS')
|
||||
return $result;
|
||||
}
|
||||
$allowed=array_merge($allowed,array_keys($route));
|
||||
}
|
||||
@@ -1923,9 +1926,11 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
@unlink($lock);
|
||||
while (!($handle=@fopen($lock,'x')) && !connection_aborted())
|
||||
usleep(mt_rand(0,100));
|
||||
$this->locks[$id]=$lock;
|
||||
$out=$this->call($func,$args);
|
||||
fclose($handle);
|
||||
@unlink($lock);
|
||||
unset($this->locks[$id]);
|
||||
return $out;
|
||||
}
|
||||
|
||||
@@ -2025,6 +2030,8 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
if (!($error=error_get_last()) &&
|
||||
session_status()==PHP_SESSION_ACTIVE)
|
||||
session_commit();
|
||||
foreach ($this->locks as $lock)
|
||||
@unlink($lock);
|
||||
$handler=$this->hive['UNLOAD'];
|
||||
if ((!$handler || $this->call($handler,$this)===FALSE) &&
|
||||
$error && in_array($error['type'],
|
||||
@@ -2236,8 +2243,10 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
'httponly'=>TRUE
|
||||
]
|
||||
);
|
||||
$port=0;
|
||||
if (isset($_SERVER['SERVER_PORT']))
|
||||
$port=80;
|
||||
if (isset($headers['X-Forwarded-Port']))
|
||||
$port=$headers['X-Forwarded-Port'];
|
||||
elseif (isset($_SERVER['SERVER_PORT']))
|
||||
$port=$_SERVER['SERVER_PORT'];
|
||||
// Default configuration
|
||||
$this->hive+=[
|
||||
@@ -2295,8 +2304,8 @@ final class Base extends Prefab implements ArrayAccess {
|
||||
'QUIET'=>FALSE,
|
||||
'RAW'=>FALSE,
|
||||
'REALM'=>$scheme.'://'.$_SERVER['SERVER_NAME'].
|
||||
($port && $port!=80 && $port!=443?
|
||||
(':'.$port):'').$_SERVER['REQUEST_URI'],
|
||||
($port && !in_array($port,[80,443])?(':'.$port):'').
|
||||
$_SERVER['REQUEST_URI'],
|
||||
'RESPONSE'=>'',
|
||||
'ROOT'=>$_SERVER['DOCUMENT_ROOT'],
|
||||
'ROUTES'=>[],
|
||||
@@ -2375,6 +2384,9 @@ class Cache extends Prefab {
|
||||
case 'memcache':
|
||||
$raw=memcache_get($this->ref,$ndx);
|
||||
break;
|
||||
case 'memcached':
|
||||
$raw=$this->ref->get($ndx);
|
||||
break;
|
||||
case 'wincache':
|
||||
$raw=wincache_ucache_get($ndx);
|
||||
break;
|
||||
@@ -2420,6 +2432,8 @@ class Cache extends Prefab {
|
||||
return $this->ref->set($ndx,$data, $ttl ? ['ex'=>$ttl] : []);
|
||||
case 'memcache':
|
||||
return memcache_set($this->ref,$ndx,$data,0,$ttl);
|
||||
case 'memcached':
|
||||
return $this->ref->set($ndx,$data,$ttl);
|
||||
case 'wincache':
|
||||
return wincache_ucache_set($ndx,$data,$ttl);
|
||||
case 'xcache':
|
||||
@@ -2457,6 +2471,8 @@ class Cache extends Prefab {
|
||||
return $this->ref->del($ndx);
|
||||
case 'memcache':
|
||||
return memcache_delete($this->ref,$ndx);
|
||||
case 'memcached':
|
||||
return $this->ref->delete($ndx);
|
||||
case 'wincache':
|
||||
return wincache_ucache_delete($ndx);
|
||||
case 'xcache':
|
||||
@@ -2471,12 +2487,11 @@ class Cache extends Prefab {
|
||||
* Clear contents of cache backend
|
||||
* @return bool
|
||||
* @param $suffix string
|
||||
* @param $lifetime int
|
||||
**/
|
||||
function reset($suffix=NULL,$lifetime=0) {
|
||||
function reset($suffix=NULL) {
|
||||
if (!$this->dsn)
|
||||
return TRUE;
|
||||
$regex='/'.preg_quote($this->prefix.'.','/').'.+?'.
|
||||
$regex='/'.preg_quote($this->prefix.'.','/').'.+'.
|
||||
preg_quote($suffix,'/').'/';
|
||||
$parts=explode('=',$this->dsn,2);
|
||||
switch ($parts[0]) {
|
||||
@@ -2489,19 +2504,15 @@ class Cache extends Prefab {
|
||||
$mtkey=array_key_exists('mtime',$info['cache_list'][0])?
|
||||
'mtime':'modification_time';
|
||||
foreach ($info['cache_list'] as $item)
|
||||
if (preg_match($regex,$item[$key]) &&
|
||||
$item[$mtkey]+$lifetime<time())
|
||||
if (preg_match($regex,$item[$key]))
|
||||
apc_delete($item[$key]);
|
||||
}
|
||||
return TRUE;
|
||||
case 'redis':
|
||||
$fw=Base::instance();
|
||||
$keys=$this->ref->keys($this->prefix.'.*'.$suffix);
|
||||
foreach($keys as $key) {
|
||||
$val=$fw->unserialize($this->ref->get($key));
|
||||
if ($val[1]+$lifetime<time())
|
||||
$this->ref->del($key);
|
||||
}
|
||||
foreach($keys as $key)
|
||||
$this->ref->del($key);
|
||||
return TRUE;
|
||||
case 'memcache':
|
||||
$fw=Base::instance();
|
||||
@@ -2513,17 +2524,20 @@ class Cache extends Prefab {
|
||||
$this->ref,'cachedump',$id) as $data)
|
||||
if (is_array($data))
|
||||
foreach (array_keys($data) as $key)
|
||||
if (preg_match($regex,$key) &&
|
||||
($val=$fw->unserialize(memcache_get($this->ref,$key))) &&
|
||||
$val[1]+$lifetime<time())
|
||||
if (preg_match($regex,$key))
|
||||
memcache_delete($this->ref,$key);
|
||||
return TRUE;
|
||||
case 'memcached':
|
||||
$fw=Base::instance();
|
||||
foreach ($this->ref->getallkeys() as $key)
|
||||
if (preg_match($regex,$key))
|
||||
$this->ref->delete($key);
|
||||
return TRUE;
|
||||
case 'wincache':
|
||||
$info=wincache_ucache_info();
|
||||
foreach ($info['ucache_entries'] as $item)
|
||||
if (preg_match($regex,$item['key_name']) &&
|
||||
$item['use_time']+$lifetime<time())
|
||||
wincache_ucache_delete($item['key_name']);
|
||||
if (preg_match($regex,$item['key_name']))
|
||||
wincache_ucache_delete($item['key_name']);
|
||||
return TRUE;
|
||||
case 'xcache':
|
||||
xcache_unset_by_prefix($this->prefix.'.');
|
||||
@@ -2531,8 +2545,7 @@ class Cache extends Prefab {
|
||||
case 'folder':
|
||||
if ($glob=@glob($parts[1].'*'))
|
||||
foreach ($glob as $file)
|
||||
if (preg_match($regex,basename($file)) &&
|
||||
filemtime($file)+$lifetime<time())
|
||||
if (preg_match($regex,basename($file)))
|
||||
@unlink($file);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2565,6 +2578,14 @@ class Cache extends Prefab {
|
||||
else
|
||||
memcache_add_server($this->ref,$host,$port);
|
||||
}
|
||||
elseif (preg_match('/^memcached=(.+)/',$dsn,$parts) &&
|
||||
extension_loaded('memcached'))
|
||||
foreach ($fw->split($parts[1]) as $server) {
|
||||
list($host,$port)=explode(':',$server)+[1=>11211];
|
||||
if (empty($this->ref))
|
||||
$this->ref=new Memcached();
|
||||
$this->ref->addServer($host,$port);
|
||||
}
|
||||
if (empty($this->ref) && !preg_match('/^folder\h*=/',$dsn))
|
||||
$dsn=($grep=preg_grep('/^(apc|wincache|xcache)/',
|
||||
array_map('strtolower',get_loaded_extensions())))?
|
||||
@@ -2631,28 +2652,50 @@ class View extends Prefab {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send resource to browser using HTTP/2 server push
|
||||
* @return string
|
||||
* @param $file string
|
||||
**/
|
||||
function push($file) {
|
||||
$fw=Base::instance();
|
||||
$hive=$fw->hive();
|
||||
if ($hive['SCHEME']=='https') {
|
||||
$base='';
|
||||
if (!preg_match('/^[.\/]/',$file))
|
||||
$base=$hive['BASE'].'/';
|
||||
if (preg_match('/'.$key.'$/',$file))
|
||||
header('Link: '.'<'.$base.$file.'>; '.'rel=preload',FALSE);
|
||||
}
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create sandbox for template execution
|
||||
* @return string
|
||||
* @param $hive array
|
||||
* @param $mime string
|
||||
**/
|
||||
protected function sandbox(array $hive=NULL) {
|
||||
$this->level++;
|
||||
protected function sandbox(array $hive=NULL,$mime=NULL) {
|
||||
$fw=Base::instance();
|
||||
$implicit=FALSE;
|
||||
if (is_null($hive)) {
|
||||
$implicit=TRUE;
|
||||
$hive=$fw->hive();
|
||||
}
|
||||
if ($this->level<2 || $implicit) {
|
||||
if ($this->level<1 || $implicit) {
|
||||
if (!$hive['CLI'] && !headers_sent() &&
|
||||
!preg_grep ('/^Content-Type:/',headers_list()))
|
||||
header('Content-Type: '.($mime?:'text/html').'; '.
|
||||
'charset='.$fw->get('ENCODING'));
|
||||
if ($fw->get('ESCAPE'))
|
||||
$hive=$this->esc($hive);
|
||||
if (isset($hive['ALIASES']))
|
||||
$hive['ALIASES']=$fw->build($hive['ALIASES']);
|
||||
}
|
||||
unset($fw,$implicit);
|
||||
extract($hive);
|
||||
unset($hive);
|
||||
unset($fw,$hive,$implicit,$mime);
|
||||
$this->level++;
|
||||
ob_start();
|
||||
require($this->view);
|
||||
$this->level--;
|
||||
@@ -2667,21 +2710,18 @@ class View extends Prefab {
|
||||
* @param $hive array
|
||||
* @param $ttl int
|
||||
**/
|
||||
function render($file,$mime='text/html',array $hive=NULL,$ttl=0) {
|
||||
function render($file,$mime=NULL,array $hive=NULL,$ttl=0) {
|
||||
$fw=Base::instance();
|
||||
$cache=Cache::instance();
|
||||
if ($cache->exists($hash=$fw->hash($file),$data))
|
||||
return $data;
|
||||
foreach ($fw->split($fw->get('UI').';./') as $dir)
|
||||
foreach ($fw->split($fw->get('UI')) as $dir)
|
||||
if (is_file($this->view=$fw->fixslashes($dir.$file))) {
|
||||
if (isset($_COOKIE[session_name()]) &&
|
||||
!headers_sent() && session_status()!=PHP_SESSION_ACTIVE)
|
||||
session_start();
|
||||
$fw->sync('SESSION');
|
||||
if ($mime && !$fw->get('CLI') && !headers_sent())
|
||||
header('Content-Type: '.$mime.'; '.
|
||||
'charset='.$fw->get('ENCODING'));
|
||||
$data=$this->sandbox($hive);
|
||||
$data=$this->sandbox($hive,$mime);
|
||||
if(isset($this->trigger['afterrender']))
|
||||
foreach($this->trigger['afterrender'] as $func)
|
||||
$data=$fw->call($func,$data);
|
||||
@@ -2706,12 +2746,11 @@ class View extends Prefab {
|
||||
class Preview extends View {
|
||||
|
||||
protected
|
||||
//! MIME type
|
||||
$mime,
|
||||
//! token filter
|
||||
$filter=[
|
||||
'esc'=>'$this->esc',
|
||||
'raw'=>'$this->raw',
|
||||
'push'=>'$this->push',
|
||||
'alias'=>'\Base::instance()->alias',
|
||||
'format'=>'\Base::instance()->format'
|
||||
];
|
||||
@@ -2804,10 +2843,6 @@ class Preview extends View {
|
||||
function render($file,$mime=NULL,array $hive=NULL,$ttl=0) {
|
||||
$fw=Base::instance();
|
||||
$cache=Cache::instance();
|
||||
if ($mime)
|
||||
$this->mime=$mime;
|
||||
elseif (!$this->mime)
|
||||
$this->mime='text/html';
|
||||
if (!is_dir($tmp=$fw->get('TEMP')))
|
||||
mkdir($tmp,Base::MODE,TRUE);
|
||||
foreach ($fw->split($fw->get('UI')) as $dir) {
|
||||
@@ -2830,10 +2865,7 @@ class Preview extends View {
|
||||
!headers_sent() && session_status()!=PHP_SESSION_ACTIVE)
|
||||
session_start();
|
||||
$fw->sync('SESSION');
|
||||
if (!$fw->get('CLI') && !headers_sent())
|
||||
header('Content-Type: '.$this->mime.'; '.
|
||||
'charset='.$fw->get('ENCODING'));
|
||||
$data=$this->sandbox($hive);
|
||||
$data=$this->sandbox($hive,$mime);
|
||||
if(isset($this->trigger['afterrender']))
|
||||
foreach ($this->trigger['afterrender'] as $func)
|
||||
$data = $fw->call($func, $data);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Lightweight password hashing library
|
||||
*
|
||||
* Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
* Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
*
|
||||
* This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
*
|
||||
@@ -19,9 +17,12 @@
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with Fat-Free Framework. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @deprecated use http://php.net/manual/en/ref.password.php instead (PHP 5.5+ only)
|
||||
**/
|
||||
|
||||
/**
|
||||
* Lightweight password hashing library (PHP 5.5+ only)
|
||||
* @deprecated Use http://php.net/manual/en/ref.password.php instead
|
||||
**/
|
||||
class Bcrypt extends Prefab {
|
||||
|
||||
//@{ Error messages
|
||||
@@ -52,8 +53,6 @@ class Bcrypt extends Prefab {
|
||||
else {
|
||||
$raw=16;
|
||||
$iv='';
|
||||
if (extension_loaded('mcrypt'))
|
||||
$iv=mcrypt_create_iv($raw,MCRYPT_DEV_URANDOM);
|
||||
if (!$iv && extension_loaded('openssl'))
|
||||
$iv=openssl_random_pseudo_bytes($raw);
|
||||
if (!$iv)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
12
app/lib/composer.json
Normal file
12
app/lib/composer.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "bcosca/fatfree-core",
|
||||
"description": "A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!",
|
||||
"homepage": "http://fatfreeframework.com/",
|
||||
"license": "GPL-3.0",
|
||||
"require": {
|
||||
"php": ">=5.4"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": ["."]
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -70,9 +70,10 @@ abstract class Cursor extends \Magic implements \IteratorAggregate {
|
||||
* Count records that match criteria
|
||||
* @return int
|
||||
* @param $filter array
|
||||
* @param $options array
|
||||
* @param $ttl int
|
||||
**/
|
||||
abstract function count($filter=NULL,$ttl=0);
|
||||
abstract function count($filter=NULL,array $options=NULL,$ttl=0);
|
||||
|
||||
/**
|
||||
* Insert new record
|
||||
@@ -145,7 +146,7 @@ abstract class Cursor extends \Magic implements \IteratorAggregate {
|
||||
**/
|
||||
function paginate(
|
||||
$pos=0,$size=10,$filter=NULL,array $options=NULL,$ttl=0) {
|
||||
$total=$this->count($filter,$ttl);
|
||||
$total=$this->count($filter,$options,$ttl);
|
||||
$count=ceil($total/$size);
|
||||
$pos=max(0,min($pos,$count-1));
|
||||
return [
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -286,11 +286,12 @@ class Mapper extends \DB\Cursor {
|
||||
* Count records that match criteria
|
||||
* @return int
|
||||
* @param $filter array
|
||||
* @param $options array
|
||||
* @param $ttl int
|
||||
**/
|
||||
function count($filter=NULL,$ttl=0) {
|
||||
function count($filter=NULL,array $options=NULL,$ttl=0) {
|
||||
$now=microtime(TRUE);
|
||||
$out=count($this->find($filter,NULL,$ttl,FALSE));
|
||||
$out=count($this->find($filter,$options,$ttl,FALSE));
|
||||
$this->db->jot('('.sprintf('%.1f',1e3*(microtime(TRUE)-$now)).'ms) '.
|
||||
$this->file.' [count] '.($filter?json_encode($filter):''));
|
||||
return $out;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -59,13 +59,13 @@ class Session extends Mapper {
|
||||
|
||||
/**
|
||||
* Return session data in serialized format
|
||||
* @return string|FALSE
|
||||
* @return string
|
||||
* @param $id string
|
||||
**/
|
||||
function read($id) {
|
||||
$this->load(['@session_id=?',$this->sid=$id]);
|
||||
if ($this->dry())
|
||||
return FALSE;
|
||||
return '';
|
||||
if ($this->get('ip')!=$this->_ip || $this->get('agent')!=$this->_agent) {
|
||||
$fw=\Base::instance();
|
||||
if (!isset($this->onsuspect) ||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -37,6 +37,8 @@ class Mongo {
|
||||
$dsn,
|
||||
//! MongoDB object
|
||||
$db,
|
||||
//! Legacy flag
|
||||
$legacy,
|
||||
//! MongoDB log
|
||||
$log;
|
||||
|
||||
@@ -63,7 +65,7 @@ class Mongo {
|
||||
**/
|
||||
function log($flag=TRUE) {
|
||||
if ($flag) {
|
||||
$cursor=$this->selectcollection('system.profile')->find();
|
||||
$cursor=$this->db->selectcollection('system.profile')->find();
|
||||
foreach (iterator_to_array($cursor) as $frame)
|
||||
if (!preg_match('/\.system\..+$/',$frame['ns']))
|
||||
$this->log.=date('r',$frame['ts']->sec).' ('.
|
||||
@@ -76,7 +78,10 @@ class Mongo {
|
||||
PHP_EOL;
|
||||
} else {
|
||||
$this->log=FALSE;
|
||||
$this->setprofilinglevel(-1);
|
||||
if ($this->legacy)
|
||||
$this->db->setprofilinglevel(-1);
|
||||
else
|
||||
$this->db->command(['profile'=>-1]);
|
||||
}
|
||||
return $this->log;
|
||||
}
|
||||
@@ -87,8 +92,12 @@ class Mongo {
|
||||
**/
|
||||
function drop() {
|
||||
$out=$this->db->drop();
|
||||
if ($this->log!==FALSE)
|
||||
$this->setprofilinglevel(2);
|
||||
if ($this->log!==FALSE) {
|
||||
if ($this->legacy)
|
||||
$this->db->setprofilinglevel(2);
|
||||
else
|
||||
$this->db->command(['profile'=>2]);
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
@@ -102,6 +111,14 @@ class Mongo {
|
||||
return call_user_func_array([$this->db,$func],$args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return TRUE if legacy driver is loaded
|
||||
* @return bool
|
||||
**/
|
||||
function legacy() {
|
||||
return $this->legacy;
|
||||
}
|
||||
|
||||
//! Prohibit cloning
|
||||
private function __clone() {
|
||||
}
|
||||
@@ -114,9 +131,14 @@ class Mongo {
|
||||
**/
|
||||
function __construct($dsn,$dbname,array $options=NULL) {
|
||||
$this->uuid=\Base::instance()->hash($this->dsn=$dsn);
|
||||
$class=class_exists('\MongoClient')?'\MongoClient':'\Mongo';
|
||||
$this->db=new \MongoDB(new $class($dsn,$options?:[]),$dbname);
|
||||
$this->setprofilinglevel(2);
|
||||
if ($this->legacy=class_exists('\MongoClient')) {
|
||||
$this->db=new \MongoDB(new \MongoClient($dsn,$options?:[]),$dbname);
|
||||
$this->db->setprofilinglevel(2);
|
||||
}
|
||||
else {
|
||||
$this->db=(new \MongoDB\Client($dsn,$options?:[]))->$dbname;
|
||||
$this->db->command(['profile'=>2]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -28,6 +28,8 @@ class Mapper extends \DB\Cursor {
|
||||
protected
|
||||
//! MongoDB wrapper
|
||||
$db,
|
||||
//! Legacy flag
|
||||
$legacy,
|
||||
//! Mongo collection
|
||||
$collection,
|
||||
//! Mongo document
|
||||
@@ -155,16 +157,26 @@ class Mapper extends \DB\Cursor {
|
||||
$filter=$filter?:[];
|
||||
$collection=$this->collection;
|
||||
}
|
||||
$this->cursor=$collection->find($filter,$fields?:[]);
|
||||
if ($options['order'])
|
||||
$this->cursor=$this->cursor->sort($options['order']);
|
||||
if ($options['limit'])
|
||||
$this->cursor=$this->cursor->limit($options['limit']);
|
||||
if ($options['offset'])
|
||||
$this->cursor=$this->cursor->skip($options['offset']);
|
||||
$result=[];
|
||||
while ($this->cursor->hasnext())
|
||||
$result[]=$this->cursor->getnext();
|
||||
if ($this->legacy) {
|
||||
$this->cursor=$collection->find($filter,$fields?:[]);
|
||||
if ($options['order'])
|
||||
$this->cursor=$this->cursor->sort($options['order']);
|
||||
if ($options['limit'])
|
||||
$this->cursor=$this->cursor->limit($options['limit']);
|
||||
if ($options['offset'])
|
||||
$this->cursor=$this->cursor->skip($options['offset']);
|
||||
$result=[];
|
||||
while ($this->cursor->hasnext())
|
||||
$result[]=$this->cursor->getnext();
|
||||
}
|
||||
else {
|
||||
$this->cursor=$collection->find($filter,[
|
||||
'sort'=>$options['order'],
|
||||
'limit'=>$options['limit'],
|
||||
'skip'=>$options['offset']
|
||||
]);
|
||||
$result=$this->cursor->toarray();
|
||||
}
|
||||
if ($options['group'])
|
||||
$tmp->drop();
|
||||
if ($fw->get('CACHE') && $ttl)
|
||||
@@ -200,9 +212,10 @@ class Mapper extends \DB\Cursor {
|
||||
* Count records that match criteria
|
||||
* @return int
|
||||
* @param $filter array
|
||||
* @param $options array
|
||||
* @param $ttl int
|
||||
**/
|
||||
function count($filter=NULL,$ttl=0) {
|
||||
function count($filter=NULL,array $options=NULL,$ttl=0) {
|
||||
$fw=\Base::instance();
|
||||
$cache=\Cache::instance();
|
||||
if (!($cached=$cache->exists($hash=$fw->hash($fw->stringify(
|
||||
@@ -240,8 +253,14 @@ class Mapper extends \DB\Cursor {
|
||||
\Base::instance()->call($this->trigger['beforeinsert'],
|
||||
[$this,['_id'=>$this->document['_id']]])===FALSE)
|
||||
return $this->document;
|
||||
$this->collection->insert($this->document);
|
||||
$pkey=['_id'=>$this->document['_id']];
|
||||
if ($this->legacy) {
|
||||
$this->collection->insert($this->document);
|
||||
$pkey=['_id'=>$this->document['_id']];
|
||||
}
|
||||
else {
|
||||
$result=$this->collection->insertone($this->document);
|
||||
$pkey=['_id'=>$result->getinsertedid()];
|
||||
}
|
||||
if (isset($this->trigger['afterinsert']))
|
||||
\Base::instance()->call($this->trigger['afterinsert'],
|
||||
[$this,$pkey]);
|
||||
@@ -259,8 +278,11 @@ class Mapper extends \DB\Cursor {
|
||||
\Base::instance()->call($this->trigger['beforeupdate'],
|
||||
[$this,$pkey])===FALSE)
|
||||
return $this->document;
|
||||
$this->collection->update(
|
||||
$pkey,$this->document,['upsert'=>TRUE]);
|
||||
$upsert=['upsert'=>TRUE];
|
||||
if ($this->legacy)
|
||||
$this->collection->update($pkey,$this->document,$upsert);
|
||||
else
|
||||
$this->collection->replaceone($pkey,$this->document,$upsert);
|
||||
if (isset($this->trigger['afterupdate']))
|
||||
\Base::instance()->call($this->trigger['afterupdate'],
|
||||
[$this,$pkey]);
|
||||
@@ -273,15 +295,19 @@ class Mapper extends \DB\Cursor {
|
||||
* @param $filter array
|
||||
**/
|
||||
function erase($filter=NULL) {
|
||||
if ($filter)
|
||||
return $this->collection->remove($filter);
|
||||
if ($filter) {
|
||||
return $this->legacy?
|
||||
$this->collection->remove($filter):
|
||||
$this->collection->deletemany($filter);
|
||||
}
|
||||
$pkey=['_id'=>$this->document['_id']];
|
||||
if (isset($this->trigger['beforeerase']) &&
|
||||
\Base::instance()->call($this->trigger['beforeerase'],
|
||||
[$this,$pkey])===FALSE)
|
||||
return FALSE;
|
||||
$result=$this->collection->
|
||||
remove(['_id'=>$this->document['_id']]);
|
||||
$result=$this->legacy?
|
||||
$this->collection->remove(['_id'=>$this->document['_id']]):
|
||||
$this->collection->deleteone(['_id'=>$this->document['_id']]);
|
||||
parent::erase();
|
||||
if (isset($this->trigger['aftererase']))
|
||||
\Base::instance()->call($this->trigger['aftererase'],
|
||||
@@ -357,6 +383,7 @@ class Mapper extends \DB\Cursor {
|
||||
**/
|
||||
function __construct(\DB\Mongo $db,$collection,$fields=NULL) {
|
||||
$this->db=$db;
|
||||
$this->legacy=$db->legacy();
|
||||
$this->collection=$db->selectcollection($collection);
|
||||
$this->fields=$fields;
|
||||
$this->reset();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -59,13 +59,13 @@ class Session extends Mapper {
|
||||
|
||||
/**
|
||||
* Return session data in serialized format
|
||||
* @return string|FALSE
|
||||
* @return string
|
||||
* @param $id string
|
||||
**/
|
||||
function read($id) {
|
||||
$this->load(['session_id'=>$this->sid=$id]);
|
||||
if ($this->dry())
|
||||
return FALSE;
|
||||
return '';
|
||||
if ($this->get('ip')!=$this->_ip || $this->get('agent')!=$this->_agent) {
|
||||
$fw=\Base::instance();
|
||||
if (!isset($this->onsuspect) ||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -113,16 +113,16 @@ class SQL {
|
||||
|
||||
/**
|
||||
* Cast value to PHP type
|
||||
* @return scalar
|
||||
* @return mixed
|
||||
* @param $type string
|
||||
* @param $val scalar
|
||||
* @param $val mixed
|
||||
**/
|
||||
function value($type,$val) {
|
||||
switch ($type) {
|
||||
case self::PARAM_FLOAT:
|
||||
return (float)(is_string($val)
|
||||
? str_replace(',','.',preg_replace('/([.,])(?!\d+$)/','',$val))
|
||||
: $val);
|
||||
if (!is_string($val))
|
||||
$val=str_replace(',','.',$val);
|
||||
return $val;
|
||||
case \PDO::PARAM_NULL:
|
||||
return (unset)$val;
|
||||
case \PDO::PARAM_INT:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -226,7 +226,8 @@ class Mapper extends \DB\Cursor {
|
||||
return preg_replace_callback(
|
||||
'/\b(\w+)\h*(HAVING.+|$)/i',
|
||||
function($parts) use($db) {
|
||||
return $db->quotekey($parts[1]).(isset($parts[2])?(' '.$parts[2]):'');
|
||||
return $db->quotekey($parts[1]).
|
||||
(isset($parts[2])?(' '.$parts[2]):'');
|
||||
},
|
||||
$str
|
||||
);
|
||||
@@ -324,24 +325,18 @@ class Mapper extends \DB\Cursor {
|
||||
* Count records that match criteria
|
||||
* @return int
|
||||
* @param $filter string|array
|
||||
* @param $options array
|
||||
* @param $ttl int|array
|
||||
**/
|
||||
function count($filter=NULL,$ttl=0) {
|
||||
$sql='SELECT COUNT(*) AS '.
|
||||
$this->db->quotekey('rows').' FROM '.$this->table;
|
||||
$args=[];
|
||||
if ($filter) {
|
||||
if (is_array($filter)) {
|
||||
$args=isset($filter[1]) && is_array($filter[1])?
|
||||
$filter[1]:
|
||||
array_slice($filter,1,NULL,TRUE);
|
||||
$args=is_array($args)?$args:[1=>$args];
|
||||
list($filter)=$filter;
|
||||
}
|
||||
$sql.=' WHERE '.$filter;
|
||||
}
|
||||
$result=$this->db->exec($sql,$args,$ttl);
|
||||
return $result[0]['rows'];
|
||||
function count($filter=NULL,array $options=NULL,$ttl=0) {
|
||||
$expr='COUNT(*)';
|
||||
$field='rows';
|
||||
$this->adhoc[$field]=['expr'=>$expr,'value'=>NULL];
|
||||
$result=$this->select($expr.' AS '.$this->db->quotekey($field),
|
||||
$filter,$options,$ttl);
|
||||
$out=$result[0]->adhoc[$field]['value'];
|
||||
unset($this->adhoc[$field]);
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -473,10 +468,10 @@ class Mapper extends \DB\Cursor {
|
||||
if ($pairs) {
|
||||
$sql='UPDATE '.$this->table.' SET '.$pairs.$filter;
|
||||
$this->db->exec($sql,$args);
|
||||
if (isset($this->trigger['afterupdate']))
|
||||
\Base::instance()->call($this->trigger['afterupdate'],
|
||||
[$this,$pkeys]);
|
||||
}
|
||||
if (isset($this->trigger['afterupdate']))
|
||||
\Base::instance()->call($this->trigger['afterupdate'],
|
||||
[$this,$pkeys]);
|
||||
// reset changed flag after calling afterupdate
|
||||
foreach ($this->fields as $key=>&$field) {
|
||||
$field['changed']=FALSE;
|
||||
@@ -492,7 +487,7 @@ class Mapper extends \DB\Cursor {
|
||||
* @param $filter string|array
|
||||
**/
|
||||
function erase($filter=NULL) {
|
||||
if ($filter) {
|
||||
if (isset($filter)) {
|
||||
$args=[];
|
||||
if (is_array($filter)) {
|
||||
$args=isset($filter[1]) && is_array($filter[1])?
|
||||
@@ -502,7 +497,7 @@ class Mapper extends \DB\Cursor {
|
||||
list($filter)=$filter;
|
||||
}
|
||||
return $this->db->
|
||||
exec('DELETE FROM '.$this->table.' WHERE '.$filter.';',$args);
|
||||
exec('DELETE FROM '.$this->table.($filter?' WHERE '.$filter:'').';',$args);
|
||||
}
|
||||
$args=[];
|
||||
$ctr=0;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -59,13 +59,13 @@ class Session extends Mapper {
|
||||
|
||||
/**
|
||||
* Return session data in serialized format
|
||||
* @return string|FALSE
|
||||
* @return string
|
||||
* @param $id string
|
||||
**/
|
||||
function read($id) {
|
||||
$this->load(['session_id=?',$this->sid=$id]);
|
||||
if ($this->dry())
|
||||
return FALSE;
|
||||
return '';
|
||||
if ($this->get('ip')!=$this->_ip || $this->get('agent')!=$this->_agent) {
|
||||
$fw=\Base::instance();
|
||||
if (!isset($this->onsuspect) ||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -58,13 +58,13 @@ class Session {
|
||||
|
||||
/**
|
||||
* Return session data in serialized format
|
||||
* @return string|FALSE
|
||||
* @return string
|
||||
* @param $id string
|
||||
**/
|
||||
function read($id) {
|
||||
$this->sid=$id;
|
||||
if (!$data=$this->_cache->get($id.'.@'))
|
||||
return FALSE;
|
||||
return '';
|
||||
if ($data['ip']!=$this->_ip || $data['agent']!=$this->_agent) {
|
||||
$fw=Base::instance();
|
||||
if (!isset($this->onsuspect) ||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -45,6 +45,8 @@ class SMTP extends Magic {
|
||||
$user,
|
||||
//! Password
|
||||
$pw,
|
||||
//! TLS/SSL stream context
|
||||
$context,
|
||||
//! TCP/IP socket
|
||||
$socket,
|
||||
//! Server-client conversation
|
||||
@@ -117,7 +119,7 @@ class SMTP extends Magic {
|
||||
* Send SMTP command and record server response
|
||||
* @return string
|
||||
* @param $cmd string
|
||||
* @param $log bool
|
||||
* @param $log bool|string
|
||||
* @param $mock bool
|
||||
**/
|
||||
protected function dialog($cmd=NULL,$log=TRUE,$mock=FALSE) {
|
||||
@@ -177,7 +179,7 @@ class SMTP extends Magic {
|
||||
* Transmit message
|
||||
* @return bool
|
||||
* @param $message string
|
||||
* @param $log bool
|
||||
* @param $log bool|string
|
||||
* @param $mock bool
|
||||
**/
|
||||
function send($message,$log=TRUE,$mock=FALSE) {
|
||||
@@ -192,7 +194,9 @@ class SMTP extends Magic {
|
||||
// Connect to the server
|
||||
if (!$mock) {
|
||||
$socket=&$this->socket;
|
||||
$socket=@fsockopen($this->host,$this->port,$errno,$errstr);
|
||||
$socket=@stream_socket_client($this->host.':'.$this->port,
|
||||
$errno,$errstr,ini_get('default_socket_timeout'),
|
||||
STREAM_CLIENT_CONNECT,$this->context);
|
||||
if (!$socket) {
|
||||
$fw->error(500,$errstr);
|
||||
return FALSE;
|
||||
@@ -221,16 +225,16 @@ class SMTP extends Magic {
|
||||
// Authenticate
|
||||
$this->dialog('AUTH LOGIN',$log,$mock);
|
||||
$this->dialog(base64_encode($this->user),$log,$mock);
|
||||
$auth_rply=$this->dialog(base64_encode($this->pw),$log,$mock);
|
||||
if (!preg_match('/^235\s.*/',$auth_rply)) {
|
||||
$reply=$this->dialog(base64_encode($this->pw),$log,$mock);
|
||||
if (!preg_match('/^235\s.*/',$reply)) {
|
||||
$this->dialog('QUIT',$log,$mock);
|
||||
if (!$mock && $socket)
|
||||
fclose($socket);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (empty($headers['Message-ID']))
|
||||
$headers['Message-ID']='<'.uniqid('',TRUE).'@'.$this->host.'>';
|
||||
if (empty($headers['Message-Id']))
|
||||
$headers['Message-Id']='<'.uniqid('',TRUE).'@'.$this->host.'>';
|
||||
if (empty($headers['Date']))
|
||||
$headers['Date']=date('r');
|
||||
// Required headers
|
||||
@@ -297,7 +301,7 @@ class SMTP extends Magic {
|
||||
$out.='Content-Type: application/octet-stream'.$eol;
|
||||
$out.='Content-Transfer-Encoding: base64'.$eol;
|
||||
if ($attachment['cid'])
|
||||
$out.='Content-ID: '.$attachment['cid'].$eol;
|
||||
$out.='Content-Id: '.$attachment['cid'].$eol;
|
||||
$out.='Content-Disposition: attachment; '.
|
||||
'filename="'.$alias.'"'.$eol;
|
||||
$out.=$eol;
|
||||
@@ -307,7 +311,7 @@ class SMTP extends Magic {
|
||||
$out.=$eol;
|
||||
$out.='--'.$hash.'--'.$eol;
|
||||
$out.='.';
|
||||
$this->dialog($out,TRUE,$mock);
|
||||
$this->dialog($out,preg_match('/verbose/i',$log),$mock);
|
||||
}
|
||||
else {
|
||||
// Send mail headers
|
||||
@@ -319,7 +323,7 @@ class SMTP extends Magic {
|
||||
$out.=$message.$eol;
|
||||
$out.='.';
|
||||
// Send message
|
||||
$this->dialog($out,TRUE,$mock);
|
||||
$this->dialog($out,preg_match('/verbose/i',$log),$mock);
|
||||
}
|
||||
$this->dialog('QUIT',$log,$mock);
|
||||
if (!$mock && $socket)
|
||||
@@ -336,18 +340,18 @@ class SMTP extends Magic {
|
||||
* @param $pw string
|
||||
**/
|
||||
function __construct(
|
||||
$host='localhost',$port=25,$scheme=NULL,$user=NULL,$pw=NULL) {
|
||||
$host='localhost',$port=25,$scheme=NULL,$user=NULL,$pw=NULL,$ctx=NULL) {
|
||||
$this->headers=[
|
||||
'MIME-Version'=>'1.0',
|
||||
'Content-Type'=>'text/plain; '.
|
||||
'charset='.Base::instance()->get('ENCODING')
|
||||
];
|
||||
$this->host=$host;
|
||||
if (strtolower($this->scheme=strtolower($scheme))=='ssl')
|
||||
$this->host='ssl://'.$host;
|
||||
$this->host=(strtolower($this->scheme=strtolower($scheme))=='ssl'?
|
||||
'ssl':'tcp').'://'.$host;
|
||||
$this->port=$port;
|
||||
$this->user=$user;
|
||||
$this->pw=$pw;
|
||||
$this->context=$ctx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -140,26 +140,33 @@ class Web extends Prefab {
|
||||
header('Content-Length: '.$size);
|
||||
header('X-Powered-By: '.Base::instance()->get('PACKAGE'));
|
||||
}
|
||||
$ctr=0;
|
||||
$handle=fopen($file,'rb');
|
||||
$start=microtime(TRUE);
|
||||
while (!feof($handle) &&
|
||||
($info=stream_get_meta_data($handle)) &&
|
||||
!$info['timed_out'] && !connection_aborted()) {
|
||||
if ($kbps) {
|
||||
// Throttle output
|
||||
$ctr++;
|
||||
if ($ctr/$kbps>$elapsed=microtime(TRUE)-$start)
|
||||
usleep(1e6*($ctr/$kbps-$elapsed));
|
||||
}
|
||||
// Send 1KiB and reset timer
|
||||
echo fread($handle,1024);
|
||||
if ($flush) {
|
||||
ob_flush();
|
||||
flush();
|
||||
}
|
||||
if (!$kbps && $flush) {
|
||||
while (ob_get_level())
|
||||
ob_end_clean();
|
||||
readfile($file);
|
||||
}
|
||||
else {
|
||||
$ctr=0;
|
||||
$handle=fopen($file,'rb');
|
||||
$start=microtime(TRUE);
|
||||
while (!feof($handle) &&
|
||||
($info=stream_get_meta_data($handle)) &&
|
||||
!$info['timed_out'] && !connection_aborted()) {
|
||||
if ($kbps) {
|
||||
// Throttle output
|
||||
$ctr++;
|
||||
if ($ctr/$kbps>$elapsed=microtime(TRUE)-$start)
|
||||
usleep(1e6*($ctr/$kbps-$elapsed));
|
||||
}
|
||||
// Send 1KiB and reset timer
|
||||
echo fread($handle,1024);
|
||||
if ($flush) {
|
||||
ob_flush();
|
||||
flush();
|
||||
}
|
||||
}
|
||||
fclose($handle);
|
||||
}
|
||||
fclose($handle);
|
||||
return $size;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
@@ -62,6 +62,8 @@ class OAuth2 extends \Magic {
|
||||
)
|
||||
);
|
||||
$response=$web->request($uri,$options);
|
||||
if ($response['error'])
|
||||
user_error($response['error']);
|
||||
return $response['body'] &&
|
||||
preg_grep('/HTTP\/1\.\d 200/',$response['headers'])?
|
||||
json_decode($response['body'],TRUE):
|
||||
@@ -121,7 +123,7 @@ class OAuth2 extends \Magic {
|
||||
/**
|
||||
* Remove scope/claim
|
||||
* @return NULL
|
||||
* @param $key
|
||||
* @param $key string
|
||||
**/
|
||||
function clear($key=NULL) {
|
||||
if ($key)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2009-2016 F3::Factory/Bong Cosca, All rights reserved.
|
||||
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
|
||||
|
||||
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
|
||||
|
||||
|
||||
@@ -577,23 +577,17 @@ class Map extends Controller\AccessController {
|
||||
* -> if characters with map access found -> broadcast mapData to them
|
||||
* @param Model\MapModel $map
|
||||
* @param array $characterIds
|
||||
* @return int
|
||||
*/
|
||||
protected function broadcastMapAccess($map, $characterIds){
|
||||
$connectionCount = 0;
|
||||
|
||||
$mapAccess = [
|
||||
'id' => $map->_id,
|
||||
'characterIds' => $characterIds
|
||||
];
|
||||
$charCount = (int)(new Socket( Config::getSocketUri() ))->sendData('mapAccess', $mapAccess);
|
||||
|
||||
if($charCount > 0){
|
||||
// map has active connections that should receive map Data
|
||||
$connectionCount = $this->broadcastMapData($map);
|
||||
}
|
||||
(new Socket( Config::getSocketUri() ))->sendData('mapAccess', $mapAccess);
|
||||
|
||||
return $connectionCount;
|
||||
// map has (probably) active connections that should receive map Data
|
||||
$this->broadcastMapData($map);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1069,6 +1063,39 @@ class Map extends Controller\AccessController {
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* get connectionData
|
||||
* @param \Base $f3
|
||||
*/
|
||||
public function getConnectionData (\Base $f3){
|
||||
$postData = (array)$f3->get('POST');
|
||||
$connectionData = [];
|
||||
|
||||
if($mapId = (int)$postData['mapId']){
|
||||
$activeCharacter = $this->getCharacter();
|
||||
|
||||
/**
|
||||
* @var Model\MapModel $map
|
||||
*/
|
||||
$map = Model\BasicModel::getNew('MapModel');
|
||||
$map->getById($mapId);
|
||||
|
||||
if($map->hasAccess($activeCharacter)){
|
||||
$connections = $map->getConnections('wh');
|
||||
foreach($connections as $connection){
|
||||
$data = $connection->getData(true);
|
||||
// skip connections whiteout signature data
|
||||
if($data->signatures){
|
||||
$connectionData[] = $data;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($connectionData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ class Signature extends Controller\AccessController {
|
||||
// delete all signatures that are not available in this request
|
||||
$deleteOldSignatures = (bool)$requestData['deleteOld'];
|
||||
|
||||
|
||||
$return = (object) [];
|
||||
$return->error = [];
|
||||
$return->signatures = [];
|
||||
@@ -135,9 +134,17 @@ class Signature extends Controller\AccessController {
|
||||
$data['name'] => $data['value']
|
||||
];
|
||||
|
||||
// if groupID changed -> typeID set to 0
|
||||
// if groupId changed
|
||||
if($data['name'] == 'groupId'){
|
||||
// -> typeId set to 0
|
||||
$newData['typeId'] = 0;
|
||||
// -> connectionId set to 0
|
||||
$newData['connectionId'] = 0;
|
||||
}
|
||||
|
||||
// if connectionId changed
|
||||
if($data['name'] == 'connectionId'){
|
||||
$newData['connectionId'] = (int)$newData['connectionId'];
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
@@ -22,7 +22,7 @@ class MailController extends \SMTP{
|
||||
parent::__construct($host,$port,$scheme,$user,$pw);
|
||||
|
||||
// error handling
|
||||
$this->set('Errors-to', '' . Controller::getEnvironmentData('SMTP_ERROR') . '>');
|
||||
$this->set('Errors-to', '<' . Controller::getEnvironmentData('SMTP_ERROR') . '>');
|
||||
$this->set('MIME-Version', '1.0');
|
||||
$this->set('Content-Type', 'text/html; charset=ISO-8859-1');
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class MailController extends \SMTP{
|
||||
*/
|
||||
public function sendDeleteAccount($to, $msg){
|
||||
$this->set('To', '<' . $to . '>');
|
||||
$this->set('From', 'Pathfinder <' . Controller::getEnvironmentData('SMTP_FROM') . '>');
|
||||
$this->set('From', '"Pathfinder" <' . Controller::getEnvironmentData('SMTP_FROM') . '>');
|
||||
$this->set('Subject', 'Account deleted');
|
||||
$status = $this->send($msg);
|
||||
|
||||
@@ -50,7 +50,7 @@ class MailController extends \SMTP{
|
||||
*/
|
||||
public function sendRallyPoint($to, $msg){
|
||||
$this->set('To', '<' . $to . '>');
|
||||
$this->set('From', 'Pathfinder <' . Controller::getEnvironmentData('SMTP_FROM') . '>');
|
||||
$this->set('From', '"Pathfinder" <' . Controller::getEnvironmentData('SMTP_FROM') . '>');
|
||||
$this->set('Subject', 'PATHFINDER - New rally point');
|
||||
$status = $this->send($msg);
|
||||
|
||||
|
||||
@@ -423,7 +423,7 @@ class Setup extends Controller {
|
||||
],
|
||||
'php' => [
|
||||
'label' => 'PHP',
|
||||
'required' => $f3->get('REQUIREMENTS.PHP.VERSION'),
|
||||
'required' => number_format((float)$f3->get('REQUIREMENTS.PHP.VERSION'), 1, '.', ''),
|
||||
'version' => phpversion(),
|
||||
'check' => version_compare( phpversion(), $f3->get('REQUIREMENTS.PHP.VERSION'), '>=')
|
||||
],
|
||||
@@ -925,7 +925,7 @@ class Setup extends Controller {
|
||||
$checkTables = [];
|
||||
if($db){
|
||||
// set/change default "character set" and "collation"
|
||||
$db->exec('ALTER DATABASE ' . $db->name()
|
||||
$db->exec('ALTER DATABASE ' . $db->quotekey($db->name())
|
||||
. ' CHARACTER SET ' . self::getRequiredMySqlVariables('CHARACTER_SET_DATABASE')
|
||||
. ' COLLATE ' . self::getRequiredMySqlVariables('COLLATION_DATABASE')
|
||||
);
|
||||
|
||||
@@ -52,7 +52,7 @@ class TableModifier extends SQL\TableModifier {
|
||||
':constraint_name' => $constraintName
|
||||
]);
|
||||
// switch back to current DB
|
||||
$this->db->exec("USE " . $this->db->name());
|
||||
$this->db->exec("USE " . $this->db->quotekey($this->db->name()));
|
||||
|
||||
$constraints = [];
|
||||
foreach($constraintsData as $data){
|
||||
|
||||
@@ -71,6 +71,9 @@ class ConnectionModel extends BasicModel{
|
||||
'eolUpdated' => [
|
||||
'type' => Schema::DT_TIMESTAMP,
|
||||
'default' => null
|
||||
],
|
||||
'signatures' => [
|
||||
'has-many' => ['Model\SystemSignatureModel', 'connectionId']
|
||||
]
|
||||
];
|
||||
|
||||
@@ -79,9 +82,7 @@ class ConnectionModel extends BasicModel{
|
||||
* @param $systemData
|
||||
*/
|
||||
public function setData($systemData){
|
||||
|
||||
foreach((array)$systemData as $key => $value){
|
||||
|
||||
if( !is_array($value) ){
|
||||
if( $this->exists($key) ){
|
||||
$this->$key = $value;
|
||||
@@ -95,19 +96,26 @@ class ConnectionModel extends BasicModel{
|
||||
|
||||
/**
|
||||
* get connection data as array
|
||||
* @return array
|
||||
* @param bool $addSignatureData
|
||||
* @return \stdClass
|
||||
*/
|
||||
public function getData(){
|
||||
public function getData($addSignatureData = false){
|
||||
|
||||
$connectionData = [
|
||||
'id' => $this->id,
|
||||
'source' => $this->source->id,
|
||||
'target' => $this->target->id,
|
||||
'scope' => $this->scope,
|
||||
'type' => $this->type,
|
||||
'updated' => strtotime($this->updated),
|
||||
'eolUpdated' => strtotime($this->eolUpdated)
|
||||
];
|
||||
$connectionData = (object) [];
|
||||
$connectionData->id = $this->id;
|
||||
$connectionData->source = $this->source->id;
|
||||
$connectionData->target = $this->target->id;
|
||||
$connectionData->scope = $this->scope;
|
||||
$connectionData->type = $this->type;
|
||||
$connectionData->updated = strtotime($this->updated);
|
||||
$connectionData->created = strtotime($this->created);
|
||||
$connectionData->eolUpdated = strtotime($this->eolUpdated);
|
||||
|
||||
if($addSignatureData){
|
||||
if( !empty($signaturesData = $this->getSignaturesData()) ){
|
||||
$connectionData->signatures = $signaturesData;
|
||||
}
|
||||
}
|
||||
|
||||
return $connectionData;
|
||||
}
|
||||
@@ -140,7 +148,11 @@ class ConnectionModel extends BasicModel{
|
||||
* @return mixed
|
||||
*/
|
||||
public function hasAccess(CharacterModel $characterModel){
|
||||
return $this->mapId->hasAccess($characterModel);
|
||||
$access = false;
|
||||
if( !$this->dry() ){
|
||||
$access = $this->mapId->hasAccess($characterModel);
|
||||
}
|
||||
return $access;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,6 +314,35 @@ class ConnectionModel extends BasicModel{
|
||||
$this->mapId->clearCacheData();
|
||||
}
|
||||
|
||||
/**
|
||||
* get all signatures that are connected with this connection
|
||||
* @return array|mixed
|
||||
*/
|
||||
public function getSignatures(){
|
||||
$signatures = [];
|
||||
$this->filter('signatures', [
|
||||
'active = :active',
|
||||
':active' => 1
|
||||
]);
|
||||
|
||||
if($this->signatures){
|
||||
$signatures = $this->signatures;
|
||||
}
|
||||
|
||||
return $signatures;
|
||||
}
|
||||
|
||||
public function getSignaturesData(){
|
||||
$signaturesData = [];
|
||||
$signatures = $this->getSignatures();
|
||||
|
||||
foreach($signatures as $signature){
|
||||
$signaturesData[] = $signature->getData();
|
||||
}
|
||||
|
||||
return $signaturesData;
|
||||
}
|
||||
|
||||
/**
|
||||
* overwrites parent
|
||||
* @param null $db
|
||||
|
||||
@@ -20,6 +20,11 @@ class MapModel extends BasicModel {
|
||||
*/
|
||||
const DATA_CACHE_KEY_CHARACTER = 'CHARACTERS';
|
||||
|
||||
/**
|
||||
* default TTL for getData(); cache
|
||||
*/
|
||||
const DEFAULT_CACHE_TTL = 60;
|
||||
|
||||
protected $fieldConf = [
|
||||
'active' => [
|
||||
'type' => Schema::DT_BOOL,
|
||||
@@ -205,7 +210,7 @@ class MapModel extends BasicModel {
|
||||
// max caching time for a map
|
||||
// the cached date has to be cleared manually on any change
|
||||
// this includes system, connection,... changes (all dependencies)
|
||||
$this->updateCacheData($mapDataAll);
|
||||
$this->updateCacheData($mapDataAll, '', self::DEFAULT_CACHE_TTL);
|
||||
}
|
||||
|
||||
return $mapDataAll;
|
||||
@@ -391,15 +396,23 @@ class MapModel extends BasicModel {
|
||||
|
||||
/**
|
||||
* get all connections in this map
|
||||
* @param string $scope
|
||||
* @return ConnectionModel[]
|
||||
*/
|
||||
public function getConnections(){
|
||||
public function getConnections($scope = ''){
|
||||
$connections = [];
|
||||
|
||||
$this->filter('connections', [
|
||||
$query = [
|
||||
'active = :active AND source > 0 AND target > 0',
|
||||
':active' => 1
|
||||
]);
|
||||
];
|
||||
|
||||
if(!empty($scope)){
|
||||
$query[0] .= ' AND scope = :scope';
|
||||
$query[':scope'] = $scope;
|
||||
}
|
||||
|
||||
$this->filter('connections', $query);
|
||||
|
||||
if($this->connections){
|
||||
$connections = $this->connections;
|
||||
|
||||
@@ -46,6 +46,18 @@ class SystemSignatureModel extends BasicModel {
|
||||
'index' => true,
|
||||
'activity-log' => true
|
||||
],
|
||||
'connectionId' => [
|
||||
'type' => Schema::DT_INT,
|
||||
'index' => true,
|
||||
'belongs-to-one' => 'Model\ConnectionModel',
|
||||
'constraint' => [
|
||||
[
|
||||
'table' => 'connection',
|
||||
'on-delete' => 'CASCADE'
|
||||
]
|
||||
],
|
||||
'activity-log' => true
|
||||
],
|
||||
'name' => [
|
||||
'type' => Schema::DT_VARCHAR128,
|
||||
'nullable' => false,
|
||||
@@ -112,11 +124,20 @@ class SystemSignatureModel extends BasicModel {
|
||||
|
||||
$signatureData = (object) [];
|
||||
$signatureData->id = $this->id;
|
||||
|
||||
$signatureData->system = (object) [];
|
||||
$signatureData->system->id = $this->get('systemId', true);
|
||||
|
||||
$signatureData->groupId = $this->groupId;
|
||||
$signatureData->typeId = $this->typeId;
|
||||
$signatureData->name = $this->name;
|
||||
$signatureData->description = $this->description;
|
||||
|
||||
if($connection = $this->getConnection()){
|
||||
$signatureData->connection = (object) [];
|
||||
$signatureData->connection->id = $connection->_id;
|
||||
}
|
||||
|
||||
$signatureData->created = (object) [];
|
||||
$signatureData->created->created = strtotime($this->created);
|
||||
if( is_object($this->createdCharacterId) ){
|
||||
@@ -132,6 +153,48 @@ class SystemSignatureModel extends BasicModel {
|
||||
return $signatureData;
|
||||
}
|
||||
|
||||
/**
|
||||
* setter for connectionId
|
||||
* @param $connectionId
|
||||
* @return int|null
|
||||
*/
|
||||
public function set_connectionId($connectionId){
|
||||
$connectionId = (int)$connectionId;
|
||||
$validConnectionId = null;
|
||||
|
||||
if($connectionId > 0){
|
||||
// check if connectionId is valid
|
||||
$systemId = (int) $this->get('systemId', true);
|
||||
|
||||
/**
|
||||
* @var $connection ConnectionModel
|
||||
*/
|
||||
$connection = $this->rel('connectionId');
|
||||
$connection->getById($connectionId);
|
||||
|
||||
if(
|
||||
!$connection->dry() &&
|
||||
(
|
||||
$connection->get('source', true) === $systemId||
|
||||
$connection->get('target', true) === $systemId
|
||||
)
|
||||
){
|
||||
// connectionId belongs to same system as $this signature -> is valid
|
||||
$validConnectionId = $connectionId;
|
||||
}
|
||||
}
|
||||
|
||||
return $validConnectionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the connection (if attached)
|
||||
* @return \Model\ConnectionModel|null
|
||||
*/
|
||||
public function getConnection(){
|
||||
return $this->connectionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* compares a new data set (array) with the current values
|
||||
* and checks if something has changed
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[PATHFINDER]
|
||||
NAME = Pathfinder
|
||||
; installed version (used for CSS/JS cache busting)
|
||||
VERSION = v1.2.0
|
||||
VERSION = v1.2.1
|
||||
; contact information [optional]
|
||||
CONTACT = https://github.com/exodus4d
|
||||
; public contact email [optional]
|
||||
@@ -60,7 +60,7 @@ LOGIN = templates/view/login.html
|
||||
; - Whether user activity should be logged for a map type
|
||||
; - E.g. create/update/delete of systems/connections/signatures
|
||||
[PATHFINDER.MAP.PRIVATE]
|
||||
LIFETIME = 14
|
||||
LIFETIME = 30
|
||||
MAX_COUNT = 3
|
||||
MAX_SHARED = 10
|
||||
MAX_SYSTEMS = 50
|
||||
@@ -100,28 +100,28 @@ RALLY_SET =
|
||||
|
||||
; TIMER ===========================================================================================
|
||||
[PATHFINDER.TIMER]
|
||||
; login time (minutes)
|
||||
LOGGED = 240
|
||||
; double click timer (ms)
|
||||
; login time (minutes) (default: 480)
|
||||
LOGGED = 480
|
||||
; double click timer (milliseconds) (default: 250)
|
||||
DBL_CLICK = 250
|
||||
; time for status change visibility in header (ms)
|
||||
; time for status change visibility in header (milliseconds) (default: 5000)
|
||||
PROGRAM_STATUS_VISIBLE = 5000
|
||||
|
||||
; main map update ping (ajax) (ms)
|
||||
; main map update ping (ajax) (milliseconds)
|
||||
[PATHFINDER.TIMER.UPDATE_SERVER_MAP]
|
||||
DELAY = 5000
|
||||
EXECUTION_LIMIT = 200
|
||||
|
||||
; update client map data (ms)
|
||||
; update client map data (milliseconds)
|
||||
[PATHFINDER.TIMER.UPDATE_CLIENT_MAP]
|
||||
EXECUTION_LIMIT = 50
|
||||
|
||||
; map user update ping (ajax) (ms)
|
||||
; map user update ping (ajax) (milliseconds)
|
||||
[PATHFINDER.TIMER.UPDATE_SERVER_USER_DATA]
|
||||
DELAY = 5000
|
||||
EXECUTION_LIMIT = 500
|
||||
|
||||
; update client user data (ms)
|
||||
; update client user data (milliseconds)
|
||||
[PATHFINDER.TIMER.UPDATE_CLIENT_USER_DATA]
|
||||
EXECUTION_LIMIT = 50
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ NGINX.VERSION = 1.9
|
||||
|
||||
[REQUIREMENTS.PHP]
|
||||
; recommended is >= 5.6
|
||||
VERSION = 5.6
|
||||
VERSION = 7.0
|
||||
|
||||
; "Perl-Compatible Regular Expressions"
|
||||
; usually shipped with PHP package,
|
||||
|
||||
@@ -12,6 +12,6 @@ GET @sso: /sso/@action [sync] = Controller\Ccp\Sso->
|
||||
GET @map: /map [sync] = Controller\MapController->init
|
||||
|
||||
; ajax wildcard APIs (throttled)
|
||||
GET|POST /api/@controller/@action [ajax] = Controller\Api\@controller->@action, , 512
|
||||
GET|POST /api/@controller/@action/@arg1 [ajax] = Controller\Api\@controller->@action, , 512
|
||||
GET|POST /api/@controller/@action/@arg1/@arg2 [ajax] = Controller\Api\@controller->@action, , 512
|
||||
GET|POST /api/@controller/@action [ajax] = Controller\Api\@controller->@action, 0, 512
|
||||
GET|POST /api/@controller/@action/@arg1 [ajax] = Controller\Api\@controller->@action, 0, 512
|
||||
GET|POST /api/@controller/@action/@arg1/@arg2 [ajax] = Controller\Api\@controller->@action, 0, 512
|
||||
|
||||
@@ -1,152 +1,235 @@
|
||||
"Id";"Created";"Updated";"SystemId";"WormholeId";
|
||||
"1";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002572";"59";
|
||||
"2";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002572";"25";
|
||||
"3";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002518";"6";
|
||||
"4";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002518";"21";
|
||||
"5";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002543";"12";
|
||||
"6";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002543";"68";
|
||||
"7";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002528";"18";
|
||||
"8";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002528";"59";
|
||||
"9";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002535";"18";
|
||||
"10";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002535";"59";
|
||||
"11";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002530";"18";
|
||||
"12";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002530";"59";
|
||||
"13";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002557";"59";
|
||||
"14";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002557";"25";
|
||||
"15";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002548";"12";
|
||||
"16";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002548";"68";
|
||||
"17";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002564";"59";
|
||||
"18";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002564";"25";
|
||||
"19";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002524";"6";
|
||||
"20";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002524";"21";
|
||||
"21";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002514";"39";
|
||||
"22";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002514";"28";
|
||||
"23";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002542";"12";
|
||||
"24";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002542";"68";
|
||||
"25";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002538";"12";
|
||||
"26";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002538";"68";
|
||||
"27";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002511";"39";
|
||||
"28";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002511";"28";
|
||||
"29";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002529";"18";
|
||||
"30";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002529";"59";
|
||||
"31";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002525";"6";
|
||||
"32";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002525";"21";
|
||||
"33";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002562";"59";
|
||||
"34";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002562";"25";
|
||||
"35";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002563";"59";
|
||||
"36";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002563";"25";
|
||||
"37";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002532";"18";
|
||||
"38";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002532";"59";
|
||||
"39";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002569";"59";
|
||||
"40";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002569";"25";
|
||||
"41";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002558";"59";
|
||||
"42";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002558";"25";
|
||||
"43";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002570";"59";
|
||||
"44";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002570";"25";
|
||||
"45";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002549";"12";
|
||||
"46";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002549";"68";
|
||||
"47";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002537";"30";
|
||||
"48";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002537";"59";
|
||||
"49";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002513";"39";
|
||||
"50";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002513";"28";
|
||||
"51";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002539";"12";
|
||||
"52";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002539";"68";
|
||||
"53";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002526";"6";
|
||||
"54";"2016-07-16 13:53:19";"2016-07-16 13:53:19";"31002526";"21";
|
||||
"55";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002512";"39";
|
||||
"56";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002512";"28";
|
||||
"57";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002574";"59";
|
||||
"58";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002574";"25";
|
||||
"59";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002561";"59";
|
||||
"60";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002561";"25";
|
||||
"61";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002571";"59";
|
||||
"62";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002571";"25";
|
||||
"63";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002567";"59";
|
||||
"64";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002567";"20";
|
||||
"65";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002546";"12";
|
||||
"66";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002546";"68";
|
||||
"67";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002555";"12";
|
||||
"68";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002555";"68";
|
||||
"69";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002552";"12";
|
||||
"70";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002552";"68";
|
||||
"71";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002515";"6";
|
||||
"72";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002515";"21";
|
||||
"73";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002568";"59";
|
||||
"74";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002568";"25";
|
||||
"75";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002573";"59";
|
||||
"76";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002573";"25";
|
||||
"77";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002506";"39";
|
||||
"78";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002506";"28";
|
||||
"79";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002550";"12";
|
||||
"80";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002550";"68";
|
||||
"81";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002516";"6";
|
||||
"82";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002516";"21";
|
||||
"83";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002534";"30";
|
||||
"84";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002534";"59";
|
||||
"85";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002508";"39";
|
||||
"86";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002508";"28";
|
||||
"87";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002547";"12";
|
||||
"88";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002547";"68";
|
||||
"89";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002523";"6";
|
||||
"90";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002523";"21";
|
||||
"91";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002541";"12";
|
||||
"92";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002541";"68";
|
||||
"93";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002576";"30";
|
||||
"94";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002576";"65";
|
||||
"95";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002544";"12";
|
||||
"96";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002544";"68";
|
||||
"97";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002509";"39";
|
||||
"98";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002509";"28";
|
||||
"99";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002556";"59";
|
||||
"100";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002556";"25";
|
||||
"101";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002579";"30";
|
||||
"102";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002579";"65";
|
||||
"103";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002554";"12";
|
||||
"104";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002554";"68";
|
||||
"105";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002519";"6";
|
||||
"106";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002519";"21";
|
||||
"107";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002536";"18";
|
||||
"108";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002536";"59";
|
||||
"109";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002553";"12";
|
||||
"110";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002553";"68";
|
||||
"111";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002551";"12";
|
||||
"112";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002551";"68";
|
||||
"113";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002527";"18";
|
||||
"114";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002527";"59";
|
||||
"115";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002545";"12";
|
||||
"116";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002545";"68";
|
||||
"117";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002559";"59";
|
||||
"118";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002559";"25";
|
||||
"119";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002540";"12";
|
||||
"120";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002540";"68";
|
||||
"121";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002510";"39";
|
||||
"122";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002510";"28";
|
||||
"123";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002507";"39";
|
||||
"124";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002507";"28";
|
||||
"125";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002577";"30";
|
||||
"126";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002577";"65";
|
||||
"127";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002565";"59";
|
||||
"128";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002565";"25";
|
||||
"129";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002522";"6";
|
||||
"130";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002522";"21";
|
||||
"131";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002575";"30";
|
||||
"132";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002575";"65";
|
||||
"133";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002521";"6";
|
||||
"134";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002521";"21";
|
||||
"135";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002566";"59";
|
||||
"136";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002566";"25";
|
||||
"137";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002533";"18";
|
||||
"138";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002533";"59";
|
||||
"139";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002517";"6";
|
||||
"140";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002517";"21";
|
||||
"141";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002520";"6";
|
||||
"142";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002520";"21";
|
||||
"143";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002560";"59";
|
||||
"144";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002560";"25";
|
||||
"145";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002531";"18";
|
||||
"146";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002531";"59";
|
||||
"147";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002505";"39";
|
||||
"148";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002505";"28";
|
||||
"149";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002578";"30";
|
||||
"150";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002578";"13";
|
||||
"151";"2016-07-16 13:53:20";"2016-07-16 13:53:20";"31002578";"66";
|
||||
"1";"2016-07-16 13:53:19";"2017-02-11 17:11:18";"31002572";"59";
|
||||
"2";"2016-07-16 13:53:19";"2017-02-11 17:11:18";"31002572";"25";
|
||||
"3";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002518";"6";
|
||||
"4";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002518";"21";
|
||||
"5";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002543";"12";
|
||||
"6";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002543";"68";
|
||||
"7";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002528";"18";
|
||||
"8";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002528";"59";
|
||||
"9";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002535";"18";
|
||||
"10";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002535";"59";
|
||||
"11";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002530";"18";
|
||||
"12";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002530";"59";
|
||||
"13";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002557";"59";
|
||||
"14";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002557";"25";
|
||||
"15";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002548";"12";
|
||||
"16";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002548";"68";
|
||||
"17";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002564";"59";
|
||||
"18";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002564";"25";
|
||||
"19";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002524";"6";
|
||||
"20";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002524";"21";
|
||||
"21";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002514";"39";
|
||||
"22";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002514";"28";
|
||||
"23";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002542";"12";
|
||||
"24";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002542";"68";
|
||||
"25";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002538";"12";
|
||||
"26";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002538";"68";
|
||||
"27";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002511";"39";
|
||||
"28";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002511";"28";
|
||||
"29";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002529";"18";
|
||||
"30";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002529";"59";
|
||||
"31";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002525";"6";
|
||||
"32";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002525";"21";
|
||||
"33";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002562";"59";
|
||||
"34";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002562";"25";
|
||||
"35";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002563";"59";
|
||||
"36";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002563";"25";
|
||||
"37";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002532";"18";
|
||||
"38";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002532";"59";
|
||||
"39";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002569";"59";
|
||||
"40";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002569";"25";
|
||||
"41";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002558";"59";
|
||||
"42";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002558";"25";
|
||||
"43";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002570";"59";
|
||||
"44";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002570";"25";
|
||||
"45";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002549";"12";
|
||||
"46";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002549";"68";
|
||||
"47";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002537";"30";
|
||||
"48";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002537";"59";
|
||||
"49";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002513";"39";
|
||||
"50";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002513";"28";
|
||||
"51";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002539";"12";
|
||||
"52";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002539";"68";
|
||||
"53";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002526";"6";
|
||||
"54";"2016-07-16 13:53:19";"2017-02-11 17:11:19";"31002526";"21";
|
||||
"55";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002512";"39";
|
||||
"56";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002512";"28";
|
||||
"57";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002574";"59";
|
||||
"58";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002574";"25";
|
||||
"59";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002561";"59";
|
||||
"60";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002561";"25";
|
||||
"61";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002571";"59";
|
||||
"62";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002571";"25";
|
||||
"63";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002567";"59";
|
||||
"64";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002567";"20";
|
||||
"65";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002546";"12";
|
||||
"66";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002546";"68";
|
||||
"67";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002555";"12";
|
||||
"68";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002555";"68";
|
||||
"69";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002552";"12";
|
||||
"70";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002552";"68";
|
||||
"71";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002515";"6";
|
||||
"72";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002515";"21";
|
||||
"73";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002568";"59";
|
||||
"74";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002568";"25";
|
||||
"75";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002573";"59";
|
||||
"76";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002573";"25";
|
||||
"77";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002506";"39";
|
||||
"78";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002506";"28";
|
||||
"79";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002550";"12";
|
||||
"80";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002550";"68";
|
||||
"81";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002516";"6";
|
||||
"82";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002516";"21";
|
||||
"83";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002534";"30";
|
||||
"84";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002534";"59";
|
||||
"85";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002508";"39";
|
||||
"86";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002508";"28";
|
||||
"87";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002547";"12";
|
||||
"88";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002547";"68";
|
||||
"89";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002523";"6";
|
||||
"90";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002523";"21";
|
||||
"91";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002541";"12";
|
||||
"92";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002541";"68";
|
||||
"93";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002576";"30";
|
||||
"94";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002576";"65";
|
||||
"95";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002544";"12";
|
||||
"96";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002544";"68";
|
||||
"97";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002509";"39";
|
||||
"98";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002509";"28";
|
||||
"99";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002556";"59";
|
||||
"100";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002556";"25";
|
||||
"101";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002579";"30";
|
||||
"102";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002579";"65";
|
||||
"103";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002554";"12";
|
||||
"104";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002554";"68";
|
||||
"105";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002519";"6";
|
||||
"106";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002519";"21";
|
||||
"107";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002536";"18";
|
||||
"108";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002536";"59";
|
||||
"109";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002553";"12";
|
||||
"110";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002553";"68";
|
||||
"111";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002551";"12";
|
||||
"112";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002551";"68";
|
||||
"113";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002527";"18";
|
||||
"114";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002527";"59";
|
||||
"115";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002545";"12";
|
||||
"116";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002545";"68";
|
||||
"117";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002559";"59";
|
||||
"118";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002559";"25";
|
||||
"119";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002540";"12";
|
||||
"120";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002540";"68";
|
||||
"121";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002510";"39";
|
||||
"122";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002510";"28";
|
||||
"123";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002507";"39";
|
||||
"124";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002507";"28";
|
||||
"125";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002577";"30";
|
||||
"126";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002577";"65";
|
||||
"127";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002565";"59";
|
||||
"128";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002565";"25";
|
||||
"129";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002522";"6";
|
||||
"130";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002522";"21";
|
||||
"131";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002575";"30";
|
||||
"132";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002575";"65";
|
||||
"133";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002521";"6";
|
||||
"134";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002521";"21";
|
||||
"135";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002566";"59";
|
||||
"136";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002566";"25";
|
||||
"137";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002533";"18";
|
||||
"138";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002533";"59";
|
||||
"139";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002517";"6";
|
||||
"140";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002517";"21";
|
||||
"141";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002520";"6";
|
||||
"142";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002520";"21";
|
||||
"143";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002560";"59";
|
||||
"144";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002560";"25";
|
||||
"145";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002531";"18";
|
||||
"146";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002531";"59";
|
||||
"147";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002505";"39";
|
||||
"148";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002505";"28";
|
||||
"149";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002578";"30";
|
||||
"150";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002578";"13";
|
||||
"151";"2016-07-16 13:53:20";"2017-02-11 17:11:19";"31002578";"66";
|
||||
"152";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002572";"35";
|
||||
"153";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002518";"16";
|
||||
"154";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002543";"30";
|
||||
"155";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002543";"26";
|
||||
"156";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002543";"61";
|
||||
"157";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002535";"30";
|
||||
"158";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002530";"30";
|
||||
"159";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002557";"30";
|
||||
"160";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002548";"30";
|
||||
"161";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002548";"26";
|
||||
"162";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002524";"2";
|
||||
"163";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002524";"75";
|
||||
"164";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002514";"72";
|
||||
"165";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002542";"18";
|
||||
"166";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002542";"49";
|
||||
"167";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002542";"42";
|
||||
"168";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002538";"59";
|
||||
"169";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002511";"72";
|
||||
"170";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002529";"30";
|
||||
"171";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002525";"2";
|
||||
"172";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002525";"38";
|
||||
"173";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002562";"15";
|
||||
"174";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002563";"35";
|
||||
"175";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002569";"30";
|
||||
"176";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002569";"20";
|
||||
"177";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002558";"30";
|
||||
"178";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002549";"18";
|
||||
"179";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002549";"42";
|
||||
"180";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002539";"59";
|
||||
"181";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002526";"2";
|
||||
"182";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002526";"47";
|
||||
"183";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002574";"30";
|
||||
"184";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002571";"30";
|
||||
"185";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002571";"64";
|
||||
"186";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002546";"18";
|
||||
"187";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002555";"59";
|
||||
"188";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002552";"30";
|
||||
"189";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002552";"26";
|
||||
"190";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002515";"2";
|
||||
"191";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002515";"75";
|
||||
"192";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002573";"30";
|
||||
"193";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002506";"72";
|
||||
"194";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002550";"59";
|
||||
"195";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002550";"49";
|
||||
"196";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002516";"2";
|
||||
"197";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002516";"69";
|
||||
"198";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002547";"30";
|
||||
"199";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002547";"26";
|
||||
"200";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002547";"61";
|
||||
"201";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002523";"75";
|
||||
"202";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002523";"16";
|
||||
"203";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002541";"59";
|
||||
"204";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002541";"42";
|
||||
"205";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002576";"66";
|
||||
"206";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002544";"18";
|
||||
"207";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002544";"49";
|
||||
"208";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002544";"42";
|
||||
"209";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002556";"30";
|
||||
"210";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002556";"64";
|
||||
"211";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002554";"59";
|
||||
"212";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002554";"26";
|
||||
"213";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002519";"69";
|
||||
"214";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002551";"59";
|
||||
"215";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002551";"26";
|
||||
"216";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002545";"18";
|
||||
"217";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002545";"49";
|
||||
"218";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002559";"17";
|
||||
"219";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002559";"30";
|
||||
"220";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002559";"35";
|
||||
"221";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002540";"59";
|
||||
"222";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002510";"72";
|
||||
"223";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002507";"72";
|
||||
"224";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002522";"2";
|
||||
"225";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002521";"47";
|
||||
"226";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002566";"20";
|
||||
"227";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002533";"30";
|
||||
"228";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002517";"2";
|
||||
"229";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002517";"53";
|
||||
"230";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002520";"2";
|
||||
"231";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002520";"16";
|
||||
"232";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002560";"30";
|
||||
"233";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31002505";"72";
|
||||
"234";"2017-02-25 17:52:14";"2017-02-25 17:52:14";"31000001";"16";
|
||||
|
@@ -1,75 +1,76 @@
|
||||
{"J001025":["U210","H296"],
|
||||
"J001057":["B274","E545"],
|
||||
"J001302":["C247","X877"],
|
||||
{"J001025":["U210","M267"],
|
||||
"J001057":["B274","E545","D382"],
|
||||
"J001302":["K346","H900","U574"],
|
||||
"J001348":["D845","U210"],
|
||||
"J001398":["D845","U210"],
|
||||
"J001670":["D845","U210"],
|
||||
"J001694":["U210","H296"],
|
||||
"J001769":["C247","X877"],
|
||||
"J001398":["U210","K346"],
|
||||
"J001670":["U210","K346"],
|
||||
"J001694":["K346","H296"],
|
||||
"J001769":["K346","X877","H900"],
|
||||
"J001820":["U210","H296"],
|
||||
"J001890":["B274","E545"],
|
||||
"J002216":["N110","J244"],
|
||||
"J002423":["C247","X877"],
|
||||
"J002625":["C247","X877"],
|
||||
"J002757":["N110","J244"],
|
||||
"J002838":["D845","U210"],
|
||||
"J002964":["B274","E545"],
|
||||
"J003382":["U210","H296"],
|
||||
"J003546":["U210","H296"],
|
||||
"J001890":["B274","A239","Z647"],
|
||||
"J002216":["J244","Z060"],
|
||||
"J002423":["D845","P060","N766"],
|
||||
"J002625":["U210","C247","X877"],
|
||||
"J002757":["N110","Z060"],
|
||||
"J002838":["U210","K346"],
|
||||
"J002964":["A239","E545","N062"],
|
||||
"J003382":["U210","D364"],
|
||||
"J003546":["U210","M267"],
|
||||
"J003789":["D845","U210"],
|
||||
"J003793":["U210","H296"],
|
||||
"J003941":["U210","H296"],
|
||||
"J003793":["K346","E175"],
|
||||
"J003941":["K346","H296"],
|
||||
"J004128":["U210","H296"],
|
||||
"J004150":["C247","X877"],
|
||||
"J004283":["K346","U210"],
|
||||
"J004150":["D845","N766","C247"],
|
||||
"J004283":["U210","K346"],
|
||||
"J004317":["N110","J244"],
|
||||
"J004470":["C247","X877"],
|
||||
"J004686":["B274","E545"],
|
||||
"J004470":["U210","C247","X877"],
|
||||
"J004686":["A239","E545","O477"],
|
||||
"J004791":["N110","J244"],
|
||||
"J004921":["U210","H296"],
|
||||
"J004921":["K346","H296"],
|
||||
"J004998":["U210","H296"],
|
||||
"J005070":["U210","H296"],
|
||||
"J005070":["K346","V753"],
|
||||
"J005223":["U210","E175"],
|
||||
"J005259":["C247","X877"],
|
||||
"J005280":["C247","X877"],
|
||||
"J005299":["C247","X877"],
|
||||
"J005482":["B274","E545"],
|
||||
"J005663":["U210","H296"],
|
||||
"J005724":["U210","H296"],
|
||||
"J005834":["N110","J244"],
|
||||
"J005872":["C247","X877"],
|
||||
"J005900":["B274","E545"],
|
||||
"J005923":["D845","U210"],
|
||||
"J005259":["D845","C247","X877"],
|
||||
"J005280":["U210","C247","X877"],
|
||||
"J005299":["K346","C247","H900"],
|
||||
"J005482":["B274","A239","Z647"],
|
||||
"J005663":["U210"],
|
||||
"J005724":["K346","H296"],
|
||||
"J005834":["N110","Z060"],
|
||||
"J005872":["U210","P060","C247"],
|
||||
"J005900":["A239","E545","Y683"],
|
||||
"J005923":["U210","K346"],
|
||||
"J005926":["N110","J244"],
|
||||
"J005969":["C247","X877"],
|
||||
"J010000":["B274","E545"],
|
||||
"J010247":["C247","X877"],
|
||||
"J010366":["K346","V911"],
|
||||
"J010556":["C247","X877"],
|
||||
"J005969":["K346","H900","U574"],
|
||||
"J010000":["B274","Z647","D382"],
|
||||
"J010247":["U210","N766","X877"],
|
||||
"J010366":["W237"],
|
||||
"J010556":["D845","P060","N766"],
|
||||
"J010569":["N110","J244"],
|
||||
"J010811":["U210","H296"],
|
||||
"J010811":["K346","V753"],
|
||||
"J010951":["K346","V911"],
|
||||
"J011195":["C247","X877"],
|
||||
"J011321":["B274","E545"],
|
||||
"J011195":["U210","X877","H900"],
|
||||
"J011321":["B274","E545","Y683"],
|
||||
"J011339":["D845","U210"],
|
||||
"J011355":["C247","X877"],
|
||||
"J011376":["C247","X877"],
|
||||
"J011376":["U210","X877","H900"],
|
||||
"J011563":["D845","U210"],
|
||||
"J011778":["C247","X877"],
|
||||
"J011790":["U210","H296"],
|
||||
"J011824":["C247","X877"],
|
||||
"J012157":["N110","J244"],
|
||||
"J012402":["N110","J244"],
|
||||
"J011778":["D845","P060","C247"],
|
||||
"J011790":["D792","K346","M267"],
|
||||
"J011824":["U210","C247","X877"],
|
||||
"J012157":["J244","Z060"],
|
||||
"J012402":["N110","Z060"],
|
||||
"J012475":["K346","V911"],
|
||||
"J012578":["U210","H296"],
|
||||
"J012635":["B274","E545"],
|
||||
"J012635":["B274","A239"],
|
||||
"J012686":["K346","V911"],
|
||||
"J012735":["B274","E545"],
|
||||
"J012773":["U210","H296"],
|
||||
"J012794":["D845","U210"],
|
||||
"J013070":["B274","E545"],
|
||||
"J013123":["B274","E545"],
|
||||
"J013146":["U210","H296"],
|
||||
"J012735":["B274","E545","O477"],
|
||||
"J012773":["E175"],
|
||||
"J012794":["U210","K346"],
|
||||
"J013070":["A239","E545","R474"],
|
||||
"J013123":["B274","A239","D382"],
|
||||
"J013146":["K346","H296"],
|
||||
"J014348":["D845","U210"],
|
||||
"J015092":["N110","J244"],
|
||||
"J015227":["K346","C248", "W237"]}
|
||||
"J015092":["N110","Z060"],
|
||||
"J015227":["K346","W237"],
|
||||
"J055520":["D382"]}
|
||||
|
||||
@@ -21,7 +21,7 @@ requirejs.config({
|
||||
mappage: './app/mappage', // initial start "map page" view
|
||||
setup: './app/setup', // initial start "setup page" view
|
||||
|
||||
jquery: 'lib/jquery-3.0.0.min', // v3.0.0 jQuery
|
||||
jquery: 'lib/jquery-3.1.1.min', // v3.1.1 jQuery
|
||||
bootstrap: 'lib/bootstrap.min', // v3.3.0 Bootstrap js code - http://getbootstrap.com/javascript
|
||||
text: 'lib/requirejs/text', // v2.0.12 A RequireJS/AMD loader plugin for loading text resources.
|
||||
mustache: 'lib/mustache.min', // v1.0.0 Javascript template engine - http://mustache.github.io
|
||||
|
||||
@@ -15,7 +15,7 @@ define(['jquery'], function($) {
|
||||
|
||||
|
||||
// NullSec Relic sites, which can also spawn in C1, C2, C3 wormholes
|
||||
var nullSecRelicSites = {
|
||||
let nullSecRelicSites = {
|
||||
10: 'Ruined Angel Crystal Quarry',
|
||||
11: 'Ruined Angel Monument Site',
|
||||
12: 'Ruined Angel Science Outpost',
|
||||
@@ -39,7 +39,7 @@ define(['jquery'], function($) {
|
||||
};
|
||||
|
||||
// NulSec Data sites, which can also spawn in C1, C2, C3 wormholes
|
||||
var nullSecDataSites = {
|
||||
let nullSecDataSites = {
|
||||
10: 'Abandoned Research Complex DA005',
|
||||
11: 'Abandoned Research Complex DA015',
|
||||
12: 'Abandoned Research Complex DC007',
|
||||
@@ -70,7 +70,7 @@ define(['jquery'], function($) {
|
||||
|
||||
|
||||
// signature types
|
||||
var signatureTypes = {
|
||||
let signatureTypes = {
|
||||
1: { // system type (wh)
|
||||
1: { // C1 (area id)
|
||||
1: { // Combat
|
||||
@@ -342,32 +342,31 @@ define(['jquery'], function($) {
|
||||
4: 'L005 - C2',
|
||||
5: 'N766 - C2',
|
||||
6: 'C247 - C3',
|
||||
7: 'K346 - C3',
|
||||
8: 'M267 - C3',
|
||||
9: 'O477 - C3',
|
||||
10: 'X877 - C4',
|
||||
11: 'Y683 - C4',
|
||||
12: 'H296 - C5',
|
||||
13: 'H900 - C5',
|
||||
14: 'H296 - C5',
|
||||
15: 'N062 - C5',
|
||||
16: 'V911 - C5',
|
||||
17: 'U574 - C6',
|
||||
18: 'V753 - C6',
|
||||
19: 'W237 - C6',
|
||||
20: 'B274 - HS',
|
||||
21: 'D792 - HS',
|
||||
22: 'D845 - HS',
|
||||
23: 'N110 - HS',
|
||||
24: 'A239 - LS',
|
||||
25: 'C391 - LS',
|
||||
26: 'J244 - LS',
|
||||
27: 'U201 - LS',
|
||||
28: 'U210 - LS',
|
||||
29: 'C248 - 0.0',
|
||||
30: 'E545 - 0.0',
|
||||
31: 'K346 - 0.0',
|
||||
32: 'Z060 - 0.0'
|
||||
7: 'M267 - C3',
|
||||
8: 'O477 - C3',
|
||||
9: 'X877 - C4',
|
||||
10: 'Y683 - C4',
|
||||
11: 'H296 - C5',
|
||||
12: 'H900 - C5',
|
||||
13: 'H296 - C5',
|
||||
14: 'N062 - C5', // ??
|
||||
15: 'V911 - C5',
|
||||
16: 'U574 - C6',
|
||||
17: 'V753 - C6',
|
||||
18: 'W237 - C6',
|
||||
19: 'B274 - HS',
|
||||
20: 'D792 - HS',
|
||||
21: 'D845 - HS',
|
||||
22: 'N110 - HS',
|
||||
23: 'A239 - LS',
|
||||
24: 'C391 - LS',
|
||||
25: 'J244 - LS',
|
||||
26: 'U201 - LS', // ??
|
||||
27: 'U210 - LS',
|
||||
28: 'C248 - 0.0',
|
||||
29: 'E545 - 0.0',
|
||||
30: 'K346 - 0.0',
|
||||
31: 'Z060 - 0.0'
|
||||
}
|
||||
}
|
||||
}, // system type (k-space)
|
||||
|
||||
@@ -9,7 +9,7 @@ define([], function() {
|
||||
'use strict';
|
||||
|
||||
// system effects
|
||||
var systemEffects = {
|
||||
let systemEffects = {
|
||||
wh: {
|
||||
magnetar: {
|
||||
1: [
|
||||
|
||||
103
js/app/init.js
103
js/app/init.js
@@ -8,51 +8,52 @@ define(['jquery'], function($) {
|
||||
|
||||
let Config = {
|
||||
path: {
|
||||
img: 'public/img/', // path for images
|
||||
img: 'public/img/', // path for images
|
||||
// user API
|
||||
getCaptcha: 'api/user/getCaptcha', // ajax URL - get captcha image
|
||||
getServerStatus: 'api/user/getEveServerStatus', // ajax URL - get EVE-Online server status
|
||||
getCookieCharacterData: 'api/user/getCookieCharacter', // ajax URL - get character data from cookie
|
||||
logIn: 'api/user/logIn', // ajax URL - login
|
||||
logout: 'api/user/logout', // ajax URL - logout
|
||||
deleteLog: 'api/user/deleteLog', // ajax URL - delete character log
|
||||
saveUserConfig: 'api/user/saveAccount', // ajax URL - saves/update user account
|
||||
deleteAccount: 'api/user/deleteAccount', // ajax URL - delete Account data
|
||||
getCaptcha: 'api/user/getCaptcha', // ajax URL - get captcha image
|
||||
getServerStatus: 'api/user/getEveServerStatus', // ajax URL - get EVE-Online server status
|
||||
getCookieCharacterData: 'api/user/getCookieCharacter', // ajax URL - get character data from cookie
|
||||
logIn: 'api/user/logIn', // ajax URL - login
|
||||
logout: 'api/user/logout', // ajax URL - logout
|
||||
deleteLog: 'api/user/deleteLog', // ajax URL - delete character log
|
||||
saveUserConfig: 'api/user/saveAccount', // ajax URL - saves/update user account
|
||||
deleteAccount: 'api/user/deleteAccount', // ajax URL - delete Account data
|
||||
// access API
|
||||
searchAccess: 'api/access/search', // ajax URL - search user/corporation/ally by name
|
||||
searchAccess: 'api/access/search', // ajax URL - search user/corporation/ally by name
|
||||
// main config/map ping API
|
||||
initMap: 'api/map/init', // ajax URL - get static data
|
||||
getAccessData: 'api/map/getAccessData', // ajax URL - get map access tokens (WebSocket)
|
||||
updateMapData: 'api/map/updateData', // ajax URL - main map update trigger
|
||||
updateUserData: 'api/map/updateUserData', // ajax URL - main map user data trigger
|
||||
initMap: 'api/map/init', // ajax URL - get static data
|
||||
getAccessData: 'api/map/getAccessData', // ajax URL - get map access tokens (WebSocket)
|
||||
updateMapData: 'api/map/updateData', // ajax URL - main map update trigger
|
||||
updateUserData: 'api/map/updateUserData', // ajax URL - main map user data trigger
|
||||
// map API
|
||||
saveMap: 'api/map/save', // ajax URL - save/update map
|
||||
deleteMap: 'api/map/delete', // ajax URL - delete map
|
||||
importMap: 'api/map/import', // ajax URL - import map
|
||||
saveMap: 'api/map/save', // ajax URL - save/update map
|
||||
deleteMap: 'api/map/delete', // ajax URL - delete map
|
||||
importMap: 'api/map/import', // ajax URL - import map
|
||||
getMapConnectionData: 'api/map/getConnectionData', // ajax URL - get connection data
|
||||
// system API
|
||||
searchSystem: 'api/system/search', // ajax URL - search system by name
|
||||
saveSystem: 'api/system/save', // ajax URL - saves system to map
|
||||
deleteSystem: 'api/system/delete', // ajax URL - delete system from map
|
||||
getSystemGraphData: 'api/system/graphData', // ajax URL - get all system graph data
|
||||
getConstellationData: 'api/system/constellationData', // ajax URL - get system constellation data
|
||||
setDestination: 'api/system/setDestination', // ajax URL - set destination
|
||||
searchSystem: 'api/system/search', // ajax URL - search system by name
|
||||
saveSystem: 'api/system/save', // ajax URL - saves system to map
|
||||
deleteSystem: 'api/system/delete', // ajax URL - delete system from map
|
||||
getSystemGraphData: 'api/system/graphData', // ajax URL - get all system graph data
|
||||
getConstellationData: 'api/system/constellationData', // ajax URL - get system constellation data
|
||||
setDestination: 'api/system/setDestination', // ajax URL - set destination
|
||||
// connection API
|
||||
saveConnection: 'api/connection/save', // ajax URL - save new connection to map
|
||||
deleteConnection: 'api/connection/delete', // ajax URL - delete connection from map
|
||||
saveConnection: 'api/connection/save', // ajax URL - save new connection to map
|
||||
deleteConnection: 'api/connection/delete', // ajax URL - delete connection from map
|
||||
// signature API
|
||||
getSignatures: 'api/signature/getAll', // ajax URL - get all signature data for system
|
||||
saveSignatureData: 'api/signature/save', // ajax URL - save signature data for system
|
||||
deleteSignatureData: 'api/signature/delete', // ajax URL - delete signature data for system
|
||||
getSignatures: 'api/signature/getAll', // ajax URL - get all signature data for system
|
||||
saveSignatureData: 'api/signature/save', // ajax URL - save signature data for system
|
||||
deleteSignatureData: 'api/signature/delete', // ajax URL - delete signature data for system
|
||||
// route API
|
||||
searchRoute: 'api/route/search', // ajax URL - search system routes
|
||||
searchRoute: 'api/route/search', // ajax URL - search system routes
|
||||
// stats API
|
||||
getStatisticsData: 'api/statistic/getData', // ajax URL - get statistics data (activity log)
|
||||
getStatisticsData: 'api/statistic/getData', // ajax URL - get statistics data (activity log)
|
||||
// GitHub API
|
||||
gitHubReleases: 'api/github/releases' // ajax URL - get release info from GitHub
|
||||
gitHubReleases: 'api/github/releases' // ajax URL - get release info from GitHub
|
||||
},
|
||||
url: {
|
||||
ccpImageServer: 'https://image.eveonline.com/', // CCP image Server
|
||||
zKillboard: 'https://zkillboard.com/api/' // killboard api
|
||||
ccpImageServer: 'https://image.eveonline.com/', // CCP image Server
|
||||
zKillboard: 'https://zkillboard.com/api/' // killboard api
|
||||
},
|
||||
breakpoints: [
|
||||
{ name: 'desktop', width: Infinity },
|
||||
@@ -61,13 +62,13 @@ define(['jquery'], function($) {
|
||||
{ name: 'phone', width: 480 }
|
||||
],
|
||||
animationSpeed: {
|
||||
splashOverlay: 300, // "splash" loading overlay
|
||||
headerLink: 100, // links in head bar
|
||||
mapOverlay: 200, // show/hide duration for map overlays
|
||||
mapMoveSystem: 180, // system position has changed animation
|
||||
mapDeleteSystem: 200, // remove system from map
|
||||
mapModule: 200, // show/hide of an map module
|
||||
dialogEvents: 180 // dialog events /slide/show/...
|
||||
splashOverlay: 300, // "splash" loading overlay
|
||||
headerLink: 100, // links in head bar
|
||||
mapOverlay: 200, // show/hide duration for map overlays
|
||||
mapMoveSystem: 180, // system position has changed animation
|
||||
mapDeleteSystem: 200, // remove system from map
|
||||
mapModule: 200, // show/hide of an map module
|
||||
dialogEvents: 180 // dialog events /slide/show/...
|
||||
},
|
||||
syncStatus: {
|
||||
type: 'ajax',
|
||||
@@ -77,7 +78,7 @@ define(['jquery'], function($) {
|
||||
timestamp: undefined
|
||||
},
|
||||
sharedWorker: {
|
||||
status: 'offline', // SharedWorker status
|
||||
status: 'offline', // SharedWorker status
|
||||
class: 'txt-color-danger',
|
||||
timestamp: undefined
|
||||
},
|
||||
@@ -88,12 +89,12 @@ define(['jquery'], function($) {
|
||||
}
|
||||
},
|
||||
performanceLogging: {
|
||||
keyServerMapData: 'UPDATE_SERVER_MAP', // ajax request update map data
|
||||
keyClientMapData: 'UPDATE_CLIENT_MAP', // update client map data
|
||||
keyServerUserData: 'UPDATE_SERVER_USER_DATA', // ajax request update map user data
|
||||
keyClientUserData: 'UPDATE_CLIENT_USER_DATA', // update client map user data
|
||||
keyServerMapData: 'UPDATE_SERVER_MAP', // ajax request update map data
|
||||
keyClientMapData: 'UPDATE_CLIENT_MAP', // update client map data
|
||||
keyServerUserData: 'UPDATE_SERVER_USER_DATA', // ajax request update map user data
|
||||
keyClientUserData: 'UPDATE_CLIENT_USER_DATA', // update client map user data
|
||||
},
|
||||
mapIcons: [ // map tab-icons
|
||||
mapIcons: [ // map tab-icons
|
||||
{
|
||||
class: 'fa-desktop',
|
||||
label: 'desktop',
|
||||
@@ -186,7 +187,7 @@ define(['jquery'], function($) {
|
||||
class: 'pf-system-sec-unknown'
|
||||
},
|
||||
'H': {
|
||||
class: 'pf-system-sec-highSec'
|
||||
class: 'pf-system-sec-highSec'
|
||||
},
|
||||
'L': {
|
||||
class: 'pf-system-sec-lowSec'
|
||||
@@ -258,12 +259,12 @@ define(['jquery'], function($) {
|
||||
},
|
||||
// easy-pie-charts
|
||||
pieChart: {
|
||||
class: 'pf-pie-chart', // class for all pie charts
|
||||
pieChartMapCounterClass: 'pf-pie-chart-map-timer' // class for timer chart
|
||||
class: 'pf-pie-chart', // class for all pie charts
|
||||
pieChartMapCounterClass: 'pf-pie-chart-map-timer' // class for timer chart
|
||||
}
|
||||
},
|
||||
// map scopes
|
||||
defaultMapScope: 'wh', // default scope for connection
|
||||
defaultMapScope: 'wh', // default scope for connection
|
||||
// map connection types
|
||||
connectionTypes: {
|
||||
jumpbridge: {
|
||||
@@ -400,7 +401,7 @@ define(['jquery'], function($) {
|
||||
6: 'G008 - C6',
|
||||
7: 'Q003 - 0.0',
|
||||
8: 'A009 - (shattered)'
|
||||
},
|
||||
},
|
||||
5: { // C5
|
||||
1: 'E004 - C1',
|
||||
2: 'L005 - C2',
|
||||
|
||||
442
js/app/key.js
Normal file
442
js/app/key.js
Normal file
@@ -0,0 +1,442 @@
|
||||
define([
|
||||
'jquery'
|
||||
], function($) {
|
||||
'use strict';
|
||||
|
||||
let allCombo = {
|
||||
// global -------------------------------------------------------------------------------------------
|
||||
tabReload: {
|
||||
group: 'global',
|
||||
label: 'Close open dialog',
|
||||
keyNames: ['ESC']
|
||||
},
|
||||
// signature ----------------------------------------------------------------------------------------
|
||||
signatureSelect: {
|
||||
group: 'signatures',
|
||||
label: 'Select multiple rows',
|
||||
keyNames: ['CONTROL', 'CLICK']
|
||||
}
|
||||
};
|
||||
|
||||
let allEvents = {
|
||||
// global -------------------------------------------------------------------------------------------
|
||||
tabReload: {
|
||||
group: 'global',
|
||||
label: 'Reload tab',
|
||||
keyNames: ['CONTROL', 'R']
|
||||
},
|
||||
signaturePaste: {
|
||||
group: 'global',
|
||||
label: 'Paste signatures from clipboard',
|
||||
keyNames: ['CONTROL', 'V'],
|
||||
alias: 'paste'
|
||||
},
|
||||
|
||||
// map ----------------------------------------------------------------------------------------------
|
||||
mapSystemAdd: {
|
||||
group: 'map',
|
||||
label: 'Add new system',
|
||||
keyNames: ['CONTROL', 'S']
|
||||
},
|
||||
mapSystemsSelect: {
|
||||
group: 'map',
|
||||
label: 'Select all systems',
|
||||
keyNames: ['CONTROL', 'A']
|
||||
},
|
||||
mapSystemsDelete: {
|
||||
group: 'map',
|
||||
label: 'Delete selected systems',
|
||||
keyNames: ['CONTROL', 'D']
|
||||
}
|
||||
};
|
||||
|
||||
let groups = {
|
||||
global: {
|
||||
label: 'Global'
|
||||
},
|
||||
map: {
|
||||
label: 'Map'
|
||||
},
|
||||
signatures: {
|
||||
label: 'Signature'
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* enables some console.log() information
|
||||
* @type {boolean}
|
||||
*/
|
||||
let debug = false;
|
||||
|
||||
/**
|
||||
* check interval for "new" active keys
|
||||
* @type {number}
|
||||
*/
|
||||
let keyWatchPeriod = 100;
|
||||
|
||||
/**
|
||||
* DOM data key for an element that lists all active events (comma separated)
|
||||
* @type {string}
|
||||
*/
|
||||
let dataKeyEvents = 'key-events';
|
||||
|
||||
/**
|
||||
* DOM data key prefix whether domElement that holds the trigger needs to be "focused"
|
||||
* @type {string}
|
||||
*/
|
||||
let dataKeyFocusPrefix = 'key-focus-';
|
||||
|
||||
/**
|
||||
* DOM data key that holds the callback function for that element
|
||||
* @type {string}
|
||||
*/
|
||||
let dataKeyCallbackPrefix = 'key-callback-';
|
||||
|
||||
/**
|
||||
* check if module is initiated
|
||||
*/
|
||||
let isInit = false;
|
||||
|
||||
/**
|
||||
* global key map holds all active (hold down) keys
|
||||
* @type {{}}
|
||||
*/
|
||||
let map = {};
|
||||
|
||||
/**
|
||||
* show debug information in console
|
||||
* @param msg
|
||||
* @param element
|
||||
*/
|
||||
let debugWatchKey = (msg, element) => {
|
||||
if(debug){
|
||||
console.info(msg, element);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get all active (hold down) keys at this moment
|
||||
* @returns {Array}
|
||||
*/
|
||||
let getActiveKeys = () => {
|
||||
return Object.keys(map);
|
||||
};
|
||||
|
||||
/**
|
||||
* callback function that compares two arrays
|
||||
* @param element
|
||||
* @param index
|
||||
* @param array
|
||||
*/
|
||||
let compareKeyLists = function(element, index, array) {
|
||||
return this.find(x => x === element);
|
||||
};
|
||||
|
||||
/**
|
||||
* get event names that COULD lead to a "full" event (not all keys pressed yet)
|
||||
* @param keyList
|
||||
* @returns {Array}
|
||||
*/
|
||||
let checkEventNames = (keyList) => {
|
||||
let incompleteEvents = [];
|
||||
for(let event in allEvents){
|
||||
// check if "some" or "all" keys are pressed for en event
|
||||
if( keyList.every(compareKeyLists, allEvents[event].keyNames) ){
|
||||
incompleteEvents.push(event);
|
||||
}
|
||||
}
|
||||
|
||||
return incompleteEvents;
|
||||
};
|
||||
|
||||
/**
|
||||
* get all event names
|
||||
* @returns {Array}
|
||||
*/
|
||||
let getAllEventNames = () => {
|
||||
let eventNames = [];
|
||||
for(let event in allEvents){
|
||||
eventNames.push(event);
|
||||
}
|
||||
return eventNames;
|
||||
};
|
||||
|
||||
/**
|
||||
* get all event names that matches a given keyList
|
||||
* @param keyList
|
||||
* @param checkEvents
|
||||
* @returns {Array}
|
||||
*/
|
||||
let getMatchingEventNames = (keyList, checkEvents) => {
|
||||
checkEvents = checkEvents || getAllEventNames();
|
||||
let events = [];
|
||||
|
||||
for(let event of checkEvents){
|
||||
// check if both key arrays are equal
|
||||
if(
|
||||
allEvents[event].keyNames.every(compareKeyLists, keyList) &&
|
||||
keyList.every(compareKeyLists, allEvents[event].keyNames)
|
||||
){
|
||||
events.push(event);
|
||||
}
|
||||
}
|
||||
|
||||
return events;
|
||||
};
|
||||
|
||||
/**
|
||||
* init global keyWatch interval and check for event trigger (hotKey combinations)
|
||||
*/
|
||||
let init = () => {
|
||||
if( !isInit ){
|
||||
// key watch loop -------------------------------------------------------------------------------
|
||||
let prevActiveKeys = [];
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
* @returns {number} 0: no keys hold, 1: invalid match, 2: partial match, 3: match, 4: alias match, 5: event(s) fired
|
||||
*/
|
||||
let checkForEvents = (e) => {
|
||||
let status = 0;
|
||||
|
||||
// get all pressed keys
|
||||
let activeKeys = getActiveKeys();
|
||||
debugWatchKey('activeKeys', activeKeys);
|
||||
|
||||
// check if "active" keys has changes since last loop
|
||||
if(activeKeys.length){
|
||||
// check for "incomplete" events (not all keys pressed yet)
|
||||
let incompleteEvents = checkEventNames(activeKeys);
|
||||
if(incompleteEvents.length){
|
||||
// "some" event keys pressed OR "all" keys pressed
|
||||
status = 2;
|
||||
|
||||
// check if key combo matches a registered (valid) event
|
||||
let events = getMatchingEventNames(activeKeys, incompleteEvents);
|
||||
if(events.length){
|
||||
status = 3;
|
||||
// check events if there are attached elements to it
|
||||
events.forEach((event) => {
|
||||
// skip events that has an alias and should not be triggered by key combo
|
||||
if( !allEvents[event].alias ){
|
||||
if(allEvents[event].elements){
|
||||
// search for callback functions attached to each element
|
||||
allEvents[event].elements.forEach((domElement) => {
|
||||
let domElementObj = $(domElement);
|
||||
// check if event on this element requires active "focus"
|
||||
let optFocus = domElementObj.data(dataKeyFocusPrefix + event);
|
||||
|
||||
if( !(
|
||||
optFocus &&
|
||||
document.activeElement !== domElement
|
||||
)
|
||||
){
|
||||
// execute callback if valid
|
||||
let callback = domElementObj.data(dataKeyCallbackPrefix + event);
|
||||
if(typeof callback === 'function'){
|
||||
status = 5;
|
||||
callback.call(domElement, domElement, e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}else{
|
||||
status = 4;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}else{
|
||||
// invalid combo
|
||||
status = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// store current keys for next loop check
|
||||
prevActiveKeys = activeKeys;
|
||||
|
||||
return status;
|
||||
};
|
||||
|
||||
// set key-events -------------------------------------------------------------------------------
|
||||
let evKeyDown = (e) => {
|
||||
// exclude some HTML Tags from watcher
|
||||
if(
|
||||
e.target.tagName !== 'INPUT' &&
|
||||
e.target.tagName !== 'TEXTAREA'
|
||||
){
|
||||
let key = e.key.toUpperCase();
|
||||
map[key] = true;
|
||||
|
||||
// check for any shortcut combo that triggers an event
|
||||
let status = checkForEvents(e);
|
||||
|
||||
if(
|
||||
status === 2 ||
|
||||
status === 3 ||
|
||||
status === 5
|
||||
){
|
||||
// prevent SOME browser default actions -> we want 'Pathfinder' shortcuts :)
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let evKeyUp = (e) => {
|
||||
let key = e.key.toUpperCase();
|
||||
|
||||
if(map.hasOwnProperty(key)){
|
||||
delete map[key];
|
||||
}
|
||||
};
|
||||
|
||||
let container = $('body');
|
||||
container.on('keydown', evKeyDown);
|
||||
container.on('keyup', evKeyUp);
|
||||
|
||||
// global dom remove listener -------------------------------------------------------------------
|
||||
// -> check whether the removed element had an event listener active and removes them.
|
||||
document.body.addEventListener ('DOMNodeRemoved', function(e){
|
||||
if(typeof e.target.getAttribute === 'function'){
|
||||
let eventNames = e.target.getAttribute(dataKeyEvents);
|
||||
if(eventNames){
|
||||
eventNames.split(',').forEach((event) => {
|
||||
let index = allEvents[event].elements.indexOf(e.target);
|
||||
if(index > -1){
|
||||
// remove element from event list
|
||||
allEvents[event].elements.splice(index, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, false);
|
||||
|
||||
isInit = true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* add a new "shortCut" combination (event) to a DOM element
|
||||
* @param event
|
||||
* @param callback
|
||||
* @param options
|
||||
*/
|
||||
$.fn.watchKey = function(event, callback, options){
|
||||
|
||||
// default options for keyWatcher on elements
|
||||
let defaultOptions = {
|
||||
focus: false, // element must be focused (active)
|
||||
bubbling: true // elements deeper (children) in the DOM can bubble the event up
|
||||
};
|
||||
|
||||
let customOptions = $.extend(true, {}, defaultOptions, options );
|
||||
|
||||
return this.each((i, domElement) => {
|
||||
let element = $(domElement);
|
||||
|
||||
// init global key events
|
||||
init();
|
||||
|
||||
// check if event is "valid" (exists) and is not already set for this element
|
||||
let validEvent = false;
|
||||
if(allEvents[event].elements){
|
||||
if(allEvents[event].elements.indexOf(domElement) === -1){
|
||||
validEvent = true;
|
||||
}else{
|
||||
console.warn('Event "' + event + '" already set');
|
||||
}
|
||||
}else{
|
||||
validEvent = true;
|
||||
allEvents[event].elements = [];
|
||||
}
|
||||
|
||||
if(validEvent){
|
||||
// store callback options to dom element
|
||||
if(customOptions.focus){
|
||||
let dataAttr = dataKeyFocusPrefix + event;
|
||||
element.data(dataAttr, true);
|
||||
|
||||
// check if DOM element has "tabindex" attr -> required to manually set focus() to it
|
||||
if(!domElement.hasAttribute('tabindex')){
|
||||
domElement.setAttribute('tabindex', 0);
|
||||
}
|
||||
|
||||
// element requires a "focus" listener
|
||||
element.off('click.focusKeyWatcher').on('click.focusKeyWatcher', function(e){
|
||||
if(
|
||||
e.target === this ||
|
||||
customOptions.bubbling
|
||||
){
|
||||
this.focus();
|
||||
debugWatchKey('focus set:', this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// check if is key combo has a native JS event that should be used instead
|
||||
if(allEvents[event].alias){
|
||||
element.on(allEvents[event].alias, callback);
|
||||
}else{
|
||||
// store callback function to dom element
|
||||
let dataAttr = dataKeyCallbackPrefix + event;
|
||||
element.data(dataAttr, callback);
|
||||
}
|
||||
|
||||
// add eventName to dom element as attribute ----------------------------------------------------
|
||||
let currentEventNames = element.attr(dataKeyEvents) ? element.attr(dataKeyEvents).split(',') : [];
|
||||
currentEventNames.push(event);
|
||||
element.attr(dataKeyEvents, currentEventNames.join(','));
|
||||
|
||||
// store domElement to event (global)
|
||||
allEvents[event].elements.push(domElement);
|
||||
|
||||
debugWatchKey('new event "' + event + '" registered', domElement);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* get a array with all available shortcut groups and their events
|
||||
* @returns {Array}
|
||||
*/
|
||||
let getGroupedShortcuts = () => {
|
||||
let result = $.extend(true, {}, groups);
|
||||
|
||||
// add combos and events to groups
|
||||
let allEntries = [allCombo, allEvents];
|
||||
for(let i = 0; i < allEntries.length; i++){
|
||||
for(let event in allEntries[i]){
|
||||
let data = allEntries[i][event];
|
||||
|
||||
//format keyNames for UI
|
||||
let keyNames = data.keyNames.map( (key) => {
|
||||
if(key === 'CONTROL'){
|
||||
key = 'ctrl';
|
||||
}
|
||||
return key;
|
||||
});
|
||||
|
||||
let newEventData = {
|
||||
label: data.label,
|
||||
keyNames: keyNames
|
||||
};
|
||||
|
||||
if( result[data.group].events ){
|
||||
result[data.group].events.push(newEventData);
|
||||
}else{
|
||||
result[data.group].events = [newEventData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// convert obj into array
|
||||
result = Object.values(result);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
return {
|
||||
getGroupedShortcuts: getGroupedShortcuts
|
||||
};
|
||||
});
|
||||
@@ -85,6 +85,7 @@ define([
|
||||
};
|
||||
|
||||
settings.menuSelected.call(this, params);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -15,15 +15,15 @@ define([
|
||||
* Cached current "Magnetizer" object
|
||||
* @type {Magnetizer}
|
||||
*/
|
||||
var m8 = null;
|
||||
let m8 = null;
|
||||
|
||||
/**
|
||||
* init a jsPlumb (map) Element for "magnetised" function.
|
||||
* this is optional and prevents systems from being overlapped
|
||||
*/
|
||||
$.fn.initMagnetizer = function(){
|
||||
var mapContainer = this;
|
||||
var systems = mapContainer.getSystems();
|
||||
let mapContainer = this;
|
||||
let systems = mapContainer.getSystems();
|
||||
|
||||
/**
|
||||
* helper function
|
||||
@@ -32,10 +32,10 @@ define([
|
||||
* @returns {{left, top}}
|
||||
* @private
|
||||
*/
|
||||
var _offset = function(system) {
|
||||
let _offset = function(system) {
|
||||
|
||||
var _ = function(p) {
|
||||
var v = system.style[p];
|
||||
let _ = function(p) {
|
||||
let v = system.style[p];
|
||||
return parseInt(v.substring(0, v.length - 2));
|
||||
};
|
||||
|
||||
@@ -52,8 +52,8 @@ define([
|
||||
* @param o
|
||||
* @private
|
||||
*/
|
||||
var _setOffset = function(system, o) {
|
||||
var markAsUpdated = false;
|
||||
let _setOffset = function(system, o) {
|
||||
let markAsUpdated = false;
|
||||
|
||||
// new position must be within parent container
|
||||
// no negative offset!
|
||||
@@ -85,11 +85,11 @@ define([
|
||||
* @returns {boolean}
|
||||
* @private
|
||||
*/
|
||||
var _dragFilter = function(id) {
|
||||
let _dragFilter = function(id) {
|
||||
return !$('#' + id).is('.jsPlumb_dragged, .pf-system-locked');
|
||||
};
|
||||
|
||||
var gridConstrain = function(gridX, gridY) {
|
||||
let gridConstrain = function(gridX, gridY) {
|
||||
return function(id, current, delta) {
|
||||
if( mapContainer.hasClass(MapUtil.config.mapGridClass) ){
|
||||
// active grid
|
||||
@@ -126,7 +126,7 @@ define([
|
||||
};
|
||||
|
||||
$.fn.destroyMagnetizer = function(){
|
||||
var mapContainer = this;
|
||||
let mapContainer = this;
|
||||
|
||||
// remove cached "magnetizer" instance
|
||||
m8 = null;
|
||||
@@ -137,7 +137,7 @@ define([
|
||||
* @param map
|
||||
* @param e
|
||||
*/
|
||||
var executeAtEvent = function(map, e){
|
||||
let executeAtEvent = function(map, e){
|
||||
if(m8 !== null && e ){
|
||||
m8.executeAtEvent(e);
|
||||
map.repaintEverything();
|
||||
@@ -149,7 +149,7 @@ define([
|
||||
* needs "magnetization" to be active
|
||||
* @param map
|
||||
*/
|
||||
var executeAtCenter = function(map){
|
||||
let executeAtCenter = function(map){
|
||||
if(m8 !== null){
|
||||
m8.executeAtCenter();
|
||||
map.repaintEverything();
|
||||
@@ -161,10 +161,10 @@ define([
|
||||
* -> (e.g. new systems was added)
|
||||
* @param map
|
||||
*/
|
||||
var setElements = function(map){
|
||||
let setElements = function(map){
|
||||
if(m8 !== null){
|
||||
var mapContainer = $(map.getContainer());
|
||||
var systems = mapContainer.getSystems();
|
||||
let mapContainer = $(map.getContainer());
|
||||
let systems = mapContainer.getSystems();
|
||||
m8.setElements(systems);
|
||||
|
||||
// re-arrange systems
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,26 +7,37 @@ define([
|
||||
'app/init',
|
||||
'app/util'
|
||||
], function($, Init, Util) {
|
||||
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
logTimerCount: 3, // map log timer in seconds
|
||||
logTimerCount: 3, // map log timer in seconds
|
||||
|
||||
// map
|
||||
mapClass: 'pf-map', // class for all maps
|
||||
mapWrapperClass: 'pf-map-wrapper', // wrapper div (scrollable)
|
||||
mapClass: 'pf-map', // class for all maps
|
||||
mapWrapperClass: 'pf-map-wrapper', // wrapper div (scrollable)
|
||||
|
||||
// map overlay positions
|
||||
mapOverlayClass: 'pf-map-overlay', // class for all map overlays
|
||||
mapOverlayTimerClass: 'pf-map-overlay-timer', // class for map overlay timer e.g. map timer
|
||||
mapOverlayInfoClass: 'pf-map-overlay-info', // class for map overlay info e.g. map info
|
||||
|
||||
// connection overlays
|
||||
|
||||
// map overlays
|
||||
mapOverlayClass: 'pf-map-overlay', // class for all map overlays
|
||||
mapOverlayTimerClass: 'pf-map-overlay-timer', // class for map overlay timer e.g. map timer
|
||||
mapOverlayInfoClass: 'pf-map-overlay-info', // class for map overlay info e.g. map info
|
||||
|
||||
// system
|
||||
systemHeadClass: 'pf-system-head', // class for system head
|
||||
systemHeadClass: 'pf-system-head', // class for system head
|
||||
|
||||
// connection
|
||||
connectionOverlayEolId: 'overlayEol' // connection overlay ID (jsPlumb)
|
||||
// overlay IDs
|
||||
connectionOverlayId: 'pf-map-connection-overlay', // connection "normal size" ID (jsPlumb)
|
||||
connectionOverlayEolId: 'pf-map-connection-eol-overlay', // connection EOL overlay ID (jsPlumb)
|
||||
connectionOverlayArrowId: 'pf-map-connection-arrow-overlay', // connection Arrows overlay ID (jsPlumb)
|
||||
connectionOverlaySmallId: 'pf-map-connection-small-overlay', // connection "smaller" overlay ID (jsPlumb)
|
||||
|
||||
// overlay classes
|
||||
connectionOverlayClass: 'pf-map-connection-overlay', // class for "normal size" overlay
|
||||
connectionArrowOverlayClass: 'pf-map-connection-arrow-overlay', // class for "connection arrow" overlay
|
||||
connectionDiamondOverlayClass: 'pf-map-connection-diamond-overlay', // class for "connection diamond" overlay
|
||||
connectionOverlaySmallClass: 'pf-map-connection-small-overlay' // class for "smaller" overlays
|
||||
};
|
||||
|
||||
|
||||
@@ -35,10 +46,308 @@ define([
|
||||
* @param mapOverlay
|
||||
* @returns {JQuery}
|
||||
*/
|
||||
let getMapFromOverlay = function(mapOverlay){
|
||||
let getMapElementFromOverlay = (mapOverlay) => {
|
||||
return $(mapOverlay).parents('.' + config.mapWrapperClass).find('.' + config.mapClass);
|
||||
};
|
||||
|
||||
/**
|
||||
* get MapObject (jsPlumb) from mapElement
|
||||
* @param mapElement
|
||||
* @returns {*}
|
||||
*/
|
||||
let getMapObjectFromMapElement = (mapElement) => {
|
||||
let Map = require('app/map/map');
|
||||
return Map.getMapInstance( mapElement.data('id') );
|
||||
};
|
||||
|
||||
/**
|
||||
* get map object (jsPlumb) from iconElement
|
||||
* @param overlayIcon
|
||||
* @returns {*}
|
||||
*/
|
||||
let getMapObjectFromOverlayIcon = (overlayIcon) => {
|
||||
let mapElement = getMapElementFromOverlay(overlayIcon);
|
||||
|
||||
return getMapObjectFromMapElement( mapElement );
|
||||
};
|
||||
|
||||
/**
|
||||
* add overlays to connections (signature based data)
|
||||
* @param connections
|
||||
* @param connectionsData
|
||||
*/
|
||||
let addConnectionsOverlay = (connections, connectionsData) => {
|
||||
let SystemSignatures = require('app/ui/system_signature');
|
||||
|
||||
/**
|
||||
* add label to endpoint
|
||||
* @param endpoint
|
||||
* @param label
|
||||
*/
|
||||
let addEndpointOverlay = (endpoint, label) => {
|
||||
let newLabel = '';
|
||||
let colorClass = 'txt-color-grayLighter';
|
||||
|
||||
if(label.length > 0){
|
||||
newLabel = label;
|
||||
|
||||
// check if multiple labels found => conflict
|
||||
if( label.includes(', ') ){
|
||||
colorClass = 'txt-color-orangeLight';
|
||||
}else if( !label.includes('K162') ){
|
||||
colorClass = 'txt-color-yellow';
|
||||
}
|
||||
}else{
|
||||
// endpoint not connected with a signature
|
||||
newLabel = '<i class="fa fa-question-circle"></i>';
|
||||
colorClass = 'txt-color-red';
|
||||
}
|
||||
|
||||
endpoint.addOverlay([
|
||||
'Label',
|
||||
{
|
||||
label: '<span class="txt-color ' + colorClass + '">' + newLabel + '</span>',
|
||||
id: config.connectionOverlaySmallId,
|
||||
cssClass: config.connectionOverlaySmallClass,
|
||||
location: [ 0.5, 0.5 ]
|
||||
}
|
||||
]);
|
||||
|
||||
};
|
||||
|
||||
// loop through all map connections (get from DOM)
|
||||
for(let connection of connections) {
|
||||
let connectionId = connection.getParameter('connectionId');
|
||||
let sourceEndpoint = connection.endpoints[0];
|
||||
let targetEndpoint = connection.endpoints[1];
|
||||
let sourceSystem = $(sourceEndpoint.element);
|
||||
let targetSystem = $(targetEndpoint.element);
|
||||
let sourceId = sourceSystem.data('id');
|
||||
let targetId = targetSystem.data('id');
|
||||
|
||||
let signatureTypeNames = {
|
||||
sourceLabels: [],
|
||||
targetLabels: []
|
||||
};
|
||||
|
||||
// ... find matching connectionData (from Ajax)
|
||||
for(let connectionData of connectionsData){
|
||||
if(
|
||||
connectionData.id === connectionId &&
|
||||
connectionData.signatures // signature data is required...
|
||||
){
|
||||
|
||||
// ... collect overlay/label data from signatures
|
||||
for(let signatureData of connectionData.signatures){
|
||||
// ... typeId is required to get a valid name
|
||||
if(signatureData.typeId > 0){
|
||||
|
||||
// whether "source" or "target" system is relevant for current connection and current signature...
|
||||
let tmpSystem = null;
|
||||
let tmpSystemType = null;
|
||||
|
||||
if(signatureData.system.id === sourceId){
|
||||
// relates to "source" endpoint
|
||||
tmpSystemType = 'sourceLabels';
|
||||
tmpSystem = sourceSystem;
|
||||
}else if(signatureData.system.id === targetId){
|
||||
// relates to "target" endpoint
|
||||
tmpSystemType = 'targetLabels';
|
||||
tmpSystem = targetSystem;
|
||||
}
|
||||
|
||||
// ... get endpoint label for source || target system
|
||||
if(tmpSystem && tmpSystem){
|
||||
// ... get all available signature type (wormholes) names
|
||||
let availableSigTypeNames = SystemSignatures.getAllSignatureNamesBySystem(tmpSystem, 5);
|
||||
let flattenSigTypeNames = Util.flattenXEditableSelectArray(availableSigTypeNames);
|
||||
|
||||
if( flattenSigTypeNames.hasOwnProperty(signatureData.typeId) ){
|
||||
let label = flattenSigTypeNames[signatureData.typeId];
|
||||
// shorten label, just take the in game name
|
||||
label = label.substr(0, label.indexOf(' '));
|
||||
signatureTypeNames[tmpSystemType].push(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ... connection matched -> continue with next one
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let sourceLabel = signatureTypeNames.sourceLabels.join(', ');
|
||||
let targetLabel = signatureTypeNames.targetLabels.join(', ');
|
||||
|
||||
// add endpoint overlays ------------------------------------------------------
|
||||
addEndpointOverlay(sourceEndpoint, sourceLabel);
|
||||
addEndpointOverlay(targetEndpoint, targetLabel);
|
||||
|
||||
// add arrow (connection) overlay that points from "XXX" => "K162" ------------
|
||||
let overlayType = 'Diamond'; // not specified
|
||||
let arrowDirection = 1;
|
||||
|
||||
if(
|
||||
(sourceLabel.includes('K162') && targetLabel.includes('K162')) ||
|
||||
(sourceLabel.length === 0 && targetLabel.length === 0) ||
|
||||
(
|
||||
sourceLabel.length > 0 && targetLabel.length > 0 &&
|
||||
!sourceLabel.includes('K162') && !targetLabel.includes('K162')
|
||||
)
|
||||
){
|
||||
// unknown direction
|
||||
overlayType = 'Diamond'; // not specified
|
||||
arrowDirection = 1;
|
||||
}else if(
|
||||
(sourceLabel.includes('K162')) ||
|
||||
(sourceLabel.length === 0 && !targetLabel.includes('K162'))
|
||||
){
|
||||
// convert default arrow direction
|
||||
overlayType = 'Arrow';
|
||||
arrowDirection = -1;
|
||||
}else{
|
||||
// default arrow direction is fine
|
||||
overlayType = 'Arrow';
|
||||
arrowDirection = 1;
|
||||
}
|
||||
|
||||
connection.addOverlay([
|
||||
overlayType,
|
||||
{
|
||||
width: 12,
|
||||
length: 15,
|
||||
location: 0.5,
|
||||
foldback: 0.85,
|
||||
direction: arrowDirection,
|
||||
id: config.connectionOverlayArrowId,
|
||||
cssClass: (overlayType === 'Arrow') ? config.connectionArrowOverlayClass : config.connectionDiamondOverlayClass
|
||||
}
|
||||
]);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* remove overviews from a Tooltip
|
||||
* @param endpoint
|
||||
* @param i
|
||||
*/
|
||||
let removeEndpointOverlay = (endpoint, i) => {
|
||||
endpoint.removeOverlays(config.connectionOverlaySmallId);
|
||||
};
|
||||
|
||||
/**
|
||||
* format json object with "time parts" into string
|
||||
* @param parts
|
||||
* @returns {string}
|
||||
*/
|
||||
let formatTimeParts = (parts) => {
|
||||
let label = '';
|
||||
if(parts.days){
|
||||
label += parts.days + 'd ';
|
||||
}
|
||||
label += ('00' + parts.hours).slice(-2);
|
||||
label += ':' + ('00' + parts.min).slice(-2);
|
||||
return label;
|
||||
};
|
||||
|
||||
/**
|
||||
* hide default icon and replace it with "loading" icon
|
||||
* @param iconElement
|
||||
*/
|
||||
let showLoading = (iconElement) => {
|
||||
iconElement = $(iconElement);
|
||||
let dataName = 'default-icon';
|
||||
let defaultIconClass = iconElement.data(dataName);
|
||||
|
||||
// get default icon class
|
||||
if( !defaultIconClass ){
|
||||
// index 0 == 'fa-fw', index 1 == IconName
|
||||
defaultIconClass = $(iconElement).attr('class').match(/\bfa-\S*/g)[1];
|
||||
iconElement.data(dataName, defaultIconClass);
|
||||
}
|
||||
|
||||
iconElement.toggleClass( defaultIconClass + ' fa-refresh fa-spin' );
|
||||
};
|
||||
|
||||
/**
|
||||
* hide "loading" icon and replace with default icon
|
||||
* @param iconElement
|
||||
*/
|
||||
let hideLoading = (iconElement) => {
|
||||
iconElement = $(iconElement);
|
||||
let dataName = 'default-icon';
|
||||
let defaultIconClass = iconElement.data(dataName);
|
||||
|
||||
iconElement.toggleClass( defaultIconClass + ' fa-refresh fa-spin' );
|
||||
};
|
||||
|
||||
/**
|
||||
* git signature data that is linked to a connection for a mapId
|
||||
* @param mapElement
|
||||
* @param connections
|
||||
* @param callback
|
||||
*/
|
||||
let getConnectionSignatureData = (mapElement, connections, callback) => {
|
||||
let mapOverlay = $(mapElement).getMapOverlay('info');
|
||||
let overlayConnectionIcon = mapOverlay.find('.pf-map-overlay-endpoint');
|
||||
|
||||
showLoading(overlayConnectionIcon);
|
||||
|
||||
let requestData = {
|
||||
mapId: mapElement.data('id')
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Init.path.getMapConnectionData,
|
||||
data: requestData,
|
||||
dataType: 'json',
|
||||
context: {
|
||||
mapElement: mapElement,
|
||||
connections: connections,
|
||||
overlayConnectionIcon: overlayConnectionIcon
|
||||
}
|
||||
}).done(function(connectionsData){
|
||||
// hide all connection before add them (refresh)
|
||||
this.mapElement.hideEndpointOverlays();
|
||||
// ... add overlays
|
||||
callback(this.connections, connectionsData);
|
||||
}).always(function() {
|
||||
hideLoading(this.overlayConnectionIcon);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* showEndpointOverlays
|
||||
* -> used by "refresh" overlays (hover) AND/OR initial menu trigger
|
||||
*/
|
||||
$.fn.showEndpointOverlays = function(){
|
||||
let mapElement = $(this);
|
||||
let map = getMapObjectFromMapElement(mapElement);
|
||||
let MapUtil = require('app/map/util');
|
||||
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh');
|
||||
|
||||
// get connection signature information ---------------------------------------
|
||||
getConnectionSignatureData(mapElement, connections, addConnectionsOverlay);
|
||||
};
|
||||
|
||||
/**
|
||||
* hideEndpointOverlays
|
||||
* -> see showEndpointOverlays()
|
||||
*/
|
||||
$.fn.hideEndpointOverlays = function(){
|
||||
let map = getMapObjectFromMapElement($(this));
|
||||
let MapUtil = require('app/map/util');
|
||||
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh');
|
||||
|
||||
for (let connection of connections){
|
||||
connection.removeOverlays(config.connectionOverlayArrowId);
|
||||
connection.endpoints.forEach(removeEndpointOverlay);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Overlay options (all available map options shown in overlay)
|
||||
* "active": (active || hover) indicated whether an icon/option
|
||||
@@ -72,7 +381,7 @@ define([
|
||||
iconClass: ['fa', 'fa-fw', 'fa-tags'],
|
||||
hoverIntent: {
|
||||
over: function(e){
|
||||
let mapElement = getMapFromOverlay(this);
|
||||
let mapElement = getMapElementFromOverlay(this);
|
||||
mapElement.find('.' + config.systemHeadClass).each(function(){
|
||||
let system = $(this);
|
||||
// init tooltip if not already exists
|
||||
@@ -90,22 +399,87 @@ define([
|
||||
});
|
||||
},
|
||||
out: function(e){
|
||||
let mapElement = getMapFromOverlay(this);
|
||||
let mapElement = getMapElementFromOverlay(this);
|
||||
mapElement.find('.' + config.systemHeadClass).tooltip('hide');
|
||||
}
|
||||
}
|
||||
},
|
||||
systemConnectionTimer: {
|
||||
title: 'show EOL timer',
|
||||
mapEndpoint: {
|
||||
title: 'refresh signature overlays',
|
||||
trigger: 'refresh',
|
||||
class: 'pf-map-overlay-endpoint',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-link'],
|
||||
hoverIntent: {
|
||||
over: function(e){
|
||||
let mapElement = getMapElementFromOverlay(this);
|
||||
mapElement.showEndpointOverlays();
|
||||
},
|
||||
out: function(e){
|
||||
// just "refresh" on hover
|
||||
}
|
||||
}
|
||||
},
|
||||
connection: {
|
||||
title: 'WH data',
|
||||
trigger: 'hover',
|
||||
class: 'pf-map-overlay-connection-timer',
|
||||
class: 'pf-map-overlay-connection',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-fighter-jet'],
|
||||
hoverIntent: {
|
||||
over: function(e){
|
||||
let map = getMapObjectFromOverlayIcon(this);
|
||||
let MapUtil = require('app/map/util');
|
||||
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh');
|
||||
let serverDate = Util.getServerTime();
|
||||
|
||||
// show connection overlays ---------------------------------------------------
|
||||
for (let connection of connections) {
|
||||
let createdTimestamp = connection.getParameter('created');
|
||||
let updatedTimestamp = connection.getParameter('updated');
|
||||
|
||||
let createdDate = Util.convertTimestampToServerTime(createdTimestamp);
|
||||
let updatedDate = Util.convertTimestampToServerTime(updatedTimestamp);
|
||||
|
||||
let createdDiff = Util.getTimeDiffParts(createdDate, serverDate);
|
||||
let updatedDiff = Util.getTimeDiffParts(updatedDate, serverDate);
|
||||
|
||||
// format overlay label
|
||||
let labels = [
|
||||
'<i class="fa fa-fw fa-plus-square"></i> ' + formatTimeParts(createdDiff),
|
||||
'<i class="fa fa-fw fa-pencil-square"></i> ' + formatTimeParts(updatedDiff)
|
||||
];
|
||||
|
||||
// add label overlay ------------------------------------------------------
|
||||
connection.addOverlay([
|
||||
'Label',
|
||||
{
|
||||
label: labels.join('<br>'),
|
||||
id: config.connectionOverlayId,
|
||||
cssClass: config.connectionOverlaySmallClass,
|
||||
location: 0.35
|
||||
}
|
||||
]);
|
||||
}
|
||||
},
|
||||
out: function(e){
|
||||
let map = getMapObjectFromOverlayIcon(this);
|
||||
let MapUtil = require('app/map/util');
|
||||
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh');
|
||||
|
||||
for (let connection of connections){
|
||||
connection.removeOverlays(config.connectionOverlayId);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
connectionEol: {
|
||||
title: 'EOL timer',
|
||||
trigger: 'hover',
|
||||
class: 'pf-map-overlay-connection-eol',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-clock-o'],
|
||||
hoverIntent: {
|
||||
over: function(e){
|
||||
let mapElement = getMapFromOverlay(this);
|
||||
let map = getMapObjectFromOverlayIcon(this);
|
||||
let MapUtil = require('app/map/util');
|
||||
let Map = require('app/map/map');
|
||||
let map = Map.getMapInstance( mapElement.data('id') );
|
||||
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh', ['wh_eol']);
|
||||
let serverDate = Util.getServerTime();
|
||||
|
||||
@@ -114,30 +488,20 @@ define([
|
||||
let eolDate = Util.convertTimestampToServerTime(eolTimestamp);
|
||||
let diff = Util.getTimeDiffParts(eolDate, serverDate);
|
||||
|
||||
// format overlay label
|
||||
let label = '';
|
||||
if(diff.days){
|
||||
label += diff.days + 'd ';
|
||||
}
|
||||
label += ('00' + diff.hours).slice(-2);
|
||||
label += ':' + ('00' + diff.min).slice(-2);
|
||||
|
||||
connection.addOverlay([
|
||||
'Label',
|
||||
{
|
||||
label: '<i class="fa fa-fw fa-clock-o"></i> ' + label,
|
||||
label: '<i class="fa fa-fw fa-clock-o"></i> ' + formatTimeParts(diff),
|
||||
id: config.connectionOverlayEolId,
|
||||
cssClass: ['pf-map-connection-overlay', 'eol'].join(' '),
|
||||
cssClass: [config.connectionOverlayClass, 'eol'].join(' '),
|
||||
location: 0.25
|
||||
}
|
||||
]);
|
||||
}
|
||||
},
|
||||
out: function(e){
|
||||
let mapElement = getMapFromOverlay(this);
|
||||
let map = getMapObjectFromOverlayIcon(this);
|
||||
let MapUtil = require('app/map/util');
|
||||
let Map = require('app/map/map');
|
||||
let map = Map.getMapInstance( mapElement.data('id') );
|
||||
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh', ['wh_eol']);
|
||||
|
||||
for (let connection of connections) {
|
||||
@@ -209,14 +573,15 @@ define([
|
||||
};
|
||||
|
||||
/**
|
||||
* get the map counter chart by an overlay
|
||||
* @returns {*}
|
||||
* get the map counter chart from overlay
|
||||
* @returns {JQuery|*|T|{}|jQuery}
|
||||
*/
|
||||
$.fn.getMapCounter = function(){
|
||||
return $(this).find('.' + Init.classes.pieChart.pieChartMapCounterClass);
|
||||
};
|
||||
|
||||
let mapOverlayTimer = $(this);
|
||||
|
||||
return mapOverlayTimer.find('.' + Init.classes.pieChart.pieChartMapCounterClass);
|
||||
$.fn.getMapOverlayInterval = function(){
|
||||
return $(this).getMapOverlay('timer').getMapCounter().data('interval');
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -261,6 +626,7 @@ define([
|
||||
duration: Init.animationSpeed.mapOverlay,
|
||||
complete: function(){
|
||||
counterChart.data('interval', false);
|
||||
getMapElementFromOverlay(mapOverlayTimer).trigger('pf:unlocked');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -313,7 +679,10 @@ define([
|
||||
showOverlay = true;
|
||||
|
||||
// check "trigger" and mark as "active"
|
||||
if(options[option].trigger === 'active'){
|
||||
if(
|
||||
options[option].trigger === 'active' ||
|
||||
options[option].trigger === 'refresh'
|
||||
){
|
||||
iconElement.addClass('active');
|
||||
}
|
||||
|
||||
@@ -324,7 +693,7 @@ define([
|
||||
iconElement.velocity({
|
||||
opacity: [0.8, 0],
|
||||
scale: [1, 0],
|
||||
width: ['26px', 0],
|
||||
width: ['30px', 0],
|
||||
marginLeft: ['3px', 0]
|
||||
},{
|
||||
duration: 240,
|
||||
@@ -374,7 +743,7 @@ define([
|
||||
});
|
||||
parentElement.append(mapOverlayTimer);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------
|
||||
// add map overlay info. after scrollbar is initialized
|
||||
let mapOverlayInfo = $('<div>', {
|
||||
class: [config.mapOverlayClass, config.mapOverlayInfoClass].join(' ')
|
||||
@@ -392,7 +761,10 @@ define([
|
||||
});
|
||||
|
||||
// add "hover" action for some icons
|
||||
if(options[prop].trigger === 'hover'){
|
||||
if(
|
||||
options[prop].trigger === 'hover' ||
|
||||
options[prop].trigger === 'refresh'
|
||||
){
|
||||
icon.hoverIntent(options[prop].hoverIntent);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ define([
|
||||
$.fn.initCustomScrollbar = function(config){
|
||||
|
||||
// default config -------------------------------------------------------------------------
|
||||
var defaultConfig = {
|
||||
let defaultConfig = {
|
||||
axis: 'x',
|
||||
theme: 'light-thick',
|
||||
scrollInertia: 300,
|
||||
@@ -52,7 +52,7 @@ define([
|
||||
config = $.extend(true, {}, defaultConfig, config);
|
||||
|
||||
return this.each(function(){
|
||||
var scrollableElement = $(this);
|
||||
let scrollableElement = $(this);
|
||||
|
||||
// prevent multiple initialization
|
||||
scrollableElement.mCustomScrollbar('destroy');
|
||||
|
||||
@@ -13,6 +13,11 @@ define([
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
newSystemOffset: {
|
||||
x: 130,
|
||||
y: 0
|
||||
},
|
||||
|
||||
systemActiveClass: 'pf-system-active' // class for an active system in a map
|
||||
};
|
||||
|
||||
@@ -193,8 +198,32 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* calculate the x/y coordinates for a new system - relativ to a source system
|
||||
* @param sourceSystem
|
||||
* @returns {{x: *, y: *}}
|
||||
*/
|
||||
let calculateNewSystemPosition = function(sourceSystem){
|
||||
|
||||
// related system is available
|
||||
let currentX = sourceSystem.css('left');
|
||||
let currentY = sourceSystem.css('top');
|
||||
|
||||
// remove "px"
|
||||
currentX = parseInt( currentX.substring(0, currentX.length - 2) );
|
||||
currentY = parseInt( currentY.substring(0, currentY.length - 2) );
|
||||
|
||||
let newPosition = {
|
||||
x: currentX + config.newSystemOffset.x,
|
||||
y: currentY + config.newSystemOffset.y
|
||||
};
|
||||
|
||||
return newPosition;
|
||||
};
|
||||
|
||||
return {
|
||||
deleteSystems: deleteSystems,
|
||||
removeSystems: removeSystems
|
||||
removeSystems: removeSystems,
|
||||
calculateNewSystemPosition: calculateNewSystemPosition
|
||||
};
|
||||
});
|
||||
@@ -5,8 +5,9 @@
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util'
|
||||
], function($, Init, Util) {
|
||||
'app/util',
|
||||
'bootbox'
|
||||
], function($, Init, Util, bootbox) {
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
@@ -17,8 +18,12 @@ define([
|
||||
mapLocalStoragePrefix: 'map_', // prefix for map data local storage key
|
||||
mapTabContentClass: 'pf-map-tab-content', // Tab-Content element (parent element)
|
||||
|
||||
mapClass: 'pf-map', // class for all maps
|
||||
mapGridClass: 'pf-grid-small', // class for map grid snapping
|
||||
|
||||
systemIdPrefix: 'pf-system-', // id prefix for a system
|
||||
systemClass: 'pf-system', // class for all systems
|
||||
mapGridClass: 'pf-grid-small' // class for map grid snapping
|
||||
systemSelectedClass: 'pf-system-selected' // class for selected systems in a map
|
||||
};
|
||||
|
||||
// map menu options
|
||||
@@ -26,13 +31,19 @@ define([
|
||||
mapMagnetizer: {
|
||||
buttonId: Util.config.menuButtonMagnetizerId,
|
||||
description: 'Magnetizer',
|
||||
onEnable: 'initMagnetizer', // jQuery extension function
|
||||
onDisable: 'destroyMagnetizer' // jQuery extension function
|
||||
onEnable: 'initMagnetizer', // jQuery extension function
|
||||
onDisable: 'destroyMagnetizer' // jQuery extension function
|
||||
},
|
||||
mapSnapToGrid : {
|
||||
buttonId: Util.config.menuButtonGridId,
|
||||
description: 'Grid snapping',
|
||||
class: 'mapGridClass'
|
||||
},
|
||||
mapEndpoint : {
|
||||
buttonId: Util.config.menuButtonEndpointId,
|
||||
description: 'Endpoint overlay',
|
||||
onEnable: 'showEndpointOverlays', // jQuery extension function
|
||||
onDisable: 'hideEndpointOverlays' // jQuery extension function
|
||||
}
|
||||
};
|
||||
|
||||
@@ -191,6 +202,14 @@ define([
|
||||
return this.find('.' + config.systemClass);
|
||||
};
|
||||
|
||||
/**
|
||||
* get all selected (NOT active) systems in a map
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.getSelectedSystems = function(){
|
||||
let mapElement = $(this);
|
||||
return mapElement.find('.' + config.systemSelectedClass);
|
||||
};
|
||||
|
||||
/**
|
||||
* search connections by systems
|
||||
@@ -200,7 +219,7 @@ define([
|
||||
*/
|
||||
let searchConnectionsBySystems = function(map, systems){
|
||||
let connections = [];
|
||||
let withBackConnection = false;
|
||||
let withBackConnection = true;
|
||||
|
||||
$.each(systems, function(i, system){
|
||||
// get connections where system is source
|
||||
@@ -571,6 +590,48 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* set map "shortcut" events
|
||||
*/
|
||||
$.fn.setMapShortcuts = function(){
|
||||
return this.each((i, mapWrapper) => {
|
||||
mapWrapper = $(mapWrapper);
|
||||
let mapElement = mapWrapper.findMapElement();
|
||||
|
||||
// dynamic require Map module -> otherwise there is a require(), loop
|
||||
let Map = require('app/map/map');
|
||||
let map = Map.getMapInstance( mapElement.data('id'));
|
||||
|
||||
mapWrapper.watchKey('mapSystemAdd', (mapWrapper) => {
|
||||
Map.showNewSystemDialog(map, {position: {x: 0, y: 0}});
|
||||
},{focus: true});
|
||||
|
||||
mapWrapper.watchKey('mapSystemsSelect', (mapWrapper) => {
|
||||
mapElement.selectAllSystems();
|
||||
},{focus: true});
|
||||
|
||||
mapWrapper.watchKey('mapSystemsDelete', (mapWrapper) => {
|
||||
let selectedSystems = mapElement.getSelectedSystems();
|
||||
$.fn.showDeleteSystemDialog(map, selectedSystems);
|
||||
},{focus: true});
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.findMapElement = function(){
|
||||
return $(this).find('.' + config.mapClass);
|
||||
};
|
||||
|
||||
/**
|
||||
* get systemId string (selector
|
||||
* @param mapId
|
||||
* @param systemId
|
||||
* @returns {string}
|
||||
*/
|
||||
let getSystemId = (mapId, systemId) => {
|
||||
return config.systemIdPrefix + mapId + '-' + systemId;
|
||||
};
|
||||
|
||||
return {
|
||||
config: config,
|
||||
mapOptions: mapOptions,
|
||||
@@ -593,6 +654,7 @@ define([
|
||||
storeDefaultMapId: storeDefaultMapId,
|
||||
getLocaleData: getLocaleData,
|
||||
storeLocalData: storeLocalData,
|
||||
deleteLocalData: deleteLocalData
|
||||
deleteLocalData: deleteLocalData,
|
||||
getSystemId: getSystemId
|
||||
};
|
||||
});
|
||||
@@ -10,6 +10,7 @@ define([
|
||||
'app/logging',
|
||||
'app/page',
|
||||
'app/map/worker',
|
||||
'app/key',
|
||||
'app/ui/form_element',
|
||||
'app/module_map'
|
||||
], ($, Init, Util, Render, Logging, Page, MapWorker) => {
|
||||
@@ -30,7 +31,7 @@ define([
|
||||
|
||||
// load page
|
||||
// load info (maintenance) info panel (if scheduled)
|
||||
$('body').loadPageStructure();
|
||||
$('body').loadPageStructure().setGlobalShortcuts();
|
||||
|
||||
// show app information in browser console
|
||||
Util.showVersionInfo();
|
||||
|
||||
@@ -56,16 +56,14 @@ define([
|
||||
};
|
||||
|
||||
/**
|
||||
* get the current active map for
|
||||
* @returns {*}
|
||||
* get the current active mapElement
|
||||
* @returns {JQuery|*|T|{}|jQuery}
|
||||
*/
|
||||
$.fn.getActiveMap = function(){
|
||||
let map = $(this).find('.active.' + config.mapTabContentClass + ' .' + config.mapClass);
|
||||
|
||||
if(map.length === 0){
|
||||
if(!map.length){
|
||||
map = false;
|
||||
}
|
||||
|
||||
return map;
|
||||
};
|
||||
|
||||
@@ -563,7 +561,7 @@ define([
|
||||
activeMapIds.push(mapId);
|
||||
|
||||
// check for map data change and update tab
|
||||
if(tabMapData.config.updated !== tabElement.data('updated')){
|
||||
if(tabMapData.config.updated > tabElement.data('updated')){
|
||||
tabElement.updateTabData(tabMapData.config);
|
||||
}
|
||||
}else{
|
||||
@@ -631,7 +629,6 @@ define([
|
||||
|
||||
// add new tab for each map
|
||||
for(let j = 0; j < tempMapData.length; j++){
|
||||
|
||||
let data = tempMapData[j];
|
||||
tabMapElement.addTab(data.config);
|
||||
}
|
||||
|
||||
243
js/app/page.js
243
js/app/page.js
@@ -16,6 +16,7 @@ define([
|
||||
'dialog/map_info',
|
||||
'dialog/account_settings',
|
||||
'dialog/manual',
|
||||
'dialog/shortcuts',
|
||||
'dialog/map_settings',
|
||||
'dialog/system_effects',
|
||||
'dialog/jump_info',
|
||||
@@ -62,7 +63,10 @@ define([
|
||||
menuHeadMenuLogoClass: 'pf-head-menu-logo', // class for main menu logo
|
||||
|
||||
// helper element
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper'
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper',
|
||||
|
||||
// system signature module
|
||||
systemSigModuleClass: 'pf-sig-table-module', // module wrapper (signatures)
|
||||
};
|
||||
|
||||
let programStatusCounter = 0; // current count down in s until next status change is possible
|
||||
@@ -74,49 +78,84 @@ define([
|
||||
* @returns {*|jQuery|HTMLElement}
|
||||
*/
|
||||
$.fn.loadPageStructure = function(){
|
||||
let body = $(this);
|
||||
return this.each((i, body) => {
|
||||
body = $(body);
|
||||
|
||||
// menu left
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
class: [config.pageSlidebarClass, config.pageSlidebarLeftClass, 'sb-style-push', 'sb-width-custom'].join(' ')
|
||||
}).attr('data-sb-width', config.pageSlideLeftWidth)
|
||||
);
|
||||
// menu left
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
class: [config.pageSlidebarClass, config.pageSlidebarLeftClass, 'sb-style-push', 'sb-width-custom'].join(' ')
|
||||
}).attr('data-sb-width', config.pageSlideLeftWidth)
|
||||
);
|
||||
|
||||
// menu right
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
class: [config.pageSlidebarClass, config.pageSlidebarRightClass, 'sb-style-push', 'sb-width-custom'].join(' ')
|
||||
}).attr('data-sb-width', config.pageSlideRightWidth)
|
||||
);
|
||||
// menu right
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
class: [config.pageSlidebarClass, config.pageSlidebarRightClass, 'sb-style-push', 'sb-width-custom'].join(' ')
|
||||
}).attr('data-sb-width', config.pageSlideRightWidth)
|
||||
);
|
||||
|
||||
// main page
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
id: config.pageId,
|
||||
class: config.pageClass
|
||||
}).append(
|
||||
// main page
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
id: config.pageId,
|
||||
class: config.pageClass
|
||||
}).append(
|
||||
Util.getMapModule()
|
||||
).append(
|
||||
$('<div>', {
|
||||
id: config.dynamicElementWrapperId
|
||||
})
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
// load header / footer
|
||||
$('.' + config.pageClass).loadHeader().loadFooter();
|
||||
// load header / footer
|
||||
$('.' + config.pageClass).loadHeader().loadFooter();
|
||||
|
||||
// load left menu
|
||||
$('.' + config.pageSlidebarLeftClass).loadLeftMenu();
|
||||
// load left menu
|
||||
$('.' + config.pageSlidebarLeftClass).loadLeftMenu();
|
||||
|
||||
// load right menu
|
||||
$('.' + config.pageSlidebarRightClass).loadRightMenu();
|
||||
// load right menu
|
||||
$('.' + config.pageSlidebarRightClass).loadRightMenu();
|
||||
|
||||
// set document observer for global events
|
||||
setDocumentObserver();
|
||||
// set document observer for global events
|
||||
setDocumentObserver();
|
||||
});
|
||||
};
|
||||
|
||||
return body;
|
||||
/**
|
||||
* set global shortcuts to <body> element
|
||||
*/
|
||||
$.fn.setGlobalShortcuts = function(){
|
||||
return this.each((i, body) => {
|
||||
body = $(body);
|
||||
|
||||
body.watchKey('tabReload', (body) => {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
body.watchKey('signaturePaste', (e) => {
|
||||
let moduleElement = $('.' + config.systemSigModuleClass);
|
||||
|
||||
// check if there is a signature module active (system clicked)
|
||||
if(moduleElement.length){
|
||||
e = e.originalEvent;
|
||||
let targetElement = $(e.target);
|
||||
|
||||
// do not read clipboard if pasting into form elements
|
||||
if(
|
||||
targetElement.prop('tagName').toLowerCase() !== 'input' &&
|
||||
targetElement.prop('tagName').toLowerCase() !== 'textarea' || (
|
||||
targetElement.is('input[type="search"]') // Datatables "search" field bubbles `paste.DT` event :(
|
||||
)
|
||||
){
|
||||
let clipboard = (e.originalEvent || e).clipboardData.getData('text/plain');
|
||||
moduleElement.trigger('pf:updateSystemSignatureModuleByClipboard', [clipboard]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -148,10 +187,10 @@ define([
|
||||
class: 'list-group-item',
|
||||
href: '/'
|
||||
}).html(' Home').prepend(
|
||||
$('<i>',{
|
||||
class: 'fa fa-home fa-fw'
|
||||
})
|
||||
)
|
||||
$('<i>',{
|
||||
class: 'fa fa-home fa-fw'
|
||||
})
|
||||
)
|
||||
).append(
|
||||
getMenuHeadline('Information')
|
||||
).append(
|
||||
@@ -162,11 +201,6 @@ define([
|
||||
$('<i>',{
|
||||
class: 'fa fa-line-chart fa-fw'
|
||||
})
|
||||
).append(
|
||||
$('<span>',{
|
||||
class: 'badge bg-color bg-color-gray txt-color txt-color-warning',
|
||||
text: 'beta'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('ShowStatsDialog');
|
||||
})
|
||||
@@ -175,23 +209,23 @@ define([
|
||||
class: 'list-group-item list-group-item-info',
|
||||
href: '#'
|
||||
}).html(' Effect info').prepend(
|
||||
$('<i>',{
|
||||
class: 'fa fa-crosshairs fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('ShowSystemEffectInfo');
|
||||
$('<i>',{
|
||||
class: 'fa fa-crosshairs fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('ShowSystemEffectInfo');
|
||||
})
|
||||
).append(
|
||||
$('<a>', {
|
||||
class: 'list-group-item list-group-item-info',
|
||||
href: '#'
|
||||
}).html(' Jump info').prepend(
|
||||
$('<i>',{
|
||||
class: 'fa fa-space-shuttle fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('ShowJumpInfo');
|
||||
$('<i>',{
|
||||
class: 'fa fa-space-shuttle fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('ShowJumpInfo');
|
||||
})
|
||||
).append(
|
||||
getMenuHeadline('Settings')
|
||||
).append(
|
||||
@@ -211,32 +245,32 @@ define([
|
||||
id: Util.config.menuButtonFullScreenId,
|
||||
href: '#'
|
||||
}).html(' Full screen').prepend(
|
||||
$('<i>',{
|
||||
class: 'glyphicon glyphicon-fullscreen',
|
||||
css: {width: '1.23em'}
|
||||
})
|
||||
).on('click', function(){
|
||||
let fullScreenElement = $('body');
|
||||
requirejs(['jquery', 'fullScreen'], function($) {
|
||||
|
||||
if($.fullscreen.isFullScreen()){
|
||||
$.fullscreen.exit();
|
||||
}else{
|
||||
fullScreenElement.fullscreen({overflow: 'scroll', toggleClass: config.fullScreenClass});
|
||||
}
|
||||
});
|
||||
$('<i>',{
|
||||
class: 'glyphicon glyphicon-fullscreen',
|
||||
css: {width: '1.23em'}
|
||||
})
|
||||
).on('click', function(){
|
||||
let fullScreenElement = $('body');
|
||||
requirejs(['jquery', 'fullScreen'], function($) {
|
||||
|
||||
if($.fullscreen.isFullScreen()){
|
||||
$.fullscreen.exit();
|
||||
}else{
|
||||
fullScreenElement.fullscreen({overflow: 'scroll', toggleClass: config.fullScreenClass});
|
||||
}
|
||||
});
|
||||
})
|
||||
).append(
|
||||
$('<a>', {
|
||||
class: 'list-group-item',
|
||||
href: '#'
|
||||
}).html(' Notification test').prepend(
|
||||
$('<i>',{
|
||||
class: 'fa fa-volume-up fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('NotificationTest');
|
||||
$('<i>',{
|
||||
class: 'fa fa-volume-up fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('NotificationTest');
|
||||
})
|
||||
).append(
|
||||
getMenuHeadline('Danger zone')
|
||||
).append(
|
||||
@@ -248,19 +282,19 @@ define([
|
||||
class: 'fa fa-user-times fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('DeleteAccount');
|
||||
})
|
||||
$(document).triggerMenuEvent('DeleteAccount');
|
||||
})
|
||||
).append(
|
||||
$('<a>', {
|
||||
class: 'list-group-item list-group-item-warning',
|
||||
href: '#'
|
||||
}).html(' Logout').prepend(
|
||||
$('<i>',{
|
||||
class: 'fa fa-sign-in fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('Logout', {clearCookies: 1});
|
||||
$('<i>',{
|
||||
class: 'fa fa-sign-in fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('Logout', {clearCookies: 1});
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
@@ -332,6 +366,21 @@ define([
|
||||
toggle: true
|
||||
});
|
||||
})
|
||||
).append(
|
||||
$('<a>', {
|
||||
class: 'list-group-item',
|
||||
id: Util.config.menuButtonEndpointId,
|
||||
href: '#'
|
||||
}).html(' Signatures').prepend(
|
||||
$('<i>',{
|
||||
class: 'fa fa-link fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
Util.getMapModule().getActiveMap().triggerMenuEvent('MapOption', {
|
||||
option: 'mapEndpoint',
|
||||
toggle: true
|
||||
});
|
||||
})
|
||||
).append(
|
||||
getMenuHeadline('Help')
|
||||
).append(
|
||||
@@ -343,8 +392,24 @@ define([
|
||||
class: 'fa fa-book fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('Manual');
|
||||
$(document).triggerMenuEvent('Manual');
|
||||
})
|
||||
).append(
|
||||
$('<a>', {
|
||||
class: 'list-group-item list-group-item-info',
|
||||
href: '#'
|
||||
}).html(' Shortcuts').prepend(
|
||||
$('<i>',{
|
||||
class: 'fa fa-keyboard-o fa-fw'
|
||||
})
|
||||
).append(
|
||||
$('<span>',{
|
||||
class: 'badge bg-color bg-color-gray txt-color txt-color-warning',
|
||||
text: 'beta'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('Shortcuts');
|
||||
})
|
||||
).append(
|
||||
$('<a>', {
|
||||
class: 'list-group-item list-group-item-info',
|
||||
@@ -367,8 +432,8 @@ define([
|
||||
class: 'fa fa-trash fa-fw'
|
||||
})
|
||||
).on('click', function(){
|
||||
$(document).triggerMenuEvent('DeleteMap');
|
||||
})
|
||||
$(document).triggerMenuEvent('DeleteMap');
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
||||
@@ -576,6 +641,18 @@ define([
|
||||
return false;
|
||||
});
|
||||
|
||||
$(document).on('pf:menuShowTaskManager', function(e, data){
|
||||
// show log dialog
|
||||
Logging.showDialog();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(document).on('pf:menuShortcuts', function(e, data){
|
||||
// show shortcuts dialog
|
||||
$.fn.showShortcutsDialog();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(document).on('pf:menuShowSettingsDialog', function(e){
|
||||
// show character select dialog
|
||||
$.fn.showSettingsDialog();
|
||||
@@ -616,12 +693,6 @@ define([
|
||||
return false;
|
||||
});
|
||||
|
||||
$(document).on('pf:menuShowTaskManager', function(e, data){
|
||||
// show log dialog
|
||||
Logging.showDialog();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(document).on('pf:menuLogout', function(e, data){
|
||||
|
||||
let clearCookies = false;
|
||||
@@ -921,8 +992,8 @@ define([
|
||||
*/
|
||||
let notificationTest = function(){
|
||||
Util.showNotify({
|
||||
title: 'Test Notification',
|
||||
text: 'Accept browser security question'},
|
||||
title: 'Test Notification',
|
||||
text: 'Accept browser security question'},
|
||||
{
|
||||
desktop: true,
|
||||
stack: 'barBottom'
|
||||
|
||||
@@ -9,9 +9,10 @@ define([
|
||||
'app/render',
|
||||
'bootbox',
|
||||
], function($, Init, Util, Render, bootbox) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
let config = {
|
||||
// jump info dialog
|
||||
jumpInfoDialogClass: 'pf-jump-info-dialog' // class for jump info dialog
|
||||
};
|
||||
@@ -22,12 +23,10 @@ define([
|
||||
$.fn.showJumpInfoDialog = function(){
|
||||
|
||||
requirejs(['text!templates/dialog/jump_info.html', 'mustache'], function(template, Mustache) {
|
||||
let data = {};
|
||||
let content = Mustache.render(template, data);
|
||||
|
||||
var data = {};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
var signatureReaderDialog = bootbox.dialog({
|
||||
let signatureReaderDialog = bootbox.dialog({
|
||||
className: config.jumpInfoDialogClass,
|
||||
title: 'Wormhole jump information',
|
||||
message: content
|
||||
|
||||
@@ -12,7 +12,7 @@ define([
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
let config = {
|
||||
// global dialog
|
||||
dialogNavigationClass: 'pf-dialog-navigation-list', // class for dialog navigation bar
|
||||
dialogNavigationListItemClass: 'pf-dialog-navigation-list-item', // class for map manual li main navigation elements
|
||||
@@ -28,7 +28,7 @@ define([
|
||||
|
||||
requirejs(['text!templates/dialog/map_manual.html', 'mustache'], function(template, Mustache) {
|
||||
|
||||
var data = {
|
||||
let data = {
|
||||
dialogNavigationClass: config.dialogNavigationClass,
|
||||
dialogNavLiClass: config.dialogNavigationListItemClass,
|
||||
scrollspyId: config.mapManualScrollspyId,
|
||||
@@ -36,10 +36,10 @@ define([
|
||||
mapCounterClass : Init.classes.pieChart.pieChartMapCounterClass
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
let content = Mustache.render(template, data);
|
||||
|
||||
// show dialog
|
||||
var mapManualDialog = bootbox.dialog({
|
||||
let mapManualDialog = bootbox.dialog({
|
||||
title: 'Manual',
|
||||
message: content,
|
||||
size: 'large',
|
||||
@@ -56,15 +56,15 @@ define([
|
||||
});
|
||||
|
||||
// modal offset top
|
||||
var modalOffsetTop = 200;
|
||||
let modalOffsetTop = 200;
|
||||
|
||||
// disable on scroll event
|
||||
var disableOnScrollEvent = false;
|
||||
let disableOnScrollEvent = false;
|
||||
|
||||
// scroll breakpoints
|
||||
var scrolLBreakpointElements = null;
|
||||
let scrolLBreakpointElements = null;
|
||||
// scroll navigation links
|
||||
var scrollNavLiElements = null;
|
||||
let scrollNavLiElements = null;
|
||||
|
||||
mapManualDialog.on('shown.bs.modal', function(e) {
|
||||
// modal on open
|
||||
@@ -72,13 +72,13 @@ define([
|
||||
scrollNavLiElements = $('.' + config.dialogNavigationListItemClass);
|
||||
});
|
||||
|
||||
var scrollspyElement = $('#' + config.mapManualScrollspyId);
|
||||
let scrollspyElement = $('#' + config.mapManualScrollspyId);
|
||||
|
||||
var whileScrolling = function(){
|
||||
let whileScrolling = function(){
|
||||
|
||||
if(disableOnScrollEvent === false){
|
||||
for(var i = 0; i < scrolLBreakpointElements.length; i++){
|
||||
var offset = $(scrolLBreakpointElements[i]).offset().top;
|
||||
for(let i = 0; i < scrolLBreakpointElements.length; i++){
|
||||
let offset = $(scrolLBreakpointElements[i]).offset().top;
|
||||
|
||||
if( (offset - modalOffsetTop) > 0){
|
||||
|
||||
@@ -116,11 +116,11 @@ define([
|
||||
scrollspyElement.find('.' + data.mapCounterClass).initMapUpdateCounter();
|
||||
|
||||
// set navigation button observer
|
||||
var mainNavigationLinks = $('.' + config.dialogNavigationClass).find('a');
|
||||
let mainNavigationLinks = $('.' + config.dialogNavigationClass).find('a');
|
||||
// text anchor links
|
||||
var subNavigationLinks = scrollspyElement.find('a[data-target]');
|
||||
let subNavigationLinks = scrollspyElement.find('a[data-target]');
|
||||
|
||||
var navigationLinks = mainNavigationLinks.add(subNavigationLinks);
|
||||
let navigationLinks = mainNavigationLinks.add(subNavigationLinks);
|
||||
|
||||
navigationLinks.on('click', function(e){
|
||||
e.preventDefault();
|
||||
@@ -130,7 +130,7 @@ define([
|
||||
// scroll to anchor
|
||||
scrollspyElement.mCustomScrollbar('scrollTo', $(this).attr('data-target'));
|
||||
|
||||
var mainNavigationLiElement = $(this).parent('.' + config.dialogNavigationListItemClass);
|
||||
let mainNavigationLiElement = $(this).parent('.' + config.dialogNavigationListItemClass);
|
||||
|
||||
|
||||
whileScrolling();
|
||||
|
||||
@@ -36,8 +36,6 @@ define([
|
||||
tableActionCellClass: 'pf-table-action-cell', // class for table "action" cells
|
||||
tableCounterCellClass: 'pf-table-counter-cell', // class for table "counter" cells
|
||||
|
||||
systemIdPrefix: 'pf-system-', // id prefix for a system
|
||||
|
||||
loadingOptions: { // config for loading overlay
|
||||
icon: {
|
||||
size: 'fa-2x'
|
||||
@@ -430,12 +428,12 @@ define([
|
||||
let deleteRowElement = $(target).parents('tr');
|
||||
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
let systemElement = $('#' + config.systemIdPrefix + mapData.config.id + '-' + rowData.id);
|
||||
let systemElement = $('#' + MapUtil.getSystemId(mapData.config.id, rowData.id) );
|
||||
|
||||
if(systemElement){
|
||||
if(systemElement.length){
|
||||
// trigger system delete event
|
||||
activeMap.trigger('pf:deleteSystems', [{
|
||||
systems: [systemElement],
|
||||
systems: [systemElement[0]],
|
||||
callback: function(){
|
||||
// callback function after ajax "delete" success
|
||||
// remove table row
|
||||
|
||||
@@ -12,7 +12,7 @@ define([
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
let config = {
|
||||
|
||||
// shutdown dialog
|
||||
notificationDialogId: 'pf-notification-dialog', // id for "notification" dialog
|
||||
@@ -23,8 +23,8 @@ define([
|
||||
* show/animate dialog page content
|
||||
* @param dialog
|
||||
*/
|
||||
var showPageContent = function(dialog){
|
||||
var headlineElement = dialog.find('h1');
|
||||
let showPageContent = function(dialog){
|
||||
let headlineElement = dialog.find('h1');
|
||||
|
||||
headlineElement.delay(300).velocity('transition.shrinkIn', {
|
||||
duration: 500
|
||||
@@ -45,7 +45,7 @@ define([
|
||||
$.fn.showNotificationDialog = function(dialogData){
|
||||
|
||||
// check if there is already a notification dialog open
|
||||
var notificationDialogClassDialoges = $('.' + config.notificationDialogClass);
|
||||
let notificationDialogClassDialoges = $('.' + config.notificationDialogClass);
|
||||
|
||||
if(notificationDialogClassDialoges.length === 0){
|
||||
|
||||
@@ -54,15 +54,15 @@ define([
|
||||
|
||||
requirejs(['text!templates/dialog/notification.html', 'mustache'], function(template, Mustache) {
|
||||
|
||||
var data = {
|
||||
let data = {
|
||||
id: config.notificationDialogId,
|
||||
content: dialogData.content
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
let content = Mustache.render(template, data);
|
||||
|
||||
// show dialog
|
||||
var shutdownDialog = bootbox.dialog({
|
||||
let shutdownDialog = bootbox.dialog({
|
||||
title: dialogData.content.title,
|
||||
message: content,
|
||||
className: config.notificationDialogClass,
|
||||
@@ -72,7 +72,7 @@ define([
|
||||
|
||||
shutdownDialog.on('shown.bs.modal', function(e) {
|
||||
// remove close button
|
||||
var dialog = $(this);
|
||||
let dialog = $(this);
|
||||
|
||||
dialog.find('.bootbox-close-button').remove();
|
||||
dialog.find('button').blur();
|
||||
|
||||
50
js/app/ui/dialog/shortcuts.js
Normal file
50
js/app/ui/dialog/shortcuts.js
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* shortcuts dialog
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'bootbox',
|
||||
'app/key',
|
||||
], function($, Init, Util, Render, bootbox, Key) {
|
||||
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
// map dialog
|
||||
shortcutsDialogId: 'pf-shortcuts-dialog', // id for shortcuts dialog
|
||||
};
|
||||
|
||||
/**
|
||||
* shows the map manual modal dialog
|
||||
*/
|
||||
$.fn.showShortcutsDialog = function(){
|
||||
requirejs(['text!templates/dialog/shortcuts.html', 'mustache'], function(template, Mustache){
|
||||
|
||||
let data = {
|
||||
id: config.shortcutsDialogId,
|
||||
shortcuts: Key.getGroupedShortcuts()
|
||||
};
|
||||
|
||||
let content = Mustache.render(template, data);
|
||||
|
||||
// show dialog
|
||||
let shortcutsDialog = bootbox.dialog({
|
||||
title: 'Keyboard Shortcuts',
|
||||
message: content,
|
||||
size: 'large',
|
||||
buttons: {
|
||||
success: {
|
||||
label: 'close',
|
||||
className: 'btn-default'
|
||||
}
|
||||
},
|
||||
show: true
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -13,12 +13,12 @@ define([
|
||||
], function($, Init, Util, Render, bootbox, MapUtil) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
let config = {
|
||||
// system effect dialog
|
||||
systemEffectDialogWrapperClass: 'pf-system-effect-dialog-wrapper' // class for system effect dialog
|
||||
};
|
||||
|
||||
var cache = {
|
||||
let cache = {
|
||||
systemEffectDialog: false // system effect info dialog
|
||||
};
|
||||
|
||||
@@ -30,31 +30,31 @@ define([
|
||||
// cache table structure
|
||||
if(!cache.systemEffectDialog){
|
||||
|
||||
var dialogWrapperElement = $('<div>', {
|
||||
let dialogWrapperElement = $('<div>', {
|
||||
class: config.systemEffectDialogWrapperClass
|
||||
});
|
||||
|
||||
var systemEffectData = Util.getSystemEffectData();
|
||||
let systemEffectData = Util.getSystemEffectData();
|
||||
|
||||
$.each( systemEffectData.wh, function( effectName, effectData ) {
|
||||
|
||||
var table = $('<table>', {
|
||||
let table = $('<table>', {
|
||||
class: ['table', 'table-condensed'].join(' ')
|
||||
});
|
||||
|
||||
var tbody = $('<tbody>');
|
||||
var thead = $('<thead>');
|
||||
let tbody = $('<tbody>');
|
||||
let thead = $('<thead>');
|
||||
|
||||
var rows = [];
|
||||
let rows = [];
|
||||
|
||||
// get formatted system effect name
|
||||
var systemEffectName = MapUtil.getEffectInfoForSystem(effectName, 'name');
|
||||
var systemEffectClass = MapUtil.getEffectInfoForSystem(effectName, 'class');
|
||||
let systemEffectName = MapUtil.getEffectInfoForSystem(effectName, 'name');
|
||||
let systemEffectClass = MapUtil.getEffectInfoForSystem(effectName, 'class');
|
||||
|
||||
$.each( effectData, function( areaId, areaData ) {
|
||||
|
||||
var systemType = 'C' + areaId;
|
||||
var securityClass = Util.getSecurityClassForSystem( systemType );
|
||||
let systemType = 'C' + areaId;
|
||||
let securityClass = Util.getSecurityClassForSystem( systemType );
|
||||
|
||||
if(areaId === '1'){
|
||||
rows.push( $('<tr>') );
|
||||
|
||||
@@ -15,7 +15,7 @@ define([
|
||||
* init a select element as "select2" for map selection
|
||||
*/
|
||||
$.fn.initMapSelect = function(){
|
||||
var selectElement = $(this);
|
||||
let selectElement = $(this);
|
||||
|
||||
$.when(
|
||||
selectElement.select2({
|
||||
@@ -31,9 +31,9 @@ define([
|
||||
* @param options
|
||||
*/
|
||||
$.fn.initSystemSelect = function(options){
|
||||
var selectElement = $(this);
|
||||
let selectElement = $(this);
|
||||
|
||||
var config = {
|
||||
let config = {
|
||||
maxSelectionLength: 1
|
||||
};
|
||||
options = $.extend({}, config, options);
|
||||
@@ -46,12 +46,12 @@ define([
|
||||
}
|
||||
|
||||
// show effect info just for wormholes
|
||||
var hideEffectClass = '';
|
||||
let hideEffectClass = '';
|
||||
if(data.effect === ''){
|
||||
hideEffectClass = 'hide';
|
||||
}
|
||||
|
||||
var markup = '<div class="clearfix">';
|
||||
let markup = '<div class="clearfix">';
|
||||
markup += '<div class="col-sm-5 pf-select-item-anchor">' + data.text + '</div>';
|
||||
markup += '<div class="col-sm-2 text-right ' + data.effectClass + '">';
|
||||
markup += '<i class="fa fa-fw fa-square ' + hideEffectClass + '"></i>';
|
||||
@@ -83,12 +83,12 @@ define([
|
||||
results: data.map( function(item){
|
||||
|
||||
// "systemId" or "name"
|
||||
var id = item[options.key];
|
||||
var disabled = false;
|
||||
var trueSec = parseFloat(item.trueSec);
|
||||
var secClass = Util.getSecurityClassForSystem(item.security);
|
||||
var trueSecClass = Util.getTrueSecClassForSystem( trueSec );
|
||||
var effectClass = MapUtil.getEffectInfoForSystem(item.effect, 'class');
|
||||
let id = item[options.key];
|
||||
let disabled = false;
|
||||
let trueSec = parseFloat(item.trueSec);
|
||||
let secClass = Util.getSecurityClassForSystem(item.security);
|
||||
let trueSecClass = Util.getTrueSecClassForSystem( trueSec );
|
||||
let effectClass = MapUtil.getEffectInfoForSystem(item.effect, 'class');
|
||||
|
||||
// check if system is dialed
|
||||
if(
|
||||
@@ -126,7 +126,7 @@ define([
|
||||
error: function (jqXHR, status, error) {
|
||||
if( !Util.isXHRAborted(jqXHR) ){
|
||||
|
||||
var reason = status + ' ' + jqXHR.status + ': ' + error;
|
||||
let reason = status + ' ' + jqXHR.status + ': ' + error;
|
||||
Util.showNotify({title: 'System select warning', text: reason + ' deleted', type: 'warning'});
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ define([
|
||||
|
||||
return this.each(function(){
|
||||
|
||||
var selectElement = $(this);
|
||||
let selectElement = $(this);
|
||||
|
||||
// format result data
|
||||
function formatResultData (data) {
|
||||
@@ -172,7 +172,7 @@ define([
|
||||
|
||||
// check if an option is already selected
|
||||
// do not show the same result twice
|
||||
var currentValues = selectElement.val();
|
||||
let currentValues = selectElement.val();
|
||||
|
||||
if(
|
||||
currentValues &&
|
||||
@@ -181,8 +181,8 @@ define([
|
||||
return ;
|
||||
}
|
||||
|
||||
var imagePath = '';
|
||||
var previewContent = '';
|
||||
let imagePath = '';
|
||||
let previewContent = '';
|
||||
|
||||
switch(options.type){
|
||||
case 'character':
|
||||
@@ -199,7 +199,7 @@ define([
|
||||
break;
|
||||
}
|
||||
|
||||
var markup = '<div class="clearfix">';
|
||||
let markup = '<div class="clearfix">';
|
||||
markup += '<div class="col-sm-2">' + previewContent + '</div>';
|
||||
markup += '<div class="col-sm-10">' + data.text + '</div></div>';
|
||||
|
||||
@@ -213,7 +213,7 @@ define([
|
||||
return data.text;
|
||||
}
|
||||
|
||||
var markup = '<div class="clearfix">';
|
||||
let markup = '<div class="clearfix">';
|
||||
markup += '<div class="col-sm-10">' + data.text + '</div></div>';
|
||||
|
||||
return markup;
|
||||
@@ -248,7 +248,7 @@ define([
|
||||
error: function (jqXHR, status, error) {
|
||||
if( !Util.isXHRAborted(jqXHR) ){
|
||||
|
||||
var reason = status + ' ' + jqXHR.status + ': ' + error;
|
||||
let reason = status + ' ' + jqXHR.status + ': ' + error;
|
||||
Util.showNotify({title: 'Access select warning', text: reason + ' deleted', type: 'warning'});
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,10 @@ define([
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'bootbox'
|
||||
], function($, Init, Util, Render, bootbox) {
|
||||
'bootbox',
|
||||
'app/map/map',
|
||||
'app/map/util'
|
||||
], function($, Init, Util, Render, bootbox, Map, MapUtil) {
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
@@ -40,10 +42,12 @@ define([
|
||||
sigTableEditSigNameInput: 'pf-sig-table-edit-name-input', // class for editable fields (input)
|
||||
sigTableEditSigGroupSelect: 'pf-sig-table-edit-group-select', // class for editable fields (sig group)
|
||||
sigTableEditSigTypeSelect: 'pf-sig-table-edit-type-select', // class for editable fields (sig type)
|
||||
sigTableEditSigConnectionSelect: 'pf-sig-table-edit-connection-select', // class for editable fields (sig connection)
|
||||
sigTableEditSigDescriptionTextarea: 'pf-sig-table-edit-desc-text', // class for editable fields (sig description)
|
||||
sigTableCreatedCellClass: 'pf-sig-table-created', // class for "created" cells
|
||||
sigTableUpdatedCellClass: 'pf-sig-table-updated', // class for "updated" cells
|
||||
|
||||
sigTableConnectionClass: 'pf-table-connection-cell', // class for "connection" cells
|
||||
sigTableCounterClass: 'pf-table-counter-cell', // class for "counter" cells
|
||||
sigTableActionCellClass: 'pf-table-action-cell', // class for "action" cells
|
||||
|
||||
@@ -159,7 +163,7 @@ define([
|
||||
let updateCell = signatureTableApi.cell( rowIndex, cellIndex );
|
||||
let updateCellElement = updateCell.nodes().to$();
|
||||
|
||||
if(cellIndex === 6){
|
||||
if(cellIndex === 7){
|
||||
// clear existing counter interval
|
||||
clearInterval( updateCellElement.data('interval') );
|
||||
}
|
||||
@@ -167,7 +171,7 @@ define([
|
||||
// set new value
|
||||
updateCell.data( data ).draw();
|
||||
|
||||
if(cellIndex === 6){
|
||||
if(cellIndex === 7){
|
||||
updateCellElement.initTimestampCounter();
|
||||
}
|
||||
};
|
||||
@@ -694,6 +698,27 @@ define([
|
||||
|
||||
tempData.type = sigType;
|
||||
|
||||
// set connection (to target system) ------------------------------------------------------------------
|
||||
let sigConnection = '<a href="#" class="' + config.sigTableEditSigConnectionSelect + '" ';
|
||||
if(data.id > 0){
|
||||
sigConnection += 'data-pk="' + data.id + '" ';
|
||||
}
|
||||
|
||||
// set disabled if group is not wromhole
|
||||
if(data.groupId !== 5){
|
||||
sigConnection += 'data-disabled="1" ';
|
||||
}
|
||||
|
||||
if(data.connection){
|
||||
sigConnection += 'data-value="' + data.connection.id + '" ';
|
||||
}
|
||||
sigConnection += '></a>';
|
||||
|
||||
tempData.connection = {
|
||||
render: sigConnection,
|
||||
connection: data.connection
|
||||
};
|
||||
|
||||
// set description ------------------------------------------------------------------------------------
|
||||
let sigDescription = '<a href="#" class="' + config.sigTableEditSigDescriptionTextarea + '" ';
|
||||
if(data.id > 0){
|
||||
@@ -1014,6 +1039,7 @@ define([
|
||||
let sigGroupFields = tableElement.find('.' + config.sigTableEditSigGroupSelect);
|
||||
let sigTypeFields = tableElement.find('.' + config.sigTableEditSigTypeSelect);
|
||||
let sigDescriptionFields = tableElement.find('.' + config.sigTableEditSigDescriptionTextarea);
|
||||
let sigConnectionFields = tableElement.find('.' + config.sigTableEditSigConnectionSelect);
|
||||
|
||||
// jump to "next" editable field on save
|
||||
let openNextEditDialogOnSave = function(fields){
|
||||
@@ -1038,8 +1064,16 @@ define([
|
||||
};
|
||||
|
||||
// helper function - get the next editable field in next table column
|
||||
let getNextEditableField = function(field){
|
||||
let nextEditableField = $(field).closest('td').next().find('.editable');
|
||||
let getNextEditableField = function(field, selector){
|
||||
let nextEditableField = null;
|
||||
if(selector){
|
||||
// search specific sibling
|
||||
nextEditableField = $(field).closest('td').nextAll(selector).find('.editable');
|
||||
}else{
|
||||
// get next sibling
|
||||
nextEditableField = $(field).closest('td').next().find('.editable');
|
||||
}
|
||||
|
||||
return $(nextEditableField);
|
||||
};
|
||||
|
||||
@@ -1108,7 +1142,7 @@ define([
|
||||
updateTooltip(columnElement, newValue);
|
||||
|
||||
// update "updated" cell
|
||||
updateSignatureCell(rowElement, 6, newRowData.updated);
|
||||
updateSignatureCell(rowElement, 7, newRowData.updated);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1145,7 +1179,7 @@ define([
|
||||
let newRowData = response.signatures[0];
|
||||
|
||||
// update "updated" cell
|
||||
updateSignatureCell(rowElement, 6, newRowData.updated);
|
||||
updateSignatureCell(rowElement, 7, newRowData.updated);
|
||||
}
|
||||
|
||||
// find related "type" select (same row) and change options
|
||||
@@ -1166,6 +1200,18 @@ define([
|
||||
}else{
|
||||
typeSelect.editable('disable');
|
||||
}
|
||||
|
||||
// find "connection" select (same row) and change "enabled" flag
|
||||
let connectionSelect = getNextEditableField(signatureTypeField, '.' + config.sigTableConnectionClass);
|
||||
connectionSelect.editable('setValue', null);
|
||||
|
||||
if(newValue === 5){
|
||||
// wormhole
|
||||
connectionSelect.editable('enable');
|
||||
}else{
|
||||
checkConnectionConflicts();
|
||||
connectionSelect.editable('disable');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1204,7 +1250,7 @@ define([
|
||||
let newRowData = response.signatures[0];
|
||||
|
||||
// update "updated" cell
|
||||
updateSignatureCell(rowElement, 6, newRowData.updated);
|
||||
updateSignatureCell(rowElement, 7, newRowData.updated);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1227,7 +1273,62 @@ define([
|
||||
let newRowData = response.signatures[0];
|
||||
|
||||
// update "updated" cell
|
||||
updateSignatureCell(rowElement, 6, newRowData.updated);
|
||||
updateSignatureCell(rowElement, 7, newRowData.updated);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Select connection (target system) --------------------------------------------------------------------------
|
||||
let initCount = 0;
|
||||
sigConnectionFields.on('init', function(e, editable) {
|
||||
if(++initCount >= sigConnectionFields.length){
|
||||
checkConnectionConflicts();
|
||||
}
|
||||
});
|
||||
|
||||
sigConnectionFields.editable({
|
||||
type: 'select',
|
||||
title: 'system',
|
||||
name: 'connectionId',
|
||||
emptytext: 'unknown',
|
||||
onblur: 'submit',
|
||||
showbuttons: false,
|
||||
params: modifyFieldParamsOnSend,
|
||||
display: function(value, sourceData) {
|
||||
let editableElement = $(this);
|
||||
let newValue = '';
|
||||
|
||||
if(value !== null){
|
||||
let selected = $.fn.editableutils.itemsByValue(value, sourceData);
|
||||
if(
|
||||
selected.length &&
|
||||
selected[0].text !== ''
|
||||
){
|
||||
newValue += '<i class="fa fa-exclamation-triangle txt-color txt-color-danger hide"></i>';
|
||||
newValue += ' ' + selected[0].text;
|
||||
}else{
|
||||
newValue = '<span class="editable-empty">unknown</span>';
|
||||
}
|
||||
}
|
||||
|
||||
editableElement.html(newValue);
|
||||
},
|
||||
source: function(a,b){
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
let mapId = activeMap.data('id');
|
||||
|
||||
let availableConnections = getSignatureConnectionOptions(mapId, systemData);
|
||||
|
||||
return availableConnections;
|
||||
},
|
||||
success: function(response, newValue){
|
||||
if(response){
|
||||
let signatureConnectionField = $(this);
|
||||
let rowElement = signatureConnectionField.parents('tr');
|
||||
let newRowData = response.signatures[0];
|
||||
|
||||
// update "updated" cell
|
||||
updateSignatureCell(rowElement, 7, newRowData.updated);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1244,13 +1345,109 @@ define([
|
||||
tableElement.parents('.' + config.tableToolsActionClass).css( 'height', '-=35px' );
|
||||
});
|
||||
|
||||
// save events
|
||||
sigConnectionFields.on('save', function(e, editable){
|
||||
checkConnectionConflicts();
|
||||
});
|
||||
|
||||
// open next field dialog -------------------------------------------------------------------------------------
|
||||
openNextEditDialogOnSave(sigNameFields);
|
||||
openNextEditDialogOnSave(sigGroupFields);
|
||||
};
|
||||
|
||||
/**
|
||||
* get all signatures that can exist for a given system
|
||||
* get all connection select options
|
||||
* @param mapId
|
||||
* @param systemData
|
||||
* @returns {Array}
|
||||
*/
|
||||
let getSignatureConnectionOptions = (mapId, systemData) => {
|
||||
let map = Map.getMapInstance( mapId );
|
||||
let systemId = MapUtil.getSystemId(mapId, systemData.id);
|
||||
let systemConnections = MapUtil.searchConnectionsBySystems(map, [systemId]);
|
||||
let connectionOptions = [];
|
||||
|
||||
for(let i = 0; i < systemConnections.length; i++){
|
||||
let connectionData = Map.getDataByConnection(systemConnections[i]);
|
||||
|
||||
// connectionId is required (must be stored)
|
||||
if(connectionData.id){
|
||||
// check whether "source" or "target" system is relevant for this connection
|
||||
// -> hint "source" === 'target' --> loop
|
||||
if(systemData.id !== connectionData.target){
|
||||
// take target...
|
||||
connectionOptions.push({
|
||||
value: connectionData.id,
|
||||
text: connectionData.targetName
|
||||
});
|
||||
}else if(systemData.id !== connectionData.source){
|
||||
// take source...
|
||||
connectionOptions.push({
|
||||
value: connectionData.id,
|
||||
text: connectionData.sourceName
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add empty entry
|
||||
connectionOptions.unshift({ value: null, text: ''});
|
||||
|
||||
return connectionOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* check connectionIds for conflicts (multiple signatures -> same connection)
|
||||
* -> show "conflict" icon next to select
|
||||
*/
|
||||
let checkConnectionConflicts = () => {
|
||||
setTimeout(function() {
|
||||
let connectionSelects = $('.' + config.sigTableConnectionClass + ' .editable');
|
||||
let connectionIds = [];
|
||||
let duplicateConnectionIds = [];
|
||||
let groupedSelects = [];
|
||||
|
||||
connectionSelects.each(function(){
|
||||
let select = $(this);
|
||||
let value = parseInt(select.editable('getValue', true) )|| 0;
|
||||
|
||||
if(
|
||||
connectionIds.indexOf(value) > -1 &&
|
||||
duplicateConnectionIds.indexOf(value) === -1
|
||||
){
|
||||
// duplicate found
|
||||
duplicateConnectionIds.push(value);
|
||||
}
|
||||
|
||||
if(groupedSelects[value] !== undefined){
|
||||
groupedSelects[value].push(select[0]);
|
||||
}else{
|
||||
groupedSelects[value] = [select[0]];
|
||||
}
|
||||
|
||||
connectionIds.push(value);
|
||||
});
|
||||
|
||||
// update "conflict" icon next to select label for connectionIds
|
||||
connectionSelects.each(function(){
|
||||
let select = $(this);
|
||||
let value = parseInt(select.editable('getValue', true) )|| 0;
|
||||
let conflictIcon = select.find('.fa-exclamation-triangle');
|
||||
if(
|
||||
duplicateConnectionIds.indexOf(value) > -1 &&
|
||||
groupedSelects[value].indexOf(select[0]) > -1
|
||||
){
|
||||
conflictIcon.removeClass('hide');
|
||||
}else{
|
||||
conflictIcon.addClass('hide');
|
||||
}
|
||||
});
|
||||
}, 200);
|
||||
};
|
||||
|
||||
/**
|
||||
* get all signature types that can exist for a given system
|
||||
* -> result is partially cached
|
||||
* @param systemData
|
||||
* @param systemTypeId
|
||||
* @param areaId
|
||||
@@ -1265,6 +1462,7 @@ define([
|
||||
// check for cached signature names
|
||||
if(sigNameCache.hasOwnProperty( cacheKey )){
|
||||
// cached signatures do not include static WHs!
|
||||
// -> ".slice(0)" creates copy
|
||||
newSelectOptions = sigNameCache[cacheKey].slice(0);
|
||||
newSelectOptionsCount = sumSignaturesRecursive('children', newSelectOptions);
|
||||
}else{
|
||||
@@ -1281,7 +1479,7 @@ define([
|
||||
tempSelectOptions.hasOwnProperty(key)
|
||||
) {
|
||||
newSelectOptionsCount++;
|
||||
fixSelectOptions.push( {value: key, text: tempSelectOptions[key] } );
|
||||
fixSelectOptions.push( {value: parseInt(key), text: tempSelectOptions[key] } );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1366,6 +1564,19 @@ define([
|
||||
return newSelectOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* get all signature types that can exist for a system (jQuery obj)
|
||||
* @param systemElement
|
||||
* @param groupId
|
||||
* @returns {Array}
|
||||
*/
|
||||
let getAllSignatureNamesBySystem = (systemElement, groupId) => {
|
||||
let systemTypeId = systemElement.data('typeId');
|
||||
let areaId = Util.getAreaIdBySecurity(systemElement.data('security'));
|
||||
let systemData = {statics: systemElement.data('statics')};
|
||||
return getAllSignatureNames(systemData, systemTypeId, areaId, groupId);
|
||||
};
|
||||
|
||||
/**
|
||||
* recursive sum array.length for a given object key
|
||||
* -> e.g.
|
||||
@@ -1451,6 +1662,9 @@ define([
|
||||
// update signature bar
|
||||
moduleElement.updateScannedSignaturesBar({showNotice: false});
|
||||
|
||||
// update connection conflicts
|
||||
checkConnectionConflicts();
|
||||
|
||||
Util.showNotify({title: 'Signature deleted', text: signatureCount + ' signatures deleted', type: 'success'});
|
||||
}
|
||||
};
|
||||
@@ -1539,16 +1753,16 @@ define([
|
||||
.css({
|
||||
'willChange': 'height'
|
||||
}).velocity('slideUp', {
|
||||
duration: duration,
|
||||
complete: function(animationElements){
|
||||
// remove wrapper
|
||||
$(animationElements).children().unwrap();
|
||||
duration: duration,
|
||||
complete: function(animationElements){
|
||||
// remove wrapper
|
||||
$(animationElements).children().unwrap();
|
||||
|
||||
if(callback !== undefined){
|
||||
callback(rowElement);
|
||||
}
|
||||
if(callback !== undefined){
|
||||
callback(rowElement);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else{
|
||||
// show row
|
||||
|
||||
@@ -1577,23 +1791,23 @@ define([
|
||||
.css({
|
||||
'willChange': 'height'
|
||||
}).velocity('slideDown', {
|
||||
duration: duration,
|
||||
complete: function(animationElements){
|
||||
// remove wrapper
|
||||
for(let i = 0; i < animationElements.length; i++){
|
||||
let currentWrapper = $(animationElements[i]);
|
||||
if(currentWrapper.children().length > 0){
|
||||
currentWrapper.children().unwrap();
|
||||
}else{
|
||||
currentWrapper.parent().html( currentWrapper.html() );
|
||||
}
|
||||
}
|
||||
|
||||
if(callback !== undefined){
|
||||
callback(rowElement);
|
||||
duration: duration,
|
||||
complete: function(animationElements){
|
||||
// remove wrapper
|
||||
for(let i = 0; i < animationElements.length; i++){
|
||||
let currentWrapper = $(animationElements[i]);
|
||||
if(currentWrapper.children().length > 0){
|
||||
currentWrapper.children().unwrap();
|
||||
}else{
|
||||
currentWrapper.parent().html( currentWrapper.html() );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(callback !== undefined){
|
||||
callback(rowElement);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1789,6 +2003,18 @@ define([
|
||||
data: 'description'
|
||||
},{
|
||||
targets: 5,
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: [config.sigTableConnectionClass].join(' '),
|
||||
title: 'leads to',
|
||||
type: 'html',
|
||||
width: '70px',
|
||||
data: 'connection',
|
||||
render: {
|
||||
_: 'render'
|
||||
}
|
||||
},{
|
||||
targets: 6,
|
||||
title: 'created',
|
||||
width: '90px',
|
||||
searchable: false,
|
||||
@@ -1802,7 +2028,7 @@ define([
|
||||
$(cell).initTimestampCounter();
|
||||
}
|
||||
},{
|
||||
targets: 6,
|
||||
targets: 7,
|
||||
title: 'updated',
|
||||
width: '90px',
|
||||
searchable: false,
|
||||
@@ -1824,7 +2050,7 @@ define([
|
||||
}
|
||||
}
|
||||
},{
|
||||
targets: 7,
|
||||
targets: 8,
|
||||
title: '',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
@@ -1845,7 +2071,7 @@ define([
|
||||
}
|
||||
}
|
||||
},{
|
||||
targets: 8,
|
||||
targets: 9,
|
||||
title: '',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
@@ -1924,6 +2150,9 @@ define([
|
||||
btnOkLabel: 'delete',
|
||||
btnOkIcon: 'fa fa-fw fa-close',
|
||||
onConfirm : function(e, target){
|
||||
// top scroll to top
|
||||
e.preventDefault();
|
||||
|
||||
let deleteRowElement = $(target).parents('tr');
|
||||
let row = tempTableElement.DataTable().rows(deleteRowElement);
|
||||
deleteSignatures(row);
|
||||
@@ -1977,17 +2206,8 @@ define([
|
||||
});
|
||||
|
||||
// event listener for global "paste" signatures into the page -------------------------------------------------
|
||||
$(document).off('paste').on('paste', function(e){
|
||||
|
||||
// do not read clipboard if pasting into form elements
|
||||
if(
|
||||
$(e.target).prop('tagName').toLowerCase() !== 'input' &&
|
||||
$(e.target).prop('tagName').toLowerCase() !== 'textarea'
|
||||
){
|
||||
let clipboard = (e.originalEvent || e).clipboardData.getData('text/plain');
|
||||
|
||||
moduleElement.updateSignatureTableByClipboard(systemData, clipboard, {});
|
||||
}
|
||||
moduleElement.on('pf:updateSystemSignatureModuleByClipboard', function(e, clipboard){
|
||||
$(this).updateSignatureTableByClipboard(systemData, clipboard, {});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2097,9 +2317,9 @@ define([
|
||||
moduleElement.velocity('transition.slideDownOut', {
|
||||
duration: Init.animationSpeed.mapModule,
|
||||
complete: function(tempElement){
|
||||
// Destroying the data tables throws
|
||||
// save remove of all dataTables
|
||||
signatureTable.api().destroy();
|
||||
// Destroying the data tables throws
|
||||
// save remove of all dataTables
|
||||
signatureTable.api().destroy();
|
||||
|
||||
$(tempElement).remove();
|
||||
|
||||
@@ -2118,4 +2338,8 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
getAllSignatureNamesBySystem: getAllSignatureNamesBySystem
|
||||
};
|
||||
|
||||
});
|
||||
@@ -40,6 +40,7 @@ define([
|
||||
menuButtonFullScreenId: 'pf-menu-button-fullscreen', // id for menu button "fullscreen"
|
||||
menuButtonMagnetizerId: 'pf-menu-button-magnetizer', // id for menu button "magnetizer"
|
||||
menuButtonGridId: 'pf-menu-button-grid', // id for menu button "grid snap"
|
||||
menuButtonEndpointId: 'pf-menu-button-endpoint', // id for menu button "endpoint" overlays
|
||||
|
||||
|
||||
settingsMessageVelocityOptions: {
|
||||
@@ -712,7 +713,7 @@ define([
|
||||
content: '',
|
||||
container: 'body',
|
||||
title: tooltipData.name +
|
||||
'<span class="pull-right ' + tooltipData.class +'">' + tooltipData.security + '</span>',
|
||||
'<span class="pull-right ' + tooltipData.class +'">' + tooltipData.security + '</span>',
|
||||
delay: {
|
||||
show: 250,
|
||||
hide: 0
|
||||
@@ -881,6 +882,27 @@ define([
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* flatten XEditable array for select fields
|
||||
* @param dataArray
|
||||
* @returns {{}}
|
||||
*/
|
||||
let flattenXEditableSelectArray = (dataArray) => {
|
||||
let flatten = {};
|
||||
|
||||
for(let data of dataArray){
|
||||
if(data.children && data.children.length > 0){
|
||||
for(let child of data.children){
|
||||
flatten[child.value] = child.text;
|
||||
}
|
||||
}else{
|
||||
flatten[data.value] = data.text;
|
||||
}
|
||||
}
|
||||
|
||||
return flatten;
|
||||
} ;
|
||||
|
||||
/**
|
||||
* set default configuration for "Bootbox" dialogs
|
||||
*/
|
||||
@@ -1205,7 +1227,7 @@ define([
|
||||
* @returns {string}
|
||||
*/
|
||||
let getSyncType = () => {
|
||||
return Init.syncStatus.type;
|
||||
return Init.syncStatus.type;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1230,9 +1252,7 @@ define([
|
||||
* @returns {JQuery|*|{}|T}
|
||||
*/
|
||||
$.fn.getMapTabElements = function(mapId){
|
||||
|
||||
let mapModuleElement = $(this);
|
||||
|
||||
let mapTabElements = mapModuleElement.find('#' + config.mapTabBarId).find('a');
|
||||
|
||||
if(mapId){
|
||||
@@ -1861,8 +1881,8 @@ define([
|
||||
let getCurrentLocationData = function(){
|
||||
let currentLocationLink = $('#' + config.headCurrentLocationId).find('a');
|
||||
return {
|
||||
id: currentLocationLink.data('systemId'),
|
||||
name: currentLocationLink.data('systemName')
|
||||
id: currentLocationLink.data('systemId'),
|
||||
name: currentLocationLink.data('systemName')
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2037,6 +2057,7 @@ define([
|
||||
getCurrentLocationData: getCurrentLocationData,
|
||||
getCurrentUserInfo: getCurrentUserInfo,
|
||||
getCurrentCharacterLog: getCurrentCharacterLog,
|
||||
flattenXEditableSelectArray: flattenXEditableSelectArray,
|
||||
setDestination: setDestination,
|
||||
convertDateToString: convertDateToString,
|
||||
getOpenDialogs: getOpenDialogs,
|
||||
|
||||
4
js/lib/jquery-3.0.0.min.js
vendored
4
js/lib/jquery-3.0.0.min.js
vendored
File diff suppressed because one or more lines are too long
4
js/lib/jquery-3.1.1.min.js
vendored
Normal file
4
js/lib/jquery-3.1.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
public/img/landing/donate_patreon.png
Normal file
BIN
public/img/landing/donate_patreon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
BIN
public/img/landing/donate_paypal.png
Normal file
BIN
public/img/landing/donate_paypal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
@@ -1,2 +1,2 @@
|
||||
var mainScriptPath=document.body.getAttribute("data-script"),jsBaseUrl=document.body.getAttribute("data-js-path");requirejs.config({baseUrl:"js",paths:{layout:"layout",config:"app/config",dialog:"app/ui/dialog",templates:"../../templates",img:"../../img",login:"./app/login",mappage:"./app/mappage",setup:"./app/setup",jquery:"lib/jquery-3.0.0.min",bootstrap:"lib/bootstrap.min",text:"lib/requirejs/text",mustache:"lib/mustache.min",localForage:"lib/localforage.min",velocity:"lib/velocity.min",velocityUI:"lib/velocity.ui.min",slidebars:"lib/slidebars",jsPlumb:"lib/dom.jsPlumb-1.7.6",farahey:"lib/farahey-0.5",customScrollbar:"lib/jquery.mCustomScrollbar.min",mousewheel:"lib/jquery.mousewheel.min",xEditable:"lib/bootstrap-editable.min",morris:"lib/morris.min",raphael:"lib/raphael-min",bootbox:"lib/bootbox.min",easyPieChart:"lib/jquery.easypiechart.min",peityInlineChart:"lib/jquery.peity.min",dragToSelect:"lib/jquery.dragToSelect",hoverIntent:"lib/jquery.hoverIntent.minified",fullScreen:"lib/jquery.fullscreen.min",select2:"lib/select2.min",validator:"lib/validator.min",lazylinepainter:"lib/jquery.lazylinepainter-1.5.1.min",blueImpGallery:"lib/blueimp-gallery",blueImpGalleryHelper:"lib/blueimp-helper",blueImpGalleryBootstrap:"lib/bootstrap-image-gallery",bootstrapConfirmation:"lib/bootstrap-confirmation",bootstrapToggle:"lib/bootstrap2-toggle.min",lazyload:"lib/jquery.lazyload.min",easePack:"lib/EasePack.min",tweenLite:"lib/TweenLite.min","datatables.net":"lib/datatables/DataTables-1.10.12/js/jquery.dataTables.min","datatables.net-buttons":"lib/datatables/Buttons-1.2.1/js/dataTables.buttons.min","datatables.net-buttons-html":"lib/datatables/Buttons-1.2.1/js/buttons.html5.min","datatables.net-responsive":"lib/datatables/Responsive-2.1.0/js/dataTables.responsive.min","datatables.net-select":"lib/datatables/Select-1.2.0/js/dataTables.select.min",pnotify:"lib/pnotify/pnotify","pnotify.buttons":"lib/pnotify/pnotify.buttons","pnotify.confirm":"lib/pnotify/pnotify.confirm","pnotify.nonblock":"lib/pnotify/pnotify.nonblock","pnotify.desktop":"lib/pnotify/pnotify.desktop","pnotify.history":"lib/pnotify/pnotify.history","pnotify.callbacks":"lib/pnotify/pnotify.callbacks","pnotify.reference":"lib/pnotify/pnotify.reference"},shim:{bootstrap:{deps:["jquery"]},farahey:{deps:["jsPlumb"]},velocity:{deps:["jquery"]},velocityUI:{deps:["velocity"]},slidebars:{deps:["jquery"]},customScrollbar:{deps:["jquery","mousewheel"]},"datatables.net":{deps:["jquery"]},"datatables.net-buttons":{deps:["datatables.net"]},"datatables.net-buttons-html":{deps:["datatables.net-buttons"]},"datatables.net-responsive":{deps:["datatables.net"]},"datatables.net-select":{deps:["datatables.net"]},xEditable:{deps:["bootstrap"]},bootbox:{deps:["jquery","bootstrap"],exports:"bootbox"},morris:{deps:["jquery","raphael"],exports:"Morris"},pnotify:{deps:["jquery"]},easyPieChart:{deps:["jquery"]},peityInlineChart:{deps:["jquery"]},dragToSelect:{deps:["jquery"]},hoverIntent:{deps:["jquery"]},fullScreen:{deps:["jquery"]},select2:{deps:["jquery"],exports:"Select2"},validator:{deps:["jquery","bootstrap"]},lazylinepainter:{deps:["jquery","bootstrap"]},blueImpGallery:{deps:["jquery"]},bootstrapConfirmation:{deps:["bootstrap"]},bootstrapToggle:{deps:["jquery"]},lazyload:{deps:["jquery"]}}});require.config({baseUrl:jsBaseUrl});requirejs([mainScriptPath]);
|
||||
var mainScriptPath=document.body.getAttribute("data-script"),jsBaseUrl=document.body.getAttribute("data-js-path");requirejs.config({baseUrl:"js",paths:{layout:"layout",config:"app/config",dialog:"app/ui/dialog",templates:"../../templates",img:"../../img",login:"./app/login",mappage:"./app/mappage",setup:"./app/setup",jquery:"lib/jquery-3.1.1.min",bootstrap:"lib/bootstrap.min",text:"lib/requirejs/text",mustache:"lib/mustache.min",localForage:"lib/localforage.min",velocity:"lib/velocity.min",velocityUI:"lib/velocity.ui.min",slidebars:"lib/slidebars",jsPlumb:"lib/dom.jsPlumb-1.7.6",farahey:"lib/farahey-0.5",customScrollbar:"lib/jquery.mCustomScrollbar.min",mousewheel:"lib/jquery.mousewheel.min",xEditable:"lib/bootstrap-editable.min",morris:"lib/morris.min",raphael:"lib/raphael-min",bootbox:"lib/bootbox.min",easyPieChart:"lib/jquery.easypiechart.min",peityInlineChart:"lib/jquery.peity.min",dragToSelect:"lib/jquery.dragToSelect",hoverIntent:"lib/jquery.hoverIntent.minified",fullScreen:"lib/jquery.fullscreen.min",select2:"lib/select2.min",validator:"lib/validator.min",lazylinepainter:"lib/jquery.lazylinepainter-1.5.1.min",blueImpGallery:"lib/blueimp-gallery",blueImpGalleryHelper:"lib/blueimp-helper",blueImpGalleryBootstrap:"lib/bootstrap-image-gallery",bootstrapConfirmation:"lib/bootstrap-confirmation",bootstrapToggle:"lib/bootstrap2-toggle.min",lazyload:"lib/jquery.lazyload.min",easePack:"lib/EasePack.min",tweenLite:"lib/TweenLite.min","datatables.net":"lib/datatables/DataTables-1.10.12/js/jquery.dataTables.min","datatables.net-buttons":"lib/datatables/Buttons-1.2.1/js/dataTables.buttons.min","datatables.net-buttons-html":"lib/datatables/Buttons-1.2.1/js/buttons.html5.min","datatables.net-responsive":"lib/datatables/Responsive-2.1.0/js/dataTables.responsive.min","datatables.net-select":"lib/datatables/Select-1.2.0/js/dataTables.select.min",pnotify:"lib/pnotify/pnotify","pnotify.buttons":"lib/pnotify/pnotify.buttons","pnotify.confirm":"lib/pnotify/pnotify.confirm","pnotify.nonblock":"lib/pnotify/pnotify.nonblock","pnotify.desktop":"lib/pnotify/pnotify.desktop","pnotify.history":"lib/pnotify/pnotify.history","pnotify.callbacks":"lib/pnotify/pnotify.callbacks","pnotify.reference":"lib/pnotify/pnotify.reference"},shim:{bootstrap:{deps:["jquery"]},farahey:{deps:["jsPlumb"]},velocity:{deps:["jquery"]},velocityUI:{deps:["velocity"]},slidebars:{deps:["jquery"]},customScrollbar:{deps:["jquery","mousewheel"]},"datatables.net":{deps:["jquery"]},"datatables.net-buttons":{deps:["datatables.net"]},"datatables.net-buttons-html":{deps:["datatables.net-buttons"]},"datatables.net-responsive":{deps:["datatables.net"]},"datatables.net-select":{deps:["datatables.net"]},xEditable:{deps:["bootstrap"]},bootbox:{deps:["jquery","bootstrap"],exports:"bootbox"},morris:{deps:["jquery","raphael"],exports:"Morris"},pnotify:{deps:["jquery"]},easyPieChart:{deps:["jquery"]},peityInlineChart:{deps:["jquery"]},dragToSelect:{deps:["jquery"]},hoverIntent:{deps:["jquery"]},fullScreen:{deps:["jquery"]},select2:{deps:["jquery"],exports:"Select2"},validator:{deps:["jquery","bootstrap"]},lazylinepainter:{deps:["jquery","bootstrap"]},blueImpGallery:{deps:["jquery"]},bootstrapConfirmation:{deps:["bootstrap"]},bootstrapToggle:{deps:["jquery"]},lazyload:{deps:["jquery"]}}});require.config({baseUrl:jsBaseUrl});requirejs([mainScriptPath]);
|
||||
//# sourceMappingURL=app.js.map
|
||||
@@ -21,7 +21,7 @@ requirejs.config({
|
||||
mappage: './app/mappage', // initial start "map page" view
|
||||
setup: './app/setup', // initial start "setup page" view
|
||||
|
||||
jquery: 'lib/jquery-3.0.0.min', // v3.0.0 jQuery
|
||||
jquery: 'lib/jquery-3.1.1.min', // v3.1.1 jQuery
|
||||
bootstrap: 'lib/bootstrap.min', // v3.3.0 Bootstrap js code - http://getbootstrap.com/javascript
|
||||
text: 'lib/requirejs/text', // v2.0.12 A RequireJS/AMD loader plugin for loading text resources.
|
||||
mustache: 'lib/mustache.min', // v1.0.0 Javascript template engine - http://mustache.github.io
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -8,51 +8,52 @@ define('app/init',['jquery'], function($) {
|
||||
|
||||
let Config = {
|
||||
path: {
|
||||
img: 'public/img/', // path for images
|
||||
img: 'public/img/', // path for images
|
||||
// user API
|
||||
getCaptcha: 'api/user/getCaptcha', // ajax URL - get captcha image
|
||||
getServerStatus: 'api/user/getEveServerStatus', // ajax URL - get EVE-Online server status
|
||||
getCookieCharacterData: 'api/user/getCookieCharacter', // ajax URL - get character data from cookie
|
||||
logIn: 'api/user/logIn', // ajax URL - login
|
||||
logout: 'api/user/logout', // ajax URL - logout
|
||||
deleteLog: 'api/user/deleteLog', // ajax URL - delete character log
|
||||
saveUserConfig: 'api/user/saveAccount', // ajax URL - saves/update user account
|
||||
deleteAccount: 'api/user/deleteAccount', // ajax URL - delete Account data
|
||||
getCaptcha: 'api/user/getCaptcha', // ajax URL - get captcha image
|
||||
getServerStatus: 'api/user/getEveServerStatus', // ajax URL - get EVE-Online server status
|
||||
getCookieCharacterData: 'api/user/getCookieCharacter', // ajax URL - get character data from cookie
|
||||
logIn: 'api/user/logIn', // ajax URL - login
|
||||
logout: 'api/user/logout', // ajax URL - logout
|
||||
deleteLog: 'api/user/deleteLog', // ajax URL - delete character log
|
||||
saveUserConfig: 'api/user/saveAccount', // ajax URL - saves/update user account
|
||||
deleteAccount: 'api/user/deleteAccount', // ajax URL - delete Account data
|
||||
// access API
|
||||
searchAccess: 'api/access/search', // ajax URL - search user/corporation/ally by name
|
||||
searchAccess: 'api/access/search', // ajax URL - search user/corporation/ally by name
|
||||
// main config/map ping API
|
||||
initMap: 'api/map/init', // ajax URL - get static data
|
||||
getAccessData: 'api/map/getAccessData', // ajax URL - get map access tokens (WebSocket)
|
||||
updateMapData: 'api/map/updateData', // ajax URL - main map update trigger
|
||||
updateUserData: 'api/map/updateUserData', // ajax URL - main map user data trigger
|
||||
initMap: 'api/map/init', // ajax URL - get static data
|
||||
getAccessData: 'api/map/getAccessData', // ajax URL - get map access tokens (WebSocket)
|
||||
updateMapData: 'api/map/updateData', // ajax URL - main map update trigger
|
||||
updateUserData: 'api/map/updateUserData', // ajax URL - main map user data trigger
|
||||
// map API
|
||||
saveMap: 'api/map/save', // ajax URL - save/update map
|
||||
deleteMap: 'api/map/delete', // ajax URL - delete map
|
||||
importMap: 'api/map/import', // ajax URL - import map
|
||||
saveMap: 'api/map/save', // ajax URL - save/update map
|
||||
deleteMap: 'api/map/delete', // ajax URL - delete map
|
||||
importMap: 'api/map/import', // ajax URL - import map
|
||||
getMapConnectionData: 'api/map/getConnectionData', // ajax URL - get connection data
|
||||
// system API
|
||||
searchSystem: 'api/system/search', // ajax URL - search system by name
|
||||
saveSystem: 'api/system/save', // ajax URL - saves system to map
|
||||
deleteSystem: 'api/system/delete', // ajax URL - delete system from map
|
||||
getSystemGraphData: 'api/system/graphData', // ajax URL - get all system graph data
|
||||
getConstellationData: 'api/system/constellationData', // ajax URL - get system constellation data
|
||||
setDestination: 'api/system/setDestination', // ajax URL - set destination
|
||||
searchSystem: 'api/system/search', // ajax URL - search system by name
|
||||
saveSystem: 'api/system/save', // ajax URL - saves system to map
|
||||
deleteSystem: 'api/system/delete', // ajax URL - delete system from map
|
||||
getSystemGraphData: 'api/system/graphData', // ajax URL - get all system graph data
|
||||
getConstellationData: 'api/system/constellationData', // ajax URL - get system constellation data
|
||||
setDestination: 'api/system/setDestination', // ajax URL - set destination
|
||||
// connection API
|
||||
saveConnection: 'api/connection/save', // ajax URL - save new connection to map
|
||||
deleteConnection: 'api/connection/delete', // ajax URL - delete connection from map
|
||||
saveConnection: 'api/connection/save', // ajax URL - save new connection to map
|
||||
deleteConnection: 'api/connection/delete', // ajax URL - delete connection from map
|
||||
// signature API
|
||||
getSignatures: 'api/signature/getAll', // ajax URL - get all signature data for system
|
||||
saveSignatureData: 'api/signature/save', // ajax URL - save signature data for system
|
||||
deleteSignatureData: 'api/signature/delete', // ajax URL - delete signature data for system
|
||||
getSignatures: 'api/signature/getAll', // ajax URL - get all signature data for system
|
||||
saveSignatureData: 'api/signature/save', // ajax URL - save signature data for system
|
||||
deleteSignatureData: 'api/signature/delete', // ajax URL - delete signature data for system
|
||||
// route API
|
||||
searchRoute: 'api/route/search', // ajax URL - search system routes
|
||||
searchRoute: 'api/route/search', // ajax URL - search system routes
|
||||
// stats API
|
||||
getStatisticsData: 'api/statistic/getData', // ajax URL - get statistics data (activity log)
|
||||
getStatisticsData: 'api/statistic/getData', // ajax URL - get statistics data (activity log)
|
||||
// GitHub API
|
||||
gitHubReleases: 'api/github/releases' // ajax URL - get release info from GitHub
|
||||
gitHubReleases: 'api/github/releases' // ajax URL - get release info from GitHub
|
||||
},
|
||||
url: {
|
||||
ccpImageServer: 'https://image.eveonline.com/', // CCP image Server
|
||||
zKillboard: 'https://zkillboard.com/api/' // killboard api
|
||||
ccpImageServer: 'https://image.eveonline.com/', // CCP image Server
|
||||
zKillboard: 'https://zkillboard.com/api/' // killboard api
|
||||
},
|
||||
breakpoints: [
|
||||
{ name: 'desktop', width: Infinity },
|
||||
@@ -61,13 +62,13 @@ define('app/init',['jquery'], function($) {
|
||||
{ name: 'phone', width: 480 }
|
||||
],
|
||||
animationSpeed: {
|
||||
splashOverlay: 300, // "splash" loading overlay
|
||||
headerLink: 100, // links in head bar
|
||||
mapOverlay: 200, // show/hide duration for map overlays
|
||||
mapMoveSystem: 180, // system position has changed animation
|
||||
mapDeleteSystem: 200, // remove system from map
|
||||
mapModule: 200, // show/hide of an map module
|
||||
dialogEvents: 180 // dialog events /slide/show/...
|
||||
splashOverlay: 300, // "splash" loading overlay
|
||||
headerLink: 100, // links in head bar
|
||||
mapOverlay: 200, // show/hide duration for map overlays
|
||||
mapMoveSystem: 180, // system position has changed animation
|
||||
mapDeleteSystem: 200, // remove system from map
|
||||
mapModule: 200, // show/hide of an map module
|
||||
dialogEvents: 180 // dialog events /slide/show/...
|
||||
},
|
||||
syncStatus: {
|
||||
type: 'ajax',
|
||||
@@ -77,7 +78,7 @@ define('app/init',['jquery'], function($) {
|
||||
timestamp: undefined
|
||||
},
|
||||
sharedWorker: {
|
||||
status: 'offline', // SharedWorker status
|
||||
status: 'offline', // SharedWorker status
|
||||
class: 'txt-color-danger',
|
||||
timestamp: undefined
|
||||
},
|
||||
@@ -88,12 +89,12 @@ define('app/init',['jquery'], function($) {
|
||||
}
|
||||
},
|
||||
performanceLogging: {
|
||||
keyServerMapData: 'UPDATE_SERVER_MAP', // ajax request update map data
|
||||
keyClientMapData: 'UPDATE_CLIENT_MAP', // update client map data
|
||||
keyServerUserData: 'UPDATE_SERVER_USER_DATA', // ajax request update map user data
|
||||
keyClientUserData: 'UPDATE_CLIENT_USER_DATA', // update client map user data
|
||||
keyServerMapData: 'UPDATE_SERVER_MAP', // ajax request update map data
|
||||
keyClientMapData: 'UPDATE_CLIENT_MAP', // update client map data
|
||||
keyServerUserData: 'UPDATE_SERVER_USER_DATA', // ajax request update map user data
|
||||
keyClientUserData: 'UPDATE_CLIENT_USER_DATA', // update client map user data
|
||||
},
|
||||
mapIcons: [ // map tab-icons
|
||||
mapIcons: [ // map tab-icons
|
||||
{
|
||||
class: 'fa-desktop',
|
||||
label: 'desktop',
|
||||
@@ -186,7 +187,7 @@ define('app/init',['jquery'], function($) {
|
||||
class: 'pf-system-sec-unknown'
|
||||
},
|
||||
'H': {
|
||||
class: 'pf-system-sec-highSec'
|
||||
class: 'pf-system-sec-highSec'
|
||||
},
|
||||
'L': {
|
||||
class: 'pf-system-sec-lowSec'
|
||||
@@ -258,12 +259,12 @@ define('app/init',['jquery'], function($) {
|
||||
},
|
||||
// easy-pie-charts
|
||||
pieChart: {
|
||||
class: 'pf-pie-chart', // class for all pie charts
|
||||
pieChartMapCounterClass: 'pf-pie-chart-map-timer' // class for timer chart
|
||||
class: 'pf-pie-chart', // class for all pie charts
|
||||
pieChartMapCounterClass: 'pf-pie-chart-map-timer' // class for timer chart
|
||||
}
|
||||
},
|
||||
// map scopes
|
||||
defaultMapScope: 'wh', // default scope for connection
|
||||
defaultMapScope: 'wh', // default scope for connection
|
||||
// map connection types
|
||||
connectionTypes: {
|
||||
jumpbridge: {
|
||||
@@ -400,7 +401,7 @@ define('app/init',['jquery'], function($) {
|
||||
6: 'G008 - C6',
|
||||
7: 'Q003 - 0.0',
|
||||
8: 'A009 - (shattered)'
|
||||
},
|
||||
},
|
||||
5: { // C5
|
||||
1: 'E004 - C1',
|
||||
2: 'L005 - C2',
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
|
||||
app/login.js
|
||||
----------------
|
||||
lib/jquery-3.0.0.min.js
|
||||
lib/jquery-3.1.1.min.js
|
||||
app/init.js
|
||||
app/config/system_effect.js
|
||||
app/config/signature_type.js
|
||||
@@ -40,7 +40,7 @@ lib/requirejs/text.js
|
||||
|
||||
app/mappage.js
|
||||
----------------
|
||||
lib/jquery-3.0.0.min.js
|
||||
lib/jquery-3.1.1.min.js
|
||||
app/init.js
|
||||
app/config/system_effect.js
|
||||
app/config/signature_type.js
|
||||
@@ -71,6 +71,8 @@ app/map/util.js
|
||||
app/ui/dialog/map_info.js
|
||||
app/ui/dialog/account_settings.js
|
||||
app/ui/dialog/manual.js
|
||||
app/key.js
|
||||
app/ui/dialog/shortcuts.js
|
||||
app/ui/dialog/map_settings.js
|
||||
app/ui/dialog/system_effects.js
|
||||
app/ui/dialog/jump_info.js
|
||||
@@ -110,7 +112,7 @@ app/mappage.js
|
||||
|
||||
app/setup.js
|
||||
----------------
|
||||
lib/jquery-3.0.0.min.js
|
||||
lib/jquery-3.1.1.min.js
|
||||
app/init.js
|
||||
app/config/system_effect.js
|
||||
app/config/signature_type.js
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user