Skip to content

Commit edf264e

Browse files
authored
Merge pull request #700 from exodus4d/develop
v1.4.2
2 parents 1a998a2 + 83c9303 commit edf264e

File tree

108 files changed

+2406
-1034
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2406
-1034
lines changed

app/main/controller/api/map.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,6 @@ public function initData(\Base $f3){
231231
}
232232
}
233233

234-
// Add data that should not be cached =========================================================================
235-
236-
// program mode (e.g. "maintenance") --------------------------------------------------------------------------
237-
$return->programMode = [
238-
'maintenance' => Config::getPathfinderData('login.mode_maintenance')
239-
];
240-
241234
// get SSO error messages that should be shown immediately ----------------------------------------------------
242235
// -> e.g. errors while character switch from previous HTTP requests
243236
if($f3->exists(Controller\Ccp\Sso::SESSION_KEY_SSO_ERROR, $message)){

app/main/controller/api/system.php

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use Controller;
1212
use Model;
13+
use Exception;
1314

1415
class System extends Controller\AccessController {
1516

@@ -79,24 +80,34 @@ public function save(\Base $f3){
7980
}
8081

8182
if( !is_null($systemModel) ){
82-
// set/update system custom data
83-
$systemModel->copyfrom($systemData, ['statusId', 'locked', 'rallyUpdated', 'position', 'description']);
84-
85-
if($systemModel->save($activeCharacter)){
86-
// get data from "fresh" model (e.g. some relational data has changed: "statusId")
87-
/**
88-
* @var $newSystemModel Model\SystemModel
89-
*/
90-
$newSystemModel = Model\BasicModel::getNew('SystemModel');
91-
$newSystemModel->getById( $systemModel->_id, 0);
92-
$newSystemModel->clearCacheData();
93-
$return->systemData = $newSystemModel->getData();
94-
95-
// broadcast map changes
96-
$this->broadcastMapData($newSystemModel->mapId);
97-
}else{
98-
$return->error = $systemModel->getErrors();
83+
try{
84+
// set/update system custom data
85+
$systemModel->copyfrom($systemData, ['statusId', 'locked', 'rallyUpdated', 'position', 'description']);
86+
87+
if($systemModel->save($activeCharacter)){
88+
// get data from "fresh" model (e.g. some relational data has changed: "statusId")
89+
/**
90+
* @var $newSystemModel Model\SystemModel
91+
*/
92+
$newSystemModel = Model\BasicModel::getNew('SystemModel');
93+
$newSystemModel->getById( $systemModel->_id, 0);
94+
$newSystemModel->clearCacheData();
95+
$return->systemData = $newSystemModel->getData();
96+
97+
// broadcast map changes
98+
$this->broadcastMapData($newSystemModel->mapId);
99+
}else{
100+
$return->error = $systemModel->getErrors();
101+
}
102+
}catch(Exception\ValidationException $e){
103+
$validationError = (object) [];
104+
$validationError->type = 'error';
105+
$validationError->field = $e->getField();
106+
$validationError->message = $e->getMessage();
107+
$return->error[] = $validationError;
99108
}
109+
110+
100111
}
101112
}
102113

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

278290
$return = (object) [];
279291

280292
if(
281293
!is_null($map = $activeCharacter->getMap($mapId)) &&
282-
!is_null($system = $map->getSystemById($systemId))
294+
!is_null($system = $isCcpId ? $map->getSystemByCCPId($systemId) : $map->getSystemById($systemId))
283295
){
284296
$return->system = $system->getData();
285297
$return->system->signatures = $system->getSignaturesData();

app/main/model/systemmodel.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ class SystemModel extends AbstractMapTrackingModel {
9494
'activity-log' => true
9595
],
9696
'description' => [
97-
'type' => Schema::DT_VARCHAR512,
97+
'type' => Schema::DT_TEXT,
9898
'nullable' => false,
9999
'default' => '',
100-
'activity-log' => true
100+
'activity-log' => true,
101+
'validate' => true
101102
],
102103
'posX' => [
103104
'type' => Schema::DT_INT,
@@ -262,6 +263,21 @@ protected function validate_statusId(string $key, int $val): bool {
262263
return $valid;
263264
}
264265

266+
/**
267+
* @param string $key
268+
* @param string $val
269+
* @return bool
270+
* @throws \Exception\ValidationException
271+
*/
272+
protected function validate_description(string $key, string $val): bool {
273+
$valid = true;
274+
if(mb_strlen($val) > 9000){
275+
$valid = false;
276+
$this->throwValidationException($key);
277+
}
278+
return $valid;
279+
}
280+
265281
/**
266282
* setter for system alias
267283
* @param string $alias

app/pathfinder.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[PATHFINDER]
44
NAME = Pathfinder
55
; installed version (used for CSS/JS cache busting)
6-
VERSION = v1.4.1
6+
VERSION = v1.4.2
77
; contact information [optional]
88
CONTACT = https://github.com/exodus4d
99
; public contact email [optional]

composer-dev.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"php-64bit": ">=7.0",
2424
"ext-curl": "*",
2525
"ext-json": "*",
26+
"ext-mbstring": "*",
2627
"ext-ctype": "*",
2728
"ext-zmq": ">=1.1.3",
2829
"react/zmq": "0.3.*",

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"php-64bit": ">=7.0",
2424
"ext-curl": "*",
2525
"ext-json": "*",
26+
"ext-mbstring": "*",
2627
"ext-ctype": "*",
2728
"ext-zmq": ">=1.1.3",
2829
"react/zmq": "0.3.*",

js/app.js

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,40 @@ requirejs.config({
2525
admin: './app/admin', // initial start "admin page" view
2626
notification: './app/notification', // "notification" view
2727

28-
jquery: 'lib/jquery-3.3.1.min', // v3.3.1 jQuery
29-
bootstrap: 'lib/bootstrap.min', // v3.3.0 Bootstrap js code - http://getbootstrap.com/javascript
30-
text: 'lib/requirejs/text', // v2.0.12 A RequireJS/AMD loader plugin for loading text resources.
31-
mustache: 'lib/mustache.min', // v1.0.0 Javascript template engine - http://mustache.github.io
32-
localForage: 'lib/localforage.min', // v1.4.2 localStorage library - https://mozilla.github.io/localForage
33-
velocity: 'lib/velocity.min', // v1.5.1 animation engine - http://julian.com/research/velocity
34-
velocityUI: 'lib/velocity.ui.min', // v5.2.0 plugin for velocity - http://julian.com/research/velocity/#uiPack
35-
slidebars: 'lib/slidebars', // v0.10 Slidebars - side menu plugin http://plugins.adchsm.me/slidebars
36-
jsPlumb: 'lib/dom.jsPlumb-1.7.6', // v1.7.6 jsPlumb (Vanilla)- main map draw plugin https://jsplumbtoolkit.com
37-
farahey: 'lib/farahey-0.5', // v0.5 jsPlumb "magnetizing" extension - https://github.com/jsplumb/farahey
38-
customScrollbar: 'lib/jquery.mCustomScrollbar.min', // v3.1.5 Custom scroll bars - http://manos.malihu.gr
39-
mousewheel: 'lib/jquery.mousewheel.min', // v3.1.13 Mousewheel - https://github.com/jquery/jquery-mousewheel
40-
xEditable: 'lib/bootstrap-editable.min', // v1.5.1 X-editable - in placed editing
41-
morris: 'lib/morris.min', // v0.5.1 Morris.js - graphs and charts
42-
raphael: 'lib/raphael-min', // v2.1.2 Raphaël - required for morris (dependency)
43-
bootbox: 'lib/bootbox.min', // v4.4.0 Bootbox.js - custom dialogs - http://bootboxjs.com
44-
easyPieChart: 'lib/jquery.easypiechart.min', // v2.1.6 Easy Pie Chart - HTML 5 pie charts - http://rendro.github.io/easy-pie-chart
45-
peityInlineChart: 'lib/jquery.peity.min', // v3.2.1 Inline Chart - http://benpickles.github.io/peity/
46-
dragToSelect: 'lib/jquery.dragToSelect', // v1.1 Drag to Select - http://andreaslagerkvist.com/jquery/drag-to-select
47-
hoverIntent: 'lib/jquery.hoverIntent.min', // v1.9.0 Hover intention - http://cherne.net/brian/resources/jquery.hoverIntent.html
48-
fullScreen: 'lib/jquery.fullscreen.min', // v0.6.0 Full screen mode - https://github.com/private-face/jquery.fullscreen
49-
select2: 'lib/select2.min', // v4.0.3 Drop Down customization - https://select2.github.io
50-
validator: 'lib/validator.min', // v0.10.1 Validator for Bootstrap 3 - https://github.com/1000hz/bootstrap-validator
51-
lazylinepainter: 'lib/jquery.lazylinepainter-1.5.1.min', // v1.5.1 SVG line animation plugin - http://lazylinepainter.info
52-
blueImpGallery: 'lib/blueimp-gallery', // v2.21.3 Image Gallery - https://github.com/blueimp/Gallery
53-
blueImpGalleryHelper: 'lib/blueimp-helper', // helper function for Blue Imp Gallery
54-
blueImpGalleryBootstrap: 'lib/bootstrap-image-gallery', // v3.4.2 Bootstrap extension for Blue Imp Gallery - https://blueimp.github.io/Bootstrap-Image-Gallery
55-
bootstrapConfirmation: 'lib/bootstrap-confirmation', // v1.0.5 Bootstrap extension for inline confirm dialog - https://github.com/tavicu/bs-confirmation
56-
bootstrapToggle: 'lib/bootstrap-toggle.min', // v2.2.0 Bootstrap Toggle (Checkbox) - http://www.bootstraptoggle.com
57-
lazyload: 'lib/jquery.lazyload.min', // v1.9.5 LazyLoader images - http://www.appelsiini.net/projects/lazyload
58-
sortable: 'lib/sortable.min', // v1.6.0 Sortable - drag&drop reorder - https://github.com/rubaxa/Sortable
28+
jquery: 'lib/jquery-3.3.1.min', // v3.3.1 jQuery
29+
bootstrap: 'lib/bootstrap.min', // v3.3.0 Bootstrap js code - http://getbootstrap.com/javascript
30+
text: 'lib/requirejs/text', // v2.0.12 A RequireJS/AMD loader plugin for loading text resources.
31+
mustache: 'lib/mustache.min', // v1.0.0 Javascript template engine - http://mustache.github.io
32+
localForage: 'lib/localforage.min', // v1.4.2 localStorage library - https://mozilla.github.io/localForage
33+
velocity: 'lib/velocity.min', // v1.5.1 animation engine - http://julian.com/research/velocity
34+
velocityUI: 'lib/velocity.ui.min', // v5.2.0 plugin for velocity - http://julian.com/research/velocity/#uiPack
35+
slidebars: 'lib/slidebars', // v0.10 Slidebars - side menu plugin http://plugins.adchsm.me/slidebars
36+
jsPlumb: 'lib/dom.jsPlumb-1.7.6', // v1.7.6 jsPlumb (Vanilla)- main map draw plugin https://jsplumbtoolkit.com
37+
farahey: 'lib/farahey-0.5', // v0.5 jsPlumb "magnetizing" extension - https://github.com/jsplumb/farahey
38+
customScrollbar: 'lib/jquery.mCustomScrollbar.min', // v3.1.5 Custom scroll bars - http://manos.malihu.gr
39+
mousewheel: 'lib/jquery.mousewheel.min', // v3.1.13 Mousewheel - https://github.com/jquery/jquery-mousewheel
40+
xEditable: 'lib/bootstrap-editable.min', // v1.5.1 X-editable - in placed editing
41+
morris: 'lib/morris.min', // v0.5.1 Morris.js - graphs and charts
42+
raphael: 'lib/raphael-min', // v2.1.2 Raphaël - required for morris (dependency)
43+
bootbox: 'lib/bootbox.min', // v4.4.0 Bootbox.js - custom dialogs - http://bootboxjs.com
44+
easyPieChart: 'lib/jquery.easypiechart.min', // v2.1.6 Easy Pie Chart - HTML 5 pie charts - http://rendro.github.io/easy-pie-chart
45+
peityInlineChart: 'lib/jquery.peity.min', // v3.2.1 Inline Chart - http://benpickles.github.io/peity/
46+
dragToSelect: 'lib/jquery.dragToSelect', // v1.1 Drag to Select - http://andreaslagerkvist.com/jquery/drag-to-select
47+
hoverIntent: 'lib/jquery.hoverIntent.min', // v1.9.0 Hover intention - http://cherne.net/brian/resources/jquery.hoverIntent.html
48+
fullScreen: 'lib/jquery.fullscreen.min', // v0.6.0 Full screen mode - https://github.com/private-face/jquery.fullscreen
49+
select2: 'lib/select2.min', // v4.0.3 Drop Down customization - https://select2.github.io
50+
validator: 'lib/validator.min', // v0.10.1 Validator for Bootstrap 3 - https://github.com/1000hz/bootstrap-validator
51+
lazylinepainter: 'lib/jquery.lazylinepainter-1.5.1.min', // v1.5.1 SVG line animation plugin - http://lazylinepainter.info
52+
blueImpGallery: 'lib/blueimp-gallery', // v2.21.3 Image Gallery - https://github.com/blueimp/Gallery
53+
blueImpGalleryHelper: 'lib/blueimp-helper', // helper function for Blue Imp Gallery
54+
blueImpGalleryBootstrap: 'lib/bootstrap-image-gallery', // v3.4.2 Bootstrap extension for Blue Imp Gallery - https://blueimp.github.io/Bootstrap-Image-Gallery
55+
bootstrapConfirmation: 'lib/bootstrap-confirmation', // v1.0.5 Bootstrap extension for inline confirm dialog - https://github.com/tavicu/bs-confirmation
56+
bootstrapToggle: 'lib/bootstrap-toggle.min', // v2.2.0 Bootstrap Toggle (Checkbox) - http://www.bootstraptoggle.com
57+
lazyload: 'lib/jquery.lazyload.min', // v1.9.5 LazyLoader images - http://www.appelsiini.net/projects/lazyload
58+
sortable: 'lib/sortable.min', // v1.6.0 Sortable - drag&drop reorder - https://github.com/rubaxa/Sortable
59+
60+
'summernote.loader': './app/summernote.loader', // v0.8.10 Summernote WYSIWYG editor -https://summernote.org
61+
'summernote': 'lib/summernote/summernote.min',
5962

6063
// header animation
6164
easePack: 'lib/EasePack.min',
@@ -135,44 +138,47 @@ requirejs.config({
135138
}
136139
},
137140
pnotify: {
138-
deps : ['jquery']
141+
deps: ['jquery']
139142
},
140143
easyPieChart: {
141-
deps : ['jquery']
144+
deps: ['jquery']
142145
},
143146
peityInlineChart: {
144-
deps : ['jquery']
147+
deps: ['jquery']
145148
},
146149
dragToSelect: {
147-
deps : ['jquery']
150+
deps: ['jquery']
148151
},
149152
hoverIntent: {
150-
deps : ['jquery']
153+
deps: ['jquery']
151154
},
152155
fullScreen: {
153-
deps : ['jquery']
156+
deps: ['jquery']
154157
},
155158
select2: {
156-
deps : ['jquery', 'mousewheel'],
159+
deps: ['jquery', 'mousewheel'],
157160
exports: 'Select2'
158161
},
159162
validator: {
160-
deps : ['jquery', 'bootstrap']
163+
deps: ['jquery', 'bootstrap']
161164
},
162165
lazylinepainter: {
163-
deps : ['jquery', 'bootstrap']
166+
deps: ['jquery', 'bootstrap']
164167
},
165168
blueImpGallery: {
166-
deps : ['jquery']
169+
deps: ['jquery']
167170
},
168171
bootstrapConfirmation: {
169-
deps : ['bootstrap']
172+
deps: ['bootstrap']
170173
},
171174
bootstrapToggle: {
172-
deps : ['jquery']
175+
deps: ['jquery']
173176
},
174177
lazyload: {
175-
deps : ['jquery']
178+
deps: ['jquery']
179+
},
180+
summernote: {
181+
deps: ['jquery']
176182
}
177183
}
178184
});

js/app/key.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ define([
275275
// exclude some HTML Tags from watcher
276276
if(
277277
e.target.tagName !== 'INPUT' &&
278-
e.target.tagName !== 'TEXTAREA'
278+
e.target.tagName !== 'TEXTAREA' &&
279+
!e.target.classList.contains('note-editable') // Summerstyle editor
279280
){
280281
let key = e.key.toUpperCase();
281282
map[key] = true;

0 commit comments

Comments
 (0)