Skip to content

Commit

Permalink
Merge pull request #700 from exodus4d/develop
Browse files Browse the repository at this point in the history
v1.4.2
  • Loading branch information
exodus4d authored Oct 8, 2018
2 parents 1a998a2 + 83c9303 commit edf264e
Show file tree
Hide file tree
Showing 108 changed files with 2,406 additions and 1,034 deletions.
7 changes: 0 additions & 7 deletions app/main/controller/api/map.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,6 @@ public function initData(\Base $f3){
}
}

// Add data that should not be cached =========================================================================

// program mode (e.g. "maintenance") --------------------------------------------------------------------------
$return->programMode = [
'maintenance' => Config::getPathfinderData('login.mode_maintenance')
];

// get SSO error messages that should be shown immediately ----------------------------------------------------
// -> e.g. errors while character switch from previous HTTP requests
if($f3->exists(Controller\Ccp\Sso::SESSION_KEY_SSO_ERROR, $message)){
Expand Down
48 changes: 30 additions & 18 deletions app/main/controller/api/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use Controller;
use Model;
use Exception;

class System extends Controller\AccessController {

Expand Down Expand Up @@ -79,24 +80,34 @@ public function save(\Base $f3){
}

if( !is_null($systemModel) ){
// set/update system custom data
$systemModel->copyfrom($systemData, ['statusId', 'locked', 'rallyUpdated', 'position', 'description']);

if($systemModel->save($activeCharacter)){
// get data from "fresh" model (e.g. some relational data has changed: "statusId")
/**
* @var $newSystemModel Model\SystemModel
*/
$newSystemModel = Model\BasicModel::getNew('SystemModel');
$newSystemModel->getById( $systemModel->_id, 0);
$newSystemModel->clearCacheData();
$return->systemData = $newSystemModel->getData();

// broadcast map changes
$this->broadcastMapData($newSystemModel->mapId);
}else{
$return->error = $systemModel->getErrors();
try{
// set/update system custom data
$systemModel->copyfrom($systemData, ['statusId', 'locked', 'rallyUpdated', 'position', 'description']);

if($systemModel->save($activeCharacter)){
// get data from "fresh" model (e.g. some relational data has changed: "statusId")
/**
* @var $newSystemModel Model\SystemModel
*/
$newSystemModel = Model\BasicModel::getNew('SystemModel');
$newSystemModel->getById( $systemModel->_id, 0);
$newSystemModel->clearCacheData();
$return->systemData = $newSystemModel->getData();

// broadcast map changes
$this->broadcastMapData($newSystemModel->mapId);
}else{
$return->error = $systemModel->getErrors();
}
}catch(Exception\ValidationException $e){
$validationError = (object) [];
$validationError->type = 'error';
$validationError->field = $e->getField();
$validationError->message = $e->getMessage();
$return->error[] = $validationError;
}


}
}

Expand Down Expand Up @@ -273,13 +284,14 @@ public function getData(\Base $f3){
$requestData = (array)$f3->get('POST');
$mapId = (int)$requestData['mapId'];
$systemId = (int)$requestData['systemId'];
$isCcpId = (bool)$requestData['isCcpId'];
$activeCharacter = $this->getCharacter();

$return = (object) [];

if(
!is_null($map = $activeCharacter->getMap($mapId)) &&
!is_null($system = $map->getSystemById($systemId))
!is_null($system = $isCcpId ? $map->getSystemByCCPId($systemId) : $map->getSystemById($systemId))
){
$return->system = $system->getData();
$return->system->signatures = $system->getSignaturesData();
Expand Down
20 changes: 18 additions & 2 deletions app/main/model/systemmodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ class SystemModel extends AbstractMapTrackingModel {
'activity-log' => true
],
'description' => [
'type' => Schema::DT_VARCHAR512,
'type' => Schema::DT_TEXT,
'nullable' => false,
'default' => '',
'activity-log' => true
'activity-log' => true,
'validate' => true
],
'posX' => [
'type' => Schema::DT_INT,
Expand Down Expand Up @@ -262,6 +263,21 @@ protected function validate_statusId(string $key, int $val): bool {
return $valid;
}

/**
* @param string $key
* @param string $val
* @return bool
* @throws \Exception\ValidationException
*/
protected function validate_description(string $key, string $val): bool {
$valid = true;
if(mb_strlen($val) > 9000){
$valid = false;
$this->throwValidationException($key);
}
return $valid;
}

/**
* setter for system alias
* @param string $alias
Expand Down
2 changes: 1 addition & 1 deletion app/pathfinder.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[PATHFINDER]
NAME = Pathfinder
; installed version (used for CSS/JS cache busting)
VERSION = v1.4.1
VERSION = v1.4.2
; contact information [optional]
CONTACT = https://github.com/exodus4d
; public contact email [optional]
Expand Down
1 change: 1 addition & 0 deletions composer-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"php-64bit": ">=7.0",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-ctype": "*",
"ext-zmq": ">=1.1.3",
"react/zmq": "0.3.*",
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"php-64bit": ">=7.0",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-ctype": "*",
"ext-zmq": ">=1.1.3",
"react/zmq": "0.3.*",
Expand Down
94 changes: 50 additions & 44 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,40 @@ requirejs.config({
admin: './app/admin', // initial start "admin page" view
notification: './app/notification', // "notification" view

jquery: 'lib/jquery-3.3.1.min', // v3.3.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
localForage: 'lib/localforage.min', // v1.4.2 localStorage library - https://mozilla.github.io/localForage
velocity: 'lib/velocity.min', // v1.5.1 animation engine - http://julian.com/research/velocity
velocityUI: 'lib/velocity.ui.min', // v5.2.0 plugin for velocity - http://julian.com/research/velocity/#uiPack
slidebars: 'lib/slidebars', // v0.10 Slidebars - side menu plugin http://plugins.adchsm.me/slidebars
jsPlumb: 'lib/dom.jsPlumb-1.7.6', // v1.7.6 jsPlumb (Vanilla)- main map draw plugin https://jsplumbtoolkit.com
farahey: 'lib/farahey-0.5', // v0.5 jsPlumb "magnetizing" extension - https://github.com/jsplumb/farahey
customScrollbar: 'lib/jquery.mCustomScrollbar.min', // v3.1.5 Custom scroll bars - http://manos.malihu.gr
mousewheel: 'lib/jquery.mousewheel.min', // v3.1.13 Mousewheel - https://github.com/jquery/jquery-mousewheel
xEditable: 'lib/bootstrap-editable.min', // v1.5.1 X-editable - in placed editing
morris: 'lib/morris.min', // v0.5.1 Morris.js - graphs and charts
raphael: 'lib/raphael-min', // v2.1.2 Raphaël - required for morris (dependency)
bootbox: 'lib/bootbox.min', // v4.4.0 Bootbox.js - custom dialogs - http://bootboxjs.com
easyPieChart: 'lib/jquery.easypiechart.min', // v2.1.6 Easy Pie Chart - HTML 5 pie charts - http://rendro.github.io/easy-pie-chart
peityInlineChart: 'lib/jquery.peity.min', // v3.2.1 Inline Chart - http://benpickles.github.io/peity/
dragToSelect: 'lib/jquery.dragToSelect', // v1.1 Drag to Select - http://andreaslagerkvist.com/jquery/drag-to-select
hoverIntent: 'lib/jquery.hoverIntent.min', // v1.9.0 Hover intention - http://cherne.net/brian/resources/jquery.hoverIntent.html
fullScreen: 'lib/jquery.fullscreen.min', // v0.6.0 Full screen mode - https://github.com/private-face/jquery.fullscreen
select2: 'lib/select2.min', // v4.0.3 Drop Down customization - https://select2.github.io
validator: 'lib/validator.min', // v0.10.1 Validator for Bootstrap 3 - https://github.com/1000hz/bootstrap-validator
lazylinepainter: 'lib/jquery.lazylinepainter-1.5.1.min', // v1.5.1 SVG line animation plugin - http://lazylinepainter.info
blueImpGallery: 'lib/blueimp-gallery', // v2.21.3 Image Gallery - https://github.com/blueimp/Gallery
blueImpGalleryHelper: 'lib/blueimp-helper', // helper function for Blue Imp Gallery
blueImpGalleryBootstrap: 'lib/bootstrap-image-gallery', // v3.4.2 Bootstrap extension for Blue Imp Gallery - https://blueimp.github.io/Bootstrap-Image-Gallery
bootstrapConfirmation: 'lib/bootstrap-confirmation', // v1.0.5 Bootstrap extension for inline confirm dialog - https://github.com/tavicu/bs-confirmation
bootstrapToggle: 'lib/bootstrap-toggle.min', // v2.2.0 Bootstrap Toggle (Checkbox) - http://www.bootstraptoggle.com
lazyload: 'lib/jquery.lazyload.min', // v1.9.5 LazyLoader images - http://www.appelsiini.net/projects/lazyload
sortable: 'lib/sortable.min', // v1.6.0 Sortable - drag&drop reorder - https://github.com/rubaxa/Sortable
jquery: 'lib/jquery-3.3.1.min', // v3.3.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
localForage: 'lib/localforage.min', // v1.4.2 localStorage library - https://mozilla.github.io/localForage
velocity: 'lib/velocity.min', // v1.5.1 animation engine - http://julian.com/research/velocity
velocityUI: 'lib/velocity.ui.min', // v5.2.0 plugin for velocity - http://julian.com/research/velocity/#uiPack
slidebars: 'lib/slidebars', // v0.10 Slidebars - side menu plugin http://plugins.adchsm.me/slidebars
jsPlumb: 'lib/dom.jsPlumb-1.7.6', // v1.7.6 jsPlumb (Vanilla)- main map draw plugin https://jsplumbtoolkit.com
farahey: 'lib/farahey-0.5', // v0.5 jsPlumb "magnetizing" extension - https://github.com/jsplumb/farahey
customScrollbar: 'lib/jquery.mCustomScrollbar.min', // v3.1.5 Custom scroll bars - http://manos.malihu.gr
mousewheel: 'lib/jquery.mousewheel.min', // v3.1.13 Mousewheel - https://github.com/jquery/jquery-mousewheel
xEditable: 'lib/bootstrap-editable.min', // v1.5.1 X-editable - in placed editing
morris: 'lib/morris.min', // v0.5.1 Morris.js - graphs and charts
raphael: 'lib/raphael-min', // v2.1.2 Raphaël - required for morris (dependency)
bootbox: 'lib/bootbox.min', // v4.4.0 Bootbox.js - custom dialogs - http://bootboxjs.com
easyPieChart: 'lib/jquery.easypiechart.min', // v2.1.6 Easy Pie Chart - HTML 5 pie charts - http://rendro.github.io/easy-pie-chart
peityInlineChart: 'lib/jquery.peity.min', // v3.2.1 Inline Chart - http://benpickles.github.io/peity/
dragToSelect: 'lib/jquery.dragToSelect', // v1.1 Drag to Select - http://andreaslagerkvist.com/jquery/drag-to-select
hoverIntent: 'lib/jquery.hoverIntent.min', // v1.9.0 Hover intention - http://cherne.net/brian/resources/jquery.hoverIntent.html
fullScreen: 'lib/jquery.fullscreen.min', // v0.6.0 Full screen mode - https://github.com/private-face/jquery.fullscreen
select2: 'lib/select2.min', // v4.0.3 Drop Down customization - https://select2.github.io
validator: 'lib/validator.min', // v0.10.1 Validator for Bootstrap 3 - https://github.com/1000hz/bootstrap-validator
lazylinepainter: 'lib/jquery.lazylinepainter-1.5.1.min', // v1.5.1 SVG line animation plugin - http://lazylinepainter.info
blueImpGallery: 'lib/blueimp-gallery', // v2.21.3 Image Gallery - https://github.com/blueimp/Gallery
blueImpGalleryHelper: 'lib/blueimp-helper', // helper function for Blue Imp Gallery
blueImpGalleryBootstrap: 'lib/bootstrap-image-gallery', // v3.4.2 Bootstrap extension for Blue Imp Gallery - https://blueimp.github.io/Bootstrap-Image-Gallery
bootstrapConfirmation: 'lib/bootstrap-confirmation', // v1.0.5 Bootstrap extension for inline confirm dialog - https://github.com/tavicu/bs-confirmation
bootstrapToggle: 'lib/bootstrap-toggle.min', // v2.2.0 Bootstrap Toggle (Checkbox) - http://www.bootstraptoggle.com
lazyload: 'lib/jquery.lazyload.min', // v1.9.5 LazyLoader images - http://www.appelsiini.net/projects/lazyload
sortable: 'lib/sortable.min', // v1.6.0 Sortable - drag&drop reorder - https://github.com/rubaxa/Sortable

'summernote.loader': './app/summernote.loader', // v0.8.10 Summernote WYSIWYG editor -https://summernote.org
'summernote': 'lib/summernote/summernote.min',

// header animation
easePack: 'lib/EasePack.min',
Expand Down Expand Up @@ -135,44 +138,47 @@ requirejs.config({
}
},
pnotify: {
deps : ['jquery']
deps: ['jquery']
},
easyPieChart: {
deps : ['jquery']
deps: ['jquery']
},
peityInlineChart: {
deps : ['jquery']
deps: ['jquery']
},
dragToSelect: {
deps : ['jquery']
deps: ['jquery']
},
hoverIntent: {
deps : ['jquery']
deps: ['jquery']
},
fullScreen: {
deps : ['jquery']
deps: ['jquery']
},
select2: {
deps : ['jquery', 'mousewheel'],
deps: ['jquery', 'mousewheel'],
exports: 'Select2'
},
validator: {
deps : ['jquery', 'bootstrap']
deps: ['jquery', 'bootstrap']
},
lazylinepainter: {
deps : ['jquery', 'bootstrap']
deps: ['jquery', 'bootstrap']
},
blueImpGallery: {
deps : ['jquery']
deps: ['jquery']
},
bootstrapConfirmation: {
deps : ['bootstrap']
deps: ['bootstrap']
},
bootstrapToggle: {
deps : ['jquery']
deps: ['jquery']
},
lazyload: {
deps : ['jquery']
deps: ['jquery']
},
summernote: {
deps: ['jquery']
}
}
});
Expand Down
3 changes: 2 additions & 1 deletion js/app/key.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ define([
// exclude some HTML Tags from watcher
if(
e.target.tagName !== 'INPUT' &&
e.target.tagName !== 'TEXTAREA'
e.target.tagName !== 'TEXTAREA' &&
!e.target.classList.contains('note-editable') // Summerstyle editor
){
let key = e.key.toUpperCase();
map[key] = true;
Expand Down
Loading

0 comments on commit edf264e

Please sign in to comment.