- added build files for upcoming release 1.1.5
- removed "upgrade information" from version information panel
This commit is contained in:
@@ -62,11 +62,18 @@ class GitHub extends Controller\Controller {
|
||||
$md = \Markdown::instance();
|
||||
foreach($releasesData as &$releaseData){
|
||||
if(isset($releaseData->body)){
|
||||
$body = $releaseData->body;
|
||||
|
||||
// remove "update information" from release text
|
||||
// -> keep everything until first "***" -> horizontal line
|
||||
if( ($pos = strpos($body, '***')) !== false){
|
||||
$body = substr($body, 0, $pos);
|
||||
}
|
||||
|
||||
// convert list style
|
||||
$body = str_replace(' - ', '* ', $releaseData->body );
|
||||
$body = str_replace(' - ', '* ', $body );
|
||||
|
||||
$releaseData->body = $md->convert( $body );
|
||||
$releaseData->body = $md->convert( trim($body) );
|
||||
}
|
||||
}
|
||||
$f3->set($cacheKey, $releasesData, $ttl);
|
||||
|
||||
@@ -26,8 +26,6 @@ class User extends Controller\Controller{
|
||||
|
||||
// character specific session keys
|
||||
const SESSION_KEY_CHARACTERS = 'SESSION.CHARACTERS';
|
||||
//const SESSION_KEY_CHARACTERS_PREV_SYSTEM_ID = 'SESSION.CHARACTERS.PREV_SYSTEM_ID';
|
||||
const SESSION_KEY_CHARACTERS_PREV_SYSTEM_ID = 'SESSION.TEST.PREV_SYSTEM_ID';
|
||||
|
||||
// temp login character ID (during HTTP redirects on login)
|
||||
const SESSION_KEY_TEMP_CHARACTER_ID = 'SESSION.TEMP_CHARACTER_ID';
|
||||
|
||||
@@ -1,168 +1,2 @@
|
||||
// main script path
|
||||
var mainScriptPath = document.body.getAttribute('data-script');
|
||||
|
||||
// js baseURL. Depends on the environment.
|
||||
// e.g. use raw files (develop) or build files (production)
|
||||
var jsBaseUrl = document.body.getAttribute('data-js-path');
|
||||
|
||||
// requireJs configuration
|
||||
requirejs.config({
|
||||
baseUrl: 'js', // path for baseUrl - dynamically set !below! ("build_js" | "js")
|
||||
|
||||
paths: {
|
||||
layout: 'layout',
|
||||
config: 'app/config', // path for "configuration" files dir
|
||||
dialog: 'app/ui/dialog', // path for "dialog" files dir
|
||||
templates: '../../templates', // template dir
|
||||
img: '../../img', // images dir
|
||||
|
||||
// main views
|
||||
login: './app/login', // initial start "login page" view
|
||||
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
|
||||
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.2.2 animation engine - http://julian.com/research/velocity
|
||||
velocityUI: 'lib/velocity.ui.min', // v5.0.4 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.3 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
|
||||
dragToSelect: 'lib/jquery.dragToSelect', // v1.1 Drag to Select - http://andreaslagerkvist.com/jquery/drag-to-select
|
||||
hoverIntent: 'lib/jquery.hoverIntent.minified', // v1.8.0 Hover intention - http://cherne.net/brian/resources/jquery.hoverIntent.html
|
||||
fullScreen: 'lib/jquery.fullscreen.min', // v0.5.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.1 Bootstrap extension for inline confirm dialog - https://github.com/tavicu/bs-confirmation
|
||||
bootstrapToggle: 'lib/bootstrap2-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
|
||||
|
||||
// header animation
|
||||
easePack: 'lib/EasePack.min',
|
||||
tweenLite: 'lib/TweenLite.min',
|
||||
|
||||
// datatables // v1.10.12 DataTables - https://datatables.net
|
||||
'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',
|
||||
|
||||
// notification plugin
|
||||
pnotify: 'lib/pnotify/pnotify', // v3.0.0 PNotify - notification core file - https://sciactive.com/pnotify/
|
||||
'pnotify.buttons': 'lib/pnotify/pnotify.buttons', // PNotify - buttons notification extension
|
||||
'pnotify.confirm': 'lib/pnotify/pnotify.confirm', // PNotify - confirmation notification extension
|
||||
'pnotify.nonblock': 'lib/pnotify/pnotify.nonblock', // PNotify - notification non-block extension (hover effect)
|
||||
'pnotify.desktop': 'lib/pnotify/pnotify.desktop', // PNotify - desktop push notification extension
|
||||
'pnotify.history': 'lib/pnotify/pnotify.history', // PNotify - history push notification history extension
|
||||
'pnotify.callbacks': 'lib/pnotify/pnotify.callbacks', // PNotify - callbacks push notification extension
|
||||
'pnotify.reference': 'lib/pnotify/pnotify.reference' // PNotify - reference push notification extension
|
||||
},
|
||||
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']
|
||||
},
|
||||
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']
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// switch baseUrl to js "build_js" in production environment
|
||||
// this has no effect for js build process!
|
||||
// check build.js for build configuration
|
||||
require.config({
|
||||
baseUrl: jsBaseUrl
|
||||
});
|
||||
|
||||
// load the main app module -> initial app start
|
||||
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.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",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"]},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
|
||||
1
public/js/v1.1.5/app.js.map
Normal file
1
public/js/v1.1.5/app.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["app.js.src.js"],"names":["mainScriptPath","document","body","getAttribute","jsBaseUrl","requirejs","config","baseUrl","paths","layout","dialog","templates","img","login","mappage","setup","jquery","bootstrap","text","mustache","localForage","velocity","velocityUI","slidebars","jsPlumb","farahey","customScrollbar","mousewheel","xEditable","morris","raphael","bootbox","easyPieChart","dragToSelect","hoverIntent","fullScreen","select2","validator","lazylinepainter","blueImpGallery","blueImpGalleryHelper","blueImpGalleryBootstrap","bootstrapConfirmation","bootstrapToggle","lazyload","easePack","tweenLite","datatables.net","datatables.net-buttons","datatables.net-buttons-html","datatables.net-responsive","datatables.net-select","pnotify","pnotify.buttons","pnotify.confirm","pnotify.nonblock","pnotify.desktop","pnotify.history","pnotify.callbacks","pnotify.reference","shim","deps","exports","require"],"mappings":"AACA,GAAIA,gBAAiBC,SAASC,KAAKC,aAAa,eAI5CC,UAAYH,SAASC,KAAKC,aAAa,eAG3CE,WAAUC,QACNC,QAAS,KAETC,OACIC,OAAQ,SACRH,OAAQ,aACRI,OAAQ,gBACRC,UAAW,kBACXC,IAAK,YAGLC,MAAO,cACPC,QAAS,gBACTC,MAAO,cAEPC,OAAQ,uBACRC,UAAW,oBACXC,KAAM,qBACNC,SAAU,mBACVC,YAAa,sBACbC,SAAU,mBACVC,WAAY,sBACZC,UAAW,gBACXC,QAAS,wBACTC,QAAS,kBACTC,gBAAiB,kCACjBC,WAAY,4BACZC,UAAW,6BACXC,OAAQ,iBACRC,QAAS,kBACTC,QAAS,kBACTC,aAAc,8BACdC,aAAc,0BACdC,YAAa,kCACbC,WAAY,4BACZC,QAAS,kBACTC,UAAW,oBACXC,gBAAiB,uCACjBC,eAAgB,sBAChBC,qBAAsB,qBACtBC,wBAAyB,8BACzBC,sBAAuB,6BACvBC,gBAAiB,4BACjBC,SAAU,0BAGVC,SAAU,mBACVC,UAAW,oBAGXC,iBAAkB,6DAClBC,yBAA0B,yDAC1BC,8BAA+B,oDAC/BC,4BAA6B,+DAC7BC,wBAAyB,uDAGzBC,QAAS,sBACTC,kBAAmB,8BACnBC,kBAAmB,8BACnBC,mBAAoB,+BACpBC,kBAAmB,8BACnBC,kBAAmB,8BACnBC,oBAAqB,gCACrBC,oBAAqB,iCAEzBC,MACI3C,WACI4C,MAAO,WAEXpC,SACIoC,MAAO,YAEXxC,UACIwC,MAAO,WAEXvC,YACIuC,MAAO,aAEXtC,WACIsC,MAAO,WAEXnC,iBACImC,MAAO,SAAU,eAErBd,kBACIc,MAAO,WAEXb,0BACIa,MAAO,mBAEXZ,+BACIY,MAAO,2BAEXX,6BACIW,MAAO,mBAEXV,yBACIU,MAAO,mBAEXjC,WACIiC,MAAO,cAEX9B,SACI8B,MAAO,SAAU,aACjBC,QAAS,WAEbjC,QACIgC,MAAO,SAAU,WACjBC,QAAS,UAEbV,SACIS,MAAQ,WAEZ7B,cACI6B,MAAQ,WAEZ5B,cACI4B,MAAQ,WAEZ3B,aACI2B,MAAQ,WAEZ1B,YACI0B,MAAQ,WAEZzB,SACIyB,MAAQ,UACRC,QAAS,WAEbzB,WACIwB,MAAQ,SAAU,cAEtBvB,iBACIuB,MAAQ,SAAU,cAEtBtB,gBACIsB,MAAQ,WAEZnB,uBACImB,MAAQ,cAEZlB,iBACIkB,MAAQ,WAEZjB,UACIiB,MAAQ,aAQpBE,SAAQzD,QACJC,QAASH,WAIbC,YAAYL","file":"app.js.map"}
|
||||
168
public/js/v1.1.5/app.js.src.js
Normal file
168
public/js/v1.1.5/app.js.src.js
Normal file
@@ -0,0 +1,168 @@
|
||||
// main script path
|
||||
var mainScriptPath = document.body.getAttribute('data-script');
|
||||
|
||||
// js baseURL. Depends on the environment.
|
||||
// e.g. use raw files (develop) or build files (production)
|
||||
var jsBaseUrl = document.body.getAttribute('data-js-path');
|
||||
|
||||
// requireJs configuration
|
||||
requirejs.config({
|
||||
baseUrl: 'js', // path for baseUrl - dynamically set !below! ("build_js" | "js")
|
||||
|
||||
paths: {
|
||||
layout: 'layout',
|
||||
config: 'app/config', // path for "configuration" files dir
|
||||
dialog: 'app/ui/dialog', // path for "dialog" files dir
|
||||
templates: '../../templates', // template dir
|
||||
img: '../../img', // images dir
|
||||
|
||||
// main views
|
||||
login: './app/login', // initial start "login page" view
|
||||
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
|
||||
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.2.2 animation engine - http://julian.com/research/velocity
|
||||
velocityUI: 'lib/velocity.ui.min', // v5.0.4 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.3 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
|
||||
dragToSelect: 'lib/jquery.dragToSelect', // v1.1 Drag to Select - http://andreaslagerkvist.com/jquery/drag-to-select
|
||||
hoverIntent: 'lib/jquery.hoverIntent.minified', // v1.8.0 Hover intention - http://cherne.net/brian/resources/jquery.hoverIntent.html
|
||||
fullScreen: 'lib/jquery.fullscreen.min', // v0.5.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.1 Bootstrap extension for inline confirm dialog - https://github.com/tavicu/bs-confirmation
|
||||
bootstrapToggle: 'lib/bootstrap2-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
|
||||
|
||||
// header animation
|
||||
easePack: 'lib/EasePack.min',
|
||||
tweenLite: 'lib/TweenLite.min',
|
||||
|
||||
// datatables // v1.10.12 DataTables - https://datatables.net
|
||||
'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',
|
||||
|
||||
// notification plugin
|
||||
pnotify: 'lib/pnotify/pnotify', // v3.0.0 PNotify - notification core file - https://sciactive.com/pnotify/
|
||||
'pnotify.buttons': 'lib/pnotify/pnotify.buttons', // PNotify - buttons notification extension
|
||||
'pnotify.confirm': 'lib/pnotify/pnotify.confirm', // PNotify - confirmation notification extension
|
||||
'pnotify.nonblock': 'lib/pnotify/pnotify.nonblock', // PNotify - notification non-block extension (hover effect)
|
||||
'pnotify.desktop': 'lib/pnotify/pnotify.desktop', // PNotify - desktop push notification extension
|
||||
'pnotify.history': 'lib/pnotify/pnotify.history', // PNotify - history push notification history extension
|
||||
'pnotify.callbacks': 'lib/pnotify/pnotify.callbacks', // PNotify - callbacks push notification extension
|
||||
'pnotify.reference': 'lib/pnotify/pnotify.reference' // PNotify - reference push notification extension
|
||||
},
|
||||
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']
|
||||
},
|
||||
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']
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// switch baseUrl to js "build_js" in production environment
|
||||
// this has no effect for js build process!
|
||||
// check build.js for build configuration
|
||||
require.config({
|
||||
baseUrl: jsBaseUrl
|
||||
});
|
||||
|
||||
// load the main app module -> initial app start
|
||||
requirejs( [mainScriptPath] );
|
||||
@@ -1,419 +0,0 @@
|
||||
/**
|
||||
* Created by exodus4d on 06.07.2015.
|
||||
* static signature types
|
||||
*
|
||||
* (*) marked fields are in-game verified and
|
||||
* proofed, signature names (copy & paste from scanning window)
|
||||
*/
|
||||
|
||||
define(['jquery'], function($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
// signature sources
|
||||
// http://de.sistersprobe.wikia.com/wiki/EVE_Sister_Core_Scanner_Probe_Wiki
|
||||
|
||||
|
||||
// NullSec Relic sites, which can also spawn in C1, C2, C3 wormholes
|
||||
var nullSecRelicSites = {
|
||||
10: 'Ruined Angel Crystal Quarry',
|
||||
11: 'Ruined Angel Monument Site',
|
||||
12: 'Ruined Angel Science Outpost',
|
||||
13: 'Ruined Angel Temple Site',
|
||||
14: 'Ruined Blood Raider Crystal Quarry',
|
||||
15: 'Ruined Blood Raider Monument Site',
|
||||
16: 'Ruined Blood Raider Science Outpost',
|
||||
17: 'Ruined Blood Raider Temple Site',
|
||||
18: 'Ruined Guristas Crystal Quarry',
|
||||
19: 'Ruined Guristas Monument Site',
|
||||
20: 'Ruined Guristas Science Outpost',
|
||||
21: 'Ruined Guristas Temple Site',
|
||||
22: 'Ruined Sansha Crystal Quarry',
|
||||
23: 'Ruined Sansha Monument Site',
|
||||
24: 'Ruined Sansha Science Outpost',
|
||||
25: 'Ruined Sansha Temple Site',
|
||||
26: 'Ruined Serpentis Crystal Quarry',
|
||||
27: 'Ruined Serpentis Monument Site',
|
||||
28: 'Ruined Serpentis Science Outpost',
|
||||
29: 'Ruined Serpentis Temple Site'
|
||||
};
|
||||
|
||||
// NulSec Data sites, which can also spawn in C1, C2, C3 wormholes
|
||||
var nullSecDataSites = {
|
||||
10: 'Abandoned Research Complex DA005',
|
||||
11: 'Abandoned Research Complex DA015',
|
||||
12: 'Abandoned Research Complex DC007',
|
||||
13: 'Abandoned Research Complex DC021',
|
||||
14: 'Abandoned Research Complex DC035',
|
||||
15: 'Abandoned Research Complex DG003',
|
||||
16: 'Central Angel Command Center',
|
||||
17: 'Central Angel Data Mining Site',
|
||||
18: 'Central Angel Sparking Transmitter',
|
||||
19: 'Central Angel Survey Site',
|
||||
20: 'Central Blood Raider Command Center',
|
||||
21: 'Central Blood Raider Data Mining Site',
|
||||
22: 'Central Blood Raider Sparking Transmitter',
|
||||
23: 'Central Blood Raider Survey Site',
|
||||
24: 'Central Guristas Command Center',
|
||||
25: 'Central Guristas Data Mining Center',
|
||||
26: 'Central Guristas Sparking Transmitter',
|
||||
27: 'Central Guristas Survey Site',
|
||||
28: 'Central Sansha Command Center',
|
||||
29: 'Central Sansha Data Mining Site',
|
||||
30: 'Central Sansha Sparking Transmitter',
|
||||
31: 'Central Sansha Survey Site',
|
||||
32: 'Central Serpentis Command Center',
|
||||
33: 'Central Serpentis Data Mining Site',
|
||||
34: 'Central Serpentis Sparking Transmitter',
|
||||
35: 'Central Serpentis Survey Site'
|
||||
};
|
||||
|
||||
|
||||
// signature types
|
||||
var signatureTypes = {
|
||||
1: { // system type (wh)
|
||||
1: { // C1 (area id)
|
||||
1: { // Combat
|
||||
1: 'Perimeter Ambush Point',
|
||||
2: 'Perimeter Camp',
|
||||
3: 'Phase Catalyst Node',
|
||||
4: 'The Line'
|
||||
},
|
||||
2: $.extend({}, nullSecRelicSites, { // Relic
|
||||
1: 'Forgotten Perimeter Coronation Platform', //*
|
||||
2: 'Forgotten Perimeter Power Array' //*
|
||||
}),
|
||||
3: $.extend({}, nullSecDataSites, { // Data
|
||||
1: 'Unsecured Perimeter Amplifier', //*
|
||||
2: 'Unsecured Perimeter Information Center' //*
|
||||
}),
|
||||
4: { // Gas
|
||||
1: 'Barren Perimeter Reservoir', //*
|
||||
2: 'Token Perimeter Reservoir', //*
|
||||
3: 'Minor Perimeter Reservoir', //*
|
||||
4: 'Sizeable Perimeter Reservoir', //*
|
||||
5: 'Ordinary Perimeter Reservoir' //*
|
||||
},
|
||||
5: { // Wormhole
|
||||
1: 'H121 - C1',
|
||||
2: 'C125 - C2',
|
||||
3: 'O883 - C3',
|
||||
4: 'M609 - C4',
|
||||
5: 'L614 - C5',
|
||||
6: 'S804 - C6',
|
||||
7: 'F135 - Thera'
|
||||
},
|
||||
6: { // ORE
|
||||
1: 'Ordinary Perimeter Deposit', //*
|
||||
2: 'Common Perimeter Deposit', //*
|
||||
3: 'Unexceptional Frontier Deposit', //*
|
||||
4: 'Average Frontier Deposit', //*
|
||||
5: 'Isolated Core Deposit', //*
|
||||
6: 'Uncommon Core Deposit' //*
|
||||
},
|
||||
7: { // Ghost
|
||||
|
||||
}
|
||||
},
|
||||
2: { // C2
|
||||
1: { // Combat
|
||||
1: 'Perimeter Checkpoint',
|
||||
2: 'Perimeter Hangar',
|
||||
3: 'The Ruins of Enclave Cohort 27',
|
||||
4: 'Sleeper Data Sanctuary'
|
||||
},
|
||||
2: $.extend({}, nullSecRelicSites, { // Relic
|
||||
1: 'Forgotten Perimeter Gateway', //*
|
||||
2: 'Forgotten Perimeter Habitation Coils' //*
|
||||
}),
|
||||
3: $.extend({}, nullSecDataSites, { // Data
|
||||
1: 'Unsecured Perimeter Comms Relay', //*
|
||||
2: 'Unsecured Perimeter Transponder Farm' //*
|
||||
}),
|
||||
4: { // Gas
|
||||
1: 'Barren Perimeter Reservoir', //*
|
||||
2: 'Token Perimeter Reservoir', //*
|
||||
3: 'Minor Perimeter Reservoir', //*
|
||||
4: 'Sizeable Perimeter Reservoir', //*
|
||||
5: 'Ordinary Perimeter Reservoir' //*
|
||||
},
|
||||
5: { // Wormhole
|
||||
1: 'Z647 - C1',
|
||||
2: 'D382 - C2',
|
||||
3: 'O477 - C3',
|
||||
4: 'Y683 - C4',
|
||||
5: 'N062 - C5',
|
||||
6: 'R474 - C6',
|
||||
7: 'F135 - Thera'
|
||||
},
|
||||
6: { // ORE
|
||||
1: 'Ordinary Perimeter Deposit', //*
|
||||
2: 'Common Perimeter Deposit', //*
|
||||
3: 'Unexceptional Frontier Deposit', //*
|
||||
4: 'Average Frontier Deposit', //*
|
||||
5: 'Isolated Core Deposit', //*
|
||||
6: 'Uncommon Core Deposit' //*
|
||||
},
|
||||
7: { // Ghost
|
||||
|
||||
}
|
||||
},
|
||||
3: { // C3
|
||||
1: { // Combat
|
||||
1: 'Fortification Frontier Stronghold',
|
||||
2: 'Outpost Frontier Stronghold',
|
||||
3: 'Solar Cell',
|
||||
4: 'The Oruze Construct'
|
||||
},
|
||||
2: $.extend({}, nullSecRelicSites, { // Relic
|
||||
1: 'Forgotten Frontier Quarantine Outpost', //*
|
||||
2: 'Forgotten Frontier Recursive Depot' //*
|
||||
}),
|
||||
3: $.extend({}, nullSecDataSites, { // Data
|
||||
1: 'Unsecured Frontier Database', //*
|
||||
2: 'Unsecured Frontier Receiver' //*
|
||||
}),
|
||||
4: { // Gas
|
||||
1: 'Barren Perimeter Reservoir', //*
|
||||
2: 'Token Perimeter Reservoir', //*
|
||||
3: 'Minor Perimeter Reservoir', //*
|
||||
4: 'Sizeable Perimeter Reservoir', //*
|
||||
5: 'Ordinary Perimeter Reservoir', //*
|
||||
6: 'Bountiful Frontier Reservoir', //*
|
||||
7: 'Vast Frontier Reservoir' //*
|
||||
},
|
||||
5: { // Wormhole
|
||||
1: 'V301 - C1',
|
||||
2: 'I182 - C2',
|
||||
3: 'N968 - C3',
|
||||
4: 'T405 - C4',
|
||||
5: 'N770 - C5',
|
||||
6: 'A982 - C6',
|
||||
7: 'F135 - Thera'
|
||||
},
|
||||
6: { // ORE
|
||||
1: 'Ordinary Perimeter Deposit', //*
|
||||
2: 'Common Perimeter Deposit', //*
|
||||
3: 'Unexceptional Frontier Deposit', //*
|
||||
4: 'Average Frontier Deposit', //*
|
||||
5: 'Infrequent Core Deposit', //*
|
||||
6: 'Unusual Core Deposit' //*
|
||||
},
|
||||
7: { // Ghost
|
||||
|
||||
}
|
||||
},
|
||||
4: { // C4
|
||||
1: { // Combat
|
||||
1: 'Frontier Barracks',
|
||||
2: 'Frontier Command Post',
|
||||
3: 'Integrated Terminus',
|
||||
4: 'Sleeper Information Sanctum'
|
||||
},
|
||||
2: { // Relic
|
||||
1: 'Forgotten Frontier Conversion Module',
|
||||
2: 'Forgotten Frontier Evacuation Center'
|
||||
},
|
||||
3: { // Data
|
||||
1: 'Unsecured Frontier Digital Nexus',
|
||||
2: 'Unsecured Frontier Trinary Hub'
|
||||
},
|
||||
4: { // Gas
|
||||
1: 'Barren Perimeter Reservoir', //*
|
||||
2: 'Token Perimeter Reservoir', //*
|
||||
3: 'Minor Perimeter Reservoir', //*
|
||||
4: 'Sizeable Perimeter Reservoir', //*
|
||||
5: 'Ordinary Perimeter Reservoir', //*
|
||||
6: 'Vast Frontier Reservoir' //*
|
||||
},
|
||||
5: { // Wormhole
|
||||
// no *wandering* w-space -> k-space wormholes
|
||||
// all holes are statics or K162
|
||||
},
|
||||
6: { // ORE
|
||||
1: 'Ordinary Perimeter Deposit', //*
|
||||
2: 'Common Perimeter Deposit', //*
|
||||
3: 'Unexceptional Frontier Deposit', //*
|
||||
4: 'Average Frontier Deposit', //*
|
||||
5: 'Unusual Core Deposit' //*
|
||||
},
|
||||
7: { // Ghost
|
||||
|
||||
}
|
||||
},
|
||||
5: { // C5
|
||||
1: { // Combat
|
||||
1: 'Core Garrison', //*
|
||||
2: 'Core Stronghold', //*
|
||||
3: 'Oruze Osobnyk', //*
|
||||
4: 'Quarantine Area'
|
||||
},
|
||||
2: { // Relic
|
||||
1: 'Forgotten Core Data Field',
|
||||
2: 'Forgotten Core Information Pen'
|
||||
},
|
||||
3: { // Data
|
||||
1: 'Unsecured Frontier Enclave Relay',
|
||||
2: 'Unsecured Frontier Server Bank'
|
||||
},
|
||||
4: { // Gas
|
||||
1: 'Barren Perimeter Reservoir', //*
|
||||
2: 'Minor Perimeter Reservoir', //*
|
||||
3: 'Ordinary Perimeter Reservoir', //*
|
||||
4: 'Sizeable Perimeter Reservoir', //*
|
||||
5: 'Token Perimeter Reservoir', //*
|
||||
6: 'Bountiful Frontier Reservoir', //*
|
||||
7: 'Vast Frontier Reservoir', //*
|
||||
8: 'Instrumental Core Reservoir', //*
|
||||
9: 'Vital Core Reservoir' //*
|
||||
},
|
||||
5: { // Wormhole
|
||||
1: 'D792 - HS',
|
||||
2: 'C140 - LS',
|
||||
3: 'Z142 - 0.0',
|
||||
4: 'F135 - Thera'
|
||||
},
|
||||
6: { // ORE
|
||||
1: 'Average Frontier Deposit', //*
|
||||
2: 'Unexceptional Frontier Deposit', //*
|
||||
3: 'Uncommon Core Deposit', //*
|
||||
4: 'Ordinary Perimeter Deposit', //*
|
||||
5: 'Common Perimeter Deposit', //*
|
||||
6: 'Exceptional Core Deposit', //*
|
||||
7: 'Infrequent Core Deposit', //*
|
||||
8: 'Unusual Core Deposit', //*
|
||||
9: 'Rarified Core Deposit', //*
|
||||
10: 'Isolated Core Deposit' //*
|
||||
},
|
||||
7: { // Ghost
|
||||
|
||||
}
|
||||
},
|
||||
6: { // C6
|
||||
1: { // Combat
|
||||
1: 'Core Citadel', //*
|
||||
2: 'Core Bastion', //*
|
||||
3: 'Strange Energy Readings', //*
|
||||
4: 'The Mirror' //*
|
||||
},
|
||||
2: { // Relic
|
||||
1: 'Forgotten Core Assembly Hall', //*
|
||||
2: 'Forgotten Core Circuitry Disassembler' //*
|
||||
},
|
||||
3: { // Data
|
||||
1: 'Unsecured Core Backup Array', //*
|
||||
2: 'Unsecured Core Emergence' //*
|
||||
},
|
||||
4: { // Gas
|
||||
1: 'Barren Perimeter Reservoir', //*
|
||||
2: 'Minor Perimeter Reservoir', //*
|
||||
3: 'Ordinary Perimeter Reservoir', //*
|
||||
4: 'Sizeable Perimeter Reservoir', //*
|
||||
5: 'Token Perimeter Reservoir', //*
|
||||
6: 'Bountiful Frontier Reservoir', //*
|
||||
7: 'Vast Frontier Reservoir', //*
|
||||
8: 'Instrumental Core Reservoir', //*
|
||||
9: 'Vital Core Reservoir' //*
|
||||
},
|
||||
5: { // Wormhole
|
||||
1: 'D792 - HS',
|
||||
2: 'C391 - LS',
|
||||
3: 'Z142 - 0.0',
|
||||
4: 'F135 - Thera'
|
||||
},
|
||||
6: { // ORE
|
||||
1: 'Ordinary Perimeter Deposit', //*
|
||||
2: 'Common Perimeter Deposit', //*
|
||||
3: 'Unexceptional Frontier Deposit', //*
|
||||
4: 'Average Frontier Deposit', //*
|
||||
5: 'Rarified Core Deposit' //*
|
||||
},
|
||||
7: { // Ghost
|
||||
1: 'Superior Blood Raider Covert Research Facility' //*
|
||||
}
|
||||
},
|
||||
13: { // Shattered Wormholes
|
||||
5: { // Wormhole (some of them are static)
|
||||
1: 'P060 - C1',
|
||||
2: 'Z647 - C1',
|
||||
3: 'D382 - C2',
|
||||
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'
|
||||
}
|
||||
}
|
||||
}, // system type (k-space)
|
||||
2: {
|
||||
10: { // High Sec
|
||||
5: { // Wormhole
|
||||
1: 'Z971 - C1',
|
||||
2: 'R943 - C2',
|
||||
3: 'X702 - C3',
|
||||
// no C4
|
||||
4: 'M555 - C5',
|
||||
5: 'B041 - C6',
|
||||
6: 'A641 - HS',
|
||||
7: 'R051 - LS',
|
||||
8: 'V283 - 0.0',
|
||||
9: 'T458 - Thera'
|
||||
}
|
||||
},
|
||||
11: { // Low Sec
|
||||
5: { // Wormhole
|
||||
1: 'Z971 - C1',
|
||||
2: 'R943 - C2',
|
||||
3: 'X702 - C3',
|
||||
// no C4
|
||||
4: 'N432 - C5',
|
||||
5: 'U319 - C6',
|
||||
6: 'B449 - HS',
|
||||
7: 'N944 - LS',
|
||||
8: 'S199 - 0.0',
|
||||
9: 'M164 - Thera'
|
||||
}
|
||||
},
|
||||
12: { // 0.0
|
||||
5: { // Wormhole
|
||||
1: 'Z971 - C1',
|
||||
2: 'R943 - C2',
|
||||
3: 'X702 - C3',
|
||||
// no C4
|
||||
4: 'N432 - C5',
|
||||
5: 'U319 - C6',
|
||||
6: 'B449 - HS',
|
||||
7: 'N944 - LS',
|
||||
8: 'S199 - 0.0',
|
||||
9: 'L031 - Thera'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return signatureTypes;
|
||||
});
|
||||
@@ -1,733 +0,0 @@
|
||||
/**
|
||||
* Created by exodus4d on 06.07.2015.
|
||||
* static system effects
|
||||
*/
|
||||
|
||||
|
||||
define([], function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
// system effects
|
||||
var systemEffects = {
|
||||
wh: {
|
||||
magnetar: {
|
||||
1: [
|
||||
{
|
||||
effect: 'Damage',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Missile explosion radius',
|
||||
value: '+15%'
|
||||
},{
|
||||
effect: 'Drone Tracking',
|
||||
value: '-15%'
|
||||
},{
|
||||
effect: 'Targeting Range',
|
||||
value: '-15%'
|
||||
},{
|
||||
effect: 'Tracking Speed',
|
||||
value: '-15%'
|
||||
},{
|
||||
effect: 'Target Painter Strength',
|
||||
value: '-15%'
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
effect: 'Damage',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Missile explosion radius',
|
||||
value: '+22%'
|
||||
},{
|
||||
effect: 'Drone Tracking',
|
||||
value: '-22%'
|
||||
},{
|
||||
effect: 'Targeting Range',
|
||||
value: '-22%'
|
||||
},{
|
||||
effect: 'Tracking Speed',
|
||||
value: '-22%'
|
||||
},{
|
||||
effect: 'Target Painter Strength',
|
||||
value: '-22%'
|
||||
}
|
||||
],
|
||||
3: [
|
||||
{
|
||||
effect: 'Damage',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Missile explosion radius',
|
||||
value: '+29%'
|
||||
},{
|
||||
effect: 'Drone Tracking',
|
||||
value: '-29%'
|
||||
},{
|
||||
effect: 'Targeting Range',
|
||||
value: '-29%'
|
||||
},{
|
||||
effect: 'Tracking Speed',
|
||||
value: '-29%'
|
||||
},{
|
||||
effect: 'Target Painter Strength',
|
||||
value: '-29%'
|
||||
}
|
||||
],
|
||||
4: [
|
||||
{
|
||||
effect: 'Damage',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Missile explosion radius',
|
||||
value: '+36%'
|
||||
},{
|
||||
effect: 'Drone Tracking',
|
||||
value: '-36%'
|
||||
},{
|
||||
effect: 'Targeting Range',
|
||||
value: '-36%'
|
||||
},{
|
||||
effect: 'Tracking Speed',
|
||||
value: '-36%'
|
||||
},{
|
||||
effect: 'Target Painter Strength',
|
||||
value: '-36%'
|
||||
}
|
||||
],
|
||||
5: [
|
||||
{
|
||||
effect: 'Damage',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Missile explosion radius',
|
||||
value: '+43%'
|
||||
},{
|
||||
effect: 'Drone Tracking',
|
||||
value: '-43%'
|
||||
},{
|
||||
effect: 'Targeting Range',
|
||||
value: '-43%'
|
||||
},{
|
||||
effect: 'Tracking Speed',
|
||||
value: '-43%'
|
||||
},{
|
||||
effect: 'Target Painter Strength',
|
||||
value: '-43%'
|
||||
}
|
||||
],
|
||||
6: [
|
||||
{
|
||||
effect: 'Damage',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Missile explosion radius',
|
||||
value: '+50%'
|
||||
},{
|
||||
effect: 'Drone Tracking',
|
||||
value: '-50%'
|
||||
},{
|
||||
effect: 'Targeting Range',
|
||||
value: '-50%'
|
||||
},{
|
||||
effect: 'Tracking Speed',
|
||||
value: '-50%'
|
||||
},{
|
||||
effect: 'Target Painter Strength',
|
||||
value: '-50%'
|
||||
}
|
||||
]
|
||||
},
|
||||
redGiant: {
|
||||
1: [
|
||||
{
|
||||
effect: 'Heat Damage',
|
||||
value: '+15%'
|
||||
},{
|
||||
effect: 'Overload Bonus',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Smart Bomb Range',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Smart Bomb Damage',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Bomb Damage',
|
||||
value: '+30%'
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
effect: 'Heat Damage',
|
||||
value: '+22%'
|
||||
},{
|
||||
effect: 'Overload Bonus',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Smart Bomb Range',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Smart Bomb Damage',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Bomb Damage',
|
||||
value: '+44%'
|
||||
}
|
||||
],
|
||||
3: [
|
||||
{
|
||||
effect: 'Heat Damage',
|
||||
value: '+29%'
|
||||
},{
|
||||
effect: 'Overload Bonus',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Smart Bomb Range',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Smart Bomb Damage',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Bomb Damage',
|
||||
value: '+58%'
|
||||
}
|
||||
],
|
||||
4: [
|
||||
{
|
||||
effect: 'Heat Damage',
|
||||
value: '+36%'
|
||||
},{
|
||||
effect: 'Overload Bonus',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Smart Bomb Range',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Smart Bomb Damage',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Bomb Damage',
|
||||
value: '+72%'
|
||||
}
|
||||
],
|
||||
5: [
|
||||
{
|
||||
effect: 'Heat Damage',
|
||||
value: '+43%'
|
||||
},{
|
||||
effect: 'Overload Bonus',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Smart Bomb Range',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Smart Bomb Damage',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Bomb Damage',
|
||||
value: '+86%'
|
||||
}
|
||||
],
|
||||
6: [
|
||||
{
|
||||
effect: 'Heat Damage',
|
||||
value: '+50%'
|
||||
},{
|
||||
effect: 'Overload Bonus',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Smart Bomb Range',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Smart Bomb Damage',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Bomb Damage',
|
||||
value: '+100%'
|
||||
}
|
||||
]
|
||||
},
|
||||
pulsar: {
|
||||
1: [
|
||||
{
|
||||
effect: 'Shield HP',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Armor Resists',
|
||||
value: '-15%'
|
||||
},{
|
||||
effect: 'Capacitor recharge',
|
||||
value: '-15%'
|
||||
},{
|
||||
effect: 'Signature',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'NOS / Neut Drain Amount',
|
||||
value: '+30%'
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
effect: 'Shield HP',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Armor Resists',
|
||||
value: '-22%'
|
||||
},{
|
||||
effect: 'Capacitor recharge',
|
||||
value: '-22%'
|
||||
},{
|
||||
effect: 'Signature',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'NOS / Neut Drain Amount',
|
||||
value: '+44%'
|
||||
}
|
||||
],
|
||||
3: [
|
||||
{
|
||||
effect: 'Shield HP',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Armor Resists',
|
||||
value: '-29%'
|
||||
},{
|
||||
effect: 'Capacitor recharge',
|
||||
value: '-29%'
|
||||
},{
|
||||
effect: 'Signature',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'NOS / Neut Drain Amount',
|
||||
value: '+58%'
|
||||
}
|
||||
],
|
||||
4: [
|
||||
{
|
||||
effect: 'Shield HP',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Armor Resists',
|
||||
value: '-36%'
|
||||
},{
|
||||
effect: 'Capacitor recharge',
|
||||
value: '-36%'
|
||||
},{
|
||||
effect: 'Signature',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'NOS / Neut Drain Amount',
|
||||
value: '+72%'
|
||||
}
|
||||
],
|
||||
5: [
|
||||
{
|
||||
effect: 'Shield HP',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Armor Resists',
|
||||
value: '-43%'
|
||||
},{
|
||||
effect: 'Capacitor recharge',
|
||||
value: '-43%'
|
||||
},{
|
||||
effect: 'Signature',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'NOS / Neut Drain Amount',
|
||||
value: '+86%'
|
||||
}
|
||||
],
|
||||
6: [
|
||||
{
|
||||
effect: 'Shield HP',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Armor Resists',
|
||||
value: '-50%'
|
||||
},{
|
||||
effect: 'Capacitor recharge',
|
||||
value: '-50%'
|
||||
},{
|
||||
effect: 'Signature',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'NOS / Neut Drain Amount',
|
||||
value: '+100%'
|
||||
}
|
||||
]
|
||||
},
|
||||
wolfRayet: {
|
||||
1: [
|
||||
{
|
||||
effect: 'Armor HP',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Shield Resist',
|
||||
value: '-15%'
|
||||
},{
|
||||
effect: 'Small Weapon Damage',
|
||||
value: '+60%'
|
||||
},{
|
||||
effect: 'Signature Size',
|
||||
value: '-15%'
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
effect: 'Armor HP',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Shield Resist',
|
||||
value: '-22%'
|
||||
},{
|
||||
effect: 'Small Weapon Damage',
|
||||
value: '+88%'
|
||||
},{
|
||||
effect: 'Signature Size',
|
||||
value: '-22%'
|
||||
}
|
||||
],
|
||||
3: [
|
||||
{
|
||||
effect: 'Armor HP',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Shield Resist',
|
||||
value: '-29%'
|
||||
},{
|
||||
effect: 'Small Weapon Damage',
|
||||
value: '+116%'
|
||||
},{
|
||||
effect: 'Signature Size',
|
||||
value: '-29%'
|
||||
}
|
||||
],
|
||||
4: [
|
||||
{
|
||||
effect: 'Armor HP',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Shield Resist',
|
||||
value: '-36%'
|
||||
},{
|
||||
effect: 'Small Weapon Damage',
|
||||
value: '+144%'
|
||||
},{
|
||||
effect: 'Signature Size',
|
||||
value: '-36%'
|
||||
}
|
||||
],
|
||||
5: [
|
||||
{
|
||||
effect: 'Armor HP',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Shield Resist',
|
||||
value: '-43%'
|
||||
},{
|
||||
effect: 'Small Weapon Damage',
|
||||
value: '+172%'
|
||||
},{
|
||||
effect: 'Signature Size',
|
||||
value: '-43%'
|
||||
}
|
||||
],
|
||||
6: [
|
||||
{
|
||||
effect: 'Armor HP',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Shield Resist',
|
||||
value: '-50%'
|
||||
},{
|
||||
effect: 'Small Weapon Damage',
|
||||
value: '+200%'
|
||||
},{
|
||||
effect: 'Signature Size',
|
||||
value: '-50%'
|
||||
}
|
||||
]
|
||||
},
|
||||
cataclysmic: {
|
||||
1: [
|
||||
{
|
||||
effect: 'Local armor repair amount',
|
||||
value: '-15%'
|
||||
},{
|
||||
effect: 'Local shield boost amount',
|
||||
value: '-15%'
|
||||
},{
|
||||
effect: 'Shield transfer amount',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Remote repair amount',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Capacitor capacity',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Capacitor recharge time',
|
||||
value: '+15%'
|
||||
},{
|
||||
effect: 'Remote Capacitor Transmitter amount',
|
||||
value: '-15%'
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
effect: 'Local armor repair amount',
|
||||
value: '-22%'
|
||||
},{
|
||||
effect: 'Local shield boost amount',
|
||||
value: '-22%'
|
||||
},{
|
||||
effect: 'Shield transfer amount',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Remote repair amount',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Capacitor capacity',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Capacitor recharge time',
|
||||
value: '+22%'
|
||||
},{
|
||||
effect: 'Remote Capacitor Transmitter amount',
|
||||
value: '-22%'
|
||||
}
|
||||
],
|
||||
3: [
|
||||
{
|
||||
effect: 'Local armor repair amount',
|
||||
value: '-29%'
|
||||
},{
|
||||
effect: 'Local shield boost amount',
|
||||
value: '-29%'
|
||||
},{
|
||||
effect: 'Shield transfer amount',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Remote repair amount',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Capacitor capacity',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Capacitor recharge time',
|
||||
value: '+29%'
|
||||
},{
|
||||
effect: 'Remote Capacitor Transmitter amount',
|
||||
value: '-29%'
|
||||
}
|
||||
],
|
||||
4: [
|
||||
{
|
||||
effect: 'Local armor repair amount',
|
||||
value: '-36%'
|
||||
},{
|
||||
effect: 'Local shield boost amount',
|
||||
value: '-36%'
|
||||
},{
|
||||
effect: 'Shield transfer amount',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Remote repair amount',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Capacitor capacity',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Capacitor recharge time',
|
||||
value: '+36%'
|
||||
},{
|
||||
effect: 'Remote Capacitor Transmitter amount',
|
||||
value: '-36%'
|
||||
}
|
||||
],
|
||||
5: [
|
||||
{
|
||||
effect: 'Local armor repair amount',
|
||||
value: '-43%'
|
||||
},{
|
||||
effect: 'Local shield boost amount',
|
||||
value: '-43%'
|
||||
},{
|
||||
effect: 'Shield transfer amount',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Remote repair amount',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Capacitor capacity',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Capacitor recharge time',
|
||||
value: '+43%'
|
||||
},{
|
||||
effect: 'Remote Capacitor Transmitter amount',
|
||||
value: '-43%'
|
||||
}
|
||||
],
|
||||
6: [
|
||||
{
|
||||
effect: 'Local armor repair amount',
|
||||
value: '-50%'
|
||||
},{
|
||||
effect: 'Local shield boost amount',
|
||||
value: '-50%'
|
||||
},{
|
||||
effect: 'Shield transfer amount',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Remote repair amount',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Capacitor capacity',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Capacitor recharge time',
|
||||
value: '+50%'
|
||||
},{
|
||||
effect: 'Remote Capacitor Transmitter amount',
|
||||
value: '-50%'
|
||||
}
|
||||
]
|
||||
},
|
||||
blackHole: {
|
||||
1: [
|
||||
{
|
||||
effect: 'Missile velocity',
|
||||
value: '+15%'
|
||||
},{
|
||||
effect: 'Missile Explosion Velocity',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Ship velocity',
|
||||
value: '+30%'
|
||||
},{
|
||||
effect: 'Stasis Webifier Strength',
|
||||
value: '-15%'
|
||||
},{
|
||||
effect: 'Inertia',
|
||||
value: '+15%'
|
||||
},{
|
||||
effect: 'Targeting range',
|
||||
value: '+30%'
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
effect: 'Missile velocity',
|
||||
value: '+22%'
|
||||
},{
|
||||
effect: 'Missile Explosion Velocity',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Ship velocity',
|
||||
value: '+44%'
|
||||
},{
|
||||
effect: 'Stasis Webifier Strength',
|
||||
value: '-22%'
|
||||
},{
|
||||
effect: 'Inertia',
|
||||
value: '+22%'
|
||||
},{
|
||||
effect: 'Targeting range',
|
||||
value: '+44%'
|
||||
}
|
||||
],
|
||||
3: [
|
||||
{
|
||||
effect: 'Missile velocity',
|
||||
value: '+29%'
|
||||
},{
|
||||
effect: 'Missile Explosion Velocity',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Ship velocity',
|
||||
value: '+58%'
|
||||
},{
|
||||
effect: 'Stasis Webifier Strength',
|
||||
value: '-29%'
|
||||
},{
|
||||
effect: 'Inertia',
|
||||
value: '+29%'
|
||||
},{
|
||||
effect: 'Targeting range',
|
||||
value: '+58%'
|
||||
}
|
||||
],
|
||||
4: [
|
||||
{
|
||||
effect: 'Missile velocity',
|
||||
value: '+36%'
|
||||
},{
|
||||
effect: 'Missile Explosion Velocity',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Ship velocity',
|
||||
value: '+72%'
|
||||
},{
|
||||
effect: 'Stasis Webifier Strength',
|
||||
value: '-36%'
|
||||
},{
|
||||
effect: 'Inertia',
|
||||
value: '+36%'
|
||||
},{
|
||||
effect: 'Targeting range',
|
||||
value: '+72%'
|
||||
}
|
||||
],
|
||||
5: [
|
||||
{
|
||||
effect: 'Missile velocity',
|
||||
value: '+43%'
|
||||
},{
|
||||
effect: 'Missile Explosion Velocity',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Ship velocity',
|
||||
value: '+86%'
|
||||
},{
|
||||
effect: 'Stasis Webifier Strength',
|
||||
value: '-43%'
|
||||
},{
|
||||
effect: 'Inertia',
|
||||
value: '+43%'
|
||||
},{
|
||||
effect: 'Targeting range',
|
||||
value: '+86%'
|
||||
}
|
||||
],
|
||||
6: [
|
||||
{
|
||||
effect: 'Missile velocity',
|
||||
value: '+50%'
|
||||
},{
|
||||
effect: 'Missile Explosion Velocity',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Ship velocity',
|
||||
value: '+100%'
|
||||
},{
|
||||
effect: 'Stasis Webifier Strength',
|
||||
value: '-50%'
|
||||
},{
|
||||
effect: 'Inertia',
|
||||
value: '+50%'
|
||||
},{
|
||||
effect: 'Targeting range',
|
||||
value: '+100%'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return systemEffects;
|
||||
});
|
||||
@@ -1,87 +0,0 @@
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util'
|
||||
], function($, Init, Util) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
counterDigitSmallClass: 'pf-digit-counter-small',
|
||||
counterDigitLargeClass: 'pf-digit-counter-large'
|
||||
};
|
||||
|
||||
/**
|
||||
* update element with time information
|
||||
* @param element
|
||||
* @param tempDate
|
||||
*/
|
||||
var updateDateDiff = function(element, tempDate){
|
||||
var diff = Util.getTimeDiffParts(tempDate, new Date());
|
||||
var days = diff.days;
|
||||
var hrs = diff.hours;
|
||||
var min = diff.min;
|
||||
var leftSec = diff.sec;
|
||||
var value = [];
|
||||
|
||||
if(
|
||||
days > 0 ||
|
||||
value.length > 0
|
||||
){
|
||||
value.push('<span class="' + config.counterDigitLargeClass + '">' + days + 'd' + '</span>');
|
||||
}
|
||||
if(
|
||||
hrs > 0 ||
|
||||
value.length > 0
|
||||
){
|
||||
value.push('<span class="' + config.counterDigitSmallClass + '">' + hrs + 'h' + '</span>');
|
||||
}
|
||||
if(
|
||||
min > 0 ||
|
||||
value.length > 0
|
||||
){
|
||||
value.push('<span class="' + config.counterDigitSmallClass + '">' + min + 'm' + '</span>');
|
||||
}
|
||||
|
||||
if(
|
||||
leftSec >= 0 ||
|
||||
value.length > 0
|
||||
){
|
||||
value.push('<span class="' + config.counterDigitSmallClass + '">' + leftSec + 's' + '</span>');
|
||||
}
|
||||
|
||||
element.html(value.join(' '));
|
||||
};
|
||||
|
||||
/**
|
||||
* init a live counter based on a unix timestamp
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.initTimestampCounter = function(){
|
||||
return this.each(function(){
|
||||
var element = $(this);
|
||||
var timestamp = parseInt( element.text() );
|
||||
|
||||
// do not init twice
|
||||
if(timestamp > 0){
|
||||
// mark as init
|
||||
element.attr('data-counter', 'init');
|
||||
|
||||
var date = new Date( timestamp * 1000);
|
||||
|
||||
updateDateDiff(element, date);
|
||||
|
||||
var refreshIntervalId = window.setInterval(function(){
|
||||
|
||||
// update element with current time
|
||||
if( !element.hasClass('stopCounter')){
|
||||
updateDateDiff(element, date);
|
||||
}else{
|
||||
clearInterval( element.data('interval') );
|
||||
}
|
||||
}, 500);
|
||||
|
||||
element.data('interval', refreshIntervalId);
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -1,417 +0,0 @@
|
||||
/**
|
||||
* Init
|
||||
*/
|
||||
|
||||
define(['jquery'], function($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var Config = {
|
||||
path: {
|
||||
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
|
||||
// access API
|
||||
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
|
||||
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
|
||||
// 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
|
||||
|
||||
// connection API
|
||||
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
|
||||
// route API
|
||||
searchRoute: 'api/route/search', // ajax URL - search system routes
|
||||
// GitHub API
|
||||
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
|
||||
},
|
||||
animationSpeed: {
|
||||
splashOverlay: 300, // "splash" loading overlay
|
||||
headerLink: 100, // links in head bar
|
||||
mapOverlay: 200, // show/hide duration for map overlays
|
||||
mapMoveSystem: 300, // 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/...
|
||||
},
|
||||
mapIcons: [ // map tab-icons
|
||||
{
|
||||
class: 'fa-desktop',
|
||||
label: 'desktop',
|
||||
unicode: ''
|
||||
},{
|
||||
class: 'fa-bookmark',
|
||||
label: 'bookmark',
|
||||
unicode: ''
|
||||
},{
|
||||
class: 'fa-cube',
|
||||
label: 'cube',
|
||||
unicode: ''
|
||||
},{
|
||||
class: 'fa-plane',
|
||||
label: 'plane',
|
||||
unicode: ''
|
||||
},{
|
||||
class: 'fa-globe',
|
||||
label: 'globe',
|
||||
unicode: ''
|
||||
},{
|
||||
class: 'fa-rocket',
|
||||
label: 'rocket',
|
||||
unicode: ''
|
||||
},{
|
||||
class: 'fa-life-ring',
|
||||
label: 'life ring',
|
||||
unicode: ''
|
||||
},{
|
||||
class: 'fa-heart',
|
||||
label: 'heart',
|
||||
unicode: ''
|
||||
}
|
||||
],
|
||||
|
||||
classes: {
|
||||
// log types
|
||||
logTypes: {
|
||||
info: {
|
||||
class: 'pf-log-info',
|
||||
label: 'info'
|
||||
},
|
||||
warning: {
|
||||
class: 'pf-log-warning',
|
||||
label: 'warning'
|
||||
},
|
||||
error: {
|
||||
class: 'pf-log-error',
|
||||
label: 'error'
|
||||
}
|
||||
},
|
||||
// system effects
|
||||
systemEffects: {
|
||||
|
||||
effect: {
|
||||
class: 'pf-system-effect',
|
||||
name: 'no effect'
|
||||
},
|
||||
magnetar: {
|
||||
class: 'pf-system-effect-magnetar',
|
||||
name: 'magnetar'
|
||||
},
|
||||
redGiant: {
|
||||
class: 'pf-system-effect-redgiant',
|
||||
name: 'red giant'
|
||||
},
|
||||
pulsar: {
|
||||
class: 'pf-system-effect-pulsar',
|
||||
name: 'pulsar'
|
||||
},
|
||||
wolfRayet: {
|
||||
class: 'pf-system-effect-wolfrayet',
|
||||
name: 'wolf rayet'
|
||||
},
|
||||
cataclysmic: {
|
||||
class: 'pf-system-effect-cataclysmic',
|
||||
name: 'cataclysmic'
|
||||
},
|
||||
blackHole: {
|
||||
class: 'pf-system-effect-blackhole',
|
||||
name: 'black hole'
|
||||
}
|
||||
},
|
||||
// system security
|
||||
systemSecurity: {
|
||||
security: {
|
||||
class: 'pf-system-sec'
|
||||
},
|
||||
'SH': {
|
||||
class: 'pf-system-sec-unknown'
|
||||
},
|
||||
'H': {
|
||||
class: 'pf-system-sec-highSec'
|
||||
},
|
||||
'L': {
|
||||
class: 'pf-system-sec-lowSec'
|
||||
},
|
||||
'0.0': {
|
||||
class: 'pf-system-sec-nullSec'
|
||||
},
|
||||
'C6': {
|
||||
class: 'pf-system-sec-high'
|
||||
},
|
||||
'C5': {
|
||||
class: 'pf-system-sec-high'
|
||||
},
|
||||
'C4': {
|
||||
class: 'pf-system-sec-mid'
|
||||
},
|
||||
'C3': {
|
||||
class: 'pf-system-sec-mid'
|
||||
},
|
||||
'C2': {
|
||||
class: 'pf-system-sec-low'
|
||||
},
|
||||
'C1': {
|
||||
class: 'pf-system-sec-low'
|
||||
}
|
||||
},
|
||||
// true sec
|
||||
trueSec: {
|
||||
'0.0': {
|
||||
class: 'pf-system-security-0-0'
|
||||
},
|
||||
'0.1': {
|
||||
class: 'pf-system-security-0-1'
|
||||
},
|
||||
'0.2': {
|
||||
class: 'pf-system-security-0-2'
|
||||
},
|
||||
'0.3': {
|
||||
class: 'pf-system-security-0-3'
|
||||
},
|
||||
'0.4': {
|
||||
class: 'pf-system-security-0-4'
|
||||
},
|
||||
'0.5': {
|
||||
class: 'pf-system-security-0-5'
|
||||
},
|
||||
'0.6': {
|
||||
class: 'pf-system-security-0-6'
|
||||
},
|
||||
'0.7': {
|
||||
class: 'pf-system-security-0-7'
|
||||
},
|
||||
'0.8': {
|
||||
class: 'pf-system-security-0-8'
|
||||
},
|
||||
'0.9': {
|
||||
class: 'pf-system-security-0-9'
|
||||
},
|
||||
'1.0': {
|
||||
class: 'pf-system-security-1-0'
|
||||
}
|
||||
},
|
||||
// system info
|
||||
systemInfo: {
|
||||
rally: {
|
||||
class: 'pf-system-info-rally',
|
||||
label: 'rally point'
|
||||
}
|
||||
},
|
||||
// easy-pie-charts
|
||||
pieChart: {
|
||||
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
|
||||
// map connection types
|
||||
connectionTypes: {
|
||||
jumpbridge: {
|
||||
cssClass: 'pf-map-connection-jumpbridge',
|
||||
paintStyle: {
|
||||
dashstyle: '4 2 1 2'
|
||||
}
|
||||
},
|
||||
stargate: {
|
||||
cssClass: 'pf-map-connection-stargate',
|
||||
paintStyle: {
|
||||
dashstyle: '0' // solid line
|
||||
}
|
||||
},
|
||||
wh_eol: {
|
||||
cssClass: 'pf-map-connection-wh-eol',
|
||||
paintStyle: {
|
||||
dashstyle: '0' // solid line
|
||||
}
|
||||
},
|
||||
wh_fresh: {
|
||||
cssClass: 'pf-map-connection-wh-fresh',
|
||||
paintStyle: {
|
||||
dashstyle: '0' // solid line
|
||||
}
|
||||
},
|
||||
wh_reduced: {
|
||||
cssClass: 'pf-map-connection-wh-reduced',
|
||||
paintStyle: {
|
||||
dashstyle: '0' // solid line
|
||||
}
|
||||
},
|
||||
wh_critical: {
|
||||
cssClass: 'pf-map-connection-wh-critical',
|
||||
paintStyle: {
|
||||
dashstyle: '0' // solid line
|
||||
}
|
||||
},
|
||||
frigate: {
|
||||
cssClass: 'pf-map-connection-frig',
|
||||
paintStyle: {
|
||||
dashstyle: '0.99'
|
||||
},
|
||||
overlays:[
|
||||
['Label',
|
||||
{
|
||||
label: 'frig',
|
||||
cssClass: ['pf-map-connection-overlay', 'frig'].join(' '),
|
||||
location: 0.6
|
||||
}]
|
||||
]
|
||||
},
|
||||
preserve_mass: {
|
||||
cssClass: 'pf-map-connection-preserve-mass',
|
||||
overlays:[
|
||||
['Label',
|
||||
{
|
||||
label: '<i class="fa fa-fw fa-warning"></i> save mass',
|
||||
cssClass: ['pf-map-connection-overlay', 'mass'].join(' '),
|
||||
location: 0.6
|
||||
}]
|
||||
]
|
||||
}
|
||||
},
|
||||
// signature groups
|
||||
signatureGroups: {
|
||||
1: {
|
||||
name: 'combat site', //*
|
||||
label: 'Combat'
|
||||
},
|
||||
2: {
|
||||
name: 'relic site', //*
|
||||
label: 'Relic'
|
||||
},
|
||||
3: {
|
||||
name: 'data site',
|
||||
label: 'Data'
|
||||
},
|
||||
4: {
|
||||
name: 'gas site',
|
||||
label: 'Gas'
|
||||
},
|
||||
5: {
|
||||
name: 'wormhole',
|
||||
label: 'Wormhole'
|
||||
},
|
||||
6: {
|
||||
name: 'ore site',
|
||||
label: 'Ore'
|
||||
},
|
||||
7: {
|
||||
name: 'ghost',
|
||||
label: 'Ghost'
|
||||
}
|
||||
},
|
||||
// frigate wormholes
|
||||
frigateWormholes: {
|
||||
1: { // C1
|
||||
1: 'E004 - C1',
|
||||
2: 'L005 - C2',
|
||||
3: 'Z006 - C3',
|
||||
4: 'M001 - C4',
|
||||
5: 'C008 - C5',
|
||||
6: 'G008 - C6',
|
||||
7: 'Q003 - 0.0',
|
||||
8: 'A009 - (shattered)'
|
||||
},
|
||||
2: { // C2
|
||||
1: 'E004 - C1',
|
||||
2: 'L005 - C2',
|
||||
3: 'Z006 - C3',
|
||||
4: 'M001 - C4',
|
||||
5: 'C008 - C5',
|
||||
6: 'G008 - C6',
|
||||
7: 'Q003 - 0.0',
|
||||
8: 'A009 - (shattered)'
|
||||
},
|
||||
3: { // C3
|
||||
1: 'E004 - C1',
|
||||
2: 'L005 - C2',
|
||||
3: 'Z006 - C3',
|
||||
4: 'M001 - C4',
|
||||
5: 'C008 - C5',
|
||||
6: 'G008 - C6',
|
||||
7: 'Q003 - 0.0',
|
||||
8: 'A009 - (shattered)'
|
||||
},
|
||||
4: { // C4
|
||||
1: 'E004 - C1',
|
||||
2: 'L005 - C2',
|
||||
3: 'Z006 - C3',
|
||||
4: 'M001 - C4',
|
||||
5: 'C008 - C5',
|
||||
6: 'G008 - C6',
|
||||
7: 'Q003 - 0.0',
|
||||
8: 'A009 - (shattered)'
|
||||
},
|
||||
5: { // C5
|
||||
1: 'E004 - C1',
|
||||
2: 'L005 - C2',
|
||||
3: 'Z006 - C3',
|
||||
4: 'M001 - C4',
|
||||
5: 'C008 - C5',
|
||||
6: 'G008 - C6',
|
||||
7: 'Q003 - 0.0',
|
||||
8: 'A009 - (shattered)'
|
||||
},
|
||||
6: { // C6
|
||||
1: 'E004 - C1',
|
||||
2: 'L005 - C2',
|
||||
3: 'Z006 - C3',
|
||||
4: 'M001 - C4',
|
||||
5: 'C008 - C5',
|
||||
6: 'G008 - C6',
|
||||
7: 'Q003 - 0.0',
|
||||
8: 'A009 - (shattered)'
|
||||
},
|
||||
13: { // Shattered Wormholes (some of them are static)
|
||||
1: 'E004 - C1',
|
||||
2: 'L005 - C2',
|
||||
3: 'Z006 - C3',
|
||||
4: 'M001 - C4',
|
||||
5: 'C008 - C5',
|
||||
6: 'G008 - C6',
|
||||
7: 'Q003 - 0.0',
|
||||
8: 'A009 - (shattered)'
|
||||
}
|
||||
},
|
||||
// incoming wormholes
|
||||
incomingWormholes: {
|
||||
1: 'K162 - C1/2/3 (unknown)',
|
||||
2: 'K162 - C4/5 (dangerous)',
|
||||
3: 'K162 - C6 (deadly)',
|
||||
4: 'K162 - HS',
|
||||
5: 'K162 - LS',
|
||||
6: 'K162 - 0.0',
|
||||
7: 'K162 - Thera'
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return Config;
|
||||
});
|
||||
@@ -1,504 +0,0 @@
|
||||
/**
|
||||
* logging
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'bootbox'
|
||||
], function($, Init, Util, bootbox) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var logData = []; // cache object for all log entries
|
||||
var logDataTable = null; // "Datatables" Object
|
||||
|
||||
// Morris charts data
|
||||
var maxGraphDataCount = 30; // max date entries for a graph
|
||||
var chartData = {}; // chart Data object for all Morris Log graphs
|
||||
|
||||
var config = {
|
||||
dialogDynamicAreaClass: 'pf-dynamic-area', // class for dynamic areas
|
||||
logGraphClass: 'pf-log-graph', // class for all log Morris graphs
|
||||
tableToolsClass: 'pf-table-tools' // class for table tools
|
||||
};
|
||||
|
||||
/**
|
||||
* get log time string
|
||||
* @returns {string}
|
||||
*/
|
||||
var getLogTime = function(){
|
||||
|
||||
var serverTime = Util.getServerTime();
|
||||
|
||||
var logTime = serverTime.toLocaleTimeString('en-US', { hour12: false });
|
||||
|
||||
return logTime;
|
||||
};
|
||||
|
||||
/**
|
||||
* shows the logging dialog
|
||||
*/
|
||||
var showDialog = function(){
|
||||
|
||||
// dialog content
|
||||
|
||||
var content = $('<div>');
|
||||
|
||||
// content row for log graphs
|
||||
var rowElementGraphs = $('<div>', {
|
||||
class: 'row'
|
||||
});
|
||||
|
||||
content.append(rowElementGraphs);
|
||||
|
||||
|
||||
|
||||
var tableHeadline = $('<h4>', {
|
||||
text: ' Processes'
|
||||
}).prepend( $('<i>', {
|
||||
class: ['fa', 'fa-fw', 'fa-lg', 'fa-list-alt'].join(' ')
|
||||
}));
|
||||
|
||||
// add content Structure to dome before table initialization
|
||||
content.append(tableHeadline);
|
||||
|
||||
// log table area --------------------------------------------------
|
||||
var logTableArea = $('<div>', {
|
||||
class: config.dialogDynamicAreaClass
|
||||
});
|
||||
|
||||
var logTableActionBar = $('<div>', {
|
||||
class: config.tableToolsClass
|
||||
});
|
||||
logTableArea.append(logTableActionBar);
|
||||
|
||||
var logTable = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border'].join(' ')
|
||||
});
|
||||
logTableArea.append(logTable);
|
||||
|
||||
content.append(logTableArea);
|
||||
|
||||
// init log table
|
||||
logDataTable = logTable.DataTable({
|
||||
paging: true,
|
||||
ordering: true,
|
||||
order: [ 1, 'desc' ],
|
||||
autoWidth: false,
|
||||
hover: false,
|
||||
pageLength: 15,
|
||||
lengthMenu: [[10, 15, 25, 50, 50], [10, 15, 25, 50, 50]],
|
||||
data: logData, // load cached logs (if available)
|
||||
language: {
|
||||
emptyTable: 'No entries',
|
||||
zeroRecords: 'No entries found',
|
||||
lengthMenu: 'Show _MENU_ entries',
|
||||
info: 'Showing _START_ to _END_ of _TOTAL_ entries'
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 0,
|
||||
title: '<i class="fa fa-lg fa-tag"></i>',
|
||||
width: '18px',
|
||||
searchable: false,
|
||||
class: ['text-center'].join(' '),
|
||||
data: 'status'
|
||||
},{
|
||||
targets: 1,
|
||||
title: '<i class="fa fa-lg fa-fw fa-clock-o"></i> ',
|
||||
width: '50px',
|
||||
searchable: true,
|
||||
class: 'text-right',
|
||||
data: 'time'
|
||||
},{
|
||||
targets: 2,
|
||||
title: '<i class="fa fa-lg fa-fw fa-history"></i> ',
|
||||
width: '35px',
|
||||
searchable: false,
|
||||
class: 'text-right',
|
||||
sType: 'html',
|
||||
data: 'duration'
|
||||
},{
|
||||
targets: 3,
|
||||
title: 'description',
|
||||
searchable: true,
|
||||
data: 'description'
|
||||
},{
|
||||
targets: 4,
|
||||
title: 'type',
|
||||
width: '40px',
|
||||
searchable: true,
|
||||
class: ['text-center'].join(' '),
|
||||
data: 'type'
|
||||
},{
|
||||
targets: 5,
|
||||
title: 'Prozess-ID ',
|
||||
width: '80px',
|
||||
searchable: false,
|
||||
class: 'text-right',
|
||||
data: 'key'
|
||||
}
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
// open dialog
|
||||
var logDialog = bootbox.dialog({
|
||||
title: 'Task-Manager',
|
||||
message: content,
|
||||
size: 'large',
|
||||
buttons: {
|
||||
close: {
|
||||
label: 'close',
|
||||
className: 'btn-default'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// modal dialog is shown
|
||||
logDialog.on('shown.bs.modal', function(e) {
|
||||
|
||||
// show Morris graphs ----------------------------------------------------------
|
||||
|
||||
// function for chart label formation
|
||||
var labelYFormat = function(y){
|
||||
return Math.round(y) + 'ms';
|
||||
};
|
||||
|
||||
for(var key in chartData) {
|
||||
if(chartData.hasOwnProperty(key)) {
|
||||
// create a chart for each key
|
||||
|
||||
var colElementGraph = $('<div>', {
|
||||
class: ['col-md-6'].join(' ')
|
||||
});
|
||||
|
||||
|
||||
// graph element
|
||||
var graphElement = $('<div>', {
|
||||
class: config.logGraphClass
|
||||
});
|
||||
|
||||
var graphArea = $('<div>', {
|
||||
class: config.dialogDynamicAreaClass
|
||||
}).append( graphElement );
|
||||
|
||||
// headline
|
||||
var headline = $('<h4>', {
|
||||
text: key
|
||||
}).prepend(
|
||||
$('<span>', {
|
||||
class: ['txt-color', 'txt-color-grayLight'].join(' '),
|
||||
text: 'Prozess-ID: '
|
||||
})
|
||||
);
|
||||
|
||||
// show update ping between function calls
|
||||
var updateElement = $('<small>', {
|
||||
class: ['txt-color', 'txt-color-blue', 'pull-right'].join(' ')
|
||||
});
|
||||
headline.append(updateElement).append('<br>');
|
||||
|
||||
// show average execution time
|
||||
var averageElement = $('<small>', {
|
||||
class: 'pull-right'
|
||||
});
|
||||
headline.append(averageElement);
|
||||
|
||||
colElementGraph.append( headline );
|
||||
colElementGraph.append( graphArea );
|
||||
|
||||
graphArea.showLoadingAnimation();
|
||||
|
||||
rowElementGraphs.append( colElementGraph );
|
||||
|
||||
// cache DOM Elements that will be updated frequently
|
||||
chartData[key].averageElement = averageElement;
|
||||
chartData[key].updateElement = updateElement;
|
||||
|
||||
chartData[key].graph = Morris.Area({
|
||||
element: graphElement,
|
||||
data: [],
|
||||
xkey: 'x',
|
||||
ykeys: ['y'],
|
||||
labels: [key],
|
||||
units: 'ms',
|
||||
parseTime: false,
|
||||
ymin: 0,
|
||||
yLabelFormat: labelYFormat,
|
||||
padding: 10,
|
||||
hideHover: true,
|
||||
pointSize: 3,
|
||||
lineColors: ['#375959'],
|
||||
pointFillColors: ['#477372'],
|
||||
pointStrokeColors: ['#313335'],
|
||||
lineWidth: 2,
|
||||
grid: false,
|
||||
gridStrokeWidth: 0.3,
|
||||
gridTextSize: 9,
|
||||
gridTextFamily: 'Oxygen Bold',
|
||||
gridTextColor: '#63676a',
|
||||
behaveLikeLine: true,
|
||||
goals: [],
|
||||
goalLineColors: ['#66c84f'],
|
||||
smooth: false,
|
||||
fillOpacity: 0.3,
|
||||
resize: true
|
||||
});
|
||||
|
||||
graphArea.hideLoadingAnimation();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// add dataTable buttons (extension)
|
||||
|
||||
var buttons = new $.fn.dataTable.Buttons( logDataTable, {
|
||||
buttons: [
|
||||
{
|
||||
extend: 'copy',
|
||||
className: 'btn btn-sm btn-default',
|
||||
text: '<i class="fa fa-fw fa-clipboard"></i> copy'
|
||||
},{
|
||||
extend: 'csv',
|
||||
className: 'btn btn-sm btn-default',
|
||||
text: '<i class="fa fa-fw fa-download"></i> csv'
|
||||
}
|
||||
]
|
||||
} );
|
||||
|
||||
logDataTable.buttons().container().appendTo( $(this).find('.' + config.tableToolsClass));
|
||||
});
|
||||
|
||||
|
||||
// modal dialog is closed
|
||||
logDialog.on('hidden.bs.modal', function(e) {
|
||||
// clear memory -> destroy all charts
|
||||
for (var key in chartData) {
|
||||
if (chartData.hasOwnProperty(key)) {
|
||||
chartData[key].graph = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// modal dialog before hide
|
||||
logDialog.on('hide.bs.modal', function(e) {
|
||||
|
||||
// destroy logTable
|
||||
logDataTable.destroy(true);
|
||||
logDataTable= null;
|
||||
|
||||
// remove event -> prevent calling this multiple times
|
||||
$(this).off('hide.bs.modal');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* updates the log graph for a log key
|
||||
* @param key
|
||||
* @param duration
|
||||
*/
|
||||
var updateLogGraph = function(key, duration){
|
||||
|
||||
// check if graph data already exist
|
||||
if( !(chartData.hasOwnProperty(key))){
|
||||
chartData[key] = {};
|
||||
chartData[key].data = [];
|
||||
chartData[key].graph = null;
|
||||
chartData[key].averageElement = null;
|
||||
chartData[key].updateElement = null;
|
||||
}
|
||||
|
||||
// add new value
|
||||
chartData[key].data.unshift(duration);
|
||||
|
||||
if(chartData[key].data.length > maxGraphDataCount){
|
||||
chartData[key].data = chartData[key].data.slice(0, maxGraphDataCount);
|
||||
}
|
||||
|
||||
function getGraphData(data) {
|
||||
var tempChartData = {
|
||||
data: [],
|
||||
dataSum: 0,
|
||||
average: 0
|
||||
};
|
||||
|
||||
for(var x = 0; x < maxGraphDataCount; x++){
|
||||
var value = 0;
|
||||
if(data[x]){
|
||||
value = data[x];
|
||||
tempChartData.dataSum = Number( (tempChartData.dataSum + value).toFixed(2) );
|
||||
}
|
||||
|
||||
tempChartData.data.push({
|
||||
x: x,
|
||||
y: value
|
||||
});
|
||||
}
|
||||
|
||||
// calculate average
|
||||
tempChartData.average = Number( ( tempChartData.dataSum / data.length ).toFixed(2) );
|
||||
|
||||
return tempChartData;
|
||||
}
|
||||
|
||||
var tempChartData = getGraphData(chartData[key].data);
|
||||
|
||||
// add new data to graph (Morris chart) - if is already initialized
|
||||
if(chartData[key].graph !== null){
|
||||
var avgElement = chartData[key].averageElement;
|
||||
var updateElement = chartData[key].updateElement;
|
||||
|
||||
var delay = Util.getCurrentTriggerDelay( key, 0 );
|
||||
|
||||
if(delay){
|
||||
updateElement[0].textContent = ' delay: ' + delay + 'ms ';
|
||||
}
|
||||
|
||||
// set/change average line
|
||||
chartData[key].graph.options.goals = [tempChartData.average];
|
||||
|
||||
// change avg. display
|
||||
avgElement[0].textContent = 'Avg. ' + tempChartData.average + 'ms';
|
||||
|
||||
var avgStatus = getLogStatusByDuration(key, tempChartData.average);
|
||||
var avgStatusClass = Util.getLogInfo( avgStatus, 'class' );
|
||||
|
||||
//change avg. display class
|
||||
if( !avgElement.hasClass(avgStatusClass) ){
|
||||
// avg status changed!
|
||||
avgElement.removeClass().addClass('pull-right txt-color ' + avgStatusClass);
|
||||
|
||||
// change goals line color
|
||||
if(avgStatus === 'warning'){
|
||||
chartData[key].graph.options.goalLineColors = ['#e28a0d'];
|
||||
$(document).setProgramStatus('problem');
|
||||
}else{
|
||||
chartData[key].graph.options.goalLineColors = ['#5cb85c'];
|
||||
}
|
||||
}
|
||||
|
||||
// set new data and redraw
|
||||
chartData[key].graph.setData( tempChartData.data );
|
||||
}
|
||||
|
||||
return tempChartData.data;
|
||||
};
|
||||
|
||||
/**
|
||||
* get the log "status" by log duration (ms).
|
||||
* If duration > warning limit -> show as warning
|
||||
* @param logKey
|
||||
* @param logDuration
|
||||
* @returns {string}
|
||||
*/
|
||||
var getLogStatusByDuration = function(logKey, logDuration){
|
||||
|
||||
var logStatus = 'info';
|
||||
if( logDuration > Init.timer[logKey].EXECUTION_LIMIT ){
|
||||
logStatus = 'warning';
|
||||
}
|
||||
return logStatus;
|
||||
};
|
||||
|
||||
/**
|
||||
* get the css class for a specific log type
|
||||
* @param logType
|
||||
* @returns {string}
|
||||
*/
|
||||
var getLogTypeIconClass = function(logType){
|
||||
|
||||
var logIconClass = '';
|
||||
|
||||
switch(logType){
|
||||
case 'client':
|
||||
logIconClass = 'fa-user';
|
||||
break;
|
||||
case 'server':
|
||||
logIconClass = 'fa-download';
|
||||
break;
|
||||
}
|
||||
|
||||
return logIconClass;
|
||||
};
|
||||
|
||||
/**
|
||||
* init logging -> set global log event
|
||||
*/
|
||||
var init = function(){
|
||||
|
||||
var maxEntries = 150;
|
||||
|
||||
// set global logging listener
|
||||
$(window).on('pf:log', function(e, logKey, options){
|
||||
|
||||
// check required logging information
|
||||
if(
|
||||
options &&
|
||||
options.duration &&
|
||||
options.description
|
||||
){
|
||||
var logDescription = options.description;
|
||||
var logDuration = options.duration;
|
||||
var logType = options.type;
|
||||
|
||||
// check log status by duration
|
||||
var logStatus = getLogStatusByDuration(logKey, logDuration);
|
||||
|
||||
var statusClass = Util.getLogInfo( logStatus, 'class' );
|
||||
|
||||
var typeIconClass = getLogTypeIconClass(logType);
|
||||
|
||||
// update graph data
|
||||
updateLogGraph(logKey, logDuration);
|
||||
|
||||
var logRowData = {
|
||||
status: '<i class="fa fa-fw fa-circle txt-color ' + statusClass + '"></i>',
|
||||
time: getLogTime(),
|
||||
duration: '<span class="txt-color ' + statusClass + '">' + logDuration + '<small>ms</small></span>',
|
||||
description: logDescription,
|
||||
type: '<i class="fa ' + typeIconClass + '"></i>',
|
||||
key: logKey
|
||||
};
|
||||
|
||||
|
||||
if(logDataTable){
|
||||
// add row if dataTable is initialized before new log
|
||||
logDataTable.row.add( logRowData ).draw(false);
|
||||
}else{
|
||||
// add row data to cache
|
||||
logData.push(logRowData);
|
||||
}
|
||||
}
|
||||
|
||||
// delete old log entries from table ---------------------------------
|
||||
var rowCount = logData.length;
|
||||
|
||||
if( rowCount >= maxEntries ){
|
||||
|
||||
if(logDataTable){
|
||||
logDataTable.rows(0, {order:'index'}).remove().draw(false);
|
||||
}else{
|
||||
logData.shift();
|
||||
}
|
||||
}
|
||||
|
||||
// cache logs in order to keep previous logs in table after reopening the dialog
|
||||
if(logDataTable){
|
||||
logData = logDataTable.rows({order:'index'}).data();
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
init: init,
|
||||
getLogTime: getLogTime,
|
||||
showDialog: showDialog
|
||||
};
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
1
public/js/v1.1.5/app/login.js.map
Normal file
1
public/js/v1.1.5/app/login.js.map
Normal file
File diff suppressed because one or more lines are too long
@@ -1,110 +0,0 @@
|
||||
/**
|
||||
* context menu
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery'
|
||||
], function($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
$.fn.contextMenu = function (settings) {
|
||||
|
||||
// animation
|
||||
var animationInType = 'transition.flipXIn';
|
||||
var animationInDuration = 150;
|
||||
var animationOutType = 'transition.flipXOut';
|
||||
var animationOutDuration = 150;
|
||||
|
||||
return this.each(function () {
|
||||
|
||||
// Open context menu
|
||||
$(this).off('pf:openContextMenu').on('pf:openContextMenu', function (e, originalEvent, component, hiddenOptions, activeOptions) {
|
||||
|
||||
// hide all other open context menus
|
||||
$('#pf-dialog-wrapper > .dropdown-menu').hide();
|
||||
|
||||
var contextMenu = $(settings.menuSelector);
|
||||
|
||||
var menuLiElements = contextMenu.find('li');
|
||||
|
||||
// show all menu entries
|
||||
menuLiElements.show();
|
||||
|
||||
// disable specific menu entries
|
||||
for(var i = 0; i < hiddenOptions.length; i++){
|
||||
contextMenu.find('li[data-action="' + hiddenOptions[i] + '"]').hide();
|
||||
}
|
||||
|
||||
// deactivate all menu entries
|
||||
menuLiElements.removeClass('active');
|
||||
|
||||
//set active specific menu entries
|
||||
for(var j = 0; j < activeOptions.length; j++){
|
||||
contextMenu.find('li[data-action="' + activeOptions[j] + '"]').addClass('active');
|
||||
}
|
||||
|
||||
//open menu
|
||||
contextMenu.css({
|
||||
position: 'absolute',
|
||||
left: getLeftLocation(originalEvent),
|
||||
top: getTopLocation(originalEvent)
|
||||
}).velocity(animationInType, {
|
||||
duration: animationInDuration,
|
||||
complete: function(){
|
||||
// set context menu "click" observer
|
||||
$(this).off('click').one('click', {component: component, position:{x: originalEvent.offsetX, y: originalEvent.offsetY}}, function (e) {
|
||||
// hide contextmenu
|
||||
$(this).hide();
|
||||
|
||||
var params = {
|
||||
selectedMenu: $(e.target),
|
||||
component: e.data.component,
|
||||
position: e.data.position
|
||||
};
|
||||
|
||||
settings.menuSelected.call(this, params);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//make sure menu closes on any click
|
||||
$(document).one('click.closeContextmenu', function () {
|
||||
$('.dropdown-menu[role="menu"]').velocity(animationOutType, {
|
||||
duration: animationOutDuration
|
||||
});
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function getLeftLocation(e) {
|
||||
var mouseWidth = e.pageX;
|
||||
var pageWidth = $(window).width();
|
||||
var menuWidth = $(settings.menuSelector).width();
|
||||
|
||||
// opening menu would pass the side of the page
|
||||
if (mouseWidth + menuWidth > pageWidth &&
|
||||
menuWidth < mouseWidth) {
|
||||
return mouseWidth - menuWidth;
|
||||
}
|
||||
return mouseWidth;
|
||||
}
|
||||
|
||||
function getTopLocation(e) {
|
||||
var mouseHeight = e.pageY;
|
||||
var pageHeight = $(window).height();
|
||||
var menuHeight = $(settings.menuSelector).height();
|
||||
|
||||
// opening menu would pass the bottom of the page
|
||||
if (mouseHeight + menuHeight > pageHeight &&
|
||||
menuHeight < mouseHeight) {
|
||||
return mouseHeight - menuHeight;
|
||||
}
|
||||
return mouseHeight;
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
@@ -1,180 +0,0 @@
|
||||
/**
|
||||
* Map "magnetizing" feature
|
||||
* jsPlumb extension used: http://morrisonpitt.com/farahey/
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/map/util',
|
||||
'farahey'
|
||||
], function($, MapUtil) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Cached current "Magnetizer" object
|
||||
* @type {Magnetizer}
|
||||
*/
|
||||
var 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();
|
||||
|
||||
/**
|
||||
* helper function
|
||||
* get current system offset
|
||||
* @param system
|
||||
* @returns {{left, top}}
|
||||
* @private
|
||||
*/
|
||||
var _offset = function(system) {
|
||||
|
||||
var _ = function(p) {
|
||||
var v = system.style[p];
|
||||
return parseInt(v.substring(0, v.length - 2));
|
||||
};
|
||||
|
||||
return {
|
||||
left:_('left'),
|
||||
top:_('top')
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* helper function
|
||||
* set new system offset
|
||||
* @param system
|
||||
* @param o
|
||||
* @private
|
||||
*/
|
||||
var _setOffset = function(system, o) {
|
||||
var markAsUpdated = false;
|
||||
|
||||
// new position must be within parent container
|
||||
// no negative offset!
|
||||
if(
|
||||
o.left >= 0 &&
|
||||
o.left <= 2300
|
||||
){
|
||||
markAsUpdated = true;
|
||||
system.style.left = o.left + 'px';
|
||||
}
|
||||
|
||||
if(
|
||||
o.top >= 0 &&
|
||||
o.top <= 498
|
||||
){
|
||||
markAsUpdated = true;
|
||||
system.style.top = o.top + 'px';
|
||||
}
|
||||
|
||||
if(markAsUpdated === true){
|
||||
$(system).markAsChanged();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* helper function
|
||||
* exclude current dragged element(s) from position update
|
||||
* @param id
|
||||
* @returns {boolean}
|
||||
* @private
|
||||
*/
|
||||
var _dragFilter = function(id) {
|
||||
return !$('#' + id).is('.jsPlumb_dragged, .pf-system-locked');
|
||||
};
|
||||
|
||||
var gridConstrain = function(gridX, gridY) {
|
||||
return function(id, current, delta) {
|
||||
if( mapContainer.hasClass(MapUtil.config.mapGridClass) ){
|
||||
// active grid
|
||||
return {
|
||||
left:(gridX * Math.floor( (current[0] + delta.left) / gridX )) - current[0],
|
||||
top:(gridY * Math.floor( (current[1] + delta.top) / gridY )) - current[1]
|
||||
};
|
||||
}else{
|
||||
// no grid
|
||||
return delta;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// main init for "magnetize" feature ------------------------------------------------------
|
||||
m8 = new Magnetizer({
|
||||
container: mapContainer,
|
||||
getContainerPosition: function(c) {
|
||||
return c.offset();
|
||||
},
|
||||
getPosition:_offset,
|
||||
getSize: function(system) {
|
||||
return [ $(system).outerWidth(), $(system).outerHeight() ];
|
||||
},
|
||||
getId : function(system) {
|
||||
return $(system).attr('id');
|
||||
},
|
||||
setPosition:_setOffset,
|
||||
elements: systems,
|
||||
filter: _dragFilter,
|
||||
padding: [6, 6],
|
||||
constrain: gridConstrain(MapUtil.config.mapSnapToGridDimension, MapUtil.config.mapSnapToGridDimension)
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.destroyMagnetizer = function(){
|
||||
var mapContainer = this;
|
||||
|
||||
// remove cached "magnetizer" instance
|
||||
m8 = null;
|
||||
};
|
||||
|
||||
/**
|
||||
* update system positions for "all" systems that are effected by drag&drop
|
||||
* @param map
|
||||
* @param e
|
||||
*/
|
||||
var executeAtEvent = function(map, e){
|
||||
if(m8 !== null && e ){
|
||||
m8.executeAtEvent(e);
|
||||
map.repaintEverything();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* rearrange all systems of a map
|
||||
* needs "magnetization" to be active
|
||||
* @param map
|
||||
*/
|
||||
var executeAtCenter = function(map){
|
||||
if(m8 !== null){
|
||||
m8.executeAtCenter();
|
||||
map.repaintEverything();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* set/update elements for "magnetization"
|
||||
* -> (e.g. new systems was added)
|
||||
* @param map
|
||||
*/
|
||||
var setElements = function(map){
|
||||
if(m8 !== null){
|
||||
var mapContainer = $(map.getContainer());
|
||||
var systems = mapContainer.getSystems();
|
||||
m8.setElements(systems);
|
||||
|
||||
// re-arrange systems
|
||||
executeAtCenter(map);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
executeAtCenter: executeAtCenter,
|
||||
executeAtEvent: executeAtEvent,
|
||||
setElements: setElements
|
||||
};
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,406 +0,0 @@
|
||||
/**
|
||||
* map overlay functions
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util'
|
||||
], function($, Init, Util) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
logTimerCount: 3, // map log timer in seconds
|
||||
|
||||
// map
|
||||
mapClass: 'pf-map', // class for all maps
|
||||
mapWrapperClass: 'pf-map-wrapper', // wrapper div (scrollable)
|
||||
|
||||
// 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
|
||||
|
||||
// connection
|
||||
connectionOverlayEolId: 'overlayEol' // connection overlay ID (jsPlumb)
|
||||
};
|
||||
|
||||
/**
|
||||
* Overlay options (all available map options shown in overlay)
|
||||
* "active": (active || hover) indicated whether an icon/option
|
||||
* is marked as "active".
|
||||
* "active": Makes icon active when visible
|
||||
* "hover": Make icon active on hover
|
||||
*/
|
||||
var options = {
|
||||
filter: {
|
||||
title: 'active filter',
|
||||
trigger: 'active',
|
||||
class: 'pf-map-overlay-filter',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-filter']
|
||||
},
|
||||
mapSnapToGrid: {
|
||||
title: 'active grid',
|
||||
trigger: 'active',
|
||||
class: 'pf-map-overlay-grid',
|
||||
iconClass: ['glyphicon', 'glyphicon-th']
|
||||
},
|
||||
mapMagnetizer: {
|
||||
title: 'active magnetizer',
|
||||
trigger: 'active',
|
||||
class: 'pf-map-overlay-magnetizer',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-magnet']
|
||||
},
|
||||
systemRegion: {
|
||||
title: 'show regions',
|
||||
trigger: 'hover',
|
||||
class: 'pf-map-overlay-region',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-tags'],
|
||||
hoverIntent: {
|
||||
over: function(e){
|
||||
var mapElement = getMapFromOverlay(this);
|
||||
mapElement.find('.' + config.systemHeadClass).each(function(){
|
||||
var system = $(this);
|
||||
// init tooltip if not already exists
|
||||
if ( !system.data('bs.tooltip') ){
|
||||
system.tooltip({
|
||||
container: mapElement,
|
||||
placement: 'right',
|
||||
title: function(){
|
||||
return $(this).parent().data('region');
|
||||
},
|
||||
trigger: 'manual'
|
||||
});
|
||||
}
|
||||
system.tooltip('show');
|
||||
});
|
||||
},
|
||||
out: function(e){
|
||||
var mapElement = getMapFromOverlay(this);
|
||||
mapElement.find('.' + config.systemHeadClass).tooltip('hide');
|
||||
}
|
||||
}
|
||||
},
|
||||
systemConnectionTimer: {
|
||||
title: 'show EOL timer',
|
||||
trigger: 'hover',
|
||||
class: 'pf-map-overlay-connection-timer',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-clock-o'],
|
||||
hoverIntent: {
|
||||
over: function(e){
|
||||
var mapElement = getMapFromOverlay(this);
|
||||
var MapUtil = require('app/map/util');
|
||||
var Map = require('app/map/map');
|
||||
var map = Map.getMapInstance( mapElement.data('id') );
|
||||
var connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh', ['wh_eol']);
|
||||
var serverDate = Util.getServerTime();
|
||||
|
||||
for (let connection of connections) {
|
||||
var eolTimestamp = connection.getParameter('eolUpdated');
|
||||
var eolDate = Util.convertTimestampToServerTime(eolTimestamp);
|
||||
var diff = Util.getTimeDiffParts(eolDate, serverDate);
|
||||
|
||||
// format overlay label
|
||||
var 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,
|
||||
id: config.connectionOverlayEolId,
|
||||
cssClass: ['pf-map-connection-overlay', 'eol'].join(' '),
|
||||
location: 0.25
|
||||
}
|
||||
]);
|
||||
}
|
||||
},
|
||||
out: function(e){
|
||||
var mapElement = getMapFromOverlay(this);
|
||||
var MapUtil = require('app/map/util');
|
||||
var Map = require('app/map/map');
|
||||
var map = Map.getMapInstance( mapElement.data('id') );
|
||||
var connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh', ['wh_eol']);
|
||||
|
||||
for (let connection of connections) {
|
||||
connection.removeOverlay(config.connectionOverlayEolId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get mapElement from overlay or any child of that
|
||||
* @param mapOverlay
|
||||
* @returns {JQuery}
|
||||
*/
|
||||
var getMapFromOverlay = function(mapOverlay){
|
||||
return $(mapOverlay).parents('.' + config.mapWrapperClass).find('.' + config.mapClass);
|
||||
};
|
||||
|
||||
/**
|
||||
* get map overlay element by type e.g. timer/counter, info - overlay
|
||||
* @param overlayType
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.getMapOverlay = function(overlayType){
|
||||
|
||||
var mapWrapperElement = $(this).parents('.' + config.mapWrapperClass);
|
||||
|
||||
var mapOverlay = null;
|
||||
switch(overlayType){
|
||||
case 'timer':
|
||||
mapOverlay = mapWrapperElement.find('.' + config.mapOverlayTimerClass);
|
||||
break;
|
||||
case 'info':
|
||||
mapOverlay = mapWrapperElement.find('.' + config.mapOverlayInfoClass);
|
||||
break;
|
||||
}
|
||||
|
||||
return mapOverlay;
|
||||
};
|
||||
|
||||
/**
|
||||
* draws the map update counter to the map overlay timer
|
||||
* @param percent
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.setMapUpdateCounter = function(percent, value){
|
||||
|
||||
var mapOverlayTimer = $(this);
|
||||
|
||||
// check if counter already exists
|
||||
var counterChart = mapOverlayTimer.getMapCounter();
|
||||
|
||||
if(counterChart.length === 0){
|
||||
// create new counter
|
||||
|
||||
counterChart = $('<div>', {
|
||||
class: [Init.classes.pieChart.class, Init.classes.pieChart.pieChartMapCounterClass].join(' ')
|
||||
}).attr('data-percent', percent).append(
|
||||
$('<span>', {
|
||||
text: value
|
||||
})
|
||||
);
|
||||
|
||||
mapOverlayTimer.append(counterChart);
|
||||
|
||||
// init counter
|
||||
counterChart.initMapUpdateCounter();
|
||||
|
||||
// set tooltip
|
||||
mapOverlayTimer.attr('data-placement', 'left');
|
||||
mapOverlayTimer.attr('title', 'update counter');
|
||||
mapOverlayTimer.tooltip();
|
||||
}
|
||||
|
||||
return counterChart;
|
||||
};
|
||||
|
||||
/**
|
||||
* get the map counter chart by an overlay
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.getMapCounter = function(){
|
||||
|
||||
var mapOverlayTimer = $(this);
|
||||
|
||||
return mapOverlayTimer.find('.' + Init.classes.pieChart.pieChartMapCounterClass);
|
||||
};
|
||||
|
||||
/**
|
||||
* start the map update counter or reset
|
||||
*/
|
||||
$.fn.startMapUpdateCounter = function(){
|
||||
|
||||
var mapOverlayTimer = $(this);
|
||||
var counterChart = mapOverlayTimer.getMapCounter();
|
||||
|
||||
var maxSeconds = config.logTimerCount;
|
||||
|
||||
var counterChartLabel = counterChart.find('span');
|
||||
|
||||
var percentPerCount = 100 / maxSeconds;
|
||||
|
||||
// update counter
|
||||
var updateChart = function(tempSeconds){
|
||||
var pieChart = counterChart.data('easyPieChart');
|
||||
|
||||
if(pieChart !== undefined){
|
||||
counterChart.data('easyPieChart').update( percentPerCount * tempSeconds);
|
||||
}
|
||||
counterChartLabel.text(tempSeconds);
|
||||
};
|
||||
|
||||
// main timer function is called on any counter update
|
||||
var timer = function(){
|
||||
// decrease timer
|
||||
var currentSeconds = counterChart.data('currentSeconds');
|
||||
currentSeconds--;
|
||||
counterChart.data('currentSeconds', currentSeconds);
|
||||
|
||||
|
||||
if(currentSeconds >= 0){
|
||||
// update counter
|
||||
updateChart(currentSeconds);
|
||||
}else{
|
||||
// hide counter and reset
|
||||
clearInterval(mapUpdateCounter);
|
||||
|
||||
mapOverlayTimer.velocity('transition.whirlOut', {
|
||||
duration: Init.animationSpeed.mapOverlay,
|
||||
complete: function(){
|
||||
counterChart.data('interval', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// get current seconds (in case the timer is already running)
|
||||
var currentSeconds = counterChart.data('currentSeconds');
|
||||
|
||||
// start values for timer and chart
|
||||
counterChart.data('currentSeconds', maxSeconds);
|
||||
updateChart(maxSeconds);
|
||||
|
||||
if(
|
||||
currentSeconds === undefined ||
|
||||
currentSeconds < 0
|
||||
){
|
||||
// start timer
|
||||
var mapUpdateCounter = setInterval(timer, 1000);
|
||||
|
||||
// store counter interval
|
||||
counterChart.data('interval', mapUpdateCounter);
|
||||
|
||||
// show overlay
|
||||
if(mapOverlayTimer.is(':hidden')){
|
||||
mapOverlayTimer.velocity('stop').velocity('transition.whirlIn', { duration: Init.animationSpeed.mapOverlay });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* update (show/hide) a overlay icon in the "info"-overlay
|
||||
* show/hide the overlay itself is no icons are visible
|
||||
* @param option
|
||||
* @param viewType
|
||||
*/
|
||||
$.fn.updateOverlayIcon = function(option, viewType){
|
||||
var mapOverlayInfo = $(this);
|
||||
|
||||
var showOverlay = false;
|
||||
|
||||
var mapOverlayIconClass = options[option].class;
|
||||
|
||||
// look for the overlay icon that should be updated
|
||||
var iconElement = mapOverlayInfo.find('.' + mapOverlayIconClass);
|
||||
|
||||
if(iconElement){
|
||||
if(viewType === 'show'){
|
||||
showOverlay = true;
|
||||
|
||||
// check "trigger" and mark as "active"
|
||||
if(options[option].trigger === 'active'){
|
||||
iconElement.addClass('active');
|
||||
}
|
||||
|
||||
// check if icon is not already visible
|
||||
// -> prevents unnecessary "show" animation
|
||||
if( !iconElement.data('visible') ){
|
||||
// display animation for icon
|
||||
iconElement.velocity({
|
||||
opacity: [0.8, 0],
|
||||
scale: [1, 0],
|
||||
width: ['26px', 0],
|
||||
marginLeft: ['3px', 0]
|
||||
},{
|
||||
duration: 240,
|
||||
easing: 'easeInOutQuad'
|
||||
});
|
||||
|
||||
iconElement.data('visible', true);
|
||||
}
|
||||
}else if(viewType === 'hide'){
|
||||
iconElement.removeClass('active').velocity('reverse');
|
||||
iconElement.data('visible', false);
|
||||
|
||||
// check if there is any visible icon remaining
|
||||
var visibleIcons = mapOverlayInfo.find('i:visible');
|
||||
if(visibleIcons.length > 0){
|
||||
showOverlay = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// show the entire overlay if there is at least one active icon
|
||||
if(
|
||||
showOverlay === true &&
|
||||
mapOverlayInfo.is(':hidden')
|
||||
){
|
||||
// show overlay
|
||||
mapOverlayInfo.velocity('stop').velocity('transition.whirlIn', { duration: Init.animationSpeed.mapOverlay });
|
||||
}else if(
|
||||
showOverlay === false &&
|
||||
mapOverlayInfo.is(':visible')
|
||||
){
|
||||
// hide overlay
|
||||
mapOverlayInfo.velocity('stop').velocity('transition.whirlOut', { duration: Init.animationSpeed.mapOverlay });
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* init all map overlays on a "parent" element
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.initMapOverlays = function(){
|
||||
return this.each(function(){
|
||||
var parentElement = $(this);
|
||||
|
||||
var mapOverlayTimer = $('<div>', {
|
||||
class: [config.mapOverlayClass, config.mapOverlayTimerClass].join(' ')
|
||||
});
|
||||
parentElement.append(mapOverlayTimer);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// add map overlay info. after scrollbar is initialized
|
||||
var mapOverlayInfo = $('<div>', {
|
||||
class: [config.mapOverlayClass, config.mapOverlayInfoClass].join(' ')
|
||||
});
|
||||
|
||||
// add all overlay elements
|
||||
for (var prop in options) {
|
||||
if(options.hasOwnProperty(prop)){
|
||||
var icon = $('<i>', {
|
||||
class: options[prop].iconClass.concat( ['pull-right', options[prop].class] ).join(' ')
|
||||
}).attr('title', options[prop].title).tooltip({
|
||||
placement: 'bottom',
|
||||
container: 'body',
|
||||
delay: 150
|
||||
});
|
||||
|
||||
// add "hover" action for some icons
|
||||
if(options[prop].trigger === 'hover'){
|
||||
icon.hoverIntent(options[prop].hoverIntent);
|
||||
}
|
||||
|
||||
mapOverlayInfo.append(icon);
|
||||
}
|
||||
}
|
||||
parentElement.append(mapOverlayInfo);
|
||||
|
||||
// reset map update timer
|
||||
mapOverlayTimer.setMapUpdateCounter(100, config.logTimerCount);
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
@@ -1,75 +0,0 @@
|
||||
/**
|
||||
* Created by Exodus on 26.06.2016.
|
||||
*/
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util'
|
||||
], function($, Init, Util) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* init map scrollbar
|
||||
* @param config
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.initCustomScrollbar = function(config){
|
||||
|
||||
// default config -------------------------------------------------------------------------
|
||||
var defaultConfig = {
|
||||
axis: 'x',
|
||||
theme: 'light-thick',
|
||||
scrollInertia: 300,
|
||||
autoExpandScrollbar: false,
|
||||
scrollButtons:{
|
||||
scrollAmount: 30,
|
||||
enable: true
|
||||
},
|
||||
callbacks:{
|
||||
onTotalScrollOffset: 0,
|
||||
onTotalScrollBackOffset: 0,
|
||||
alwaysTriggerOffsets: true
|
||||
},
|
||||
|
||||
advanced: {
|
||||
updateOnBrowserResize: true,
|
||||
updateOnContentResize: true,
|
||||
autoExpandHorizontalScroll: true,
|
||||
autoScrollOnFocus: 'div'
|
||||
},
|
||||
mouseWheel:{
|
||||
enable: false, // scroll weel currently disabled
|
||||
scrollAmount: 'auto',
|
||||
axis: 'x',
|
||||
preventDefault: true
|
||||
},
|
||||
scrollbarPosition: 'inside',
|
||||
autoDraggerLength: true
|
||||
//autoHideScrollbar: false
|
||||
};
|
||||
|
||||
// init -----------------------------------------------------------------------------------
|
||||
config = $.extend(true, {}, defaultConfig, config);
|
||||
|
||||
return this.each(function(){
|
||||
var scrollableElement = $(this);
|
||||
|
||||
// prevent multiple initialization
|
||||
scrollableElement.mCustomScrollbar('destroy');
|
||||
|
||||
// init custom scrollbars
|
||||
scrollableElement.mCustomScrollbar(config);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* scroll to a specific position in the map
|
||||
* demo: http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/scrollTo_demo.html
|
||||
* @returns {*} // string or id
|
||||
*/
|
||||
$.fn.scrollToX = function(position){
|
||||
return this.each(function(){
|
||||
$(this).mCustomScrollbar('scrollTo', position);
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -1,194 +0,0 @@
|
||||
/**
|
||||
* map system functions
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'bootbox',
|
||||
'app/map/util'
|
||||
], ($, Init, Util, bootbox, MapUtil) => {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
systemActiveClass: 'pf-system-active' // class for an active system in a map
|
||||
};
|
||||
|
||||
/**
|
||||
* show "set rally point" dialog for system
|
||||
* @param system
|
||||
*/
|
||||
$.fn.showRallyPointDialog = (system) => {
|
||||
requirejs(['text!templates/dialog/system_rally.html', 'mustache'], function(template, Mustache) {
|
||||
var data = {
|
||||
notificationStatus: Init.notificationStatus.rallySet
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
var rallyDialog = bootbox.dialog({
|
||||
message: content,
|
||||
title: 'Set rally point for "' + system.getSystemInfo( ['alias'] ) + '"',
|
||||
buttons: {
|
||||
close: {
|
||||
label: 'cancel',
|
||||
className: 'btn-default'
|
||||
},
|
||||
setRallyPoke: {
|
||||
label: '<i class="fa fa-fw fa-volume-up"></i> set rally and poke',
|
||||
className: 'btn-primary',
|
||||
callback: function() {
|
||||
system.setSystemRally(1, {
|
||||
poke: true
|
||||
});
|
||||
system.markAsChanged();
|
||||
}
|
||||
},
|
||||
success: {
|
||||
label: '<i class="fa fa-fw fa-users"></i> set rally',
|
||||
className: 'btn-success',
|
||||
callback: function() {
|
||||
system.setSystemRally(1);
|
||||
system.markAsChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* shows delete dialog for systems that should be deleted
|
||||
* @param map
|
||||
* @param systems
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.showDeleteSystemDialog = (map, systems = []) => {
|
||||
var mapContainer = $( map.getContainer() );
|
||||
var validDeleteSystems = [];
|
||||
var activeCharacters = 0;
|
||||
// check if systems belong to map -> security check
|
||||
for (let system of systems) {
|
||||
let systemElement = $(system);
|
||||
if(
|
||||
systemElement.data('mapid') === mapContainer.data('id') &&
|
||||
!systemElement.data('locked')
|
||||
){
|
||||
// system belongs to map -> valid system
|
||||
validDeleteSystems.push(system);
|
||||
|
||||
activeCharacters += (systemElement.data('userCount') ? parseInt( systemElement.data('userCount') ) : 0);
|
||||
}
|
||||
}
|
||||
|
||||
if(validDeleteSystems.length){
|
||||
var msg = '';
|
||||
if(validDeleteSystems.length === 1){
|
||||
msg = 'Delete system "' + $(validDeleteSystems[0]).data('name') + '" and all its connections?';
|
||||
}else{
|
||||
msg = 'Delete ' + validDeleteSystems.length + ' selected systems and their connections?';
|
||||
}
|
||||
|
||||
// add warning for active characters
|
||||
if(activeCharacters > 0){
|
||||
msg += ' <span class="txt-color txt-color-warning">Warning: ' + activeCharacters + ' active characters</span>';
|
||||
}
|
||||
|
||||
var systemDeleteDialog = bootbox.confirm(msg, result => {
|
||||
if(result){
|
||||
deleteSystems(map, validDeleteSystems, (systems) => {
|
||||
// callback function after deleted -> close dialog
|
||||
systemDeleteDialog.modal('hide');
|
||||
|
||||
if(systems.length === 1){
|
||||
Util.showNotify({title: 'System deleted', text: $(systems[0]).data('name'), type: 'success'});
|
||||
}else{
|
||||
Util.showNotify({title: systems.length + ' systems deleted', type: 'success'});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else{
|
||||
Util.showNotify({title: 'No systems selected', type: 'warning'});
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* delete system(s) with all their connections
|
||||
* (ajax call) remove system from DB
|
||||
* @param map
|
||||
* @param systems
|
||||
* @param callback function
|
||||
*/
|
||||
var deleteSystems = (map, systems = [], callback = (systems) => {}) => {
|
||||
var mapContainer = $( map.getContainer() );
|
||||
mapContainer.getMapOverlay('timer').startMapUpdateCounter();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Init.path.deleteSystem,
|
||||
data: {
|
||||
systemIds: systems.map( system => $(system).data('id') )
|
||||
},
|
||||
dataType: 'json',
|
||||
context: {
|
||||
map: map,
|
||||
systems: systems
|
||||
}
|
||||
}).done(function(){
|
||||
// remove systems from map
|
||||
removeSystems(this.map, this.systems);
|
||||
|
||||
callback(this.systems);
|
||||
}).fail(function(jqXHR, status, error) {
|
||||
var reason = status + ' ' + error;
|
||||
Util.showNotify({title: jqXHR.status + ': deleteSystem', text: reason, type: 'warning'});
|
||||
$(document).setProgramStatus('problem');
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* remove system(s) from map (no backend requests)
|
||||
* @param map
|
||||
* @param systems
|
||||
*/
|
||||
var removeSystems = (map, systems) => {
|
||||
|
||||
var removeSystemCallbak = function(deleteSystem){
|
||||
map.remove(deleteSystem);
|
||||
};
|
||||
|
||||
for (let system of systems){
|
||||
system = $(system);
|
||||
|
||||
// check if system is "active"
|
||||
if( system.hasClass(config.systemActiveClass) ){
|
||||
// get parent Tab Content and fire clear modules event
|
||||
var tabContentElement = MapUtil.getTabContentElementByMapElement( system );
|
||||
$(tabContentElement).trigger('pf:removeSystemModules');
|
||||
}
|
||||
|
||||
// remove endpoints and their connections
|
||||
// do not fire a "connectionDetached" event
|
||||
map.detachAllConnections(system, {fireEvent: false});
|
||||
|
||||
// hide tooltip
|
||||
system.toggleSystemTooltip('destroy', {});
|
||||
|
||||
// remove system
|
||||
system.velocity('transition.whirlOut', {
|
||||
duration: Init.animationSpeed.mapDeleteSystem,
|
||||
complete: removeSystemCallbak
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
deleteSystems: deleteSystems,
|
||||
removeSystems: removeSystems
|
||||
};
|
||||
});
|
||||
@@ -1,598 +0,0 @@
|
||||
/**
|
||||
* Map util functions
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util'
|
||||
], function($, Init, Util) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
mapSnapToGridDimension: 20, // px for grid snapping (grid YxY)
|
||||
|
||||
// local storage
|
||||
characterLocalStoragePrefix: 'character_', // prefix for character data local storage key
|
||||
mapLocalStoragePrefix: 'map_', // prefix for map data local storage key
|
||||
mapTabContentClass: 'pf-map-tab-content', // Tab-Content element (parent element)
|
||||
|
||||
systemClass: 'pf-system', // class for all systems
|
||||
mapGridClass: 'pf-grid-small' // class for map grid snapping
|
||||
};
|
||||
|
||||
// map menu options
|
||||
var mapOptions = {
|
||||
mapMagnetizer: {
|
||||
buttonId: Util.config.menuButtonMagnetizerId,
|
||||
description: 'Magnetizer',
|
||||
onEnable: 'initMagnetizer', // jQuery extension function
|
||||
onDisable: 'destroyMagnetizer' // jQuery extension function
|
||||
},
|
||||
mapSnapToGrid : {
|
||||
buttonId: Util.config.menuButtonGridId,
|
||||
description: 'Grid snapping',
|
||||
class: 'mapGridClass'
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get all available map Types
|
||||
* optional they can be filtered by current access level of a user
|
||||
* @param {bool} filterByUser
|
||||
* @returns {Array}
|
||||
*/
|
||||
var getMapTypes = function(filterByUser){
|
||||
var mapTypes = [];
|
||||
|
||||
$.each(Init.mapTypes, function(prop, data){
|
||||
// skip "default" type -> just for 'add' icon
|
||||
if(data.label.length > 0){
|
||||
var tempData = data;
|
||||
tempData.name = prop;
|
||||
mapTypes.push(tempData);
|
||||
}
|
||||
});
|
||||
|
||||
if(filterByUser === true){
|
||||
var corporationId = Util.getCurrentUserInfo('corporationId');
|
||||
var allianceId = Util.getCurrentUserInfo('allianceId');
|
||||
|
||||
var authorizedMapTypes = [];
|
||||
// check if character data exists
|
||||
if(corporationId > 0) {
|
||||
authorizedMapTypes.push('corporation');
|
||||
}
|
||||
if(allianceId > 0){
|
||||
authorizedMapTypes.push('alliance');
|
||||
}
|
||||
|
||||
// private maps are always allowed
|
||||
authorizedMapTypes.push('private');
|
||||
|
||||
// compare "all" map types with "authorized" types
|
||||
var tempMapTypes = [];
|
||||
for(var i = 0; i < mapTypes.length; i++){
|
||||
for(var j = 0; j < authorizedMapTypes.length; j++){
|
||||
if(mapTypes[i].name === authorizedMapTypes[j]){
|
||||
tempMapTypes.push(mapTypes[i]);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
mapTypes = tempMapTypes;
|
||||
}
|
||||
|
||||
return mapTypes;
|
||||
};
|
||||
|
||||
/**
|
||||
* get all available scopes for a map
|
||||
* @returns {Array}
|
||||
*/
|
||||
var getMapScopes = function(){
|
||||
var scopes = [];
|
||||
$.each(Init.mapScopes, function(prop, data){
|
||||
var tempData = data;
|
||||
tempData.name = prop;
|
||||
scopes.push(tempData);
|
||||
});
|
||||
|
||||
return scopes;
|
||||
};
|
||||
|
||||
/**
|
||||
* get some scope info for a given info string
|
||||
* @param {string} info
|
||||
* @param {string} option
|
||||
* @returns {string}
|
||||
*/
|
||||
var getScopeInfoForMap = function(info, option){
|
||||
var scopeInfo = '';
|
||||
if(Init.mapScopes.hasOwnProperty(info)){
|
||||
scopeInfo = Init.mapScopes[info][option];
|
||||
}
|
||||
return scopeInfo;
|
||||
};
|
||||
|
||||
/**
|
||||
* get all available map icons
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
var getMapIcons = function(){
|
||||
return Init.mapIcons;
|
||||
};
|
||||
|
||||
/**
|
||||
* get map info
|
||||
* @param {string} mapType
|
||||
* @param {string} option
|
||||
* @returns {string}
|
||||
*/
|
||||
var getInfoForMap = function(mapType, option){
|
||||
var mapInfo = '';
|
||||
if(Init.mapTypes.hasOwnProperty(mapType)){
|
||||
mapInfo = Init.mapTypes[mapType][option];
|
||||
}
|
||||
return mapInfo;
|
||||
};
|
||||
|
||||
/**
|
||||
* get some system info for a given info string (e.g. rally class)
|
||||
* @param {string} info
|
||||
* @param {string} option
|
||||
* @returns {string}
|
||||
*/
|
||||
var getInfoForSystem = function(info, option){
|
||||
var systemInfo = '';
|
||||
if(Init.classes.systemInfo.hasOwnProperty(info)){
|
||||
systemInfo = Init.classes.systemInfo[info][option];
|
||||
}
|
||||
return systemInfo;
|
||||
};
|
||||
|
||||
/**
|
||||
* get system type information
|
||||
* @param {number} systemTypeId
|
||||
* @param {string} option
|
||||
* @returns {string}
|
||||
*/
|
||||
var getSystemTypeInfo = function(systemTypeId, option){
|
||||
var systemTypeInfo = '';
|
||||
$.each(Init.systemType, function(prop, data){
|
||||
if(systemTypeId === data.id){
|
||||
systemTypeInfo = data[option];
|
||||
return;
|
||||
}
|
||||
});
|
||||
return systemTypeInfo;
|
||||
};
|
||||
|
||||
/**
|
||||
* get some info for a given effect string
|
||||
* @param effect
|
||||
* @param option
|
||||
* @returns {string}
|
||||
*/
|
||||
var getEffectInfoForSystem = function(effect, option){
|
||||
var effectInfo = '';
|
||||
if( Init.classes.systemEffects.hasOwnProperty(effect) ){
|
||||
effectInfo = Init.classes.systemEffects[effect][option];
|
||||
}
|
||||
return effectInfo;
|
||||
};
|
||||
|
||||
/**
|
||||
* get system elements on a map
|
||||
* @returns {*|jQuery}
|
||||
*/
|
||||
$.fn.getSystems = function(){
|
||||
return this.find('.' + config.systemClass);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* search connections by systems
|
||||
* @param {Object} map - jsPlumb
|
||||
* @param {JQuery[]} systems - system DOM elements
|
||||
* @returns {Array} connections - found connection, DOM elements
|
||||
*/
|
||||
var searchConnectionsBySystems = function(map, systems){
|
||||
var connections = [];
|
||||
var withBackConnection = false;
|
||||
|
||||
$.each(systems, function(i, system){
|
||||
// get connections where system is source
|
||||
connections = connections.concat( map.getConnections({source: system}) );
|
||||
if(withBackConnection === true){
|
||||
// get connections where system is target
|
||||
connections = connections.concat( map.getConnections({target: system}) );
|
||||
}
|
||||
});
|
||||
return connections;
|
||||
};
|
||||
|
||||
/**
|
||||
* search connections by scope and/or type
|
||||
* -> scope and target can be an array
|
||||
* @param {Object} map - jsPlumb
|
||||
* @param {string|string[]} scope
|
||||
* @param {string|string[]} type
|
||||
* @returns {Array}
|
||||
*/
|
||||
var searchConnectionsByScopeAndType = function(map, scope, type){
|
||||
var connections = [];
|
||||
var scopeArray = (scope === undefined) ? ['*'] : ((Array.isArray(scope)) ? scope : [scope]);
|
||||
var typeArray = (type === undefined) ? [] : ((Array.isArray(type)) ? type : [type]);
|
||||
|
||||
map.select({scope: scopeArray}).each(function(connection){
|
||||
if(typeArray.length > 0){
|
||||
// filter by connection type as well...
|
||||
for(var i = 0; i < typeArray.length; i++){
|
||||
if( connection.hasType(typeArray[i]) ){
|
||||
connections.push(connection);
|
||||
break; // don´t add same connection multiple times
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// connection type is ignored
|
||||
connections.push(connection);
|
||||
}
|
||||
});
|
||||
|
||||
return connections;
|
||||
};
|
||||
|
||||
/**
|
||||
* get Connection Info by option
|
||||
* @param {string} connectionTyp
|
||||
* @param {string} option
|
||||
* @returns {string}
|
||||
*/
|
||||
var getConnectionInfo = function(connectionTyp, option){
|
||||
var connectionInfo = '';
|
||||
if(Init.connectionTypes.hasOwnProperty(connectionTyp)){
|
||||
connectionInfo = Init.connectionTypes[connectionTyp][option];
|
||||
}
|
||||
return connectionInfo;
|
||||
};
|
||||
|
||||
/**
|
||||
* get all direct connections between two given systems
|
||||
* @param map
|
||||
* @param {JQuery} systemA
|
||||
* @param {JQuery} systemB
|
||||
* @returns {Array}
|
||||
*/
|
||||
var checkForConnection = function(map, systemA, systemB){
|
||||
var connections = [];
|
||||
connections = connections.concat( map.getConnections({scope: '*', source: systemA, target: systemB}) );
|
||||
// get connections where system is target
|
||||
connections = connections.concat( map.getConnections({scope: '*', source: systemB, target: systemA}) );
|
||||
return connections;
|
||||
};
|
||||
|
||||
/**
|
||||
* get the default connection type for a scope
|
||||
* e.g. for new type after scope change
|
||||
* @param {string} scope
|
||||
* @returns {string}
|
||||
*/
|
||||
var getDefaultConnectionTypeByScope = function(scope){
|
||||
var type = '';
|
||||
switch(scope){
|
||||
case 'wh':
|
||||
type = 'wh_fresh';
|
||||
break;
|
||||
case 'jumpbridge':
|
||||
type = 'jumpbridge';
|
||||
break;
|
||||
case'stargate':
|
||||
type = 'stargate';
|
||||
break;
|
||||
default:
|
||||
console.error('Connection scope "' + scope + '" unknown!');
|
||||
}
|
||||
|
||||
return type;
|
||||
};
|
||||
|
||||
/**
|
||||
* set/change connection status of a wormhole
|
||||
* @param {Object} connection - jsPlumb object
|
||||
* @param {string} status
|
||||
*/
|
||||
var setConnectionWHStatus = function(connection, status){
|
||||
if(
|
||||
status === 'wh_fresh' &&
|
||||
connection.hasType('wh_fresh') !== true
|
||||
){
|
||||
connection.removeType('wh_reduced');
|
||||
connection.removeType('wh_critical');
|
||||
connection.addType('wh_fresh');
|
||||
}else if(
|
||||
status === 'wh_reduced' &&
|
||||
connection.hasType('wh_reduced') !== true
|
||||
){
|
||||
connection.removeType('wh_fresh');
|
||||
connection.removeType('wh_critical');
|
||||
connection.addType('wh_reduced');
|
||||
}else if(
|
||||
status === 'wh_critical' &&
|
||||
connection.hasType('wh_critical') !== true
|
||||
){
|
||||
connection.removeType('wh_fresh');
|
||||
connection.removeType('wh_reduced');
|
||||
connection.addType('wh_critical');
|
||||
}else if(
|
||||
status === 'wh_eol' &&
|
||||
connection.hasType('wh_eol') !== true
|
||||
){
|
||||
connection.addType('wh_eol');
|
||||
}else if(
|
||||
status === 'wh_eol' &&
|
||||
connection.hasType('wh_eol') !== true
|
||||
){
|
||||
connection.addType('wh_eol');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get some scope info for a given info string
|
||||
* @param {string} info
|
||||
* @param {string} option
|
||||
* @returns {string}
|
||||
*/
|
||||
var getScopeInfoForConnection = function(info, option){
|
||||
var scopeInfo = '';
|
||||
if(Init.connectionScopes.hasOwnProperty(info)){
|
||||
switch(option){
|
||||
case 'connectorDefinition':
|
||||
// json data in DB
|
||||
var temp = '{ "data": ' + Init.connectionScopes[info][option] + '}';
|
||||
scopeInfo = $.parseJSON( temp).data;
|
||||
break;
|
||||
default:
|
||||
scopeInfo = Init.connectionScopes[info][option];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return scopeInfo;
|
||||
};
|
||||
|
||||
/**
|
||||
* get TabContentElement by any element on a map e.g. system
|
||||
* @param element
|
||||
* @returns {*}
|
||||
*/
|
||||
var getTabContentElementByMapElement = function(element){
|
||||
var tabContentElement = $(element).parents('.' + config.mapTabContentClass);
|
||||
return tabContentElement;
|
||||
};
|
||||
|
||||
/**
|
||||
* set or change rallyPoint for systems
|
||||
* @param rallyUpdated
|
||||
* @param options
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.setSystemRally = function(rallyUpdated, options){
|
||||
rallyUpdated = rallyUpdated || 0;
|
||||
var rallyPoke = false;
|
||||
|
||||
var defaultOptions = {
|
||||
poke: false,
|
||||
hideNotification: false,
|
||||
hideCounter: false,
|
||||
};
|
||||
options = $.extend({}, defaultOptions, options);
|
||||
|
||||
return this.each(function(){
|
||||
var system = $(this);
|
||||
var rally = system.data('rallyUpdated') || 0;
|
||||
|
||||
if(rallyUpdated !== rally){
|
||||
// rally status changed
|
||||
if( !options.hideCounter ){
|
||||
system.getMapOverlay('timer').startMapUpdateCounter();
|
||||
}
|
||||
|
||||
var rallyClass = getInfoForSystem('rally', 'class');
|
||||
|
||||
if(rallyUpdated > 0){
|
||||
// new rally point set OR update system with rally information
|
||||
|
||||
system.addClass( rallyClass );
|
||||
// rallyUpdated > 0 is required for poke!
|
||||
rallyPoke = options.poke;
|
||||
|
||||
var notificationOptions = {
|
||||
title: 'Rally Point',
|
||||
text: 'System: ' + system.data('name')
|
||||
};
|
||||
|
||||
if(rallyUpdated === 1){
|
||||
// rally point not saved on DB
|
||||
notificationOptions.type = 'success';
|
||||
Util.showNotify(notificationOptions);
|
||||
}else if(options.poke){
|
||||
// rally saved AND poke option active
|
||||
|
||||
// check if desktop notification was already send
|
||||
var mapId = system.data('mapid');
|
||||
var systemId = system.data('id');
|
||||
var promiseStore = getLocaleData('map', mapId);
|
||||
promiseStore.then(function(data) {
|
||||
// This code runs once the value has been loaded
|
||||
// from the offline store.
|
||||
var rallyPokeData = {};
|
||||
|
||||
if(
|
||||
data &&
|
||||
data.rallyPoke
|
||||
){
|
||||
// poke data exists
|
||||
rallyPokeData = data.rallyPoke;
|
||||
}
|
||||
|
||||
if(
|
||||
!rallyPokeData.hasOwnProperty(this.systemId) || // rally poke was not already send to client
|
||||
rallyPokeData[this.systemId] !== rallyUpdated // already send to that system but in the past
|
||||
){
|
||||
rallyPokeData[this.systemId] = rallyUpdated;
|
||||
storeLocalData('map', this.mapId, 'rallyPoke', rallyPokeData);
|
||||
|
||||
notificationOptions.type = 'info';
|
||||
Util.showNotify(notificationOptions, {desktop: true, stack: 'barBottom'});
|
||||
}
|
||||
}.bind({
|
||||
mapId: mapId,
|
||||
systemId: systemId,
|
||||
rallyUpdated: rallyUpdated
|
||||
}));
|
||||
}
|
||||
}else{
|
||||
// rally point removed
|
||||
system.removeClass( rallyClass );
|
||||
|
||||
if( !options.hideNotification ){
|
||||
Util.showNotify({title: 'Rally point removed', type: 'success'});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
system.data('rallyUpdated', rallyUpdated);
|
||||
system.data('rallyPoke', rallyPoke);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* store mapId for current user (IndexedDB)
|
||||
* @param mapId
|
||||
*/
|
||||
var storeDefaultMapId = function(mapId){
|
||||
if(mapId > 0){
|
||||
var userData = Util.getCurrentUserData();
|
||||
if(
|
||||
userData &&
|
||||
userData.character
|
||||
){
|
||||
storeLocalData('character', userData.character.id, 'defaultMapId', mapId);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get key prefix for local storage data
|
||||
* @param type
|
||||
* @returns {boolean}
|
||||
*/
|
||||
var getLocalStoragePrefixByType = function(type){
|
||||
var prefix = false;
|
||||
switch(type){
|
||||
case 'character': prefix = config.characterLocalStoragePrefix; break;
|
||||
case 'map': prefix = config.mapLocalStoragePrefix; break;
|
||||
default: prefix = config.mapLocalStoragePrefix;
|
||||
}
|
||||
return prefix;
|
||||
};
|
||||
|
||||
/**
|
||||
* get stored local data from client cache (IndexedDB)
|
||||
* @param type
|
||||
* @param objectId
|
||||
* @returns {*}
|
||||
*/
|
||||
var getLocaleData = function(type, objectId){
|
||||
if(objectId > 0){
|
||||
var storageKey = getLocalStoragePrefixByType(type) + objectId;
|
||||
return Util.getLocalStorage().getItem(storageKey);
|
||||
}else{
|
||||
console.warn('Local storage requires object id > 0');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* store local config data to client cache (IndexedDB)
|
||||
* @param type
|
||||
* @param objectId
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
var storeLocalData = function(type, objectId, key, value){
|
||||
if(objectId > 0){
|
||||
// get current map config
|
||||
var storageKey = getLocalStoragePrefixByType(type) + objectId;
|
||||
Util.getLocalStorage().getItem(storageKey).then(function(data) {
|
||||
// This code runs once the value has been loaded
|
||||
// from the offline store.
|
||||
data = (data === null) ? {} : data;
|
||||
// set/update value
|
||||
data[this.key] = this.value;
|
||||
Util.getLocalStorage().setItem(this.storageKey, data);
|
||||
}.bind({
|
||||
key: key,
|
||||
value: value,
|
||||
storageKey: storageKey
|
||||
})).catch(function(err) {
|
||||
// This code runs if there were any errors
|
||||
console.error('Map local storage can not be accessed!');
|
||||
});
|
||||
}else{
|
||||
console.warn('storeLocalData(): Local storage requires object id > 0');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* delete local map configuration by key (IndexedDB)
|
||||
* @param type
|
||||
* @param objectId
|
||||
* @param key
|
||||
*/
|
||||
var deleteLocalData = function(type, objectId, key){
|
||||
if(objectId > 0){
|
||||
// get current map config
|
||||
var storageKey = getLocalStoragePrefixByType(type) + objectId;
|
||||
Util.getLocalStorage().getItem(storageKey).then(function(data) {
|
||||
if(
|
||||
data &&
|
||||
data.hasOwnProperty(key)
|
||||
){
|
||||
delete data[key];
|
||||
Util.getLocalStorage().setItem(this.storageKey, data);
|
||||
}
|
||||
}.bind({
|
||||
storageKey: storageKey
|
||||
}));
|
||||
}else{
|
||||
console.warn('deleteLocalData(): Local storage requires object id > 0');
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
config: config,
|
||||
mapOptions: mapOptions,
|
||||
getMapTypes: getMapTypes,
|
||||
getMapScopes: getMapScopes,
|
||||
getScopeInfoForMap: getScopeInfoForMap,
|
||||
getMapIcons: getMapIcons,
|
||||
getInfoForMap: getInfoForMap,
|
||||
getInfoForSystem: getInfoForSystem,
|
||||
getSystemTypeInfo: getSystemTypeInfo,
|
||||
getEffectInfoForSystem: getEffectInfoForSystem,
|
||||
searchConnectionsBySystems: searchConnectionsBySystems,
|
||||
searchConnectionsByScopeAndType: searchConnectionsByScopeAndType,
|
||||
getConnectionInfo: getConnectionInfo,
|
||||
checkForConnection: checkForConnection,
|
||||
getDefaultConnectionTypeByScope: getDefaultConnectionTypeByScope,
|
||||
setConnectionWHStatus: setConnectionWHStatus,
|
||||
getScopeInfoForConnection: getScopeInfoForConnection,
|
||||
getTabContentElementByMapElement: getTabContentElementByMapElement,
|
||||
storeDefaultMapId: storeDefaultMapId,
|
||||
getLocaleData: getLocaleData,
|
||||
storeLocalData: storeLocalData,
|
||||
deleteLocalData: deleteLocalData
|
||||
};
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
140
public/js/v1.1.5/app/mappage.js.map
Normal file
140
public/js/v1.1.5/app/mappage.js.map
Normal file
File diff suppressed because one or more lines are too long
@@ -1,763 +0,0 @@
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/map/map',
|
||||
'app/map/util',
|
||||
'app/counter',
|
||||
'app/ui/system_info',
|
||||
'app/ui/system_graph',
|
||||
'app/ui/system_signature',
|
||||
'app/ui/system_route',
|
||||
'app/ui/system_killboard',
|
||||
'datatables.net',
|
||||
'datatables.net-buttons',
|
||||
'datatables.net-buttons-html',
|
||||
'datatables.net-responsive',
|
||||
'datatables.net-select'
|
||||
], function($, Init, Util, Map, MapUtil) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper', // parent Element for dynamic content (dialogs,..)
|
||||
mapTabElementId: 'pf-map-tab-element', // id for map tab element (tabs + content)
|
||||
mapTabBarId: 'pf-map-tabs', // id for map tab bar
|
||||
mapTabIdPrefix: 'pf-map-tab-', // id prefix for a map tab
|
||||
mapTabClass: 'pf-map-tab', // class for a map tab
|
||||
mapTabLinkTextClass: 'nav-tabs-link', // class for span elements in a tab
|
||||
mapTabIconClass: 'pf-map-tab-icon', // class for map icon
|
||||
mapTabSharedIconClass: 'pf-map-tab-shared-icon', // class for map shared icon
|
||||
mapTabContentClass: 'pf-map-tab-content', // class for tab content container
|
||||
mapTabContentSystemInfoClass: 'pf-map-tab-content-system',
|
||||
mapWrapperClass: 'pf-map-wrapper', // scrollable
|
||||
mapClass: 'pf-map', // class for each map
|
||||
|
||||
// TabContentStructure
|
||||
mapTabContentRow: 'pf-map-content-row', // main row for Tab content (grid)
|
||||
mapTabContentCell: 'pf-map-content-col', // column
|
||||
mapTabContentCellFirst: 'pf-map-content-col-first', // first column
|
||||
mapTabContentCellSecond: 'pf-map-content-col-second', // second column
|
||||
|
||||
// module
|
||||
moduleClass: 'pf-module', // class for a module
|
||||
moduleClosedClass: 'pf-module-closed' // class for a closed module
|
||||
|
||||
};
|
||||
|
||||
var mapTabChangeBlocked = false; // flag for preventing map tab switch
|
||||
|
||||
/**
|
||||
* get all maps for a maps module
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.getMaps = function(){
|
||||
var maps = $(this).find('.' + config.mapClass);
|
||||
return maps;
|
||||
};
|
||||
|
||||
/**
|
||||
* get the current active map for
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.getActiveMap = function(){
|
||||
|
||||
var map = $(this).find('.active.' + config.mapTabContentClass + ' .' + config.mapClass);
|
||||
|
||||
if(map.length === 0){
|
||||
map = false;
|
||||
}
|
||||
|
||||
return map;
|
||||
};
|
||||
|
||||
/**
|
||||
* set Tab Observer, events are triggered within map.js
|
||||
*/
|
||||
$.fn.setTabContentObserver = function(){
|
||||
return this.each(function(){
|
||||
// update Tab Content with system data information
|
||||
$(this).on('pf:drawSystemModules', function(e){
|
||||
drawSystemModules($( e.target ));
|
||||
});
|
||||
|
||||
$(this).on('pf:removeSystemModules', function(e){
|
||||
removeSystemModules($( e.target ));
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* clear all system info modules and remove them
|
||||
* @param tabContentElement
|
||||
* @param callback
|
||||
*/
|
||||
var removeSystemModules = function(tabContentElement, callback){
|
||||
tabContentElement.find('.' + config.moduleClass).velocity('transition.slideDownOut', {
|
||||
duration: Init.animationSpeed.mapModule,
|
||||
complete: function(tempElement){
|
||||
$(tempElement).remove();
|
||||
|
||||
if(callback){
|
||||
callback();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* clears and updates the system info element (signature table, system info,...)
|
||||
* @param tabContentElement
|
||||
*/
|
||||
var drawSystemModules = function(tabContentElement){
|
||||
var currentSystemData = Util.getCurrentSystemData();
|
||||
|
||||
// get Table cell for system Info
|
||||
var firstCell = $(tabContentElement).find('.' + config.mapTabContentCellFirst);
|
||||
var secondCell = $(tabContentElement).find('.' + config.mapTabContentCellSecond);
|
||||
|
||||
// draw system info module
|
||||
firstCell.drawSystemInfoModule(currentSystemData.mapId, currentSystemData.systemData);
|
||||
|
||||
// draw system graph module
|
||||
firstCell.drawSystemGraphModule(currentSystemData.systemData);
|
||||
|
||||
// draw signature table module
|
||||
firstCell.drawSignatureTableModule(currentSystemData.systemData);
|
||||
|
||||
// draw system routes module
|
||||
secondCell.drawSystemRouteModule(currentSystemData.mapId, currentSystemData.systemData);
|
||||
|
||||
// draw system killboard module
|
||||
secondCell.drawSystemKillboardModule(currentSystemData.systemData);
|
||||
|
||||
// set Module Observer
|
||||
setModuleObserver();
|
||||
};
|
||||
|
||||
/**
|
||||
* set observer for each module
|
||||
*/
|
||||
var setModuleObserver = function(){
|
||||
|
||||
// toggle height for a module
|
||||
$(document).off('click.toggleModuleHeight').on('click.toggleModuleHeight', '.' + config.moduleClass, function(e){
|
||||
var moduleElement = $(this);
|
||||
// get click position
|
||||
var posX = moduleElement.offset().left;
|
||||
var posY = moduleElement.offset().top;
|
||||
var clickX = e.pageX - posX;
|
||||
var clickY = e.pageY - posY;
|
||||
|
||||
// check for top-left click
|
||||
if(clickX <= 8 && clickY <= 8){
|
||||
|
||||
// remember height
|
||||
if(! moduleElement.data('origHeight')){
|
||||
|
||||
moduleElement.data('origHeight', moduleElement.outerHeight());
|
||||
}
|
||||
|
||||
if(moduleElement.hasClass( config.moduleClosedClass )){
|
||||
var moduleHeight = moduleElement.data('origHeight');
|
||||
moduleElement.velocity('finish').velocity({
|
||||
height: [ moduleHeight + 'px', [ 400, 15 ] ]
|
||||
},{
|
||||
duration: 400,
|
||||
easing: 'easeInSine',
|
||||
complete: function(){
|
||||
moduleElement.removeClass( config.moduleClosedClass );
|
||||
moduleElement.removeData();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
moduleElement.velocity('finish').velocity({
|
||||
height: [ '36px', [ 400, 15 ] ]
|
||||
},{
|
||||
duration: 400,
|
||||
easing: 'easeInSine',
|
||||
complete: function(){
|
||||
moduleElement.addClass( config.moduleClosedClass );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* updates only visible/active map module
|
||||
* @returns {boolean}
|
||||
*/
|
||||
$.fn.updateMapModuleData = function(){
|
||||
var mapModule = $(this);
|
||||
|
||||
// get all active map elements for module
|
||||
var mapElement = mapModule.getActiveMap();
|
||||
|
||||
if(mapElement !== false){
|
||||
var mapId = mapElement.data('id');
|
||||
|
||||
var currentMapUserData = Util.getCurrentMapUserData(mapId);
|
||||
|
||||
// update map with current user data
|
||||
if(currentMapUserData){
|
||||
mapElement.updateUserData(currentMapUserData);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* update system info panels (below map)
|
||||
* @param systemData
|
||||
*/
|
||||
$.fn.updateSystemModuleData = function(systemData){
|
||||
var mapModule = $(this);
|
||||
|
||||
if(systemData){
|
||||
// check if current open system is still the requested info system
|
||||
var currentSystemData = Util.getCurrentSystemData();
|
||||
|
||||
if(currentSystemData){
|
||||
if(systemData.id === currentSystemData.systemData.id){
|
||||
// trigger system update events
|
||||
$(document).triggerHandler('pf:updateSystemInfoModule', [systemData]);
|
||||
$(document).triggerHandler('pf:updateSystemSignatureModule', [systemData]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* load all structure elements into a TabsContent div (tab body)
|
||||
*/
|
||||
$.fn.initContentStructure = function(){
|
||||
return this.each(function(){
|
||||
// init bootstrap Grid
|
||||
var contentStructure = $('<div>', {
|
||||
class: ['row', config.mapTabContentRow].join(' ')
|
||||
}).append(
|
||||
$('<div>', {
|
||||
class: ['col-xs-12', 'col-md-8', config.mapTabContentCellFirst, config.mapTabContentCell].join(' ')
|
||||
})
|
||||
).append(
|
||||
$('<div>', {
|
||||
class: ['col-xs-12', 'col-md-4', config.mapTabContentCellSecond, config.mapTabContentCell].join(' ')
|
||||
})
|
||||
);
|
||||
|
||||
// append grid structure
|
||||
$(this).append(contentStructure);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* get a fresh tab element
|
||||
* @param options
|
||||
* @returns {*|jQuery|HTMLElement}
|
||||
*/
|
||||
var getTabElement = function(options){
|
||||
var tabElement = $('<div>', {
|
||||
id: config.mapTabElementId
|
||||
});
|
||||
|
||||
var tabBar = $('<ul>', {
|
||||
class: ['nav', 'nav-tabs'].join(' '),
|
||||
id: options.barId
|
||||
}).attr('role', 'tablist');
|
||||
|
||||
var tabContent = $('<div>', {
|
||||
class: 'tab-content'
|
||||
}).attr('data-map-tabs', options.barId);
|
||||
|
||||
tabElement.append(tabBar);
|
||||
tabElement.append(tabContent);
|
||||
|
||||
return tabElement;
|
||||
};
|
||||
|
||||
/**
|
||||
* set data for a map tab, or update an existing map tab with new data
|
||||
* @param options
|
||||
*/
|
||||
$.fn.updateTabData = function(options){
|
||||
var tabElement = $(this);
|
||||
|
||||
// set "main" data
|
||||
tabElement.data('map-id', options.id).data('updated', options.updated);
|
||||
|
||||
// change "tab" link
|
||||
tabElement.attr('href', '#' + config.mapTabIdPrefix + options.id);
|
||||
|
||||
// change "map" icon
|
||||
var mapIconElement = tabElement.find('.' + config.mapTabIconClass);
|
||||
mapIconElement.removeClass().addClass([config.mapTabIconClass, 'fa', 'fa-fw', options.icon].join(' '));
|
||||
|
||||
// change "shared" icon
|
||||
var mapSharedIconElement = tabElement.find('.' + config.mapTabSharedIconClass);
|
||||
mapSharedIconElement.hide();
|
||||
|
||||
// check if the map is a "shared" map
|
||||
if(options.access){
|
||||
if(
|
||||
options.access.user.length > 1 ||
|
||||
options.access.corporation.length > 1 ||
|
||||
options.access.alliance.length > 1
|
||||
){
|
||||
mapSharedIconElement.show();
|
||||
}
|
||||
}
|
||||
|
||||
// change map name label
|
||||
var tabLinkTextElement = tabElement.find('.' + config.mapTabLinkTextClass);
|
||||
tabLinkTextElement.text(options.name);
|
||||
|
||||
// change tabClass
|
||||
var listElement = tabElement.parent();
|
||||
|
||||
// new tab classes
|
||||
var tabClasses = [config.mapTabClass, options.type.classTab ];
|
||||
|
||||
// check if tab was "active" before
|
||||
if( listElement.hasClass('active') ){
|
||||
tabClasses.push('active');
|
||||
}
|
||||
listElement.removeClass().addClass( tabClasses.join(' ') );
|
||||
|
||||
// set title for tooltip
|
||||
if(options.type.name !== undefined){
|
||||
tabLinkTextElement.attr('title', options.type.name + ' map');
|
||||
}
|
||||
|
||||
var mapTooltipOptions = {
|
||||
placement: 'bottom',
|
||||
container: 'body',
|
||||
trigger: 'hover',
|
||||
delay: 150
|
||||
};
|
||||
|
||||
listElement.find('[title]').tooltip(mapTooltipOptions).tooltip('fixTitle');
|
||||
|
||||
if(options.right === true){
|
||||
listElement.addClass('pull-right');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* add a new tab to tab-map-module end returns the new objects
|
||||
* @param options
|
||||
* @returns {{listElement: (*|void), contentElement: (*|HTMLElement)}}
|
||||
*/
|
||||
$.fn.addTab = function(options){
|
||||
var tabElement = $(this);
|
||||
var tabBar = tabElement.find('ul.nav-tabs');
|
||||
var tabContent = tabElement.find('div.tab-content');
|
||||
|
||||
var listElement = $('<li>').attr('role', 'presentation');
|
||||
|
||||
if(options.right === true){
|
||||
listElement.addClass('pull-right');
|
||||
}
|
||||
|
||||
// link element
|
||||
var linkElement = $('<a>').attr('role', 'tab');
|
||||
|
||||
// map icon element
|
||||
var mapIconElement = $('<i>', {
|
||||
class: config.mapTabIconClass
|
||||
});
|
||||
|
||||
// map shared icon element
|
||||
var mapSharedIconElement = $('<i>', {
|
||||
class: [config.mapTabSharedIconClass, 'fa', 'fa-fw', 'fa-share-alt'].join(' '),
|
||||
title: 'shared map'
|
||||
});
|
||||
|
||||
// text element
|
||||
var textElement = $('<span>', {
|
||||
class: config.mapTabLinkTextClass
|
||||
});
|
||||
|
||||
var newListElement = listElement.append(
|
||||
linkElement.append(mapIconElement).append(textElement).append(mapSharedIconElement)
|
||||
);
|
||||
|
||||
tabBar.append( newListElement );
|
||||
|
||||
// update Tab element -> set data
|
||||
linkElement.updateTabData(options);
|
||||
|
||||
// tabs content =======================================================
|
||||
var contentElement = $('<div>', {
|
||||
id: config.mapTabIdPrefix + parseInt( options.id ),
|
||||
class: [config.mapTabContentClass].join(' ')
|
||||
});
|
||||
|
||||
contentElement.addClass('tab-pane');
|
||||
|
||||
tabContent.append(contentElement);
|
||||
|
||||
// init tab ===========================================================
|
||||
linkElement.on('click', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
// callback function after tab switch
|
||||
function switchTabCallback(mapElement, tabLinkElement){
|
||||
tabLinkElement.tab('show');
|
||||
// unfreeze map
|
||||
mapElement.data('frozen', false);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(mapTabChangeBlocked === false){
|
||||
var tabLinkElement = $(this);
|
||||
var mapId = tabLinkElement.data('map-id');
|
||||
|
||||
// ignore "add" tab. no need for map change
|
||||
if(mapId > 0){
|
||||
var mapElement = $('#' + config.mapTabElementId).getActiveMap();
|
||||
|
||||
if(mapId !== mapElement.data('id')){
|
||||
// block tabs until switch is done
|
||||
mapTabChangeBlocked = true;
|
||||
|
||||
// freeze active map -> no user data update while map switch
|
||||
mapElement.data('frozen', true);
|
||||
|
||||
// hide current map with animation
|
||||
mapElement.visualizeMap('hide', function(){
|
||||
// un-block map tabs
|
||||
mapTabChangeBlocked = switchTabCallback(mapElement, tabLinkElement);
|
||||
});
|
||||
}
|
||||
}else{
|
||||
tabLinkElement.tab('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
listElement: newListElement,
|
||||
contentElement: contentElement
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* deletes a map tab for a given map id
|
||||
* @param mapId
|
||||
*/
|
||||
$.fn.deleteTab = function(mapId){
|
||||
var tabElement = $(this);
|
||||
var linkElement = tabElement.find('a[href="#' + config.mapTabIdPrefix + mapId + '"]');
|
||||
var deletedTabName = '';
|
||||
|
||||
if(linkElement.length > 0){
|
||||
deletedTabName = linkElement.find('.' + config.mapTabLinkTextClass).text();
|
||||
|
||||
var liElement = linkElement.parent();
|
||||
var contentElement = tabElement.find('div[id="' + config.mapTabIdPrefix + mapId + '"]');
|
||||
|
||||
var findNewActiveTab = false;
|
||||
// check if liElement was active
|
||||
if(liElement.hasClass('active')){
|
||||
// search any remaining li element and set active
|
||||
findNewActiveTab = true;
|
||||
}
|
||||
|
||||
liElement.remove();
|
||||
contentElement.remove();
|
||||
|
||||
// remove map instance from local cache
|
||||
Map.clearMapInstance(mapId);
|
||||
|
||||
if(findNewActiveTab === true){
|
||||
tabElement.find('.' + config.mapTabClass + ':not(.pull-right):first a').tab('show');
|
||||
}
|
||||
}
|
||||
|
||||
return deletedTabName;
|
||||
};
|
||||
|
||||
/**
|
||||
* clear all active maps
|
||||
*/
|
||||
$.fn.clearMapModule = function(){
|
||||
var mapModuleElement = $(this);
|
||||
var tabMapElement = $('#' + config.mapTabElementId);
|
||||
|
||||
if(tabMapElement.length > 0){
|
||||
var tabElements = mapModuleElement.getMapTabElements();
|
||||
|
||||
for(var i = 0; i < tabElements.length; i++){
|
||||
var tabElement = $(tabElements[i]);
|
||||
var mapId = tabElement.data('map-id');
|
||||
|
||||
if(mapId > 0){
|
||||
tabMapElement.deleteTab(mapId);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* load/update map module into element (all maps)
|
||||
* @param mapData
|
||||
* @returns {boolean}
|
||||
*/
|
||||
$.fn.updateMapModule = function(mapData){
|
||||
if(mapData.length === 0){
|
||||
return true;
|
||||
}
|
||||
|
||||
// store current map data global (cache)
|
||||
// temp store current map data to prevent data-change while function execution!
|
||||
var tempMapData = Util.setCurrentMapData(mapData);
|
||||
|
||||
var mapModuleElement = $(this);
|
||||
|
||||
// check if tabs module is already loaded
|
||||
var tabMapElement = $('#' + config.mapTabElementId);
|
||||
|
||||
// check if tabs have changed
|
||||
var tabsChanged = false;
|
||||
|
||||
if(tabMapElement.length > 0){
|
||||
// tab element already exists
|
||||
var tabElements = mapModuleElement.getMapTabElements();
|
||||
|
||||
// map ID that is currently active
|
||||
var activeMapId = 0;
|
||||
|
||||
// mapIds that are currently active
|
||||
var activeMapIds = [];
|
||||
|
||||
// check whether a tab/map is still active
|
||||
for(var i = 0; i < tabElements.length; i++){
|
||||
var tabElement = $(tabElements[i]);
|
||||
var mapId = tabElement.data('map-id');
|
||||
|
||||
if(mapId > 0){
|
||||
var tabMapData = Util.getCurrentMapData(mapId);
|
||||
|
||||
if(tabMapData !== false){
|
||||
// map data available ->
|
||||
activeMapIds.push(mapId);
|
||||
|
||||
// check for map data change and update tab
|
||||
if(tabMapData.config.updated !== tabElement.data('updated')){
|
||||
tabElement.updateTabData(tabMapData.config);
|
||||
}
|
||||
}else{
|
||||
// map data not available -> remove tab
|
||||
var deletedTabName = tabMapElement.deleteTab(mapId);
|
||||
|
||||
tabsChanged = true;
|
||||
|
||||
if(deletedTabName.length > 0){
|
||||
Util.showNotify({title: 'Map removed', text: deletedTabName + ' deleted', type: 'warning'});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add new tabs for new maps
|
||||
$.each(tempMapData, function(i, data){
|
||||
if( activeMapIds.indexOf( data.config.id ) === -1 ){
|
||||
// add new map tab
|
||||
|
||||
var newTabElements = tabMapElement.addTab(data.config);
|
||||
|
||||
// check if there is any active map yet (this is not the case
|
||||
// when ALL maps are removed AND new maps are added in one call
|
||||
// e.g. character switch)
|
||||
if(tabMapElement.find('.' + config.mapTabClass + '.active:not(.pull-right)').length === 0){
|
||||
tabMapElement.find('.' + config.mapTabClass + ':not(.pull-right):first a').tab('show');
|
||||
|
||||
activeMapId = data.config.id;
|
||||
}
|
||||
|
||||
// set observer for manually triggered map events
|
||||
newTabElements.contentElement.setTabContentObserver();
|
||||
|
||||
// load all the structure elements for the new tab
|
||||
newTabElements.contentElement.initContentStructure();
|
||||
|
||||
tabsChanged = true;
|
||||
|
||||
Util.showNotify({title: 'Map added', text: data.config.name + ' added', type: 'success'});
|
||||
}
|
||||
});
|
||||
|
||||
// get current active map
|
||||
if(activeMapId === 0){
|
||||
activeMapId = Util.getMapModule().getActiveMap().data('id');
|
||||
}
|
||||
var activeMapData = Util.getCurrentMapData(activeMapId);
|
||||
|
||||
if(activeMapData !== false){
|
||||
// update active map with new mapData
|
||||
var currentTabContentElement = $('#' + config.mapTabIdPrefix + activeMapId);
|
||||
|
||||
$( currentTabContentElement).loadMap( activeMapData, {} );
|
||||
}
|
||||
}else{
|
||||
// create Tab Element
|
||||
tabsChanged = true;
|
||||
|
||||
var options = {
|
||||
barId: config.mapTabBarId
|
||||
};
|
||||
|
||||
tabMapElement = getTabElement(options);
|
||||
|
||||
// add new tab for each map
|
||||
for(var j = 0; j < tempMapData.length; j++){
|
||||
|
||||
var data = tempMapData[j];
|
||||
tabMapElement.addTab(data.config);
|
||||
}
|
||||
|
||||
// add "add" button
|
||||
var tabAddOptions = {
|
||||
id: 0,
|
||||
type: {
|
||||
classTab: MapUtil.getInfoForMap( 'standard', 'classTab')
|
||||
},
|
||||
icon: 'fa-plus',
|
||||
name: 'add',
|
||||
right: true
|
||||
};
|
||||
|
||||
tabMapElement.addTab(tabAddOptions);
|
||||
|
||||
mapModuleElement.prepend(tabMapElement);
|
||||
|
||||
var currentUserData = Util.getCurrentUserData();
|
||||
var promiseStore = MapUtil.getLocaleData('character', currentUserData.character.id);
|
||||
|
||||
promiseStore.then(function(data) {
|
||||
// array key where map data is available (0 == first map found)
|
||||
var mapDataIndex = 0;
|
||||
// tab dom selector
|
||||
var mapKeyTabSelector = 'first';
|
||||
|
||||
if(
|
||||
data &&
|
||||
data.defaultMapId
|
||||
){
|
||||
mapDataIndex = Util.getCurrentMapDataIndex(data.defaultMapId);
|
||||
mapKeyTabSelector = 'nth-child(' + ( mapDataIndex + 1 ) + ')';
|
||||
}
|
||||
|
||||
// ==============================================================
|
||||
|
||||
// this new created module
|
||||
var tabContentElements = tabMapElement.find('.' + config.mapTabContentClass);
|
||||
|
||||
// set observer for manually triggered map events
|
||||
tabContentElements.setTabContentObserver();
|
||||
|
||||
// load all the structure elements for ALL Tab Content Body
|
||||
tabContentElements.initContentStructure();
|
||||
|
||||
// set first Tab active
|
||||
tabMapElement.find('.' + config.mapTabClass + ':' + mapKeyTabSelector + ' a').tab('show');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if(tabsChanged === true){
|
||||
|
||||
// remove previous event handlers
|
||||
var allTabElements = mapModuleElement.getMapTabElements();
|
||||
allTabElements.off('show.bs.tab');
|
||||
allTabElements.off('shown.bs.tab');
|
||||
allTabElements.off('hide.bs.tab');
|
||||
|
||||
|
||||
// check for "new map" action before tap-change
|
||||
allTabElements.on('show.bs.tab', function (e) {
|
||||
var mapId = $(e.target).data('map-id');
|
||||
|
||||
if(mapId > 0){
|
||||
// save mapId as new "default" (local storage)
|
||||
var userData = MapUtil.storeDefaultMapId(mapId);
|
||||
}else{
|
||||
// add new Tab selected
|
||||
$(document).trigger('pf:menuShowMapSettings', {tab: 'new'});
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// load new map right after tab-change
|
||||
allTabElements.on('shown.bs.tab', function (e) {
|
||||
var mapId = $(e.target).data('map-id');
|
||||
var tabMapData = Util.getCurrentMapData(mapId);
|
||||
|
||||
if(tabMapData !== false){
|
||||
// load map
|
||||
var currentTabContentElement = $('#' + config.mapTabIdPrefix + mapId);
|
||||
|
||||
$( currentTabContentElement).loadMap( tabMapData, {showAnimation: true} );
|
||||
|
||||
// "wake up" scrollbar for map and get previous state back
|
||||
var scrollableElement = currentTabContentElement.find('.' + config.mapWrapperClass);
|
||||
$(scrollableElement).mCustomScrollbar( 'update');
|
||||
}else{
|
||||
// no map data found -> remove tab
|
||||
tabMapElement.deleteTab(mapId);
|
||||
}
|
||||
});
|
||||
|
||||
allTabElements.on('hide.bs.tab', function (e) {
|
||||
var newMapId = $(e.relatedTarget).data('map-id');
|
||||
var oldMapId = $(e.target).data('map-id');
|
||||
|
||||
// skip "add button"
|
||||
if(newMapId > 0){
|
||||
var currentTabContentElement = $('#' + config.mapTabIdPrefix + oldMapId);
|
||||
|
||||
// disable scrollbar for map that will be hidden. "freeze" current state
|
||||
var scrollableElement = currentTabContentElement.find('.' + config.mapWrapperClass);
|
||||
$(scrollableElement).mCustomScrollbar( 'disable' );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* collect all data (systems/connections) for export/save from each active map in the map module
|
||||
* if no change detected -> do not attach map data to return array
|
||||
* @returns {Array}
|
||||
*/
|
||||
$.fn.getMapModuleDataForUpdate = function(){
|
||||
|
||||
// get all active map elements for module
|
||||
var mapElements = $(this).getMaps();
|
||||
|
||||
var data = [];
|
||||
for(var i = 0; i < mapElements.length; i++){
|
||||
// get all changed (system / connection) data from this map
|
||||
var mapData = $(mapElements[i]).getMapDataFromClient({forceData: false, checkForChange: true});
|
||||
|
||||
if(mapData !== false){
|
||||
|
||||
if(
|
||||
mapData.data.systems.length > 0 ||
|
||||
mapData.data.connections.length > 0
|
||||
){
|
||||
data.push(mapData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
1
public/js/v1.1.5/app/notification.js.map
Normal file
1
public/js/v1.1.5/app/notification.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,69 +0,0 @@
|
||||
/**
|
||||
* Render controller
|
||||
*/
|
||||
|
||||
define(['jquery', 'mustache'], function($, Mustache) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* init function will be called before and after a new module is loaded
|
||||
* @param functionName
|
||||
* @param config
|
||||
*/
|
||||
var initModule = function(functionName, config){
|
||||
|
||||
if(
|
||||
typeof config.functions === 'object' &&
|
||||
typeof config.functions[functionName] === 'function'
|
||||
){
|
||||
config.functions[functionName]();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* load a template and render is with Mustache
|
||||
* @param config
|
||||
* @param data
|
||||
*/
|
||||
var showModule = function(config, data){
|
||||
|
||||
// require module template
|
||||
requirejs(['text!templates/' + config.name + '.html'], function(template) {
|
||||
|
||||
// check for an id, if module already exists, do not insert again
|
||||
if(
|
||||
data.id === 'undefined' ||
|
||||
$('#' + data.id).length === 0
|
||||
){
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
// display module
|
||||
switch(config.link){
|
||||
case 'prepend':
|
||||
config.position.prepend(content);
|
||||
break;
|
||||
case 'before':
|
||||
config.position.before(content);
|
||||
break;
|
||||
case 'after':
|
||||
config.position.after(content);
|
||||
break;
|
||||
default:
|
||||
config.position.append(content);
|
||||
}
|
||||
}
|
||||
|
||||
// init module function after render
|
||||
initModule('after', config);
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
showModule: showModule
|
||||
};
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
1
public/js/v1.1.5/app/setup.js.map
Normal file
1
public/js/v1.1.5/app/setup.js.map
Normal file
File diff suppressed because one or more lines are too long
@@ -1,314 +0,0 @@
|
||||
/**
|
||||
* Demo SVG map
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'lazylinepainter'
|
||||
], function($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
headerSystemsContainerId: 'pf-header-systems', // id for systems layer
|
||||
headerSystemConnectorsId: 'pf-header-connectors', // id for connectors layer
|
||||
headerConnectionsContainerId: 'pf-header-connections', // id for connections layer
|
||||
headerBackgroundContainerId: 'pf-header-background', // id for background layer
|
||||
|
||||
headerSystemClass: 'pf-header-system', // class for all header background systems
|
||||
|
||||
// map dimensions
|
||||
mapWidth: 600, // map width (px)
|
||||
mapHeight: 380 // map height (px)
|
||||
};
|
||||
|
||||
/**
|
||||
* draw systems layer
|
||||
* @param callback
|
||||
*/
|
||||
var drawSystems = function(callback){
|
||||
|
||||
var pathObj = {
|
||||
systems: {
|
||||
strokepath: [
|
||||
// systems =======================================================================
|
||||
// 1
|
||||
{
|
||||
path: 'm 155 30 90 0 c 2.8 0 5 2.2 5 5 l 0 10 c 0 2.8 -2.2 5 -5 5 l -90 0 c -2.8 0 -5 -2.2 -5 -5 l 0 -10 c 0 -2.8 2.2 -5 5 -5 z',
|
||||
duration: 500,
|
||||
strokeColor: '#568A89' //teal
|
||||
},
|
||||
// 2
|
||||
{
|
||||
path: 'm 374 91 110 0 c 2.8 0 5 2.2 5 5 l 0 10 c 0 2.8 -2.2 5 -5 5 l -110 0 c -2.8 0 -5 -2.2 -5 -5 l 0 -10 c 0 -2.8 2.2 -5 5 -5 z',
|
||||
duration: 500,
|
||||
strokeColor: '#63676A' //gray
|
||||
},
|
||||
// 3
|
||||
{
|
||||
path: 'm 15 149 90 0 c 2.8 0 5 2.2 5 5 l 0 30 c 0 2.8 -2.2 5 -5 5 l -90 0 c -2.8 0 -5 -2.2 -5 -5 l 0 -30 c 0 -2.8 2.2 -5 5 -5 z',
|
||||
duration: 500,
|
||||
strokeColor: '#D9534F ' //red
|
||||
},
|
||||
// 4
|
||||
{
|
||||
path: 'm 235 230 90 0 c 2.8 0 5 2.2 5 5 l 0 10 c 0 2.8 -2.2 5 -5 5 l -90 0 c -2.8 0 -5 -2.2 -5 -5 l 0 -10 c 0 -2.8 2.2 -5 5 -5 z',
|
||||
duration: 500,
|
||||
strokeColor: '#63676A' //gray
|
||||
},
|
||||
// 5
|
||||
{
|
||||
path: 'm 175 330 90 0 c 2.8 0 5 2.2 5 5 l 0 30 c 0 2.8 -2.2 5 -5 5 l -90 0 c -2.8 0 -5 -2.2 -5 -5 l 0 -30 c 0 -2.8 2.2 -5 5 -5 z',
|
||||
duration: 500,
|
||||
strokeColor: '#E28A0D ' //orange
|
||||
},
|
||||
// 6
|
||||
{
|
||||
path: 'm 436 312 90 0 c 2.8 0 5 2.2 5 5 l 0 10 c 0 2.8 -2.2 5 -5 5 l -90 0 c -2.8 0 -5 -2.2 -5 -5 l 0 -10 c 0 -2.8 2.2 -5 5 -5 z',
|
||||
duration: 500,
|
||||
strokeColor: '#5CB85C ' //green
|
||||
}
|
||||
],
|
||||
dimensions: {
|
||||
width: config.mapWidth,
|
||||
height: config.mapHeight
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// draw systems into header
|
||||
$('#' + config.headerSystemsContainerId).lazylinepainter(
|
||||
{
|
||||
svgData: pathObj,
|
||||
strokeWidth: 2,
|
||||
strokeOpacity: 1,
|
||||
overrideKey: 'systems',
|
||||
strokeJoin: 'miter',
|
||||
strokeCap: 'butt',
|
||||
delay: 1000,
|
||||
onComplete: function(){
|
||||
drawConnectors(callback);
|
||||
}
|
||||
|
||||
}).lazylinepainter('paint');
|
||||
};
|
||||
|
||||
/**
|
||||
* draw connectors layer
|
||||
* @param callback
|
||||
*/
|
||||
var drawConnectors = function(callback){
|
||||
|
||||
var connectorDuration = 150;
|
||||
|
||||
var pathObj = {
|
||||
connectors: {
|
||||
strokepath: [
|
||||
// connectors ====================================================================
|
||||
// 1
|
||||
{
|
||||
path: 'm 250.4 34.8 c 1.7 0 3.1 1.3 3.9 2.9 0.8 1.7 0.8 3.7 0 5.3 -0.8 1.7 -2.4 2.7 -4 2.7',
|
||||
duration: connectorDuration
|
||||
},
|
||||
{
|
||||
path: 'm 150 34.7 c -1.7 0 -3.1 1.3 -3.9 2.9 -0.8 1.7 -0.8 3.7 0 5.3 0.8 1.7 2.4 2.7 4 2.7',
|
||||
duration: connectorDuration
|
||||
},
|
||||
// 2
|
||||
{
|
||||
path: 'm 369 96 c -1.7 0 -3.1 1.3 -3.9 2.9 -0.8 1.7 -0.8 3.7 0 5.3 0.8 1.7 2.4 2.7 4 2.7',
|
||||
duration: connectorDuration
|
||||
},
|
||||
// 3
|
||||
{
|
||||
path: 'm 110.4 165 c 1.7 0 3.1 1.3 3.9 2.9 0.8 1.7 0.8 3.7 0 5.3 -0.8 1.7 -2.4 2.7 -4 2.7',
|
||||
duration: connectorDuration
|
||||
},
|
||||
{
|
||||
path: 'm 56 148 c 0 -1.7 1.3 -3.1 2.9 -3.9 1.7 -0.8 3.7 -0.8 5.3 0 1.7 0.8 2.7 2.4 2.7 4',
|
||||
duration: connectorDuration
|
||||
},
|
||||
// 4
|
||||
{
|
||||
path: 'm 229 236 c -1.7 0 -3.1 1.3 -3.9 2.9 -0.8 1.7 -0.8 3.7 0 5.3 0.8 1.7 2.4 2.7 4 2.7',
|
||||
duration: connectorDuration
|
||||
},
|
||||
{
|
||||
path: 'm 331 234.7 c 1.7 0 3.1 1.3 3.9 2.9 0.8 1.7 0.8 3.7 0 5.3 -0.8 1.7 -2.4 2.7 -4 2.7',
|
||||
duration: connectorDuration
|
||||
},
|
||||
{
|
||||
path: 'm 285 251 c 0 1.7 -1.3 3.1 -2.9 3.9 -1.7 0.8 -3.7 0.8 -5.3 0 -1.7 -0.8 -2.7 -2.4 -2.7 -4',
|
||||
duration: connectorDuration
|
||||
},
|
||||
// 5
|
||||
{
|
||||
path: 'm 213 329.5 c 0 -1.7 1.3 -3.1 2.9 -3.9 1.7 -0.8 3.7 -0.8 5.3 0 1.7 0.8 2.7 2.4 2.7 4',
|
||||
duration: connectorDuration
|
||||
},
|
||||
// 6
|
||||
{
|
||||
path: 'm 430 316 c -1.7 0 -3.1 1.3 -3.9 2.9 -0.8 1.7 -0.8 3.7 0 5.3 0.8 1.7 2.4 2.7 4 2.7',
|
||||
duration: connectorDuration
|
||||
}
|
||||
],
|
||||
dimensions: {
|
||||
width: config.mapWidth,
|
||||
height: config.mapHeight
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// draw systems into header
|
||||
$('#' + config.headerConnectionsContainerId).lazylinepainter(
|
||||
{
|
||||
svgData: pathObj,
|
||||
strokeWidth: 2,
|
||||
duration: 600,
|
||||
drawSequential: false,
|
||||
strokeOpacity: 1,
|
||||
overrideKey: 'connectors',
|
||||
strokeJoin: 'miter',
|
||||
strokeCap: 'butt',
|
||||
strokeColor: '#63676A', //gray
|
||||
onComplete: function(){
|
||||
drawConnections(callback);
|
||||
}
|
||||
|
||||
}).lazylinepainter('paint');
|
||||
};
|
||||
|
||||
/**
|
||||
* draw connections layer
|
||||
* @param callback
|
||||
*/
|
||||
var drawConnections = function(callback){
|
||||
|
||||
var connectionDuration = 250;
|
||||
var connectionWidth = 8;
|
||||
var connectionInnerWidth = 4;
|
||||
var connectionBorderColor = '#63676A'; //gray
|
||||
|
||||
var pathObj = {
|
||||
connections: {
|
||||
strokepath: [
|
||||
// connections ====================================================================
|
||||
// 1 - 2
|
||||
{
|
||||
path: 'm 255,40 c 44.5,0 64.2,61.1 109.0,61.15',
|
||||
duration: connectionDuration,
|
||||
strokeWidth: connectionWidth
|
||||
},
|
||||
{
|
||||
path: 'm 255,40 c 44.5,0 64.2,61.1 109.0,61.15',
|
||||
duration: connectionDuration,
|
||||
strokeWidth: connectionInnerWidth,
|
||||
strokeColor: '#3C3F41' // gray
|
||||
},
|
||||
// 2 - 3
|
||||
{
|
||||
path: 'm 146,40.0 c -51.7,0 -83.8,58.8 -83.8,104.5',
|
||||
duration: connectionDuration,
|
||||
strokeWidth: connectionWidth
|
||||
},
|
||||
{
|
||||
path: 'm 146,40.0 c -51.7,0 -83.8,58.8 -83.8,104.5',
|
||||
duration: connectionDuration,
|
||||
strokeWidth: connectionInnerWidth,
|
||||
strokeColor: '#E28A0D' // orange
|
||||
},
|
||||
// 3 - 4
|
||||
{
|
||||
path: 'm 115,171 c 45.7,0 64.1,71.2 109.6,70.8',
|
||||
duration: connectionDuration,
|
||||
strokeWidth: connectionWidth
|
||||
},
|
||||
{
|
||||
path: 'm 115,171 c 45.7,0 64.1,71.2 109.6,70.8',
|
||||
duration: connectionDuration,
|
||||
strokeWidth: connectionInnerWidth,
|
||||
strokeColor: '#A52521' // red
|
||||
},
|
||||
// 4 - 5
|
||||
{
|
||||
path: 'm 279,256 c 0.5,35.9 -60.1,35.1 -60.1,70.0',
|
||||
duration: connectionDuration,
|
||||
strokeWidth: connectionWidth
|
||||
},
|
||||
{
|
||||
path: 'm 279,256 c 0.5,35.9 -60.1,35.1 -60.1,70.0',
|
||||
duration: connectionDuration,
|
||||
strokeWidth: connectionInnerWidth,
|
||||
strokeColor: '#3C3F41' // gray
|
||||
},
|
||||
// 4 - 6
|
||||
{
|
||||
path: 'm 335,240 c 44.2,0 43.7,81.6 89.9,81.6',
|
||||
duration: connectionDuration,
|
||||
strokeWidth: connectionWidth
|
||||
},
|
||||
{
|
||||
path: 'm 335,240 c 44.2,0 43.7,81.6 89.9,81.6',
|
||||
duration: connectionDuration,
|
||||
strokeWidth: connectionInnerWidth,
|
||||
strokeColor: '#3C3F41' // gray
|
||||
}
|
||||
],
|
||||
dimensions: {
|
||||
width: config.mapWidth,
|
||||
height: config.mapHeight
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// draw systems into header
|
||||
$('#' + config.headerSystemConnectorsId).lazylinepainter(
|
||||
{
|
||||
svgData: pathObj,
|
||||
strokeWidth: 2,
|
||||
duration: 600,
|
||||
// drawSequential: false,
|
||||
strokeOpacity: 1,
|
||||
overrideKey: 'connections',
|
||||
strokeJoin: 'miter',
|
||||
strokeCap: 'butt',
|
||||
strokeColor: connectionBorderColor,
|
||||
onComplete: function(){
|
||||
drawBackground(callback);
|
||||
}
|
||||
|
||||
}).lazylinepainter('paint');
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* draw background layer
|
||||
* @param callback
|
||||
*/
|
||||
var drawBackground = function(callback){
|
||||
$('#' + config.headerBackgroundContainerId + ' .' + config.headerSystemClass).velocity('transition.bounceUpIn', {
|
||||
stagger: 150,
|
||||
complete: function(){
|
||||
if(typeof callback === 'function'){
|
||||
callback();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* draws the demo map
|
||||
* @param callback
|
||||
*/
|
||||
$.fn.drawDemoMap = function(callback){
|
||||
var canvasElement = $(this);
|
||||
|
||||
|
||||
// draw systems
|
||||
drawSystems(callback);
|
||||
};
|
||||
|
||||
});
|
||||
@@ -1,209 +0,0 @@
|
||||
/**
|
||||
* user settings/share dialog
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'bootbox'
|
||||
], function($, Init, Util, Render, bootbox) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// select character dialog
|
||||
settingsDialogId: 'pf-settings-dialog', // id for "settings" dialog
|
||||
settingsAccountContainerId: 'pf-settings-dialog-account', // id for the "account" container
|
||||
settingsShareContainerId: 'pf-settings-dialog-share', // id for the "share" container
|
||||
|
||||
// captcha
|
||||
captchaKeyUpdateAccount: 'SESSION.CAPTCHA.ACCOUNT.UPDATE', // key for captcha reason
|
||||
captchaImageWrapperId: 'pf-dialog-captcha-wrapper', // id for "captcha image" wrapper
|
||||
captchaImageId: 'pf-dialog-captcha-image', // id for "captcha image"
|
||||
|
||||
loadingOptions: { // config for loading overlay
|
||||
icon: {
|
||||
size: 'fa-2x'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* show "register/settings" dialog
|
||||
* @returns {boolean}
|
||||
*/
|
||||
$.fn.showSettingsDialog = function(){
|
||||
|
||||
// check if there are other dialogs open
|
||||
var openDialogs = Util.getOpenDialogs();
|
||||
if(openDialogs.length > 0){
|
||||
return false;
|
||||
}
|
||||
|
||||
requirejs(['text!templates/dialog/settings.html', 'mustache'], function(template, Mustache) {
|
||||
|
||||
var data = {
|
||||
id: config.settingsDialogId,
|
||||
settingsAccountContainerId: config.settingsAccountContainerId,
|
||||
settingsShareContainerId: config.settingsShareContainerId,
|
||||
userData: Init.currentUserData,
|
||||
captchaImageWrapperId: config.captchaImageWrapperId,
|
||||
captchaImageId: config.captchaImageId,
|
||||
formErrorContainerClass: Util.config.formErrorContainerClass,
|
||||
ccpImageServer: Init.url.ccpImageServer
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
var accountSettingsDialog = bootbox.dialog({
|
||||
title: 'Account settings',
|
||||
message: content,
|
||||
buttons: {
|
||||
close: {
|
||||
label: 'cancel',
|
||||
className: 'btn-default'
|
||||
},
|
||||
success: {
|
||||
label: '<i class="fa fa-check fa-fw"></i> save',
|
||||
className: 'btn-success',
|
||||
callback: function() {
|
||||
|
||||
// get the current active form
|
||||
var form = $('#' + config.settingsDialogId).find('form').filter(':visible');
|
||||
|
||||
// validate form
|
||||
form.validator('validate');
|
||||
|
||||
// check whether the form is valid
|
||||
var formValid = form.isValidForm();
|
||||
|
||||
if(formValid === true){
|
||||
var tabFormValues = form.getFormValues();
|
||||
|
||||
// send Tab data and store values
|
||||
var requestData = {
|
||||
formData: tabFormValues
|
||||
};
|
||||
|
||||
accountSettingsDialog.find('.modal-content').showLoadingAnimation();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Init.path.saveUserConfig,
|
||||
data: requestData,
|
||||
dataType: 'json'
|
||||
}).done(function(responseData){
|
||||
accountSettingsDialog.find('.modal-content').hideLoadingAnimation();
|
||||
|
||||
// set new captcha for any request
|
||||
// captcha is required for sensitive data (not for all data)
|
||||
if(
|
||||
responseData.error &&
|
||||
responseData.error.length > 0
|
||||
){
|
||||
form.showFormMessage(responseData.error);
|
||||
|
||||
$('#' + config.captchaImageWrapperId).showCaptchaImage(config.captchaKeyUpdateAccount, function(){
|
||||
$('#captcha').resetFormFields();
|
||||
});
|
||||
}else{
|
||||
// store new/updated user data -> update head
|
||||
if(responseData.userData){
|
||||
Util.setCurrentUserData(responseData.userData);
|
||||
}
|
||||
|
||||
form.find('.alert').velocity('transition.slideDownOut',{
|
||||
duration: 500,
|
||||
complete: function(){
|
||||
$('#' + config.captchaImageWrapperId).showCaptchaImage(config.captchaKeyUpdateAccount, function(){
|
||||
$('#captcha').resetFormFields();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Util.showNotify({title: 'Account saved', type: 'success'});
|
||||
|
||||
// close dialog/menu
|
||||
$(document).trigger('pf:closeMenu', [{}]);
|
||||
accountSettingsDialog.modal('hide');
|
||||
}
|
||||
|
||||
}).fail(function( jqXHR, status, error) {
|
||||
accountSettingsDialog.find('.modal-content').hideLoadingAnimation();
|
||||
|
||||
var reason = status + ' ' + error;
|
||||
Util.showNotify({title: jqXHR.status + ': saveAccountSettings', text: reason, type: 'error'});
|
||||
|
||||
// set new captcha for any request
|
||||
// captcha is required for sensitive data (not for all)
|
||||
$('#' + config.captchaImageWrapperId).showCaptchaImage(config.captchaKeyUpdateAccount, function(){
|
||||
$('#captcha').resetFormFields();
|
||||
});
|
||||
|
||||
// check for DB errors
|
||||
if(jqXHR.status === 500){
|
||||
|
||||
if(jqXHR.responseText){
|
||||
var errorObj = $.parseJSON(jqXHR.responseText);
|
||||
|
||||
if(
|
||||
errorObj.error &&
|
||||
errorObj.error.length > 0
|
||||
){
|
||||
form.showFormMessage(errorObj.error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(document).setProgramStatus('problem');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// after modal is shown =======================================================================
|
||||
accountSettingsDialog.on('shown.bs.modal', function(e) {
|
||||
|
||||
var dialogElement = $(this);
|
||||
var form = dialogElement.find('form');
|
||||
|
||||
// request captcha image and show
|
||||
var captchaImageWrapperContainer = $('#' + config.captchaImageWrapperId);
|
||||
captchaImageWrapperContainer.showCaptchaImage(config.captchaKeyUpdateAccount);
|
||||
|
||||
// init captcha refresh button
|
||||
captchaImageWrapperContainer.find('i').on('click', function(){
|
||||
captchaImageWrapperContainer.showCaptchaImage(config.captchaKeyUpdateAccount);
|
||||
});
|
||||
|
||||
|
||||
// init dialog tooltips
|
||||
dialogElement.initTooltips();
|
||||
|
||||
form.initFormValidation();
|
||||
});
|
||||
|
||||
// events for tab change
|
||||
accountSettingsDialog.find('.navbar a').on('shown.bs.tab', function(e){
|
||||
|
||||
// init "toggle" switches on current active tab
|
||||
accountSettingsDialog.find( $(this).attr('href') ).find('input[type="checkbox"]').bootstrapToggle({
|
||||
on: '<i class="fa fa-fw fa-check"></i> Enable',
|
||||
off: 'Disable <i class="fa fa-fw fa-ban"></i>',
|
||||
onstyle: 'success',
|
||||
offstyle: 'warning',
|
||||
width: 90,
|
||||
height: 30
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -1,51 +0,0 @@
|
||||
/**
|
||||
* credits dialog
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'bootbox',
|
||||
'app/ui/logo'
|
||||
], function($, Init, Util, Render, bootbox) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// jump info dialog
|
||||
creditsDialogClass: 'pf-credits-dialog', // class for credits dialog
|
||||
creditsDialogLogoContainerId: 'pf-logo-container' // id for logo element
|
||||
};
|
||||
|
||||
/**
|
||||
* show jump info dialog
|
||||
*/
|
||||
$.fn.showCreditsDialog = function(callback, enableHover){
|
||||
|
||||
requirejs(['text!templates/dialog/credit.html', 'mustache'], function(template, Mustache) {
|
||||
|
||||
var data = {
|
||||
logoContainerId: config.creditsDialogLogoContainerId,
|
||||
version: $('body').data('version')
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
var creditDialog = bootbox.dialog({
|
||||
className: config.creditsDialogClass,
|
||||
title: 'Licence',
|
||||
message: content
|
||||
});
|
||||
|
||||
// after modal is shown =======================================================================
|
||||
creditDialog.on('shown.bs.modal', function(e) {
|
||||
|
||||
// load Logo svg
|
||||
creditDialog.find('#' + config.creditsDialogLogoContainerId).drawLogo(callback, enableHover);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
@@ -1,116 +0,0 @@
|
||||
/**
|
||||
* delete account dialog
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'bootbox'
|
||||
], function($, Init, Util, bootbox) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// global dialog
|
||||
deleteAccountId: 'pf-dialog-delete-account', // dialog id
|
||||
|
||||
// captcha
|
||||
captchaKeyDeleteAccount: 'SESSION.CAPTCHA.ACCOUNT.DELETE', // key for captcha reason
|
||||
captchaImageWrapperId: 'pf-dialog-captcha-wrapper' // id for "captcha image" wrapper
|
||||
};
|
||||
|
||||
/**
|
||||
* shows delete account dialog
|
||||
*/
|
||||
$.fn.showDeleteAccountDialog = function(){
|
||||
|
||||
|
||||
requirejs(['text!templates/dialog/delete_account.html', 'mustache'], function(template, Mustache) {
|
||||
|
||||
var data = {
|
||||
deleteAccountId: config.deleteAccountId,
|
||||
userData: Util.getCurrentUserData(),
|
||||
captchaImageWrapperId: config.captchaImageWrapperId,
|
||||
formErrorContainerClass: Util.config.formErrorContainerClass
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
var deleteAccountDialog = bootbox.dialog({
|
||||
title: 'Delete account',
|
||||
message: content,
|
||||
buttons: {
|
||||
close: {
|
||||
label: 'cancel',
|
||||
className: 'btn-default'
|
||||
},
|
||||
success: {
|
||||
label: '<i class="fa fa-user-times fa-fw"></i> delete account',
|
||||
className: 'btn-danger',
|
||||
callback: function() {
|
||||
var dialogElement = $(this);
|
||||
var form = dialogElement.find('form');
|
||||
|
||||
// validate form
|
||||
form.validator('validate');
|
||||
var formValid = form.isValidForm();
|
||||
|
||||
if(formValid){
|
||||
|
||||
var formValues = form.getFormValues();
|
||||
|
||||
if(! $.isEmptyObject(formValues) ){
|
||||
// send Tab data and store values
|
||||
var requestData = {
|
||||
formData: formValues
|
||||
};
|
||||
|
||||
dialogElement.find('.modal-content').showLoadingAnimation();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Init.path.deleteAccount,
|
||||
data: requestData,
|
||||
dataType: 'json'
|
||||
}).done(function(responseData){
|
||||
dialogElement.find('.modal-content').hideLoadingAnimation();
|
||||
|
||||
if(responseData.reroute !== undefined){
|
||||
Util.redirect(responseData.reroute, []);
|
||||
}else if(
|
||||
responseData.error &&
|
||||
responseData.error.length > 0
|
||||
){
|
||||
form.showFormMessage(responseData.error);
|
||||
|
||||
$('#' + config.captchaImageWrapperId).showCaptchaImage(config.captchaKeyDeleteAccount, function(){
|
||||
form.find('[name="captcha"]').resetFormFields();
|
||||
});
|
||||
}
|
||||
|
||||
}).fail(function( jqXHR, status, error) {
|
||||
dialogElement.find('.modal-content').hideLoadingAnimation();
|
||||
|
||||
var reason = status + ' ' + error;
|
||||
Util.showNotify({title: jqXHR.status + ': deleteAccount', text: reason, type: 'error'});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// after modal is shown =======================================================================
|
||||
deleteAccountDialog.on('shown.bs.modal', function(e) {
|
||||
// request captcha image and show
|
||||
$('#' + config.captchaImageWrapperId).showCaptchaImage(config.captchaKeyDeleteAccount);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* jump info dialog
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'bootbox',
|
||||
], function($, Init, Util, Render, bootbox) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// jump info dialog
|
||||
jumpInfoDialogClass: 'pf-jump-info-dialog' // class for jump info dialog
|
||||
};
|
||||
|
||||
/**
|
||||
* show jump info dialog
|
||||
*/
|
||||
$.fn.showJumpInfoDialog = function(){
|
||||
|
||||
requirejs(['text!templates/dialog/jump_info.html', 'mustache'], function(template, Mustache) {
|
||||
|
||||
var data = {};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
var signatureReaderDialog = bootbox.dialog({
|
||||
className: config.jumpInfoDialogClass,
|
||||
title: 'Wormhole jump information',
|
||||
message: content
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
@@ -1,172 +0,0 @@
|
||||
/**
|
||||
* map manual dialog
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'bootbox',
|
||||
], function($, Init, Util, Render, bootbox) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var 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
|
||||
|
||||
// map manual dialog
|
||||
mapManualScrollspyId: 'pf-manual-scrollspy' // id for map manual scrollspy
|
||||
};
|
||||
|
||||
/**
|
||||
* shows the map manual modal dialog
|
||||
*/
|
||||
$.fn.showMapManual = function(){
|
||||
|
||||
requirejs(['text!templates/dialog/map_manual.html', 'mustache'], function(template, Mustache) {
|
||||
|
||||
var data = {
|
||||
dialogNavigationClass: config.dialogNavigationClass,
|
||||
dialogNavLiClass: config.dialogNavigationListItemClass,
|
||||
scrollspyId: config.mapManualScrollspyId,
|
||||
pieChartClass : Init.classes.pieChart.pieChartMapCounterClass,
|
||||
mapCounterClass : Init.classes.pieChart.pieChartMapCounterClass
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
// show dialog
|
||||
var mapManualDialog = bootbox.dialog({
|
||||
title: 'Manual',
|
||||
message: content,
|
||||
size: 'large',
|
||||
buttons: {
|
||||
success: {
|
||||
label: 'close',
|
||||
className: 'btn-default',
|
||||
callback: function() {
|
||||
$(mapManualDialog).modal('hide');
|
||||
}
|
||||
}
|
||||
},
|
||||
show: true
|
||||
});
|
||||
|
||||
// modal offset top
|
||||
var modalOffsetTop = 200;
|
||||
|
||||
// disable on scroll event
|
||||
var disableOnScrollEvent = false;
|
||||
|
||||
// scroll breakpoints
|
||||
var scrolLBreakpointElements = null;
|
||||
// scroll navigation links
|
||||
var scrollNavLiElements = null;
|
||||
|
||||
mapManualDialog.on('shown.bs.modal', function(e) {
|
||||
// modal on open
|
||||
scrolLBreakpointElements = $('.pf-manual-scroll-break');
|
||||
scrollNavLiElements = $('.' + config.dialogNavigationListItemClass);
|
||||
});
|
||||
|
||||
var scrollspyElement = $('#' + config.mapManualScrollspyId);
|
||||
|
||||
var whileScrolling = function(){
|
||||
|
||||
if(disableOnScrollEvent === false){
|
||||
for(var i = 0; i < scrolLBreakpointElements.length; i++){
|
||||
var offset = $(scrolLBreakpointElements[i]).offset().top;
|
||||
|
||||
if( (offset - modalOffsetTop) > 0){
|
||||
|
||||
if(! $( scrollNavLiElements[i]).hasClass('active')){
|
||||
// remove all active classes
|
||||
scrollNavLiElements.removeClass('active');
|
||||
// remove focus on links
|
||||
scrollNavLiElements.find('a').blur();
|
||||
|
||||
$( scrollNavLiElements[i]).addClass('active');
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// init scrollbar
|
||||
scrollspyElement.mCustomScrollbar({
|
||||
axis: 'y',
|
||||
theme: 'light-thick',
|
||||
scrollInertia: 200,
|
||||
autoExpandScrollbar: false,
|
||||
scrollButtons:{
|
||||
scrollAmount: 30,
|
||||
enable: true
|
||||
},
|
||||
advanced: {
|
||||
updateOnBrowserResize: true,
|
||||
updateOnContentResize: true
|
||||
},
|
||||
callbacks:{
|
||||
onInit: function(){
|
||||
// init fake-map update counter
|
||||
scrollspyElement.find('.' + data.mapCounterClass).initMapUpdateCounter();
|
||||
|
||||
// set navigation button observer
|
||||
var mainNavigationLinks = $('.' + config.dialogNavigationClass).find('a');
|
||||
// text anchor links
|
||||
var subNavigationLinks = scrollspyElement.find('a[data-target]');
|
||||
|
||||
var navigationLinks = mainNavigationLinks.add(subNavigationLinks);
|
||||
|
||||
navigationLinks.on('click', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
disableOnScrollEvent = true;
|
||||
|
||||
// scroll to anchor
|
||||
scrollspyElement.mCustomScrollbar('scrollTo', $(this).attr('data-target'));
|
||||
|
||||
var mainNavigationLiElement = $(this).parent('.' + config.dialogNavigationListItemClass);
|
||||
|
||||
|
||||
whileScrolling();
|
||||
|
||||
// if link is a main navigation link (not an anchor link)
|
||||
|
||||
if(mainNavigationLiElement.length > 0){
|
||||
// remove all active classes
|
||||
scrollNavLiElements.removeClass('active');
|
||||
|
||||
// set new active class
|
||||
$(this).parent().addClass('active');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
onScroll: function(){
|
||||
disableOnScrollEvent = false;
|
||||
|
||||
whileScrolling();
|
||||
},
|
||||
whileScrolling: whileScrolling
|
||||
},
|
||||
mouseWheel:{
|
||||
enable: true,
|
||||
scrollAmount: 200,
|
||||
axis: 'y',
|
||||
preventDefault: true // do not scroll parent at the end
|
||||
},
|
||||
scrollbarPosition: 'outsite',
|
||||
autoDraggerLength: true
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
@@ -1,831 +0,0 @@
|
||||
/**
|
||||
* map info dialog
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'bootbox',
|
||||
'app/map/util'
|
||||
], function($, Init, Util, bootbox, MapUtil) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// global dialog
|
||||
dialogNavigationClass: 'pf-dialog-navigation-list', // class for dialog navigation bar
|
||||
|
||||
// map info dialog/tabs
|
||||
dialogMapInfoSummaryId: 'pf-map-info-dialog-summary', // id for map "summary" container
|
||||
dialogMapInfoUsersId: 'pf-map-info-dialog-users', // id for map "user" container
|
||||
dialogMapInfoRefreshId: 'pf-map-info-dialog-refresh', // id for map "refresh" container
|
||||
|
||||
// "summary" container
|
||||
mapInfoId: 'pf-map-info', // id for map info
|
||||
mapInfoSystemsId: 'pf-map-info-systems', // id for map info systems box
|
||||
mapInfoConnectionsId: 'pf-map-info-connections', // id for map info connections box
|
||||
mapInfoUsersId: 'pf-map-info-users', // id for map info users box
|
||||
|
||||
mapInfoTableClass: 'pf-map-info-table', // class for data
|
||||
mapInfoLifetimeCounterClass: 'pf-map-info-lifetime-counter', // class for map lifetime counter
|
||||
|
||||
// dataTable
|
||||
tableImageCellClass: 'pf-table-image-cell', // class for table "image" cells
|
||||
tableImageSmallCellClass: 'pf-table-image-small-cell', // class for table "small image" cells
|
||||
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'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// confirmation dialog settings (e.g. delete row)
|
||||
var confirmationSettings = {
|
||||
container: 'body',
|
||||
placement: 'left',
|
||||
btnCancelClass: 'btn btn-sm btn-default',
|
||||
btnCancelLabel: 'cancel',
|
||||
btnCancelIcon: 'fa fa-fw fa-ban',
|
||||
btnOkClass: 'btn btn-sm btn-danger',
|
||||
btnOkLabel: 'delete',
|
||||
btnOkIcon: 'fa fa-fw fa-close'
|
||||
};
|
||||
|
||||
/**
|
||||
* loads the map info data into an element
|
||||
* @param mapData
|
||||
*/
|
||||
$.fn.loadMapInfoData = function(mapData){
|
||||
|
||||
var mapElement = $(this);
|
||||
|
||||
mapElement.empty();
|
||||
|
||||
mapElement.showLoadingAnimation(config.loadingOptions);
|
||||
|
||||
var countSystems = mapData.data.systems.length;
|
||||
var countConnections = mapData.data.connections.length;
|
||||
|
||||
// map type
|
||||
var mapTypes = MapUtil.getMapTypes();
|
||||
var mapTypeName = '';
|
||||
var mapTypeClass = '';
|
||||
for(var i = 0; i < mapTypes.length; i++){
|
||||
if(mapTypes[i].id === mapData.config.type.id){
|
||||
mapTypeName = mapTypes[i].name;
|
||||
mapTypeClass = mapTypes[i].class;
|
||||
}
|
||||
}
|
||||
|
||||
var dlElementLeft = $('<dl>', {
|
||||
class: 'dl-horizontal',
|
||||
css: {'float': 'left'}
|
||||
}).append(
|
||||
$('<dt>').text( 'Icon' )
|
||||
).append(
|
||||
$('<dd>').append(
|
||||
$('<i>', {
|
||||
class: ['fa', 'fa-fw', mapData.config.icon].join(' ')
|
||||
})
|
||||
)
|
||||
).append(
|
||||
$('<dt>').text( 'Name' )
|
||||
).append(
|
||||
$('<dd>').text( mapData.config.name )
|
||||
).append(
|
||||
$('<dt>').text( 'Type' )
|
||||
).append(
|
||||
$('<dd>', {
|
||||
class: mapTypeClass
|
||||
}).text( mapTypeName )
|
||||
);
|
||||
|
||||
mapElement.append(dlElementLeft);
|
||||
|
||||
var dlElementRight = $('<dl>', {
|
||||
class: 'dl-horizontal',
|
||||
css: {'float': 'right'}
|
||||
}).append(
|
||||
$('<dt>').text( 'Lifetime' )
|
||||
).append(
|
||||
$('<dd>', {
|
||||
class: config.mapInfoLifetimeCounterClass,
|
||||
text: mapData.config.created
|
||||
})
|
||||
).append(
|
||||
$('<dt>').text( 'Systems' )
|
||||
).append(
|
||||
$('<dd>').text( countSystems )
|
||||
).append(
|
||||
$('<dt>').text( 'Connections' )
|
||||
).append(
|
||||
$('<dd>').text( countConnections )
|
||||
);
|
||||
|
||||
mapElement.append(dlElementRight);
|
||||
|
||||
// init map lifetime counter
|
||||
$('.' + config.mapInfoLifetimeCounterClass).initTimestampCounter();
|
||||
|
||||
|
||||
|
||||
mapElement.hideLoadingAnimation();
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* loads the system info table into an element
|
||||
* @param mapData
|
||||
*/
|
||||
$.fn.loadSystemInfoTable = function(mapData){
|
||||
|
||||
var systemsElement = $(this);
|
||||
|
||||
systemsElement.empty();
|
||||
|
||||
var systemTable = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border', config.mapInfoTableClass].join(' ')
|
||||
});
|
||||
systemsElement.append(systemTable);
|
||||
|
||||
systemsElement.showLoadingAnimation(config.loadingOptions);
|
||||
|
||||
// table init complete
|
||||
systemTable.on( 'init.dt', function () {
|
||||
systemsElement.hideLoadingAnimation();
|
||||
|
||||
// init table tooltips
|
||||
var tooltipElements = systemsElement.find('[data-toggle="tooltip"]');
|
||||
tooltipElements.tooltip();
|
||||
});
|
||||
|
||||
// prepare data for dataTables
|
||||
var systemsData = [];
|
||||
for(var i = 0; i < mapData.data.systems.length; i++){
|
||||
var tempSystemData = mapData.data.systems[i];
|
||||
|
||||
var tempData = {};
|
||||
|
||||
// system id
|
||||
tempData.id = tempSystemData.id;
|
||||
|
||||
// current position
|
||||
if(tempSystemData.currentUser === true){
|
||||
tempData.position = {
|
||||
position: '<i class="fa fa fa-map-marker fa-lg fa-fw"></i>',
|
||||
position_sort: 1
|
||||
};
|
||||
}else{
|
||||
tempData.position = {
|
||||
position: '',
|
||||
position_sort: 0
|
||||
};
|
||||
}
|
||||
|
||||
// active pilots
|
||||
if(tempSystemData.userCount > 0){
|
||||
tempData.userCount = tempSystemData.userCount;
|
||||
}else{
|
||||
tempData.userCount = '';
|
||||
}
|
||||
|
||||
// type
|
||||
tempData.type = {
|
||||
type: MapUtil.getSystemTypeInfo(tempSystemData.type.id, 'name'),
|
||||
type_sort: tempSystemData.type.id
|
||||
};
|
||||
|
||||
// security
|
||||
var securityClass = Util.getSecurityClassForSystem(tempSystemData.security);
|
||||
tempData.security = {
|
||||
security: '<span class="' + securityClass + '">' + tempSystemData.security + '</span>',
|
||||
security_sort: tempSystemData.security
|
||||
};
|
||||
|
||||
// name
|
||||
tempData.name = tempSystemData.name;
|
||||
|
||||
// region
|
||||
tempData.region = tempSystemData.region.name;
|
||||
|
||||
// static
|
||||
var statics = [];
|
||||
for(var j = 0; j < tempSystemData.statics.length; j++){
|
||||
var security = tempSystemData.statics[j].security;
|
||||
var secClass = Util.getSecurityClassForSystem(security);
|
||||
statics.push('<span class="' + secClass + '">' + security + '</span>');
|
||||
}
|
||||
tempData.static = statics.join(' ');
|
||||
|
||||
// status
|
||||
var systemStatusClass = Util.getStatusInfoForSystem(tempSystemData.status.id, 'class');
|
||||
if(systemStatusClass !== ''){
|
||||
tempData.status = {
|
||||
status: '<i class="fa fa fa-square-o fa-lg fa-fw ' + systemStatusClass + '"></i>',
|
||||
status_sort: tempSystemData.status.id
|
||||
};
|
||||
}else{
|
||||
tempData.status = {
|
||||
status: '',
|
||||
status_sort: tempSystemData.status.id
|
||||
};
|
||||
}
|
||||
|
||||
// effect
|
||||
var systemEffectClass = MapUtil.getEffectInfoForSystem(tempSystemData.effect, 'class');
|
||||
if(systemEffectClass !== ''){
|
||||
tempData.effect = {
|
||||
effect: '<i class="fa fa fa-square fa-lg fa-fw ' + systemEffectClass + '"></i>',
|
||||
effect_sort: tempSystemData.effect
|
||||
};
|
||||
}else{
|
||||
tempData.effect = {
|
||||
effect: '',
|
||||
effect_sort: ''
|
||||
};
|
||||
}
|
||||
|
||||
// trueSec
|
||||
var systemTrueSecClass = Util.getTrueSecClassForSystem(tempSystemData.trueSec);
|
||||
if(systemTrueSecClass !== ''){
|
||||
tempData.trueSec = {
|
||||
trueSec: '<span class="' + systemTrueSecClass + '">' + tempSystemData.trueSec.toFixed(1) + '</span>',
|
||||
trueSec_sort: tempSystemData.trueSec
|
||||
};
|
||||
}else{
|
||||
tempData.trueSec = {
|
||||
trueSec: '',
|
||||
trueSec_sort: tempSystemData.trueSec
|
||||
};
|
||||
}
|
||||
|
||||
// locked
|
||||
if(tempSystemData.locked === 1){
|
||||
tempData.locked = {
|
||||
locked: '<i class="fa fa-lock fa-lg fa-fw"></i>',
|
||||
locked_sort: tempSystemData.locked
|
||||
};
|
||||
}else{
|
||||
tempData.locked = {
|
||||
locked: '',
|
||||
locked_sort: 0
|
||||
};
|
||||
}
|
||||
|
||||
// updated
|
||||
tempData.updated = tempSystemData.updated.updated;
|
||||
|
||||
// delete row
|
||||
tempData.clear = '<i class="fa fa-close txt-color txt-color-redDarker"></i>';
|
||||
|
||||
systemsData.push(tempData);
|
||||
}
|
||||
|
||||
var systemsDataTable = systemTable.dataTable( {
|
||||
pageLength: 20,
|
||||
paging: true,
|
||||
lengthMenu: [[5, 10, 20, 50, -1], [5, 10, 20, 50, 'All']],
|
||||
ordering: true,
|
||||
order: [[ 9, 'desc' ], [ 3, 'asc' ]],
|
||||
autoWidth: false,
|
||||
responsive: {
|
||||
breakpoints: [
|
||||
{ name: 'desktop', width: Infinity },
|
||||
{ name: 'tablet', width: 1200 },
|
||||
{ name: 'fablet', width: 780 },
|
||||
{ name: 'phone', width: 480 }
|
||||
],
|
||||
details: false
|
||||
},
|
||||
hover: false,
|
||||
data: systemsData,
|
||||
columnDefs: [],
|
||||
language: {
|
||||
emptyTable: 'Map is empty',
|
||||
zeroRecords: 'No systems found',
|
||||
lengthMenu: 'Show _MENU_ systems',
|
||||
info: 'Showing _START_ to _END_ of _TOTAL_ systems'
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: 'type',
|
||||
width: '25px',
|
||||
className: ['min-desktop'].join(' '),
|
||||
data: 'type',
|
||||
render: {
|
||||
_: 'type',
|
||||
sort: 'type_sort'
|
||||
}
|
||||
},{
|
||||
title: '',
|
||||
width: '1px',
|
||||
searchable: false,
|
||||
data: 'security',
|
||||
render: {
|
||||
_: 'security',
|
||||
sort: 'security_sort'
|
||||
}
|
||||
},{
|
||||
title: 'sec',
|
||||
width: '18px',
|
||||
className: ['text-center', 'min-desktop'].join(' '),
|
||||
searchable: false,
|
||||
data: 'trueSec',
|
||||
render: {
|
||||
_: 'trueSec',
|
||||
sort: 'trueSec_sort'
|
||||
}
|
||||
},{
|
||||
title: 'system',
|
||||
data: 'name'
|
||||
},{
|
||||
title: 'region',
|
||||
data: 'region'
|
||||
},{
|
||||
title: '<i class="fa fa-square-o fa-lg" title="system status" data-toggle="tooltip"></i>',
|
||||
width: '12px',
|
||||
searchable: false,
|
||||
data: 'status',
|
||||
render: {
|
||||
_: 'status',
|
||||
sort: 'status_sort'
|
||||
}
|
||||
},{
|
||||
title: '<i class="fa fa-square fa-lg" title="system effect" data-toggle="tooltip"></i>',
|
||||
width: '12px',
|
||||
className: 'text-center',
|
||||
searchable: false,
|
||||
data: 'effect',
|
||||
render: {
|
||||
_: 'effect',
|
||||
sort: 'effect_sort'
|
||||
}
|
||||
},{
|
||||
title: 'static',
|
||||
width: '30px',
|
||||
data: 'static'
|
||||
},{
|
||||
title: '<i class="fa fa-map-marker fa-lg" title="your position" data-toggle="tooltip"></i>',
|
||||
width: '8px',
|
||||
searchable: false,
|
||||
data: 'position',
|
||||
render: {
|
||||
_: 'position',
|
||||
sort: 'position_sort'
|
||||
}
|
||||
},{
|
||||
title: '<i class="fa fa-plane fa-lg" title="active pilots" data-toggle="tooltip"></i>',
|
||||
width: '12px',
|
||||
className: 'text-center',
|
||||
searchable: false,
|
||||
data: 'userCount'
|
||||
},{
|
||||
title: '<i class="fa fa-lock fa-lg" title="system locked" data-toggle="tooltip"></i>',
|
||||
width: '10px',
|
||||
searchable: false,
|
||||
data: 'locked',
|
||||
render: {
|
||||
_: 'locked',
|
||||
sort: 'locked_sort'
|
||||
}
|
||||
},{
|
||||
title: 'updated',
|
||||
width: '80px',
|
||||
searchable: false,
|
||||
className: ['text-right', config.tableCounterCellClass, 'min-desktop'].join(' '),
|
||||
data: 'updated',
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
$(cell).initTimestampCounter();
|
||||
|
||||
// highlight cell
|
||||
var diff = new Date().getTime() - cellData * 1000;
|
||||
var dateDiff = new Date(diff);
|
||||
if(dateDiff.getUTCDate() > 1){
|
||||
$(cell).addClass('txt-color txt-color-warning');
|
||||
}
|
||||
}
|
||||
},{
|
||||
title: '',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
width: '10px',
|
||||
className: ['text-center', config.tableActionCellClass].join(' '),
|
||||
data: 'clear',
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex) {
|
||||
var tempTableElement = this;
|
||||
|
||||
var tempConfirmationSettings = confirmationSettings;
|
||||
tempConfirmationSettings.title = 'Delete system';
|
||||
tempConfirmationSettings.onConfirm = function(e, target){
|
||||
var deleteRowElement = $(target).parents('tr');
|
||||
|
||||
var activeMap = Util.getMapModule().getActiveMap();
|
||||
var systemElement = $('#' + config.systemIdPrefix + mapData.config.id + '-' + rowData.id);
|
||||
|
||||
if(systemElement){
|
||||
// trigger system delete event
|
||||
activeMap.trigger('pf:deleteSystems', [{
|
||||
systems: [systemElement],
|
||||
callback: function(){
|
||||
// callback function after ajax "delete" success
|
||||
// remove table row
|
||||
tempTableElement.DataTable().rows(deleteRowElement).remove().draw();
|
||||
|
||||
Util.showNotify({title: 'System deleted', text: rowData.name, type: 'success'});
|
||||
|
||||
// refresh connection table (connections might have changed) ------------------------------
|
||||
var connectionsElement = $('#' + config.mapInfoConnectionsId);
|
||||
var mapDataNew = activeMap.getMapDataFromClient({forceData: true});
|
||||
|
||||
connectionsElement.loadConnectionInfoTable(mapDataNew);
|
||||
}
|
||||
}]);
|
||||
}
|
||||
};
|
||||
|
||||
// init confirmation dialog
|
||||
$(cell).confirmation(tempConfirmationSettings);
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* loads the connection info table into an element
|
||||
* @param mapData
|
||||
*/
|
||||
$.fn.loadConnectionInfoTable = function(mapData){
|
||||
var connectionsElement = $(this);
|
||||
|
||||
connectionsElement.empty();
|
||||
|
||||
var connectionTable = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border', config.mapInfoTableClass].join(' ')
|
||||
});
|
||||
connectionsElement.append(connectionTable);
|
||||
|
||||
connectionsElement.showLoadingAnimation(config.loadingOptions);
|
||||
|
||||
// table init complete
|
||||
connectionTable.on( 'init.dt', function () {
|
||||
connectionsElement.hideLoadingAnimation();
|
||||
});
|
||||
|
||||
// connections table ==================================================
|
||||
|
||||
// prepare data for dataTables
|
||||
var connectionData = [];
|
||||
for(var j = 0; j < mapData.data.connections.length; j++){
|
||||
var tempConnectionData = mapData.data.connections[j];
|
||||
|
||||
var tempConData = {};
|
||||
|
||||
tempConData.id = tempConnectionData.id;
|
||||
|
||||
tempConData.scope = {
|
||||
scope: MapUtil.getScopeInfoForConnection(tempConnectionData.scope, 'label'),
|
||||
scope_sort: tempConnectionData.scope
|
||||
};
|
||||
|
||||
// source system name
|
||||
tempConData.source = tempConnectionData.sourceName;
|
||||
|
||||
// connection
|
||||
var connectionClasses = [];
|
||||
for(var k = 0; k < tempConnectionData.type.length; k++){
|
||||
connectionClasses.push( MapUtil.getConnectionInfo( tempConnectionData.type[k], 'cssClass') );
|
||||
|
||||
}
|
||||
|
||||
connectionClasses = connectionClasses.join(' ');
|
||||
|
||||
tempConData.connection = '<div class="pf-fake-connection ' + connectionClasses + '"></div>';
|
||||
|
||||
|
||||
tempConData.target = tempConnectionData.targetName;
|
||||
|
||||
tempConData.updated = tempConnectionData.updated;
|
||||
|
||||
tempConData.clear = '<i class="fa fa-close txt-color txt-color-redDarker"></i>';
|
||||
|
||||
connectionData.push(tempConData);
|
||||
}
|
||||
|
||||
var connectionDataTable = connectionTable.dataTable( {
|
||||
pageLength: 20,
|
||||
paging: true,
|
||||
lengthMenu: [[5, 10, 20, 50, -1], [5, 10, 20, 50, 'All']],
|
||||
ordering: true,
|
||||
order: [ 0, 'desc' ],
|
||||
autoWidth: false,
|
||||
hover: false,
|
||||
data: connectionData,
|
||||
columnDefs: [],
|
||||
language: {
|
||||
emptyTable: 'No connections',
|
||||
zeroRecords: 'No connections found',
|
||||
lengthMenu: 'Show _MENU_ connections',
|
||||
info: 'Showing _START_ to _END_ of _TOTAL_ connections'
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: 'scope',
|
||||
width: '50px',
|
||||
orderable: true,
|
||||
data: 'scope',
|
||||
render: {
|
||||
_: 'scope',
|
||||
sort: 'scope_sort'
|
||||
}
|
||||
},{
|
||||
title: 'source system',
|
||||
data: 'source'
|
||||
},{
|
||||
title: 'connection',
|
||||
width: '80px',
|
||||
className: 'text-center',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
data: 'connection'
|
||||
}, {
|
||||
title: 'target system',
|
||||
data: 'target'
|
||||
},{
|
||||
title: 'updated',
|
||||
width: '80px',
|
||||
searchable: false,
|
||||
className: ['text-right', config.tableCounterCellClass].join(' '),
|
||||
data: 'updated',
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
$(cell).initTimestampCounter();
|
||||
|
||||
// highlight cell
|
||||
var diff = new Date().getTime() - cellData * 1000;
|
||||
var dateDiff = new Date(diff);
|
||||
if(dateDiff.getUTCDate() > 1){
|
||||
$(cell).addClass('txt-color txt-color-warning');
|
||||
}
|
||||
}
|
||||
},{
|
||||
title: '',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
width: '10px',
|
||||
className: ['text-center', config.tableActionCellClass].join(' '),
|
||||
data: 'clear',
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex) {
|
||||
var tempTableElement = this;
|
||||
|
||||
var tempConfirmationSettings = confirmationSettings;
|
||||
tempConfirmationSettings.title = 'Delete connection';
|
||||
tempConfirmationSettings.onConfirm = function(e, target){
|
||||
var deleteRowElement = $(target).parents('tr');
|
||||
|
||||
// deleteSignatures(row);
|
||||
var connection = $().getConnectionById(mapData.config.id, rowData.id);
|
||||
|
||||
$().deleteConnections([connection], function(){
|
||||
// callback function after ajax "delete" success
|
||||
// remove table row
|
||||
tempTableElement.DataTable().rows(deleteRowElement).remove().draw();
|
||||
});
|
||||
};
|
||||
|
||||
// init confirmation dialog
|
||||
$(cell).confirmation(tempConfirmationSettings);
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.loadUsersInfoTable = function(mapData){
|
||||
var usersElement = $(this);
|
||||
|
||||
usersElement.empty();
|
||||
|
||||
var userTable = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border', config.mapInfoTableClass].join(' ')
|
||||
});
|
||||
usersElement.append(userTable);
|
||||
|
||||
usersElement.showLoadingAnimation(config.loadingOptions);
|
||||
|
||||
// table init complete
|
||||
userTable.on( 'init.dt', function () {
|
||||
usersElement.hideLoadingAnimation();
|
||||
});
|
||||
|
||||
// users table ========================================================
|
||||
// prepare users data for dataTables
|
||||
var currentMapUserData = Util.getCurrentMapUserData( mapData.config.id );
|
||||
var usersData = [];
|
||||
|
||||
if(
|
||||
currentMapUserData &&
|
||||
currentMapUserData.data &&
|
||||
currentMapUserData.data.systems
|
||||
){
|
||||
for(var i = 0; i < currentMapUserData.data.systems.length; i++){
|
||||
var tempSystemUserData = currentMapUserData.data.systems[i];
|
||||
for(var j = 0; j < tempSystemUserData.user.length; j++){
|
||||
usersData.push( tempSystemUserData.user[j] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var userDataTable = userTable.dataTable( {
|
||||
pageLength: 20,
|
||||
paging: true,
|
||||
lengthMenu: [[5, 10, 20, 50, -1], [5, 10, 20, 50, 'All']],
|
||||
ordering: true,
|
||||
order: [ 1, 'asc' ],
|
||||
autoWidth: false,
|
||||
hover: false,
|
||||
data: usersData,
|
||||
language: {
|
||||
emptyTable: 'No active pilots',
|
||||
zeroRecords: 'No active pilots found',
|
||||
lengthMenu: 'Show _MENU_ pilots',
|
||||
info: 'Showing _START_ to _END_ of _TOTAL_ pilots'
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 0,
|
||||
title: '',
|
||||
width: '26px',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: ['text-center', config.tableImageCellClass].join(' '),
|
||||
data: 'log.ship',
|
||||
render: {
|
||||
_: function(data, type, row, meta){
|
||||
return '<img src="' + Init.url.ccpImageServer + 'Render/' + data.typeId + '_32.png" />';
|
||||
}
|
||||
}
|
||||
},{
|
||||
targets: 1,
|
||||
title: 'ship',
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
data: 'log.ship',
|
||||
render: {
|
||||
_: 'typeName',
|
||||
sort: 'typeName'
|
||||
}
|
||||
},{
|
||||
targets: 2,
|
||||
title: '',
|
||||
width: '26px',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: [config.tableImageCellClass].join(' '),
|
||||
data: 'id',
|
||||
render: {
|
||||
_: function(data, type, row, meta){
|
||||
return '<img src="' + Init.url.ccpImageServer + 'Character/' + data + '_32.jpg" />';
|
||||
}
|
||||
}
|
||||
},{
|
||||
targets: 3,
|
||||
title: 'pilot',
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
data: 'name'
|
||||
},{
|
||||
targets: 4,
|
||||
title: '',
|
||||
width: '26px',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: [config.tableImageCellClass, config.tableImageSmallCellClass].join(' '),
|
||||
data: 'corporation',
|
||||
render: {
|
||||
_: function(data, type, row, meta){
|
||||
return '<img src="' + Init.url.ccpImageServer + 'Corporation/' + data.id + '_32.png" />';
|
||||
}
|
||||
}
|
||||
},{
|
||||
targets: 5,
|
||||
title: 'corporation',
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
data: 'corporation',
|
||||
render: {
|
||||
_: 'name'
|
||||
}
|
||||
},{
|
||||
targets: 6,
|
||||
title: 'system',
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
data: 'log.system',
|
||||
render: {
|
||||
_: 'name',
|
||||
sort: 'name'
|
||||
}
|
||||
},{
|
||||
targets: 7,
|
||||
title: 'station',
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
data: 'log.station',
|
||||
render: {
|
||||
_: 'name',
|
||||
sort: 'name'
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* shows the map information modal dialog
|
||||
*/
|
||||
$.fn.showMapInfoDialog = function(){
|
||||
|
||||
var activeMap = Util.getMapModule().getActiveMap();
|
||||
var mapData = activeMap.getMapDataFromClient({forceData: true});
|
||||
|
||||
if(mapData !== false){
|
||||
requirejs(['text!templates/dialog/map_info.html', 'mustache'], function(template, Mustache) {
|
||||
|
||||
var data = {
|
||||
dialogSummaryContainerId: config.dialogMapInfoSummaryId,
|
||||
dialogUsersContainerId: config.dialogMapInfoUsersId,
|
||||
dialogRefreshContainerId: config.dialogMapInfoRefreshId,
|
||||
dialogNavigationClass: config.dialogNavigationClass,
|
||||
mapInfoId: config.mapInfoId,
|
||||
mapInfoSystemsId: config.mapInfoSystemsId,
|
||||
mapInfoConnectionsId: config.mapInfoConnectionsId,
|
||||
mapInfoUsersId: config.mapInfoUsersId
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
var mapInfoDialog = bootbox.dialog({
|
||||
title: 'Map information',
|
||||
message: content,
|
||||
size: 'large',
|
||||
buttons: {
|
||||
success: {
|
||||
label: 'close',
|
||||
className: 'btn-primary',
|
||||
callback: function() {
|
||||
$(mapInfoDialog).modal('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mapInfoDialog.on('shown.bs.modal', function(e) {
|
||||
// modal on open
|
||||
|
||||
var mapElement = $('#' + config.mapInfoId);
|
||||
var systemsElement = $('#' + config.mapInfoSystemsId);
|
||||
var connectionsElement = $('#' + config.mapInfoConnectionsId);
|
||||
var usersElement = $('#' + config.mapInfoUsersId);
|
||||
|
||||
|
||||
// set refresh button observer
|
||||
$('#' + config.dialogMapInfoRefreshId).on('click', function(){
|
||||
var menuAction = $(this).attr('data-action');
|
||||
if(menuAction === 'refresh'){
|
||||
// get new map data
|
||||
var mapData = activeMap.getMapDataFromClient({forceData: true});
|
||||
|
||||
mapElement.loadMapInfoData(mapData);
|
||||
systemsElement.loadSystemInfoTable(mapData);
|
||||
connectionsElement.loadConnectionInfoTable(mapData);
|
||||
usersElement.loadUsersInfoTable(mapData);
|
||||
}
|
||||
});
|
||||
|
||||
// load map data
|
||||
mapElement.loadMapInfoData(mapData);
|
||||
|
||||
// load system table
|
||||
systemsElement.loadSystemInfoTable(mapData);
|
||||
|
||||
// load connection table
|
||||
connectionsElement.loadConnectionInfoTable(mapData);
|
||||
|
||||
// load users table
|
||||
usersElement.loadUsersInfoTable(mapData);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
@@ -1,608 +0,0 @@
|
||||
/**
|
||||
* map settings dialogs
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'bootbox',
|
||||
'app/map/util'
|
||||
], function($, Init, Util, Render, bootbox, MapUtil) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// map dialog
|
||||
newMapDialogId: 'pf-map-dialog', // id for map settings dialog
|
||||
dialogMapCreateContainerId: 'pf-map-dialog-create', // id for the "new map" container
|
||||
dialogMapEditContainerId: 'pf-map-dialog-edit', // id for the "edit" container
|
||||
dialogMapSettingsContainerId: 'pf-map-dialog-settings', // id for the "settings" container
|
||||
dialogMapDownloadContainerId: 'pf-map-dialog-download', // id for the "download" container
|
||||
|
||||
characterSelectId: 'pf-map-dialog-character-select', // id for "character" select
|
||||
corporationSelectId: 'pf-map-dialog-corporation-select', // id for "corporation" select
|
||||
allianceSelectId: 'pf-map-dialog-alliance-select', // id for "alliance" select
|
||||
|
||||
dialogMapExportFormId: 'pf-map-dialog-form-export', // id for "export" form
|
||||
dialogMapImportFormId: 'pf-map-dialog-form-import', // id for "import" form
|
||||
|
||||
buttonExportId: 'pf-map-dialog-button-export', // id for "export" button
|
||||
buttonImportId: 'pf-map-dialog-button-import', // id for "import" button
|
||||
|
||||
fieldExportId: 'pf-map-filename-export', // id for "export" filename field
|
||||
fieldImportId: 'pf-map-filename-import', // id for "import" filename field
|
||||
dialogMapImportInfoId: 'pf-map-import-container', // id for "info" container
|
||||
dragDropElementClass: 'pf-form-dropzone' // class for "drag&drop" zone
|
||||
};
|
||||
|
||||
/**
|
||||
* format a given string into a valid filename
|
||||
* @param filename
|
||||
* @returns {string}
|
||||
*/
|
||||
var formatFilename = function(filename){
|
||||
filename = filename.replace(/[^a-zA-Z0-9]/g,'_');
|
||||
|
||||
var nowDate = new Date();
|
||||
var filenameDate = nowDate.toISOString().slice(0,10).replace(/-/g, '_');
|
||||
|
||||
return (filename + '_' + filenameDate).replace(/__/g,'_');
|
||||
};
|
||||
|
||||
/**
|
||||
* shows the add/edit map dialog
|
||||
* @param mapData
|
||||
* @param options
|
||||
*/
|
||||
$.fn.showMapSettingsDialog = function(mapData, options){
|
||||
|
||||
// check if dialog is already open
|
||||
var mapInfoDialogElement = $('#' + config.newMapDialogId);
|
||||
if(!mapInfoDialogElement.is(':visible')){
|
||||
|
||||
requirejs([
|
||||
'text!templates/dialog/map.html',
|
||||
'text!templates/form/map_settings.html',
|
||||
'mustache'
|
||||
], function(templateMapDialog, templateMapSettings, Mustache) {
|
||||
|
||||
var dialogTitle = 'Map settings';
|
||||
|
||||
// if there are no maps -> hide settings tab
|
||||
var hideSettingsTab = false;
|
||||
var hideEditTab = false;
|
||||
var hideDownloadTab = false;
|
||||
|
||||
if(mapData === false){
|
||||
hideSettingsTab = true;
|
||||
hideEditTab = true;
|
||||
hideDownloadTab = true;
|
||||
}
|
||||
|
||||
// available map "types" for a new or existing map
|
||||
var mapTypes = MapUtil.getMapTypes(true);
|
||||
|
||||
var data = {
|
||||
scope: MapUtil.getMapScopes(),
|
||||
type: mapTypes,
|
||||
icon: MapUtil.getMapIcons(),
|
||||
formErrorContainerClass: Util.config.formErrorContainerClass,
|
||||
formWarningContainerClass: Util.config.formWarningContainerClass,
|
||||
formInfoContainerClass: Util.config.formInfoContainerClass
|
||||
};
|
||||
|
||||
// render "new map" tab content -------------------------------------------
|
||||
var contentNewMap = Mustache.render(templateMapSettings, data);
|
||||
|
||||
// render "edit map" tab content ------------------------------------------
|
||||
var contentEditMap = Mustache.render(templateMapSettings, data);
|
||||
contentEditMap = $(contentEditMap);
|
||||
|
||||
// current map access info
|
||||
var accessCharacter = [];
|
||||
var accessCorporation = [];
|
||||
var accessAlliance = [];
|
||||
|
||||
if(mapData !== false){
|
||||
// set current map information
|
||||
contentEditMap.find('input[name="id"]').val( mapData.config.id );
|
||||
contentEditMap.find('select[name="icon"]').val( mapData.config.icon );
|
||||
contentEditMap.find('input[name="name"]').val( mapData.config.name );
|
||||
contentEditMap.find('select[name="scopeId"]').val( mapData.config.scope.id );
|
||||
contentEditMap.find('select[name="typeId"]').val( mapData.config.type.id );
|
||||
|
||||
accessCharacter = mapData.config.access.character;
|
||||
accessCorporation = mapData.config.access.corporation;
|
||||
accessAlliance = mapData.config.access.alliance;
|
||||
}
|
||||
|
||||
// render main dialog -----------------------------------------------------
|
||||
data = {
|
||||
id: config.newMapDialogId,
|
||||
mapData: mapData,
|
||||
type: mapTypes,
|
||||
|
||||
// message container
|
||||
formErrorContainerClass: Util.config.formErrorContainerClass,
|
||||
formWarningContainerClass: Util.config.formWarningContainerClass,
|
||||
formInfoContainerClass: Util.config.formInfoContainerClass,
|
||||
|
||||
// default open tab ----------
|
||||
openTabNew: options.tab === 'new',
|
||||
openTabEdit: options.tab === 'edit',
|
||||
openTabSettings: options.tab === 'settings',
|
||||
openTabDownload: options.tab === 'download',
|
||||
|
||||
dialogMapCreateContainerId: config.dialogMapCreateContainerId,
|
||||
dialogMapEditContainerId: config.dialogMapEditContainerId,
|
||||
dialogMapSettingsContainerId: config.dialogMapSettingsContainerId,
|
||||
dialogMapDownloadContainerId: config.dialogMapDownloadContainerId,
|
||||
|
||||
hideEditTab: hideEditTab,
|
||||
hideSettingsTab: hideSettingsTab,
|
||||
hideDownloadTab: hideDownloadTab,
|
||||
|
||||
// settings tab --------------
|
||||
characterSelectId: config.characterSelectId,
|
||||
corporationSelectId: config.corporationSelectId,
|
||||
allianceSelectId: config.allianceSelectId,
|
||||
|
||||
// map access objects --------
|
||||
accessCharacter: accessCharacter,
|
||||
accessCorporation: accessCorporation,
|
||||
accessAlliance: accessAlliance,
|
||||
|
||||
// access limitations --------
|
||||
maxCharacter: Init.maxSharedCount.character,
|
||||
maxCorporation: Init.maxSharedCount.corporation,
|
||||
maxAlliance: Init.maxSharedCount.alliance,
|
||||
|
||||
// download tab --------------
|
||||
dialogMapExportFormId: config.dialogMapExportFormId,
|
||||
dialogMapImportFormId: config.dialogMapImportFormId,
|
||||
buttonExportId: config.buttonExportId,
|
||||
buttonImportId: config.buttonImportId,
|
||||
fieldExportId: config.fieldExportId,
|
||||
fieldImportId: config.fieldImportId,
|
||||
dialogMapImportInfoId: config.dialogMapImportInfoId,
|
||||
|
||||
formatFilename: function(){
|
||||
// format filename from "map name" (initial)
|
||||
return function (mapName, render) {
|
||||
var filename = render(mapName);
|
||||
return formatFilename(filename);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
var contentDialog = Mustache.render(templateMapDialog, data);
|
||||
contentDialog = $(contentDialog);
|
||||
|
||||
// set tab content
|
||||
$('#' + config.dialogMapCreateContainerId, contentDialog).html(contentNewMap);
|
||||
$('#' + config.dialogMapEditContainerId, contentDialog).html(contentEditMap);
|
||||
|
||||
var mapInfoDialog = bootbox.dialog({
|
||||
title: dialogTitle,
|
||||
message: contentDialog,
|
||||
buttons: {
|
||||
close: {
|
||||
label: 'cancel',
|
||||
className: 'btn-default'
|
||||
},
|
||||
success: {
|
||||
label: '<i class="fa fa-check fa-fw"></i> save',
|
||||
className: 'btn-success',
|
||||
callback: function() {
|
||||
|
||||
// get the current active form
|
||||
var form = $('#' + config.newMapDialogId).find('form').filter(':visible');
|
||||
|
||||
// validate form
|
||||
form.validator('validate');
|
||||
|
||||
// validate select2 fields (settings tab)
|
||||
form.find('select').each(function(){
|
||||
var selectField = $(this);
|
||||
var selectValues = selectField.val();
|
||||
|
||||
if(selectValues === null){
|
||||
selectField.parents('.form-group').addClass('has-error');
|
||||
}else{
|
||||
selectField.parents('.form-group').removeClass('has-error');
|
||||
}
|
||||
});
|
||||
|
||||
// check whether the form is valid
|
||||
var formValid = form.isValidForm();
|
||||
|
||||
if(formValid === true){
|
||||
|
||||
// lock dialog
|
||||
var dialogContent = mapInfoDialog.find('.modal-content');
|
||||
dialogContent.showLoadingAnimation();
|
||||
|
||||
var newMapData = {formData: form.getFormValues()};
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Init.path.saveMap,
|
||||
data: newMapData,
|
||||
dataType: 'json'
|
||||
}).done(function(responseData){
|
||||
|
||||
dialogContent.hideLoadingAnimation();
|
||||
|
||||
if(responseData.error.length){
|
||||
form.showFormMessage(responseData.error);
|
||||
}else{
|
||||
// success
|
||||
Util.showNotify({title: dialogTitle, text: 'Map: ' + responseData.mapData.mapData.name, type: 'success'});
|
||||
|
||||
// update map-tab Element
|
||||
var tabLinkElement = Util.getMapModule().getMapTabElements(responseData.mapData.mapData.id);
|
||||
if(tabLinkElement.length === 1){
|
||||
tabLinkElement.updateTabData(responseData.mapData.mapData);
|
||||
}
|
||||
|
||||
$(mapInfoDialog).modal('hide');
|
||||
$(document).trigger('pf:closeMenu', [{}]);
|
||||
}
|
||||
}).fail(function( jqXHR, status, error) {
|
||||
var reason = status + ' ' + error;
|
||||
Util.showNotify({title: jqXHR.status + ': saveMap', text: reason, type: 'warning'});
|
||||
$(document).setProgramStatus('problem');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// after modal is shown =======================================================================
|
||||
mapInfoDialog.on('shown.bs.modal', function(e){
|
||||
mapInfoDialog.initTooltips();
|
||||
|
||||
// prevent "disabled" tabs from being clicked... "bootstrap" bugFix...
|
||||
mapInfoDialog.find('.navbar a[data-toggle=tab]').on('click', function(e){
|
||||
if ($(this).hasClass('disabled')){
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// set form validator
|
||||
mapInfoDialog.find('form').initFormValidation();
|
||||
|
||||
// show form messages -------------------------------------
|
||||
// get current active form(tab)
|
||||
var form = $('#' + config.newMapDialogId).find('form').filter(':visible');
|
||||
|
||||
form.showFormMessage([{type: 'info', message: 'Creating new maps or change settings may take a few seconds'}]);
|
||||
|
||||
if(mapData === false){
|
||||
// no map data found (probably new user
|
||||
form.showFormMessage([{type: 'warning', message: 'No maps found. Create a new map before you can start'}]);
|
||||
}
|
||||
|
||||
// init select fields in case "settings" tab is open by default
|
||||
if(options.tab === 'settings'){
|
||||
initSettingsSelectFields(mapInfoDialog);
|
||||
}
|
||||
|
||||
// init "download tab" ========================================================================
|
||||
var downloadTabElement = mapInfoDialog.find('#' + config.dialogMapDownloadContainerId);
|
||||
if(downloadTabElement.length){
|
||||
// tab exists
|
||||
|
||||
// export map data ------------------------------------------------------------------------
|
||||
downloadTabElement.find('#' + config.buttonExportId).on('click', { mapData: mapData }, function(e){
|
||||
|
||||
var exportForm = $('#' + config.dialogMapExportFormId);
|
||||
var validExportForm = exportForm.isValidForm();
|
||||
|
||||
if(validExportForm){
|
||||
var mapElement = Util.getMapModule().getActiveMap();
|
||||
|
||||
if(mapElement){
|
||||
// IMPORTANT: Get map data from client (NOT from global mapData which is available in here)
|
||||
// -> This excludes some data (e.g. wh statics)
|
||||
// -> Bring export inline with main map toggle requests
|
||||
var exportMapData = mapElement.getMapDataFromClient({
|
||||
forceData: true,
|
||||
getAll: true
|
||||
});
|
||||
|
||||
// set map data right before download
|
||||
$(this).setExportMapData(exportMapData);
|
||||
|
||||
// disable button
|
||||
$(this).attr('disabled', true);
|
||||
}else{
|
||||
console.error('Map not found');
|
||||
}
|
||||
}else{
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// import map data ------------------------------------------------------------------------
|
||||
// check if "FileReader" API is supported
|
||||
var importFormElement = downloadTabElement.find('#' + config.dialogMapImportFormId);
|
||||
if(window.File && window.FileReader && window.FileList && window.Blob){
|
||||
|
||||
// show file info in UI
|
||||
downloadTabElement.find('#' + config.fieldImportId).on('change', function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
var infoContainerElement = importFormElement.find('#' + config.dialogMapImportInfoId);
|
||||
infoContainerElement.hide().empty();
|
||||
importFormElement.hideFormMessage('all');
|
||||
|
||||
var output = [];
|
||||
var files = e.target.files;
|
||||
|
||||
for (var i = 0, f; !!(f = files[i]); i++) {
|
||||
output.push(( i + 1 ) + '. file: ' + f.name + ' - ' +
|
||||
f.size + ' bytes; last modified: ' +
|
||||
f.lastModifiedDate.toLocaleDateString() );
|
||||
}
|
||||
|
||||
if(output.length > 0){
|
||||
infoContainerElement.html( output ).show();
|
||||
}
|
||||
|
||||
importFormElement.validator('validate');
|
||||
});
|
||||
|
||||
// drag&drop
|
||||
var importData = {};
|
||||
importData.mapData = [];
|
||||
var files = [];
|
||||
var filesCount = 0;
|
||||
var filesCountFail = 0;
|
||||
|
||||
// onLoad for FileReader API
|
||||
var readerOnLoad = function(readEvent) {
|
||||
|
||||
// get file content
|
||||
try{
|
||||
importData.mapData.push( JSON.parse( readEvent.target.result ) );
|
||||
}catch(error){
|
||||
filesCountFail++;
|
||||
importFormElement.showFormMessage([{type: 'error', message: 'File can not be parsed'}]);
|
||||
}
|
||||
|
||||
// start import when all files are parsed
|
||||
if(
|
||||
filesCount === files.length &&
|
||||
filesCountFail === 0
|
||||
){
|
||||
importMaps(importData);
|
||||
}
|
||||
};
|
||||
|
||||
var handleDragOver = function(dragEvent) {
|
||||
dragEvent.stopPropagation();
|
||||
dragEvent.preventDefault();
|
||||
dragEvent.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
|
||||
};
|
||||
|
||||
var handleFileSelect = function(evt){
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
|
||||
importData = importFormElement.getFormValues();
|
||||
importData.mapData = [];
|
||||
filesCount = 0;
|
||||
filesCountFail = 0;
|
||||
|
||||
files = evt.dataTransfer.files; // FileList object.
|
||||
|
||||
for (var file; !!(file = files[filesCount]); filesCount++){
|
||||
var reader = new FileReader();
|
||||
reader.onload = readerOnLoad;
|
||||
reader.readAsText(file);
|
||||
}
|
||||
};
|
||||
|
||||
var dropZone = downloadTabElement.find('.' + config.dragDropElementClass);
|
||||
dropZone[0].addEventListener('dragover', handleDragOver, false);
|
||||
dropZone[0].addEventListener('drop', handleFileSelect, false);
|
||||
|
||||
// import "button"
|
||||
downloadTabElement.find('#' + config.buttonImportId).on('click', function(e) {
|
||||
|
||||
importFormElement.validator('validate');
|
||||
var validImportForm = importFormElement.isValidForm();
|
||||
|
||||
if(validImportForm){
|
||||
importData = importFormElement.getFormValues();
|
||||
importData.mapData = [];
|
||||
|
||||
var fileElement = downloadTabElement.find('#' + config.fieldImportId);
|
||||
files = fileElement[0].files;
|
||||
filesCount = 0;
|
||||
filesCountFail = 0;
|
||||
|
||||
for (var file; !!(file = files[filesCount]); filesCount++){
|
||||
var reader = new FileReader();
|
||||
reader.onload = readerOnLoad;
|
||||
reader.readAsText(file);
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
importFormElement.showFormMessage([{type: 'error', message: 'The File APIs are not fully supported in this browser.'}]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// events for tab change
|
||||
mapInfoDialog.find('.navbar a').on('shown.bs.tab', function(e){
|
||||
var selectElementCharacter = mapInfoDialog.find('#' + config.characterSelectId);
|
||||
var selectElementCorporation = mapInfoDialog.find('#' + config.corporationSelectId);
|
||||
var selectElementAlliance = mapInfoDialog.find('#' + config.allianceSelectId);
|
||||
|
||||
if($(e.target).attr('href') === '#' + config.dialogMapSettingsContainerId){
|
||||
// "settings" tab
|
||||
initSettingsSelectFields(mapInfoDialog);
|
||||
}else{
|
||||
if( $(selectElementCharacter).data('select2') !== undefined ){
|
||||
$(selectElementCharacter).select2('destroy');
|
||||
}
|
||||
|
||||
if( $(selectElementCorporation).data('select2') !== undefined ){
|
||||
$(selectElementCorporation).select2('destroy');
|
||||
}
|
||||
|
||||
if( $(selectElementAlliance).data('select2') !== undefined ){
|
||||
$(selectElementAlliance).select2('destroy');
|
||||
}
|
||||
}
|
||||
|
||||
// no "save" dialog button on "in/export" tab
|
||||
if($(e.target).attr('href') === '#' + config.dialogMapDownloadContainerId){
|
||||
mapInfoDialog.find('button.btn-success').hide();
|
||||
}else{
|
||||
mapInfoDialog.find('button.btn-success').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* import new map(s) data
|
||||
* @param importData
|
||||
*/
|
||||
var importMaps = function(importData){
|
||||
|
||||
var importForm = $('#' + config.dialogMapImportFormId);
|
||||
importForm.hideFormMessage('all');
|
||||
|
||||
// lock dialog
|
||||
var dialogContent = importForm.parents('.modal-content');
|
||||
dialogContent.showLoadingAnimation();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Init.path.importMap,
|
||||
data: importData,
|
||||
dataType: 'json'
|
||||
}).done(function(responseData){
|
||||
if(responseData.error.length){
|
||||
// form.showFormMessage(responseData.error);
|
||||
importForm.showFormMessage(responseData.error);
|
||||
}else{
|
||||
// success
|
||||
|
||||
Util.showNotify({title: 'Import finished', text: 'Map(s) imported', type: 'success'});
|
||||
}
|
||||
}).fail(function( jqXHR, status, error) {
|
||||
var reason = status + ' ' + error;
|
||||
Util.showNotify({title: jqXHR.status + ': importMap', text: reason, type: 'error'});
|
||||
}).always(function() {
|
||||
importForm.find('input, select').resetFormFields().trigger('change');
|
||||
dialogContent.hideLoadingAnimation();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* set json map data for export to an element (e.g. <a>-Tag or button) for download
|
||||
* @param mapData
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.setExportMapData = function(mapData){
|
||||
|
||||
var fieldExport = $('#' + config.fieldExportId);
|
||||
var filename = '';
|
||||
var mapDataEncoded = '';
|
||||
|
||||
if(fieldExport.length){
|
||||
filename = fieldExport.val();
|
||||
|
||||
if(filename.length > 0){
|
||||
mapDataEncoded = 'text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify( mapData ));
|
||||
}
|
||||
}
|
||||
|
||||
return this.each(function(){
|
||||
var exportButton = $(this);
|
||||
exportButton.attr('href', 'data:' + mapDataEncoded);
|
||||
exportButton.attr('download', filename + '.json');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* init select2 fields within the settings dialog
|
||||
* @param mapInfoDialog
|
||||
*/
|
||||
var initSettingsSelectFields = function(mapInfoDialog){
|
||||
|
||||
var selectElementCharacter = mapInfoDialog.find('#' + config.characterSelectId);
|
||||
var selectElementCorporation = mapInfoDialog.find('#' + config.corporationSelectId);
|
||||
var selectElementAlliance = mapInfoDialog.find('#' + config.allianceSelectId);
|
||||
|
||||
// init character select live search
|
||||
selectElementCharacter.initAccessSelect({
|
||||
type: 'character',
|
||||
maxSelectionLength: Init.maxSharedCount.character
|
||||
});
|
||||
|
||||
// init corporation select live search
|
||||
selectElementCorporation.initAccessSelect({
|
||||
type: 'corporation',
|
||||
maxSelectionLength: Init.maxSharedCount.corporation
|
||||
});
|
||||
|
||||
// init alliance select live search
|
||||
selectElementAlliance.initAccessSelect({
|
||||
type: 'alliance',
|
||||
maxSelectionLength: Init.maxSharedCount.alliance
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* shows the delete map Dialog
|
||||
* @param mapData
|
||||
*/
|
||||
$.fn.showDeleteMapDialog = function(mapData){
|
||||
|
||||
var mapName = mapData.config.name;
|
||||
|
||||
var mapDeleteDialog = bootbox.confirm('Delete map "' + mapName + '"?', function(result){
|
||||
if(result){
|
||||
|
||||
var data = {mapData: mapData.config};
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Init.path.deleteMap,
|
||||
data: data,
|
||||
dataType: 'json'
|
||||
}).done(function(data){
|
||||
Util.showNotify({title: 'Map deleted', text: 'Map: ' + mapName, type: 'success'});
|
||||
|
||||
$(mapDeleteDialog).modal('hide');
|
||||
}).fail(function( jqXHR, status, error) {
|
||||
var reason = status + ' ' + error;
|
||||
Util.showNotify({title: jqXHR.status + ': deleteMap', text: reason, type: 'warning'});
|
||||
$(document).setProgramStatus('problem');
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
@@ -1,88 +0,0 @@
|
||||
/**
|
||||
* notification dialog
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'bootbox'
|
||||
], function($, Init, Util, Render, bootbox) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
|
||||
// shutdown dialog
|
||||
notificationDialogId: 'pf-notification-dialog', // id for "notification" dialog
|
||||
notificationDialogClass: 'pf-notification-dialog' // class for "notification" dialog
|
||||
};
|
||||
|
||||
/**
|
||||
* show/animate dialog page content
|
||||
* @param dialog
|
||||
*/
|
||||
var showPageContent = function(dialog){
|
||||
var headlineElement = dialog.find('h1');
|
||||
|
||||
headlineElement.delay(300).velocity('transition.shrinkIn', {
|
||||
duration: 500
|
||||
}).delay(800);
|
||||
|
||||
headlineElement.velocity({
|
||||
scale: 1.05
|
||||
}, {
|
||||
duration: 600,
|
||||
loop: 5
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* show "notification" dialog
|
||||
* @param dialogData
|
||||
*/
|
||||
$.fn.showNotificationDialog = function(dialogData){
|
||||
|
||||
// check if there is already a notification dialog open
|
||||
var notificationDialogClassDialoges = $('.' + config.notificationDialogClass);
|
||||
|
||||
if(notificationDialogClassDialoges.length === 0){
|
||||
|
||||
// close all modals
|
||||
$('.modal').modal('hide');
|
||||
|
||||
requirejs(['text!templates/dialog/notification.html', 'mustache'], function(template, Mustache) {
|
||||
|
||||
var data = {
|
||||
id: config.notificationDialogId,
|
||||
content: dialogData.content
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
// show dialog
|
||||
var shutdownDialog = bootbox.dialog({
|
||||
title: dialogData.content.title,
|
||||
message: content,
|
||||
className: config.notificationDialogClass,
|
||||
buttons: dialogData.buttons
|
||||
});
|
||||
|
||||
|
||||
shutdownDialog.on('shown.bs.modal', function(e) {
|
||||
// remove close button
|
||||
var dialog = $(this);
|
||||
|
||||
dialog.find('.bootbox-close-button').remove();
|
||||
dialog.find('button').blur();
|
||||
|
||||
// show error message
|
||||
showPageContent(dialog);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
@@ -1,84 +0,0 @@
|
||||
/**
|
||||
* releases dialog (GitHub API repository information)
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'bootbox'
|
||||
], function($, Init, Util, Render, bootbox) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
releasesDialogClass: 'pf-releases-dialog' // class for "Releases" dialog
|
||||
};
|
||||
|
||||
/**
|
||||
* load release information in dialog
|
||||
* @param releasesDialog
|
||||
*/
|
||||
var loadDialogData = function(releasesDialog){
|
||||
|
||||
// lock dialog
|
||||
var dialogContent = releasesDialog.find('.modal-content');
|
||||
dialogContent.showLoadingAnimation();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Init.path.gitHubReleases,
|
||||
// data: updatedMapData,
|
||||
dataType: 'json'
|
||||
}).done(function(releasesData){
|
||||
requirejs(['text!templates/ui/timeline_element.html', 'mustache'], function(template, Mustache) {
|
||||
for(var i = 0; i < releasesData.length; i++){
|
||||
var releaseData = releasesData[i];
|
||||
|
||||
// template vars
|
||||
var data = {
|
||||
isFirst: (i === 0),
|
||||
isOdd: (i % 2 !== 0),
|
||||
releaseDate: releaseData.published_at.substr(0, 10),
|
||||
releaseData: releaseData
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
releasesDialog.find('ul.timeline').append(content);
|
||||
}
|
||||
|
||||
$('.timeline > li').velocity('transition.expandIn', {
|
||||
stagger: 300,
|
||||
duration: 240,
|
||||
//display: 'auto',
|
||||
complete: function(){}
|
||||
});
|
||||
});
|
||||
}).fail(function( jqXHR, status, error) {
|
||||
var reason = status + ' ' + jqXHR.status + ': ' + error;
|
||||
Util.showNotify({title: jqXHR.status + ': login', text: reason, type: 'error'});
|
||||
}).always(function() {
|
||||
dialogContent.hideLoadingAnimation();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* show releases dialog
|
||||
*/
|
||||
$.fn.releasesDialog = function(){
|
||||
var content = '<ul class="timeline"></ul>';
|
||||
|
||||
var releasesDialog = bootbox.dialog({
|
||||
className: config.releasesDialogClass,
|
||||
title: 'Releases',
|
||||
size: 'large',
|
||||
message: content
|
||||
});
|
||||
|
||||
// after modal is shown =======================================================================
|
||||
releasesDialog.on('shown.bs.modal', function(e) {
|
||||
loadDialogData(releasesDialog);
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
@@ -1,107 +0,0 @@
|
||||
/**
|
||||
* system effects dialog
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'bootbox',
|
||||
'app/map/util'
|
||||
], function($, Init, Util, Render, bootbox, MapUtil) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// system effect dialog
|
||||
systemEffectDialogWrapperClass: 'pf-system-effect-dialog-wrapper' // class for system effect dialog
|
||||
};
|
||||
|
||||
var cache = {
|
||||
systemEffectDialog: false // system effect info dialog
|
||||
};
|
||||
|
||||
/**
|
||||
* show system effect dialog
|
||||
*/
|
||||
$.fn.showSystemEffectInfoDialog = function(){
|
||||
|
||||
// cache table structure
|
||||
if(!cache.systemEffectDialog){
|
||||
|
||||
var dialogWrapperElement = $('<div>', {
|
||||
class: config.systemEffectDialogWrapperClass
|
||||
});
|
||||
|
||||
var systemEffectData = Util.getSystemEffectData();
|
||||
|
||||
$.each( systemEffectData.wh, function( effectName, effectData ) {
|
||||
|
||||
var table = $('<table>', {
|
||||
class: ['table', 'table-condensed'].join(' ')
|
||||
});
|
||||
|
||||
var tbody = $('<tbody>');
|
||||
var thead = $('<thead>');
|
||||
|
||||
var rows = [];
|
||||
|
||||
// get formatted system effect name
|
||||
var systemEffectName = MapUtil.getEffectInfoForSystem(effectName, 'name');
|
||||
var systemEffectClass = MapUtil.getEffectInfoForSystem(effectName, 'class');
|
||||
|
||||
$.each( effectData, function( areaId, areaData ) {
|
||||
|
||||
var systemType = 'C' + areaId;
|
||||
var securityClass = Util.getSecurityClassForSystem( systemType );
|
||||
|
||||
if(areaId === '1'){
|
||||
rows.push( $('<tr>') );
|
||||
thead.append( rows[0] );
|
||||
|
||||
rows[0].append(
|
||||
$('<td>').html( ' ' + systemEffectName).prepend(
|
||||
$('<i>', {
|
||||
class: ['fa', 'fa-square', 'fa-fw', systemEffectClass].join(' ')
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
rows[0].append( $('<td>', {
|
||||
class: ['text-right', 'col-xs-1', securityClass].join(' ')
|
||||
}).text( systemType ));
|
||||
|
||||
$.each( areaData, function( i, data ) {
|
||||
|
||||
if(areaId === '1'){
|
||||
rows.push( $('<tr>') );
|
||||
tbody.append(rows[i + 1]);
|
||||
|
||||
// add label
|
||||
rows[i + 1].append( $('<td>').text( data.effect ));
|
||||
}
|
||||
|
||||
|
||||
rows[i + 1].append( $('<td>', {
|
||||
class: 'text-right'
|
||||
}).text( data.value ));
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
dialogWrapperElement.append( table.append( thead ).append( tbody ) );
|
||||
|
||||
cache.systemEffectDialog = dialogWrapperElement;
|
||||
});
|
||||
}
|
||||
|
||||
bootbox.dialog({
|
||||
title: 'System effect information',
|
||||
message: cache.systemEffectDialog
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
@@ -1,280 +0,0 @@
|
||||
/**
|
||||
* form elements
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/map/util'
|
||||
], function($, Init, Util, MapUtil) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* init a select element as "select2" for map selection
|
||||
*/
|
||||
$.fn.initMapSelect = function(){
|
||||
var selectElement = $(this);
|
||||
|
||||
$.when(
|
||||
selectElement.select2({
|
||||
dropdownParent: selectElement.parents('.modal-body'),
|
||||
theme: 'pathfinder',
|
||||
maximumSelectionLength: 5
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* init a select element as an ajax based "select2" object for system search
|
||||
* @param options
|
||||
*/
|
||||
$.fn.initSystemSelect = function(options){
|
||||
var selectElement = $(this);
|
||||
|
||||
var config = {
|
||||
maxSelectionLength: 1
|
||||
};
|
||||
options = $.extend({}, config, options);
|
||||
|
||||
// format result data
|
||||
function formatResultData (data) {
|
||||
|
||||
if (data.loading){
|
||||
return data.text;
|
||||
}
|
||||
|
||||
// show effect info just for wormholes
|
||||
var hideEffectClass = '';
|
||||
if(data.effect === ''){
|
||||
hideEffectClass = 'hide';
|
||||
}
|
||||
|
||||
var 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>';
|
||||
markup += '</div>';
|
||||
markup += '<div class="col-sm-2 text-right ' + data.secClass + '">' + data.security + '</div>';
|
||||
markup += '<div class="col-sm-3 text-right ' + data.trueSecClass + '">' + data.trueSec + '</div></div>';
|
||||
|
||||
return markup;
|
||||
}
|
||||
|
||||
$.when(
|
||||
selectElement.select2({
|
||||
ajax: {
|
||||
url: function(params){
|
||||
// add params to URL
|
||||
return Init.path.searchSystem + '/' + params.term.trim();
|
||||
},
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
timeout: 5000,
|
||||
cache: true,
|
||||
data: function(params) {
|
||||
// no url params here
|
||||
return;
|
||||
},
|
||||
processResults: function(data) {
|
||||
// parse the results into the format expected by Select2.
|
||||
return {
|
||||
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');
|
||||
|
||||
// check if system is dialed
|
||||
if(
|
||||
options.disabledOptions &&
|
||||
options.disabledOptions.indexOf(parseInt(id, 10)) !== -1
|
||||
){
|
||||
disabled = true;
|
||||
}
|
||||
|
||||
// "fix" security level
|
||||
if(
|
||||
trueSec > 0 &&
|
||||
trueSec < 0.1
|
||||
){
|
||||
trueSec = 0.1;
|
||||
}else{
|
||||
trueSec = Math.round(trueSec * 10) / 10;
|
||||
}
|
||||
|
||||
return {
|
||||
id: id,
|
||||
text: item.name,
|
||||
systemId: parseInt(item.systemId),
|
||||
security: item.security,
|
||||
secClass: secClass,
|
||||
trueSec: trueSec.toFixed(1),
|
||||
trueSecClass: trueSecClass,
|
||||
effect: item.effect,
|
||||
effectClass: effectClass,
|
||||
disabled: disabled
|
||||
};
|
||||
})
|
||||
};
|
||||
},
|
||||
error: function (jqXHR, status, error) {
|
||||
if( !Util.isXHRAborted(jqXHR) ){
|
||||
|
||||
var reason = status + ' ' + jqXHR.status + ': ' + error;
|
||||
Util.showNotify({title: 'System select warning', text: reason + ' deleted', type: 'warning'});
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
dropdownParent: selectElement.parents('.modal-body'),
|
||||
theme: 'pathfinder',
|
||||
minimumInputLength: 2,
|
||||
templateResult: formatResultData,
|
||||
placeholder: 'System name',
|
||||
allowClear: true,
|
||||
maximumSelectionLength: options.maxSelectionLength,
|
||||
escapeMarkup: function (markup) {
|
||||
// let our custom formatter work
|
||||
return markup;
|
||||
}
|
||||
}).on('change', function(e){
|
||||
// select changed
|
||||
})
|
||||
).done(function(){
|
||||
// open select
|
||||
selectElement.select2('open');
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* init a select element as an ajax based "select2" object for Access resources
|
||||
* character (private map), corporation (corp map), alliance (ally map)
|
||||
* @param options
|
||||
*/
|
||||
$.fn.initAccessSelect = function(options){
|
||||
|
||||
return this.each(function(){
|
||||
|
||||
var selectElement = $(this);
|
||||
|
||||
// format result data
|
||||
function formatResultData (data) {
|
||||
|
||||
if (data.loading){
|
||||
return data.text;
|
||||
}
|
||||
|
||||
// check if an option is already selected
|
||||
// do not show the same result twice
|
||||
var currentValues = selectElement.val();
|
||||
|
||||
if(
|
||||
currentValues &&
|
||||
currentValues.indexOf( data.id.toString() ) !== -1
|
||||
){
|
||||
return ;
|
||||
}
|
||||
|
||||
var imagePath = '';
|
||||
var previewContent = '';
|
||||
|
||||
switch(options.type){
|
||||
case 'character':
|
||||
imagePath = Init.url.ccpImageServer + 'Character/' + data.id + '_32.jpg';
|
||||
previewContent = '<img src="' + imagePath + '" style="max-width: 100%" />';
|
||||
break;
|
||||
case 'corporation':
|
||||
imagePath = Init.url.ccpImageServer + 'Corporation/' + data.id + '_32.png';
|
||||
previewContent = '<img src="' + imagePath + '" style="max-width: 100%" />';
|
||||
break;
|
||||
case 'alliance':
|
||||
imagePath = Init.url.ccpImageServer + 'Alliance/' + data.id + '_32.png';
|
||||
previewContent = '<img src="' + imagePath + '" style="max-width: 100%" />';
|
||||
break;
|
||||
}
|
||||
|
||||
var markup = '<div class="clearfix">';
|
||||
markup += '<div class="col-sm-2">' + previewContent + '</div>';
|
||||
markup += '<div class="col-sm-10">' + data.text + '</div></div>';
|
||||
|
||||
return markup;
|
||||
}
|
||||
|
||||
// format selection data
|
||||
function formatSelectionData (data){
|
||||
|
||||
if (data.loading){
|
||||
return data.text;
|
||||
}
|
||||
|
||||
var markup = '<div class="clearfix">';
|
||||
markup += '<div class="col-sm-10">' + data.text + '</div></div>';
|
||||
|
||||
return markup;
|
||||
}
|
||||
|
||||
$.when(
|
||||
selectElement.select2({
|
||||
ajax: {
|
||||
url: function(params){
|
||||
// add params to URL
|
||||
return Init.path.searchAccess + '/' + options.type + '/' + params.term;
|
||||
},
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
timeout: 5000,
|
||||
cache: true,
|
||||
data: function(params) {
|
||||
// no url params here
|
||||
return;
|
||||
},
|
||||
processResults: function(data, page) {
|
||||
// parse the results into the format expected by Select2.
|
||||
return {
|
||||
results: data.map( function(item){
|
||||
return {
|
||||
id: item.id,
|
||||
text: item.name
|
||||
};
|
||||
})
|
||||
};
|
||||
},
|
||||
error: function (jqXHR, status, error) {
|
||||
if( !Util.isXHRAborted(jqXHR) ){
|
||||
|
||||
var reason = status + ' ' + jqXHR.status + ': ' + error;
|
||||
Util.showNotify({title: 'Access select warning', text: reason + ' deleted', type: 'warning'});
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
dropdownParent: selectElement.parents('.modal-body'),
|
||||
theme: 'pathfinder',
|
||||
minimumInputLength: 3,
|
||||
placeholder: '',
|
||||
allowClear: false,
|
||||
maximumSelectionLength: options.maxSelectionLength,
|
||||
templateResult: formatResultData,
|
||||
templateSelection: formatSelectionData,
|
||||
escapeMarkup: function (markup) {
|
||||
// let our custom formatter work
|
||||
return markup;
|
||||
}
|
||||
}).on('change', function(e){
|
||||
// select changed
|
||||
|
||||
})
|
||||
).done(function(){
|
||||
// after init finish
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
@@ -1,239 +0,0 @@
|
||||
/**
|
||||
* Header animation
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'easePack',
|
||||
'tweenLite'
|
||||
], function($) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
previewElementClass: 'pf-header-preview-element' // class for "preview" elements
|
||||
};
|
||||
|
||||
|
||||
var width, height, largeHeader, canvas, ctx, points, target, animateHeader = true;
|
||||
|
||||
var canvasHeight = 450;
|
||||
var colorRGB = '108, 174, 173';
|
||||
var connectionCount = 4;
|
||||
|
||||
|
||||
var initHeader = function() {
|
||||
width = window.innerWidth;
|
||||
height = canvasHeight;
|
||||
target = {x: width * 0.8, y: 230};
|
||||
|
||||
largeHeader.style.height = height+'px';
|
||||
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
ctx = canvas.getContext('2d');
|
||||
|
||||
// create points
|
||||
points = [];
|
||||
for(var x = 0; x < width; x = x + width/20) {
|
||||
for(var y = 0; y < height; y = y + height/15) {
|
||||
var px = x + Math.random()*width/15;
|
||||
var py = y + Math.random()*height/15;
|
||||
var p = {x: px, originX: px, y: py, originY: py };
|
||||
points.push(p);
|
||||
}
|
||||
}
|
||||
|
||||
// for each point find the 5 closest points
|
||||
for(var i = 0; i < points.length; i++) {
|
||||
var closest = [];
|
||||
var p1 = points[i];
|
||||
for(var j = 0; j < points.length; j++) {
|
||||
var p2 = points[j];
|
||||
if(p1 !== p2) {
|
||||
var placed = false;
|
||||
for(var k = 0; k < connectionCount; k++) {
|
||||
if(!placed) {
|
||||
if(closest[k] === undefined) {
|
||||
closest[k] = p2;
|
||||
placed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(var m = 0; m < connectionCount; m++) {
|
||||
if(!placed) {
|
||||
if(getDistance(p1, p2) < getDistance(p1, closest[m])) {
|
||||
closest[m] = p2;
|
||||
placed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
p1.closest = closest;
|
||||
}
|
||||
|
||||
// assign a circle to each point
|
||||
for(var n in points) {
|
||||
var c = new Circle(points[n], 2+Math.random()*2, 'rgba(255,255,255,0.3)');
|
||||
points[n].circle = c;
|
||||
}
|
||||
};
|
||||
|
||||
// Event handling
|
||||
var addListeners = function() {
|
||||
if(!('ontouchstart' in window)) {
|
||||
window.addEventListener('mousemove', mouseMove);
|
||||
}
|
||||
window.addEventListener('scroll', scrollCheck);
|
||||
window.addEventListener('resize', resize);
|
||||
};
|
||||
|
||||
var mouseMove = function(e) {
|
||||
var posx = 0;
|
||||
var posy = 0;
|
||||
if (e.pageX || e.pageY) {
|
||||
posx = e.pageX;
|
||||
posy = e.pageY;
|
||||
}else if (e.clientX || e.clientY){
|
||||
posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
|
||||
posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
|
||||
}
|
||||
target.x = posx;
|
||||
target.y = posy;
|
||||
};
|
||||
|
||||
var scrollCheck = function() {
|
||||
if(document.body.scrollTop > height){
|
||||
animateHeader = false;
|
||||
}else{
|
||||
animateHeader = true;
|
||||
}
|
||||
};
|
||||
|
||||
var resize = function() {
|
||||
width = window.innerWidth;
|
||||
height = canvasHeight;
|
||||
largeHeader.style.height = height+'px';
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
};
|
||||
|
||||
// animation
|
||||
var initAnimation = function() {
|
||||
animate();
|
||||
for(var i in points) {
|
||||
shiftPoint(points[i]);
|
||||
}
|
||||
};
|
||||
|
||||
var animate = function animate() {
|
||||
if(animateHeader) {
|
||||
ctx.clearRect(0,0,width,height);
|
||||
for(var i in points) {
|
||||
// detect points in range
|
||||
if(Math.abs(getDistance(target, points[i])) < 4000) {
|
||||
points[i].active = 0.25;
|
||||
points[i].circle.active = 0.45;
|
||||
} else if(Math.abs(getDistance(target, points[i])) < 20000) {
|
||||
points[i].active = 0.1;
|
||||
points[i].circle.active = 0.3;
|
||||
} else if(Math.abs(getDistance(target, points[i])) < 40000) {
|
||||
points[i].active = 0.02;
|
||||
points[i].circle.active = 0.1;
|
||||
} else {
|
||||
points[i].active = 0;
|
||||
points[i].circle.active = 0;
|
||||
}
|
||||
|
||||
drawLines(points[i]);
|
||||
points[i].circle.draw();
|
||||
}
|
||||
}
|
||||
requestAnimationFrame(animate);
|
||||
};
|
||||
|
||||
var shiftPoint = function (p) {
|
||||
TweenLite.to(p, 1 + 1 * Math.random(), {x: p.originX - 50 + Math.random() * 100,
|
||||
y: p.originY - 50 + Math.random() * 100, ease: Circ.easeInOut,
|
||||
onComplete: function () {
|
||||
shiftPoint(p);
|
||||
}});
|
||||
};
|
||||
|
||||
// Canvas manipulation
|
||||
var drawLines = function (p) {
|
||||
if(!p.active) return;
|
||||
for(var i in p.closest) {
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(p.x, p.y);
|
||||
ctx.lineTo(p.closest[i].x, p.closest[i].y);
|
||||
ctx.strokeStyle = 'rgba(' + colorRGB +','+ p.active+')';
|
||||
ctx.stroke();
|
||||
}
|
||||
};
|
||||
|
||||
var Circle = function(pos,rad,color) {
|
||||
var _this = this;
|
||||
|
||||
// constructor
|
||||
(function() {
|
||||
_this.pos = pos || null;
|
||||
_this.radius = rad || null;
|
||||
_this.color = color || null;
|
||||
})();
|
||||
|
||||
this.draw = function() {
|
||||
if(!_this.active) return;
|
||||
ctx.beginPath();
|
||||
ctx.arc(_this.pos.x, _this.pos.y, _this.radius, 0, 2 * Math.PI, false);
|
||||
ctx.fillStyle = 'rgba(' + colorRGB + ','+ _this.active+')';
|
||||
ctx.fill();
|
||||
};
|
||||
};
|
||||
|
||||
// Util
|
||||
var getDistance = function(p1, p2) {
|
||||
return Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2);
|
||||
};
|
||||
|
||||
/**
|
||||
* init header animation
|
||||
* @param callback
|
||||
*/
|
||||
$.fn.initHeader = function(callback){
|
||||
largeHeader = $(this)[0];
|
||||
canvas = $(this).find('canvas:visible')[0];
|
||||
|
||||
// header preview elements
|
||||
$('.' + config.previewElementClass).velocity('transition.bounceIn', {
|
||||
duration: 600,
|
||||
stagger: 60,
|
||||
delay: 120,
|
||||
complete: function(){
|
||||
|
||||
// show header canvas animation
|
||||
if(canvas){
|
||||
// header animation
|
||||
initHeader();
|
||||
initAnimation();
|
||||
addListeners();
|
||||
|
||||
$(canvas).velocity('fadeIn', {
|
||||
duration: 900,
|
||||
visibility: 'visible',
|
||||
complete: function(){
|
||||
if(callback !== undefined){
|
||||
callback();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
@@ -1,150 +0,0 @@
|
||||
/**
|
||||
* Logo
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'lazylinepainter'
|
||||
], function($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
|
||||
staticLogoId: 'pf-static-logo-svg', // id for "static" logo
|
||||
|
||||
logoPartTopRightClass: 'logo-ploygon-top-right', // class for logo part "top right"
|
||||
logoPartBottomLeftClass: 'logo-ploygon-bottom-left', // class for logo part "bottom left"
|
||||
logoPartBottomRightClass: 'logo-ploygon-bottom-right', // class for logo part "bottom right"
|
||||
logoPartTopLeftClass: 'logo-ploygon-top-left'
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* draws the pathfinder logo to an element and add some animation features
|
||||
* @param callback
|
||||
* @param enableHover
|
||||
*/
|
||||
$.fn.drawLogo = function(callback, enableHover){
|
||||
var canvasElement = $(this);
|
||||
|
||||
var pathObj = {
|
||||
logo: {
|
||||
strokepath: [
|
||||
{
|
||||
path: 'M195.9 9.6 226.9 297.1 354.2 365 196.2 9.8 ',
|
||||
strokeColor: '#477372',
|
||||
duration: 1600
|
||||
},
|
||||
{
|
||||
path: 'M1.7 361.3 73.9 284.9 178.6 286.7 2.2 361.4 ',
|
||||
strokeColor: '#5cb85c',
|
||||
duration: 1000
|
||||
},
|
||||
{
|
||||
path: 'M192.9 286.7 121.2 318.6 335.6 363.5 193.4 286.7 ',
|
||||
strokeColor: '#375959',
|
||||
duration: 900
|
||||
},
|
||||
{
|
||||
path: 'M202.8 141.9 0.2 352.6 189.1 0.8 202.7 141.3 ',
|
||||
strokeColor: '#63676a',
|
||||
duration: 1500
|
||||
}
|
||||
],
|
||||
dimensions: {
|
||||
width: 355,
|
||||
height: 366
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// load Logo svg
|
||||
requirejs(['text!templates/ui/logo.html', 'mustache'], function(template, Mustache) {
|
||||
var logoData = {
|
||||
staticLogoId: config.staticLogoId,
|
||||
logoPartTopRightClass: config.logoPartTopRightClass,
|
||||
logoPartBottomLeftClass: config.logoPartBottomLeftClass,
|
||||
logoPartBottomRightClass: config.logoPartBottomRightClass,
|
||||
logoPartTopLeftClass: config.logoPartTopLeftClass
|
||||
};
|
||||
|
||||
var logoContent = Mustache.render(template, logoData);
|
||||
|
||||
canvasElement.html(logoContent);
|
||||
|
||||
// draw the logo
|
||||
canvasElement.lazylinepainter(
|
||||
{
|
||||
svgData: pathObj,
|
||||
strokeWidth: 2,
|
||||
drawSequential: false,
|
||||
delay: 300,
|
||||
overrideKey: 'logo',
|
||||
strokeJoin: 'bevel',
|
||||
onComplete: function(){
|
||||
|
||||
// hide lines
|
||||
canvasElement.find('svg:not(#' + config.staticLogoId + ')').velocity({
|
||||
opacity: 0
|
||||
},{
|
||||
delay: 100
|
||||
});
|
||||
|
||||
// show full logo
|
||||
canvasElement.find('#' + config.staticLogoId + '').velocity({
|
||||
opacity: 1
|
||||
},{
|
||||
delay: 100,
|
||||
duration: 200,
|
||||
complete: function(){
|
||||
|
||||
// execute callback
|
||||
if(typeof callback === 'function'){
|
||||
callback();
|
||||
}
|
||||
|
||||
// init logo animation
|
||||
if(enableHover === true){
|
||||
var logoElements = $('#' + config.staticLogoId + ' path');
|
||||
|
||||
var animate = [];
|
||||
logoElements.on('mouseover', function(e){
|
||||
var currentLogoElement = $(e.target);
|
||||
var currentLogoElementIndex = logoElements.index(currentLogoElement);
|
||||
|
||||
var animationXValue = currentLogoElement.attr('data-animationX');
|
||||
var animationYValue = currentLogoElement.attr('data-animationY');
|
||||
|
||||
var animationConfig = {};
|
||||
animationConfig.opacity = [1, 1];
|
||||
animationConfig.translateZ = [0, 0];
|
||||
animationConfig.translateX = [animationXValue, 0 ];
|
||||
animationConfig.translateY = [animationYValue, 0];
|
||||
|
||||
if(animate[currentLogoElementIndex] !== false){
|
||||
$(this).velocity(animationConfig,{
|
||||
duration: 120,
|
||||
begin: function(){
|
||||
animate[currentLogoElementIndex] = false;
|
||||
}
|
||||
}).velocity('reverse',{
|
||||
delay: 240,
|
||||
complete: function(){
|
||||
animate[currentLogoElementIndex] = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}).lazylinepainter('paint');
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
@@ -1,241 +0,0 @@
|
||||
/**
|
||||
* System graph module
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'morris'
|
||||
], function($, Init, Util, Morris) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// module info
|
||||
moduleClass: 'pf-module', // class for each module
|
||||
|
||||
// system graph module
|
||||
systemGraphModuleClass: 'pf-system-graph-module', // class for this module
|
||||
systemGraphClass: 'pf-system-graph', // class for each graph
|
||||
|
||||
// system graph labels
|
||||
systemGraphLabels: {
|
||||
jumps: {
|
||||
headline: 'Jumps',
|
||||
units: 'jumps',
|
||||
ykeys: ['y'],
|
||||
labels: ['jumps'],
|
||||
lineColors: ['#375959'],
|
||||
pointFillColors: ['#477372']
|
||||
},
|
||||
shipKills: {
|
||||
headline: 'Ship/POD Kills',
|
||||
units: 'kills',
|
||||
ykeys: ['y', 'z'],
|
||||
labels: ['Ship kills', 'POD kills'],
|
||||
lineColors: ['#375959', '#477372'],
|
||||
pointFillColors: ['#477372', '#568a89']
|
||||
},
|
||||
factionKills: {
|
||||
headline: 'NPC Kills',
|
||||
units: 'kills',
|
||||
ykeys: ['y'],
|
||||
labels: ['kills'],
|
||||
lineColors: ['#375959'],
|
||||
pointFillColors: ['#477372']
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get info for a given graph key
|
||||
* @param graphKey
|
||||
* @param option
|
||||
* @returns {string}
|
||||
*/
|
||||
var getInfoForGraph = function(graphKey, option){
|
||||
var info = '';
|
||||
|
||||
if(config.systemGraphLabels.hasOwnProperty(graphKey)){
|
||||
info = config.systemGraphLabels[graphKey][option];
|
||||
}
|
||||
|
||||
return info;
|
||||
};
|
||||
|
||||
/**
|
||||
* init Morris Graph
|
||||
* @param graphElement
|
||||
* @param graphKey
|
||||
* @param graphData
|
||||
*/
|
||||
var initGraph = function(graphElement, graphKey, graphData, eventLine){
|
||||
|
||||
if(graphData.length > 0){
|
||||
var labelYFormat = function(y){
|
||||
return Math.round(y);
|
||||
};
|
||||
|
||||
var graphConfig = {
|
||||
element: graphElement,
|
||||
data: graphData,
|
||||
xkey: 'x',
|
||||
ykeys: getInfoForGraph(graphKey, 'ykeys'),
|
||||
labels: getInfoForGraph(graphKey, 'labels'),
|
||||
parseTime: false,
|
||||
ymin: 0,
|
||||
yLabelFormat: labelYFormat,
|
||||
padding: 10,
|
||||
hideHover: true,
|
||||
pointSize: 3,
|
||||
lineColors: getInfoForGraph(graphKey, 'lineColors'),
|
||||
pointFillColors: getInfoForGraph(graphKey, 'pointFillColors'),
|
||||
pointStrokeColors: ['#141413'],
|
||||
lineWidth: 2,
|
||||
grid: true,
|
||||
gridStrokeWidth: 0.3,
|
||||
gridTextSize: 9,
|
||||
gridTextFamily: 'Oxygen Bold',
|
||||
gridTextColor: '#63676a',
|
||||
behaveLikeLine: false,
|
||||
goals: [],
|
||||
goalLineColors: ['#5cb85c'],
|
||||
smooth: true,
|
||||
fillOpacity: 0.2,
|
||||
resize: true,
|
||||
redraw: true,
|
||||
eventStrokeWidth: 2,
|
||||
eventLineColors: ['#5CB85C']
|
||||
};
|
||||
|
||||
if(eventLine >= 0){
|
||||
graphConfig.events = [eventLine];
|
||||
}
|
||||
|
||||
Morris.Area(graphConfig);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* draw graph module
|
||||
* @param parentElement
|
||||
* @param systemData
|
||||
*/
|
||||
var drawModule = function(parentElement, systemData){
|
||||
|
||||
// graph data is available for k-space systems
|
||||
if(systemData.type.id === 2){
|
||||
var requestData = {
|
||||
systemIds: [systemData.systemId]
|
||||
};
|
||||
|
||||
// calculate time offset until system created
|
||||
var serverData = Util.getServerTime();
|
||||
|
||||
var timestampNow = Math.floor(serverData.getTime() / 1000);
|
||||
var timeSinceUpdate = timestampNow - systemData.updated;
|
||||
|
||||
var timeInHours = Math.floor(timeSinceUpdate / 3600);
|
||||
var timeInMinutes = Math.floor((timeSinceUpdate % 3600) / 60);
|
||||
var timeInMinutesPercent = ( timeInMinutes / 60 ).toFixed(2);
|
||||
var eventLine = timeInHours + timeInMinutesPercent;
|
||||
|
||||
// graph is from right to left -> convert event line
|
||||
eventLine = 23 - eventLine;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Init.path.getSystemGraphData,
|
||||
data: requestData,
|
||||
dataType: 'json'
|
||||
}).done(function(systemGraphsData){
|
||||
|
||||
if( Object.keys(systemGraphsData).length > 0 ){
|
||||
// create new (hidden) module container
|
||||
var moduleElement = $('<div>', {
|
||||
class: [config.moduleClass, config.systemGraphModuleClass].join(' '),
|
||||
css: {opacity: 0}
|
||||
});
|
||||
|
||||
// insert at the correct position
|
||||
if($(parentElement).children().length === 1){
|
||||
$(parentElement).append(moduleElement);
|
||||
}else{
|
||||
$(parentElement).find('>:first-child').after(moduleElement);
|
||||
}
|
||||
|
||||
// row element
|
||||
var rowElement = $('<div>', {
|
||||
class: 'row'
|
||||
});
|
||||
moduleElement.append(rowElement);
|
||||
|
||||
$.each(systemGraphsData, function(systemId, graphsData){
|
||||
$.each(graphsData, function(graphKey, graphData){
|
||||
|
||||
var colElement = $('<div>', {
|
||||
class: ['col-xs-12', 'col-sm-6', 'col-md-4'].join(' ')
|
||||
});
|
||||
|
||||
var headlineElement = $('<h5>').text( getInfoForGraph(graphKey, 'headline') );
|
||||
|
||||
colElement.append(headlineElement);
|
||||
|
||||
var graphElement = $('<div>', {
|
||||
class: config.systemGraphClass
|
||||
});
|
||||
|
||||
colElement.append(graphElement);
|
||||
|
||||
rowElement.append(colElement);
|
||||
initGraph(graphElement, graphKey, graphData, eventLine);
|
||||
});
|
||||
});
|
||||
|
||||
moduleElement.append($('<div>', {
|
||||
css: {'clear': 'both'}
|
||||
}));
|
||||
|
||||
// show module
|
||||
moduleElement.velocity('transition.slideDownIn', {
|
||||
duration: Init.animationSpeed.mapModule,
|
||||
delay: Init.animationSpeed.mapModule
|
||||
});
|
||||
}
|
||||
}).fail(function( jqXHR, status, error) {
|
||||
var reason = status + ' ' + error;
|
||||
Util.showNotify({title: jqXHR.status + ': System graph data', text: reason, type: 'warning'});
|
||||
$(document).setProgramStatus('problem');
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* main module load function
|
||||
* @param systemData
|
||||
*/
|
||||
$.fn.drawSystemGraphModule = function(systemData){
|
||||
|
||||
var parentElement = $(this);
|
||||
|
||||
// check if module already exists
|
||||
var moduleElement = parentElement.find('.' + config.systemGraphModuleClass);
|
||||
|
||||
if(moduleElement.length > 0){
|
||||
moduleElement.velocity('transition.slideDownOut', {
|
||||
duration: Init.animationSpeed.mapModule,
|
||||
complete: function(tempElement){
|
||||
$(tempElement).remove();
|
||||
drawModule(parentElement, systemData);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
drawModule(parentElement, systemData);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
});
|
||||
@@ -1,486 +0,0 @@
|
||||
/**
|
||||
* System info module
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/render',
|
||||
'app/map/util'
|
||||
], function($, Init, Util, Render, MapUtil) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// module info
|
||||
moduleClass: 'pf-module', // class for each module
|
||||
|
||||
// system info module
|
||||
systemInfoModuleClass: 'pf-system-info-module', // module wrapper
|
||||
|
||||
// breadcrumb
|
||||
constellationLinkClass: 'pf-system-info-constellation', // class for "constellation" name
|
||||
regionLinkClass: 'pf-system-info-region', // class for "region" name
|
||||
typeLinkClass: 'pf-system-info-type', // class for "type" name
|
||||
|
||||
// info table
|
||||
systemInfoTableClass: 'pf-system-info-table', // class for system info table
|
||||
systemInfoNameInfoClass: 'pf-system-info-name', // class for "name" information element
|
||||
systemInfoEffectInfoClass: 'pf-system-info-effect', // class for "effect" information element
|
||||
systemInfoStatusLabelClass: 'pf-system-info-status-label', // class for "status" information element
|
||||
systemInfoStatusAttributeName: 'data-status', // attribute name for status label
|
||||
systemInfoWormholeClass: 'pf-system-info-wormhole-', // class prefix for static wormhole element
|
||||
|
||||
// description field
|
||||
descriptionArea: 'pf-system-info-description-area', // class for "description" area
|
||||
addDescriptionButtonClass: 'pf-system-info-description-button', // class for "add description" button
|
||||
moduleElementToolbarClass: 'pf-table-tools', // class for "module toolbar" element
|
||||
moduleToolbarActionId: 'pf-system-info-collapse-container', // id for "module toolbar action" element
|
||||
descriptionTextareaElementClass: 'pf-system-info-description', // class for "description" textarea element (xEditable)
|
||||
descriptionTextareaTooltipClass: 'pf-system-info-description-tooltip' // class for "description" tooltip
|
||||
};
|
||||
|
||||
// disable Module update temporary (until. some requests/animations) are finished
|
||||
var disableModuleUpdate = true;
|
||||
|
||||
// animation speed values
|
||||
var animationSpeedToolbarAction = 200;
|
||||
|
||||
/**
|
||||
* set module observer and look for relevant system data to update
|
||||
*/
|
||||
var setModuleObserver = function(moduleElement){
|
||||
$(document).off('pf:updateSystemInfoModule').on('pf:updateSystemInfoModule', function(e, data){
|
||||
if(data){
|
||||
moduleElement.updateSystemInfoModule(data);
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* shows the tool action element by animation
|
||||
*/
|
||||
var showToolsActionElement = function(){
|
||||
|
||||
// "toolbar action" element
|
||||
var toolsActionElement = $('#' + config.moduleToolbarActionId);
|
||||
|
||||
toolsActionElement.velocity('stop').velocity({
|
||||
opacity: 1,
|
||||
height: '75px'
|
||||
},{
|
||||
duration: animationSpeedToolbarAction,
|
||||
display: 'block',
|
||||
visibility: 'visible'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* hides the tool action element by animation
|
||||
*/
|
||||
var hideToolsActionElement = function(){
|
||||
|
||||
// "toolbar action" element
|
||||
var toolsActionElement = $('#' + config.moduleToolbarActionId);
|
||||
|
||||
toolsActionElement.velocity('stop').velocity('reverse', {
|
||||
display: 'none',
|
||||
visibility: 'hidden'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* update trigger function for this module
|
||||
* compare data and update module
|
||||
* @param systemData
|
||||
*/
|
||||
$.fn.updateSystemInfoModule = function(systemData){
|
||||
|
||||
// module update is disabled
|
||||
if(disableModuleUpdate === true){
|
||||
return;
|
||||
}
|
||||
|
||||
var moduleElement = $(this);
|
||||
|
||||
var systemId = moduleElement.data('id');
|
||||
|
||||
if(systemId === systemData.id){
|
||||
// update module
|
||||
|
||||
// system status =====================================================================================
|
||||
var systemStatusLabelElement = moduleElement.find('.' + config.systemInfoStatusLabelClass);
|
||||
var systemStatusId = parseInt( systemStatusLabelElement.attr( config.systemInfoStatusAttributeName ) );
|
||||
|
||||
|
||||
if(systemStatusId !== systemData.status.id){
|
||||
// status changed
|
||||
|
||||
var currentStatusClass = Util.getStatusInfoForSystem(systemStatusId, 'class');
|
||||
var newStatusClass = Util.getStatusInfoForSystem(systemData.status.id, 'class');
|
||||
var newStatusLabel = Util.getStatusInfoForSystem(systemData.status.id, 'label');
|
||||
|
||||
systemStatusLabelElement.removeClass(currentStatusClass).addClass(newStatusClass).text(newStatusLabel);
|
||||
|
||||
// set new status attribute
|
||||
systemStatusLabelElement.attr( config.systemInfoStatusAttributeName, systemData.status.id);
|
||||
}
|
||||
|
||||
// description textarea element ======================================================================
|
||||
var descriptionTextareaElement = moduleElement.find('.' + config.descriptionTextareaElementClass);
|
||||
|
||||
var description = descriptionTextareaElement.editable('getValue', true);
|
||||
|
||||
if(description !== systemData.description){
|
||||
// description changed
|
||||
|
||||
// description button
|
||||
var descriptionButton = moduleElement.find('.' + config.addDescriptionButtonClass);
|
||||
|
||||
// set new value
|
||||
descriptionTextareaElement.editable('setValue', systemData.description);
|
||||
|
||||
if(systemData.description.length === 0){
|
||||
// show/activate description field
|
||||
|
||||
// show button if value is empty
|
||||
descriptionButton.show();
|
||||
|
||||
|
||||
hideToolsActionElement();
|
||||
|
||||
}else{
|
||||
// hide/disable description field
|
||||
|
||||
// hide tool button
|
||||
descriptionButton.hide();
|
||||
|
||||
showToolsActionElement();
|
||||
}
|
||||
}
|
||||
|
||||
// created/updated tooltip ===========================================================================
|
||||
|
||||
var nameRowElement = $(moduleElement).find('.' + config.systemInfoNameInfoClass);
|
||||
|
||||
var tooltipData = {
|
||||
created: systemData.created,
|
||||
updated: systemData.updated
|
||||
};
|
||||
|
||||
nameRowElement.addCharacterInfoTooltip( tooltipData );
|
||||
}
|
||||
|
||||
$('.' + config.descriptionArea).hideLoadingAnimation();
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param parentElement
|
||||
* @param mapId
|
||||
* @param systemData
|
||||
*/
|
||||
var drawModule = function(parentElement, mapId, systemData){
|
||||
|
||||
// create new module container
|
||||
var moduleElement = $('<div>', {
|
||||
class: [config.moduleClass, config.systemInfoModuleClass].join(' '),
|
||||
css: {opacity: 0}
|
||||
});
|
||||
|
||||
// store systemId -> module can be updated with the correct data
|
||||
moduleElement.data('id', systemData.id);
|
||||
|
||||
parentElement.prepend(moduleElement);
|
||||
|
||||
// shattered wormhole info data
|
||||
var shatteredWormholeInfo = false;
|
||||
|
||||
// add security class for statics
|
||||
if(
|
||||
systemData.statics &&
|
||||
systemData.statics.length > 0
|
||||
){
|
||||
for(var i = 0; i < systemData.statics.length; i++){
|
||||
systemData.statics[i].class = Util.getSecurityClassForSystem( systemData.statics[i].security );
|
||||
}
|
||||
}else if(systemData.type.id === 1){
|
||||
// system type "wormhole" but no statics => "shattered wormhole"
|
||||
shatteredWormholeInfo = true;
|
||||
}
|
||||
|
||||
var effectName = MapUtil.getEffectInfoForSystem(systemData.effect, 'name');
|
||||
var effectClass = MapUtil.getEffectInfoForSystem(systemData.effect, 'class');
|
||||
|
||||
// systemInfo template config
|
||||
var moduleConfig = {
|
||||
name: 'modules/system_info',
|
||||
position: moduleElement,
|
||||
link: 'append',
|
||||
functions: {
|
||||
after: function(){
|
||||
// lock "description" field until first update
|
||||
$('.' + config.descriptionArea).showLoadingAnimation();
|
||||
|
||||
|
||||
var tempModuleElement = $('.' + config.systemInfoModuleClass);
|
||||
|
||||
// "add description" button
|
||||
var descriptionButton = tempModuleElement.find('.' + config.addDescriptionButtonClass);
|
||||
|
||||
// description textarea element
|
||||
var descriptionTextareaElement = tempModuleElement.find('.' + config.descriptionTextareaElementClass);
|
||||
|
||||
// init description textarea
|
||||
descriptionTextareaElement.editable({
|
||||
url: Init.path.saveSystem,
|
||||
dataType: 'json',
|
||||
pk: systemData.id,
|
||||
type: 'textarea',
|
||||
mode: 'inline',
|
||||
emptytext: '',
|
||||
onblur: 'cancel',
|
||||
showbuttons: true,
|
||||
value: '', // value is set by trigger function updateSystemInfoModule()
|
||||
rows: 5,
|
||||
name: 'description',
|
||||
inputclass: config.descriptionTextareaElementClass,
|
||||
params: function(params){
|
||||
|
||||
params.mapData = {
|
||||
id: mapId
|
||||
};
|
||||
|
||||
params.systemData = {};
|
||||
params.systemData.id = params.pk;
|
||||
params.systemData[params.name] = params.value;
|
||||
|
||||
// clear unnecessary data
|
||||
delete params.pk;
|
||||
delete params.name;
|
||||
delete params.value;
|
||||
|
||||
return params;
|
||||
},
|
||||
validate: function(value){
|
||||
if(value.length > 0 && $.trim(value).length === 0) {
|
||||
return {newValue: ''};
|
||||
}
|
||||
},
|
||||
success: function(response, newValue){
|
||||
Util.showNotify({title: 'System updated', text: 'Name: ' + response.name, type: 'success'});
|
||||
},
|
||||
error: function(jqXHR, newValue){
|
||||
|
||||
var reason = '';
|
||||
var status = '';
|
||||
if(jqXHR.name){
|
||||
// save error new sig (mass save)
|
||||
reason = jqXHR.name;
|
||||
status = 'Error';
|
||||
}else{
|
||||
reason = jqXHR.responseJSON.text;
|
||||
status = jqXHR.status;
|
||||
}
|
||||
|
||||
Util.showNotify({title: status + ': save system information', text: reason, type: 'warning'});
|
||||
$(document).setProgramStatus('problem');
|
||||
return reason;
|
||||
}
|
||||
});
|
||||
|
||||
// on xEditable open -------------------------------------------------------------------------
|
||||
descriptionTextareaElement.on('shown', function(e){
|
||||
// disable module update until description field is open
|
||||
disableModuleUpdate = true;
|
||||
|
||||
// disable tooltip
|
||||
tempModuleElement.find('.' + config.descriptionTextareaTooltipClass).tooltip('disable');
|
||||
});
|
||||
|
||||
// on xEditable close ------------------------------------------------------------------------
|
||||
descriptionTextareaElement.on('hidden', function(e){
|
||||
var value = $(this).editable('getValue', true);
|
||||
|
||||
if(value.length === 0){
|
||||
|
||||
// show button if value is empty
|
||||
hideToolsActionElement();
|
||||
|
||||
descriptionButton.show();
|
||||
}else{
|
||||
// enable tooltip
|
||||
tempModuleElement.find('.' + config.descriptionTextareaTooltipClass).tooltip('enable');
|
||||
}
|
||||
|
||||
// enable module update
|
||||
disableModuleUpdate = false;
|
||||
});
|
||||
|
||||
// enable xEditable field on Button click ----------------------------------------------------
|
||||
descriptionButton.on('click', function(e){
|
||||
e.stopPropagation();
|
||||
|
||||
// hide tool buttons
|
||||
descriptionButton.hide();
|
||||
|
||||
// show field *before* showing the element
|
||||
descriptionTextareaElement.editable('show');
|
||||
|
||||
showToolsActionElement();
|
||||
});
|
||||
|
||||
|
||||
// init tooltips -----------------------------------------------------------------------------
|
||||
var tooltipElements = $('.' + config.systemInfoModuleClass + ' [data-toggle="tooltip"]');
|
||||
tooltipElements.tooltip();
|
||||
|
||||
// init system effect popover ----------------------------------------------------------------
|
||||
var systemEffectData = Util.getSystemEffectData( systemData.security, systemData.effect);
|
||||
|
||||
if(systemEffectData !== false){
|
||||
var infoEffectElement = $(moduleElement).find('.' + config.systemInfoEffectInfoClass);
|
||||
|
||||
// transform data into table
|
||||
var systemEffectTable = Util.getSystemEffectTable( systemEffectData );
|
||||
|
||||
infoEffectElement.popover({
|
||||
html: true,
|
||||
trigger: 'hover',
|
||||
placement: 'top',
|
||||
delay: 200,
|
||||
title: 'System effects',
|
||||
container: 'body',
|
||||
content: systemEffectTable
|
||||
});
|
||||
}
|
||||
|
||||
// init static wormhole information ----------------------------------------------------------
|
||||
if(systemData.statics){
|
||||
for(var i = 0; i < systemData.statics.length; i++){
|
||||
var staticData = systemData.statics[i];
|
||||
var staticRowElement = tempModuleElement.find('.' + config.systemInfoWormholeClass + staticData.name);
|
||||
staticRowElement.addWormholeInfoTooltip(staticData);
|
||||
}
|
||||
}
|
||||
|
||||
// constellation popover ---------------------------------------------------------------------
|
||||
tempModuleElement.find('a.popup-ajax').popover({
|
||||
html: true,
|
||||
trigger: 'hover',
|
||||
placement: 'top',
|
||||
delay: 200,
|
||||
container: 'body',
|
||||
content: function(){
|
||||
return details_in_popup(this);
|
||||
}
|
||||
});
|
||||
|
||||
function details_in_popup(popoverElement){
|
||||
popoverElement = $(popoverElement);
|
||||
var popover = popoverElement.data('bs.popover');
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: popoverElement.data('url'),
|
||||
success: function(data){
|
||||
var systemEffectTable = Util.getSystemsInfoTable( data.systemData );
|
||||
popover.options.content = systemEffectTable;
|
||||
// reopen popover (new content size)
|
||||
popover.show();
|
||||
}
|
||||
});
|
||||
return 'Loading...';
|
||||
}
|
||||
|
||||
showModule(moduleElement);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var moduleData = {
|
||||
system: systemData,
|
||||
tableClass: config.systemInfoTableClass,
|
||||
nameInfoClass: config.systemInfoNameInfoClass,
|
||||
effectInfoClass: config.systemInfoEffectInfoClass,
|
||||
wormholePrefixClass: config.systemInfoWormholeClass,
|
||||
statusInfoClass: config.systemInfoStatusLabelClass,
|
||||
|
||||
systemTypeName: MapUtil.getSystemTypeInfo(systemData.type.id, 'name'),
|
||||
systemStatusId: systemData.status.id,
|
||||
systemStatusClass: Util.getStatusInfoForSystem(systemData.status.id, 'class'),
|
||||
systemStatusLabel: Util.getStatusInfoForSystem(systemData.status.id, 'label'),
|
||||
securityClass: Util.getSecurityClassForSystem( systemData.security ),
|
||||
trueSec: systemData.trueSec.toFixed(1),
|
||||
trueSecClass: Util.getTrueSecClassForSystem( systemData.trueSec ),
|
||||
effectName: effectName,
|
||||
effectClass: effectClass,
|
||||
moduleToolbarClass: config.moduleElementToolbarClass,
|
||||
descriptionButtonClass: config.addDescriptionButtonClass,
|
||||
moduleToolbarActionId: config.moduleToolbarActionId,
|
||||
descriptionTextareaClass: config.descriptionTextareaElementClass,
|
||||
descriptionTooltipClass: config.descriptionTextareaTooltipClass,
|
||||
|
||||
shatteredWormholeInfo: shatteredWormholeInfo,
|
||||
|
||||
ajaxConstellationInfoUrl: Init.path.getConstellationData,
|
||||
|
||||
systemConstellationLinkClass: config.constellationLinkClass,
|
||||
systemRegionLinkClass: config.regionLinkClass,
|
||||
systemTypeLinkClass: config.typeLinkClass
|
||||
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
};
|
||||
|
||||
/**
|
||||
* show system info module with animation
|
||||
* @param moduleElement
|
||||
*/
|
||||
var showModule = function(moduleElement){
|
||||
moduleElement.velocity('transition.slideDownIn', {
|
||||
duration: Init.animationSpeed.mapModule,
|
||||
delay: Init.animationSpeed.mapModule,
|
||||
complete: function(){
|
||||
// set module observer
|
||||
setModuleObserver(moduleElement);
|
||||
|
||||
// enable auto update
|
||||
disableModuleUpdate = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* update system info module
|
||||
* @param mapId
|
||||
* @param systemData
|
||||
*/
|
||||
$.fn.drawSystemInfoModule = function(mapId, systemData){
|
||||
|
||||
var parentElement = $(this);
|
||||
|
||||
// check if module already exists
|
||||
var moduleElement = parentElement.find('.' + config.systemInfoModuleClass);
|
||||
|
||||
if(moduleElement.length > 0){
|
||||
moduleElement.velocity('transition.slideDownOut', {
|
||||
duration: Init.animationSpeed.mapModule,
|
||||
complete: function(tempElement){
|
||||
$(tempElement).remove();
|
||||
|
||||
drawModule(parentElement, mapId, systemData);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
drawModule(parentElement, mapId, systemData);
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -1,495 +0,0 @@
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'morris'
|
||||
], function($, Init, Util, Morris) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// module info
|
||||
moduleClass: 'pf-module', // class for each module
|
||||
|
||||
// headline toolbar
|
||||
systemModuleHeadlineIcon: 'pf-module-icon-button', // class for toolbar icons in the head
|
||||
|
||||
// system killboard module
|
||||
systemKillboardModuleClass: 'pf-system-killboard-module', // module wrapper
|
||||
systemKillboardGraphKillsClass: 'pf-system-killboard-graph-kills', // class for system kill graph
|
||||
|
||||
// system killboard list
|
||||
systemKillboardListClass: 'pf-system-killboard-list', // class for a list with kill entries
|
||||
systemKillboardListEntryClass: 'pf-system-killboard-list-entry', // class for a list entry
|
||||
systemKillboardListImgShip: 'pf-system-killboard-img-ship', // class for all ship images
|
||||
systemKillboardListImgAlly: 'pf-system-killboard-img-ally', // class for all alliance logos
|
||||
systemKillboardListImgCorp: 'pf-system-killboard-img-corp' // class for all corp logos
|
||||
|
||||
};
|
||||
|
||||
var cache = {
|
||||
systemKillsGraphData: {} // data for system kills info graph
|
||||
};
|
||||
|
||||
/**
|
||||
* get label element with given content
|
||||
* @param text
|
||||
* @returns {*|XMLList}
|
||||
*/
|
||||
var getLabel = function(text, options){
|
||||
var label = $('<span>', {
|
||||
class: ['label', options.type, options.align].join(' ')
|
||||
}).text( text );
|
||||
|
||||
return label;
|
||||
};
|
||||
|
||||
|
||||
var showKillmails = function(moduleElement, killboardData){
|
||||
|
||||
// show number of killMails
|
||||
var killMailCounterMax = 20;
|
||||
var killMailCounter = 0;
|
||||
|
||||
// change order (show right to left)
|
||||
killboardData.tableData.reverse();
|
||||
|
||||
for(var i = 0; i < killboardData.tableData.length; i++){
|
||||
|
||||
// check if killMails exist in this hour
|
||||
if(killboardData.tableData[i].killmails){
|
||||
|
||||
if(killMailCounter >= killMailCounterMax){
|
||||
break;
|
||||
}
|
||||
|
||||
moduleElement.append( $('<h5>').text(i + 'h ago'));
|
||||
|
||||
var killMailData = killboardData.tableData[i].killmails;
|
||||
|
||||
var listeElement = $('<ul>', {
|
||||
class: ['media-list', config.systemKillboardListClass].join(' ')
|
||||
});
|
||||
|
||||
for(var j = 0; j < killMailData.length; j++){
|
||||
killMailCounter++;
|
||||
if(killMailCounter >= killMailCounterMax){
|
||||
break;
|
||||
}
|
||||
|
||||
var killData = killMailData[j];
|
||||
|
||||
var linkUrl = 'https://zkillboard.com/kill/' + killData.killID + '/';
|
||||
var victimImageUrl = 'https://image.eveonline.com/Type/' + killData.victim.shipTypeID + '_64.png';
|
||||
var killDate = getDateObjectByTimeString(killData.killTime);
|
||||
var killDateString = Util.convertDateToString(killDate);
|
||||
var killLossValue = Util.formatPrice( killData.zkb.totalValue );
|
||||
|
||||
// check for ally
|
||||
var victimAllyLogoUrl = '';
|
||||
var displayAlly = 'none';
|
||||
if(killData.victim.allianceID > 0){
|
||||
victimAllyLogoUrl = 'https://image.eveonline.com/Alliance/' + killData.victim.allianceID + '_32.png';
|
||||
displayAlly = 'block';
|
||||
}
|
||||
|
||||
// check for corp
|
||||
var victimCorpLogoUrl = '';
|
||||
var displayCorp = 'none';
|
||||
if(killData.victim.corporationID > 0){
|
||||
victimCorpLogoUrl = 'https://image.eveonline.com/Corporation/' + killData.victim.corporationID + '_32.png';
|
||||
displayCorp = 'inline';
|
||||
}
|
||||
|
||||
var liElement = $('<li>', {
|
||||
class: ['media', config.systemKillboardListEntryClass].join(' ')
|
||||
}).append(
|
||||
$('<a>', {
|
||||
href: linkUrl,
|
||||
target: '_blank'
|
||||
}).append(
|
||||
$('<img>', {
|
||||
src: victimImageUrl,
|
||||
class: ['media-object', 'pull-left', config.systemKillboardListImgShip].join(' ')
|
||||
})
|
||||
).append(
|
||||
$('<img>', {
|
||||
src: victimAllyLogoUrl,
|
||||
title: killData.victim.allianceName,
|
||||
class: ['pull-right', config.systemKillboardListImgAlly].join(' '),
|
||||
css: {display: displayAlly}
|
||||
}).attr('data-placement', 'left')
|
||||
).append(
|
||||
$('<div>', {
|
||||
class: 'media-body'
|
||||
}).append(
|
||||
$('<h5>', {
|
||||
class: 'media-heading',
|
||||
text: killData.victim.characterName
|
||||
}).prepend(
|
||||
$('<small>', {
|
||||
text: killDateString + ' - '
|
||||
})
|
||||
).prepend(
|
||||
$('<img>', {
|
||||
src: victimCorpLogoUrl,
|
||||
title: killData.victim.corporationName,
|
||||
class: [config.systemKillboardListImgCorp].join(' '),
|
||||
css: {display: displayCorp}
|
||||
})
|
||||
)
|
||||
).append(
|
||||
$('<h3>', {
|
||||
class: ['media-heading'].join(' ')
|
||||
}).append(
|
||||
$('<small>', {
|
||||
class: ['txt-color', 'txt-color-green', 'pull-right'].join(' '),
|
||||
text: killLossValue
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
listeElement.append(liElement);
|
||||
|
||||
}
|
||||
|
||||
moduleElement.append(listeElement);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// animate kill li-elements
|
||||
$('.' + config.systemKillboardListEntryClass).velocity('transition.expandIn', {
|
||||
stagger: 50,
|
||||
complete: function(){
|
||||
// init tooltips
|
||||
moduleElement.find('[title]').tooltip({
|
||||
container: 'body'
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* updates the system info graph
|
||||
* @param systemData
|
||||
*/
|
||||
$.fn.updateSystemInfoGraphs = function(systemData){
|
||||
|
||||
var moduleElement = $(this);
|
||||
|
||||
|
||||
// headline toolbar icons
|
||||
var headlineToolbar = $('<h5>', {
|
||||
class: 'pull-right'
|
||||
}).append(
|
||||
$('<i>', {
|
||||
class: ['fa', 'fa-fw', 'fa-external-link ', config.systemModuleHeadlineIcon].join(' '),
|
||||
title: 'zkillboard.com'
|
||||
}).on('click', function(e){
|
||||
window.open(
|
||||
'https://zkillboard.com/system/' + systemData.systemId,
|
||||
'_blank'
|
||||
);
|
||||
}).attr('data-toggle', 'tooltip')
|
||||
);
|
||||
|
||||
moduleElement.append(headlineToolbar);
|
||||
|
||||
// headline
|
||||
var headline = $('<h5>', {
|
||||
text: 'Killboard'
|
||||
});
|
||||
|
||||
moduleElement.append(headline);
|
||||
|
||||
var killboardGraphElement = $('<div>', {
|
||||
class: config.systemKillboardGraphKillsClass
|
||||
});
|
||||
|
||||
moduleElement.append(killboardGraphElement);
|
||||
|
||||
var showHours = 24;
|
||||
var maxKillmailCount = 200; // limited by API
|
||||
|
||||
var labelOptions = {
|
||||
align: 'center-block'
|
||||
};
|
||||
var label = '';
|
||||
|
||||
// private function draws a "system kills" graph
|
||||
var drawGraph = function(data){
|
||||
|
||||
var tableData = data.tableData;
|
||||
|
||||
// change order (show right to left)
|
||||
tableData.reverse();
|
||||
|
||||
|
||||
|
||||
if(data.count === 0){
|
||||
labelOptions.type = 'label-success';
|
||||
label = getLabel( 'No kills found within the last 24h', labelOptions );
|
||||
killboardGraphElement.append( label );
|
||||
|
||||
minifyKillboardGraphElement(killboardGraphElement);
|
||||
return;
|
||||
}
|
||||
|
||||
var labelYFormat = function(y){
|
||||
return Math.round(y);
|
||||
};
|
||||
|
||||
// draw chart
|
||||
Morris.Bar({
|
||||
element: killboardGraphElement,
|
||||
resize: true,
|
||||
grid: true,
|
||||
gridStrokeWidth: 0.3,
|
||||
gridTextSize: 9,
|
||||
gridTextColor: '#63676a',
|
||||
gridTextFamily: 'Oxygen Bold',
|
||||
hideHover: true,
|
||||
data: tableData,
|
||||
xkey: 'label',
|
||||
ykeys: ['kills'],
|
||||
labels: ['Kills'],
|
||||
yLabelFormat: labelYFormat,
|
||||
xLabelMargin: 10,
|
||||
padding: 10,
|
||||
parseTime: false,
|
||||
barOpacity: 0.8,
|
||||
barRadius: [2, 2, 0, 0],
|
||||
barSizeRatio: 0.5,
|
||||
barGap: 3,
|
||||
barColors: function (row, series, type) {
|
||||
if (type === 'bar') {
|
||||
// highlight last row -> recent kills found
|
||||
if(this.xmax === row.x){
|
||||
return '#c2760c';
|
||||
}
|
||||
}
|
||||
|
||||
return '#375959';
|
||||
}
|
||||
});
|
||||
|
||||
// show hint for recent kills
|
||||
if(tableData[tableData.length - 1].kills > 0){
|
||||
labelOptions.type = 'label-warning';
|
||||
label = getLabel( tableData[tableData.length - 1].kills + ' kills within the last hour', labelOptions );
|
||||
killboardGraphElement.prepend( label );
|
||||
}
|
||||
};
|
||||
|
||||
// get recent KB stats (last 24h))
|
||||
var localDate = new Date();
|
||||
|
||||
// cache result for 5min
|
||||
var cacheKey = systemData.systemId + '_' + localDate.getHours() + '_' + ( Math.ceil( localDate.getMinutes() / 5 ) * 5);
|
||||
|
||||
if(cache.systemKillsGraphData.hasOwnProperty(cacheKey) ){
|
||||
// cached results
|
||||
|
||||
drawGraph( cache.systemKillsGraphData[cacheKey] );
|
||||
|
||||
// show killmail information
|
||||
showKillmails(moduleElement, cache.systemKillsGraphData[cacheKey]);
|
||||
}else{
|
||||
|
||||
// chart data
|
||||
var chartData = [];
|
||||
|
||||
for(var i = 0; i < showHours; i++){
|
||||
var tempData = {
|
||||
label: i + 'h',
|
||||
kills: 0
|
||||
};
|
||||
|
||||
chartData.push(tempData);
|
||||
}
|
||||
|
||||
// get kills within the last 24h
|
||||
var timeFrameInSeconds = 60 * 60 * 24;
|
||||
|
||||
// get current server time
|
||||
var serverDate= Util.getServerTime();
|
||||
|
||||
// if system is w-space system -> add link modifier
|
||||
var wSpaceLinkModifier = '';
|
||||
if(systemData.type.id === 1){
|
||||
wSpaceLinkModifier = 'w-space/';
|
||||
}
|
||||
|
||||
var url = Init.url.zKillboard;
|
||||
url += 'no-items/' + wSpaceLinkModifier + 'no-attackers/solarSystemID/' + systemData.systemId + '/pastSeconds/' + timeFrameInSeconds + '/';
|
||||
|
||||
killboardGraphElement.showLoadingAnimation();
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
dataType: 'json'
|
||||
}).done(function(kbData) {
|
||||
|
||||
// the API wont return more than 200KMs ! - remember last bar block with complete KM information
|
||||
var lastCompleteDiffHourData = 0;
|
||||
|
||||
|
||||
// loop kills and count kills by hour
|
||||
for (var i = 0; i < kbData.length; i++) {
|
||||
var killmailData = kbData[i];
|
||||
|
||||
var killDate = getDateObjectByTimeString(killmailData.killTime);
|
||||
|
||||
// get time diff
|
||||
var timeDiffMin = Math.round(( serverDate - killDate ) / 1000 / 60);
|
||||
var timeDiffHour = Math.round(timeDiffMin / 60);
|
||||
|
||||
// update chart data
|
||||
if (chartData[timeDiffHour]) {
|
||||
chartData[timeDiffHour].kills++;
|
||||
|
||||
// add kill mail data
|
||||
if (chartData[timeDiffHour].killmails === undefined) {
|
||||
chartData[timeDiffHour].killmails = [];
|
||||
}
|
||||
chartData[timeDiffHour].killmails.push(killmailData);
|
||||
|
||||
if (timeDiffHour > lastCompleteDiffHourData) {
|
||||
lastCompleteDiffHourData = timeDiffHour;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// remove empty chart Data
|
||||
if (kbData.length >= maxKillmailCount) {
|
||||
chartData = chartData.splice(0, lastCompleteDiffHourData + 1);
|
||||
}
|
||||
|
||||
// fill cache
|
||||
cache.systemKillsGraphData[cacheKey] = {};
|
||||
cache.systemKillsGraphData[cacheKey].tableData = chartData;
|
||||
cache.systemKillsGraphData[cacheKey].count = kbData.length;
|
||||
|
||||
// draw table
|
||||
drawGraph(cache.systemKillsGraphData[cacheKey]);
|
||||
|
||||
// show killmail information
|
||||
showKillmails(moduleElement, cache.systemKillsGraphData[cacheKey]);
|
||||
|
||||
killboardGraphElement.hideLoadingAnimation();
|
||||
}).fail(function(e){
|
||||
|
||||
labelOptions.type = 'label-danger';
|
||||
label = getLabel( 'zKillboard is not responding', labelOptions );
|
||||
killboardGraphElement.prepend( label );
|
||||
|
||||
killboardGraphElement.hideLoadingAnimation();
|
||||
|
||||
minifyKillboardGraphElement(killboardGraphElement);
|
||||
|
||||
Util.showNotify({title: e.status + ': Get system kills', text: 'Loading failed', type: 'error'});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// init tooltips
|
||||
var tooltipElements = moduleElement.find('[data-toggle="tooltip"]');
|
||||
tooltipElements.tooltip({
|
||||
container: 'body'
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* minify the killboard graph element e.g. if no kills where found, or on error
|
||||
* @param killboardGraphElement
|
||||
*/
|
||||
var minifyKillboardGraphElement = function(killboardGraphElement){
|
||||
killboardGraphElement.velocity({
|
||||
height: '20px',
|
||||
marginBottom: '0px'
|
||||
},{
|
||||
duration: Init.animationSpeed.mapModule
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* transform timestring
|
||||
* @param timeString
|
||||
* @returns {Date}
|
||||
*/
|
||||
var getDateObjectByTimeString = function(timeString){
|
||||
var match = timeString.match(/^(\d+)-(\d+)-(\d+) (\d+)\:(\d+)\:(\d+)$/);
|
||||
var date = new Date(match[1], match[2] - 1, match[3], match[4], match[5], match[6]);
|
||||
|
||||
return date;
|
||||
};
|
||||
|
||||
/**
|
||||
* get module element
|
||||
* @param systemData
|
||||
* @returns {*|HTMLElement}
|
||||
*/
|
||||
var getModule = function(parentElement, systemData){
|
||||
|
||||
// create new module container
|
||||
var moduleElement = $('<div>', {
|
||||
class: [config.moduleClass, config.systemKillboardModuleClass].join(' '),
|
||||
css: {opacity: 0}
|
||||
});
|
||||
|
||||
parentElement.append(moduleElement);
|
||||
|
||||
// update graph
|
||||
moduleElement.updateSystemInfoGraphs(systemData);
|
||||
|
||||
return moduleElement;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* main module load function
|
||||
* @param systemData
|
||||
*/
|
||||
$.fn.drawSystemKillboardModule = function(systemData){
|
||||
|
||||
var parentElement = $(this);
|
||||
|
||||
// show route module
|
||||
var showModule = function(moduleElement){
|
||||
if(moduleElement){
|
||||
moduleElement.velocity('transition.slideDownIn', {
|
||||
duration: Init.animationSpeed.mapModule,
|
||||
delay: Init.animationSpeed.mapModule
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// check if module already exists
|
||||
var moduleElement = parentElement.find('.' + config.systemKillboardModuleClass);
|
||||
|
||||
if(moduleElement.length > 0){
|
||||
moduleElement.velocity('transition.slideDownOut', {
|
||||
duration: Init.animationSpeed.mapModule,
|
||||
complete: function(tempElement){
|
||||
$(tempElement).remove();
|
||||
|
||||
moduleElement = getModule(parentElement, systemData);
|
||||
showModule(moduleElement);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
moduleElement = getModule(parentElement, systemData);
|
||||
showModule(moduleElement);
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
@@ -1,985 +0,0 @@
|
||||
/**
|
||||
* system route module
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'bootbox',
|
||||
'app/map/util'
|
||||
], function($, Init, Util, bootbox, MapUtil) {
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
// module info
|
||||
moduleClass: 'pf-module', // class for each module
|
||||
|
||||
routeCacheTTL: 10, // route cache timer (client) in seconds
|
||||
|
||||
// system route module
|
||||
systemRouteModuleClass: 'pf-system-route-module', // class for this module
|
||||
|
||||
// headline toolbar
|
||||
systemModuleHeadlineIcon: 'pf-module-icon-button', // class for toolbar icons in the head
|
||||
systemModuleHeadlineIconSearch: 'pf-module-icon-button-search', // class for "search" icon
|
||||
systemModuleHeadlineIconSettings: 'pf-module-icon-button-settings', // class for "settings" icon
|
||||
systemModuleHeadlineIconRefresh: 'pf-module-icon-button-refresh', // class for "refresh" icon
|
||||
|
||||
systemSecurityClassPrefix: 'pf-system-security-', // prefix class for system security level (color)
|
||||
|
||||
// dialog
|
||||
routeSettingsDialogId: 'pf-route-settings-dialog', // id for route "settings" dialog
|
||||
routeDialogId: 'pf-route-dialog', // id for route "search" dialog
|
||||
systemDialogSelectClass: 'pf-system-dialog-select', // class for system select Element
|
||||
systemInfoRoutesTableClass: 'pf-system-route-table', // class for route tables
|
||||
mapSelectId: 'pf-route-dialog-map-select', // id for "map" select
|
||||
|
||||
dataTableActionCellClass: 'pf-table-action-cell' // class for "action" cells
|
||||
};
|
||||
|
||||
// cache for system routes
|
||||
var cache = {
|
||||
systemRoutes: {} // jump information between solar systems
|
||||
};
|
||||
|
||||
/**
|
||||
* callback function, adds new row to a dataTable with jump information for a route
|
||||
* @param context
|
||||
* @param routesData
|
||||
*/
|
||||
var callbackAddRouteRow = function(context, routesData){
|
||||
|
||||
if(routesData.length > 0){
|
||||
for(var i = 0; i < routesData.length; i++){
|
||||
var routeData = routesData[i];
|
||||
|
||||
// format routeData
|
||||
var rowData = formatRouteData(routeData);
|
||||
|
||||
if(rowData.route){
|
||||
var cacheKey = routeData.systemFromData.name.toLowerCase() +
|
||||
'_' + routeData.systemToData.name.toLowerCase();
|
||||
|
||||
// update route cache
|
||||
cache.systemRoutes[cacheKey] = {
|
||||
data: rowData,
|
||||
updated: Util.getServerTime().getTime() / 1000
|
||||
};
|
||||
|
||||
var rowElement = addRow(context, rowData);
|
||||
|
||||
rowElement.initTooltips({
|
||||
container: 'body'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// redraw dataTable
|
||||
context.dataTable.draw();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* add a new dataTable row to the routes table
|
||||
* @param context
|
||||
* @param rowData
|
||||
* @returns {*}
|
||||
*/
|
||||
var addRow = function(context, rowData){
|
||||
var dataTable = context.dataTable;
|
||||
var rowElement = null;
|
||||
var row = null;
|
||||
var animationStatus = 'changed';
|
||||
|
||||
// search for an existing row (e.g. on mass "table refresh" [all routes])
|
||||
// get rowIndex where column 0 (equals to "systemToData.name") matches rowData.systemToData.name
|
||||
var indexes = dataTable.rows().eq(0).filter( function (rowIdx) {
|
||||
return (dataTable.cell(rowIdx, 0 ).data().name === rowData.systemToData.name);
|
||||
});
|
||||
|
||||
if(indexes.length > 0){
|
||||
// update row with FIRST index
|
||||
// -> systemFrom should be unique!
|
||||
row = dataTable.row( parseInt(indexes[0]) );
|
||||
// update row data
|
||||
row.data(rowData);
|
||||
}else{
|
||||
// no existing route found -> add new row
|
||||
row = dataTable.row.add( rowData );
|
||||
|
||||
animationStatus = 'added';
|
||||
}
|
||||
|
||||
if(row.length > 0){
|
||||
rowElement = row.nodes().to$();
|
||||
|
||||
if(animationStatus !== null){
|
||||
rowElement.data('animationStatus', animationStatus);
|
||||
}
|
||||
}
|
||||
|
||||
return rowElement;
|
||||
};
|
||||
|
||||
/**
|
||||
* update complete routes table (refresh all)
|
||||
* @param moduleElement
|
||||
* @param dataTable
|
||||
*/
|
||||
var updateRoutesTable = function(moduleElement, dataTable){
|
||||
var context = {
|
||||
moduleElement: moduleElement,
|
||||
dataTable: dataTable
|
||||
};
|
||||
var routeData = [];
|
||||
|
||||
dataTable.rows().every( function() {
|
||||
routeData.push( getRouteRequestDataFromRowData( this.data() ));
|
||||
});
|
||||
|
||||
getRouteData({routeData: routeData}, context, callbackAddRouteRow);
|
||||
};
|
||||
|
||||
/**
|
||||
* format rowData for route search/update request
|
||||
* @param {Object} rowData
|
||||
* @returns {Object}
|
||||
*/
|
||||
var getRouteRequestDataFromRowData = function(rowData){
|
||||
return {
|
||||
mapIds: (rowData.hasOwnProperty('mapIds')) ? rowData.mapIds : [],
|
||||
systemFromData: (rowData.hasOwnProperty('systemFromData')) ? rowData.systemFromData : {},
|
||||
systemToData: (rowData.hasOwnProperty('systemToData')) ? rowData.systemToData : {},
|
||||
stargates: (rowData.hasOwnProperty('stargates')) ? rowData.stargates | 0 : 1,
|
||||
jumpbridges: (rowData.hasOwnProperty('jumpbridges')) ? rowData.jumpbridges | 0 : 1,
|
||||
wormholes: (rowData.hasOwnProperty('wormholes')) ? rowData.wormholes | 0 : 1,
|
||||
wormholesReduced: (rowData.hasOwnProperty('wormholesReduced')) ? rowData.wormholesReduced | 0 : 1,
|
||||
wormholesCritical: (rowData.hasOwnProperty('wormholesCritical')) ? rowData.wormholesCritical | 0 : 1,
|
||||
wormholesEOL: (rowData.hasOwnProperty('wormholesEOL')) ? rowData.wormholesEOL | 0 : 1
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* show route dialog. User can search for systems and jump-info for each system is added to a data table
|
||||
* @param dialogData
|
||||
*/
|
||||
var showFindRouteDialog = function(dialogData){
|
||||
|
||||
var mapSelectOptions = [];
|
||||
var currentMapData = Util.getCurrentMapData();
|
||||
if(currentMapData !== false){
|
||||
for(var i = 0; i < currentMapData.length; i++){
|
||||
mapSelectOptions.push({
|
||||
id: currentMapData[i].config.id,
|
||||
name: currentMapData[i].config.name,
|
||||
selected: (dialogData.mapId === currentMapData[i].config.id)
|
||||
});
|
||||
}
|
||||
}
|
||||
var data = {
|
||||
id: config.routeDialogId,
|
||||
selectClass: config.systemDialogSelectClass,
|
||||
mapSelectId: config.mapSelectId,
|
||||
systemFromData: dialogData.systemFromData,
|
||||
mapSelectOptions: mapSelectOptions
|
||||
};
|
||||
|
||||
requirejs(['text!templates/dialog/route.html', 'mustache'], function(template, Mustache) {
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
var findRouteDialog = bootbox.dialog({
|
||||
title: 'Route finder',
|
||||
message: content,
|
||||
show: false,
|
||||
buttons: {
|
||||
close: {
|
||||
label: 'cancel',
|
||||
className: 'btn-default'
|
||||
},
|
||||
success: {
|
||||
label: '<i class="fa fa-fw fa-search"></i> search route',
|
||||
className: 'btn-primary',
|
||||
callback: function () {
|
||||
// add new route to route table
|
||||
|
||||
// get form Values
|
||||
var form = $('#' + config.routeDialogId).find('form');
|
||||
|
||||
var routeDialogData = $(form).getFormValues();
|
||||
|
||||
// validate form
|
||||
form.validator('validate');
|
||||
|
||||
// check whether the form is valid
|
||||
var formValid = form.isValidForm();
|
||||
|
||||
if(formValid === false){
|
||||
// don't close dialog
|
||||
return false;
|
||||
}
|
||||
|
||||
// get all system data from select2
|
||||
var systemSelectData = form.find('.' + config.systemDialogSelectClass).select2('data');
|
||||
|
||||
if(
|
||||
systemSelectData &&
|
||||
systemSelectData.length === 1
|
||||
){
|
||||
var context = {
|
||||
moduleElement: dialogData.moduleElement,
|
||||
dataTable: dialogData.dataTable
|
||||
};
|
||||
|
||||
var requestData = {
|
||||
routeData: [{
|
||||
mapIds: routeDialogData.mapIds,
|
||||
systemFromData: dialogData.systemFromData,
|
||||
systemToData: {
|
||||
systemId: systemSelectData[0].systemId,
|
||||
name: systemSelectData[0].text
|
||||
},
|
||||
stargates: routeDialogData.hasOwnProperty('stargates') ? parseInt( routeDialogData.stargates ) : 0,
|
||||
jumpbridges: routeDialogData.hasOwnProperty('jumpbridges') ? parseInt( routeDialogData.jumpbridges ) : 0,
|
||||
wormholes: routeDialogData.hasOwnProperty('wormholes') ? parseInt( routeDialogData.wormholes ) : 0,
|
||||
wormholesReduced: routeDialogData.hasOwnProperty('wormholesReduced') ? parseInt( routeDialogData.wormholesReduced ) : 0,
|
||||
wormholesCritical: routeDialogData.hasOwnProperty('wormholesCritical') ? parseInt( routeDialogData.wormholesCritical ) : 0,
|
||||
wormholesEOL: routeDialogData.hasOwnProperty('wormholesEOL') ? parseInt( routeDialogData.wormholesEOL ) : 0
|
||||
}]
|
||||
};
|
||||
|
||||
getRouteData(requestData, context, callbackAddRouteRow);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
findRouteDialog.on('show.bs.modal', function(e) {
|
||||
findRouteDialog.initTooltips();
|
||||
|
||||
// init some dialog/form observer
|
||||
setDialogObserver( $(this) );
|
||||
|
||||
// init map select ----------------------------------------------------------------
|
||||
var mapSelect = $(this).find('#' + config.mapSelectId);
|
||||
mapSelect.initMapSelect();
|
||||
});
|
||||
|
||||
|
||||
findRouteDialog.on('shown.bs.modal', function(e) {
|
||||
|
||||
// init system select live search ------------------------------------------------
|
||||
// -> add some delay until modal transition has finished
|
||||
var systemTargetSelect = $(this).find('.' + config.systemDialogSelectClass);
|
||||
systemTargetSelect.delay(240).initSystemSelect({key: 'name'});
|
||||
});
|
||||
|
||||
// show dialog
|
||||
findRouteDialog.modal('show');
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* show route settings dialog
|
||||
* @param dialogData
|
||||
* @param moduleElement
|
||||
* @param systemFromData
|
||||
* @param routesTable
|
||||
*/
|
||||
var showSettingsDialog = function(dialogData, moduleElement, systemFromData, routesTable){
|
||||
|
||||
var promiseStore = MapUtil.getLocaleData('map', dialogData.mapId);
|
||||
promiseStore.then(function(dataStore) {
|
||||
// selected systems (if already stored)
|
||||
var systemSelectOptions = [];
|
||||
if(
|
||||
dataStore &&
|
||||
dataStore.routes
|
||||
){
|
||||
systemSelectOptions = dataStore.routes;
|
||||
}
|
||||
|
||||
var maxSelectionLength = 4;
|
||||
|
||||
var data = {
|
||||
id: config.routeSettingsDialogId,
|
||||
selectClass: config.systemDialogSelectClass,
|
||||
systemSelectOptions: systemSelectOptions,
|
||||
maxSelectionLength: maxSelectionLength
|
||||
};
|
||||
|
||||
requirejs(['text!templates/dialog/route_settings.html', 'mustache'], function(template, Mustache) {
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
var settingsDialog = bootbox.dialog({
|
||||
title: 'Route settings',
|
||||
message: content,
|
||||
show: false,
|
||||
buttons: {
|
||||
close: {
|
||||
label: 'cancel',
|
||||
className: 'btn-default'
|
||||
},
|
||||
success: {
|
||||
label: '<i class="fa fa-fw fa-check"></i> save',
|
||||
className: 'btn-success',
|
||||
callback: function () {
|
||||
var form = this.find('form');
|
||||
// get all system data from select2
|
||||
var systemSelectData = form.find('.' + config.systemDialogSelectClass).select2('data');
|
||||
var systemsTo = [];
|
||||
|
||||
if( systemSelectData.length > 0 ){
|
||||
systemsTo = formSystemSelectData(systemSelectData);
|
||||
MapUtil.storeLocalData('map', dialogData.mapId, 'routes', systemsTo);
|
||||
}else{
|
||||
MapUtil.deleteLocalData('map', dialogData.mapId, 'routes');
|
||||
}
|
||||
|
||||
Util.showNotify({title: 'Route settings stored', type: 'success'});
|
||||
|
||||
// (re) draw table
|
||||
drawRouteTable(dialogData.mapId, moduleElement, systemFromData, routesTable, systemsTo);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
settingsDialog.on('shown.bs.modal', function(e) {
|
||||
|
||||
// init default system select -----------------------------------------------------
|
||||
// -> add some delay until modal transition has finished
|
||||
var systemTargetSelect = $(this).find('.' + config.systemDialogSelectClass);
|
||||
systemTargetSelect.delay(240).initSystemSelect({key: 'name', maxSelectionLength: maxSelectionLength});
|
||||
});
|
||||
|
||||
// show dialog
|
||||
settingsDialog.modal('show');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* format select2 system data
|
||||
* @param {Array} data
|
||||
* @returns {Array}
|
||||
*/
|
||||
var formSystemSelectData = function(data){
|
||||
var formattedData = [];
|
||||
for(let i = 0; i < data.length; i++){
|
||||
var tmpData = data[i];
|
||||
|
||||
formattedData.push({
|
||||
name: tmpData.id,
|
||||
systemId: parseInt( tmpData.hasOwnProperty('systemId') ? tmpData.systemId : tmpData.element.getAttribute('data-systemid') )
|
||||
});
|
||||
}
|
||||
|
||||
return formattedData;
|
||||
};
|
||||
|
||||
/**
|
||||
* set event observer for route finder dialog
|
||||
* @param routeDialog
|
||||
*/
|
||||
var setDialogObserver = function(routeDialog){
|
||||
var wormholeCheckbox = routeDialog.find('input[type="checkbox"][name="wormholes"]');
|
||||
var wormholeReducedCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesReduced"]');
|
||||
var wormholeCriticalCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesCritical"]');
|
||||
var wormholeEolCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesEOL"]');
|
||||
|
||||
// store current "checked" state for each box ---------------------------------------------
|
||||
var storeCheckboxStatus = function(){
|
||||
wormholeReducedCheckbox.data('selectState', wormholeReducedCheckbox.prop('checked'));
|
||||
wormholeCriticalCheckbox.data('selectState', wormholeCriticalCheckbox.prop('checked'));
|
||||
wormholeEolCheckbox.data('selectState', wormholeEolCheckbox.prop('checked'));
|
||||
};
|
||||
|
||||
// on wormhole checkbox change ------------------------------------------------------------
|
||||
var onWormholeCheckboxChange = function(){
|
||||
|
||||
if( $(this).is(':checked') ){
|
||||
wormholeReducedCheckbox.prop('disabled', false);
|
||||
wormholeCriticalCheckbox.prop('disabled', false);
|
||||
wormholeEolCheckbox.prop('disabled', false);
|
||||
|
||||
wormholeReducedCheckbox.prop('checked', wormholeReducedCheckbox.data('selectState'));
|
||||
wormholeCriticalCheckbox.prop('checked', wormholeCriticalCheckbox.data('selectState'));
|
||||
wormholeEolCheckbox.prop('checked', wormholeEolCheckbox.data('selectState'));
|
||||
}else{
|
||||
storeCheckboxStatus();
|
||||
|
||||
wormholeReducedCheckbox.prop('checked', false);
|
||||
wormholeReducedCheckbox.prop('disabled', true);
|
||||
wormholeCriticalCheckbox.prop('checked', false);
|
||||
wormholeCriticalCheckbox.prop('disabled', true);
|
||||
wormholeEolCheckbox.prop('checked', false);
|
||||
wormholeEolCheckbox.prop('disabled', true);
|
||||
}
|
||||
}.bind(wormholeCheckbox);
|
||||
|
||||
wormholeCheckbox.on('change', onWormholeCheckboxChange);
|
||||
|
||||
// initial checkbox check
|
||||
storeCheckboxStatus();
|
||||
onWormholeCheckboxChange();
|
||||
};
|
||||
|
||||
/**
|
||||
* requests route data from eveCentral API and execute callback
|
||||
* @param requestData
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
var getRouteData = function(requestData, context, callback){
|
||||
|
||||
context.moduleElement.showLoadingAnimation();
|
||||
|
||||
$.ajax({
|
||||
url: Init.path.searchRoute,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: requestData,
|
||||
context: context
|
||||
}).done(function(routesData){
|
||||
|
||||
this.moduleElement.hideLoadingAnimation();
|
||||
|
||||
// execute callback
|
||||
callback(this, routesData.routesData);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* format route data from API request into dataTable row format
|
||||
* @param routeData
|
||||
* @returns {{}}
|
||||
*/
|
||||
var formatRouteData = function(routeData){
|
||||
|
||||
var reloadButton = '<i class="fa ' + ['fa-refresh'].join(' ') + '"></i>';
|
||||
var deleteButton = '<i class="fa ' + ['fa-close', 'txt-color', 'txt-color-redDarker'].join(' ') + '"></i>';
|
||||
|
||||
// default row data (e.g. no route found)
|
||||
var tableRowData = {
|
||||
systemFromData: routeData.systemFromData,
|
||||
systemToData: routeData.systemToData,
|
||||
jumps: {
|
||||
value: 0,
|
||||
formatted: '---'
|
||||
},
|
||||
avgTrueSec: {
|
||||
value: '',
|
||||
formatted: ''
|
||||
},
|
||||
route: 'not found',
|
||||
stargates: routeData.stargates,
|
||||
jumpbridges: routeData.jumpbridges,
|
||||
wormholes: routeData.wormholes,
|
||||
wormholesReduced: routeData.wormholesReduced,
|
||||
wormholesCritical: routeData.wormholesCritical,
|
||||
wormholesEOL: routeData.wormholesEOL,
|
||||
reload: {
|
||||
button: reloadButton
|
||||
},
|
||||
clear: {
|
||||
button: deleteButton
|
||||
},
|
||||
maps: routeData.maps,
|
||||
mapIds: routeData.mapIds //map data (mapIds is "redundant")
|
||||
};
|
||||
|
||||
if(
|
||||
routeData.routePossible === true &&
|
||||
routeData.route.length > 0
|
||||
){
|
||||
// route data available
|
||||
|
||||
// add route Data
|
||||
var jumpData = [];
|
||||
var avgSecTemp = 0;
|
||||
|
||||
// loop all systems on this route
|
||||
for(var i = 0; i < routeData.route.length; i++){
|
||||
var routeNodeData = routeData.route[i];
|
||||
// format system name (camelCase)
|
||||
var systemName = routeNodeData.system.charAt(0).toUpperCase() + routeNodeData.system.slice(1).toLowerCase();
|
||||
|
||||
var systemSec = Number(routeNodeData.security).toFixed(1).toString();
|
||||
var tempSystemSec = systemSec;
|
||||
|
||||
if(tempSystemSec <= 0){
|
||||
tempSystemSec = '0-0';
|
||||
}
|
||||
|
||||
var systemSecClass = config.systemSecurityClassPrefix + tempSystemSec.replace('.', '-');
|
||||
|
||||
var system = '<i class="fa fa-square ' + systemSecClass + '" ';
|
||||
system += 'data-toggle="tooltip" data-placement="bottom" data-container="body" ';
|
||||
system += 'title="' + systemName + ' [' + systemSec + '] "></i>';
|
||||
jumpData.push( system );
|
||||
|
||||
// "source" system is not relevant for average security
|
||||
if(i > 0){
|
||||
avgSecTemp += Number(routeNodeData.security);
|
||||
}
|
||||
}
|
||||
|
||||
var avgSec = ( avgSecTemp / (routeData.route.length - 1)).toFixed(2);
|
||||
var avgSecForClass = Number(avgSec).toFixed(1);
|
||||
|
||||
if(avgSecForClass <= 0){
|
||||
avgSecForClass = '0.0';
|
||||
}
|
||||
|
||||
var avgSecClass = config.systemSecurityClassPrefix + avgSecForClass.toString().replace('.', '-');
|
||||
|
||||
tableRowData.jumps = {
|
||||
value: routeData.routeJumps,
|
||||
formatted: routeData.routeJumps
|
||||
};
|
||||
|
||||
tableRowData.avgTrueSec = {
|
||||
value: avgSec,
|
||||
formatted: '<span class="' + avgSecClass + '">' + avgSec + '</span>'
|
||||
};
|
||||
tableRowData.route = jumpData.join(' ');
|
||||
}
|
||||
|
||||
return tableRowData;
|
||||
};
|
||||
|
||||
/**
|
||||
* get the route finder moduleElement
|
||||
* @returns {*}
|
||||
*/
|
||||
var getModule = function(){
|
||||
|
||||
// create new module container
|
||||
var moduleElement = $('<div>', {
|
||||
class: [config.moduleClass, config.systemRouteModuleClass].join(' ')
|
||||
});
|
||||
|
||||
// headline toolbar icons
|
||||
var headlineToolbar = $('<h5>', {
|
||||
class: 'pull-right'
|
||||
}).append(
|
||||
$('<i>', {
|
||||
class: ['fa', 'fa-fw', 'fa-search', config.systemModuleHeadlineIcon, config.systemModuleHeadlineIconSearch].join(' '),
|
||||
title: 'find route'
|
||||
}).attr('data-html', 'true').attr('data-toggle', 'tooltip'),
|
||||
$('<i>', {
|
||||
class: ['fa', 'fa-fw', 'fa-sliders', config.systemModuleHeadlineIcon, config.systemModuleHeadlineIconSettings].join(' '),
|
||||
title: 'settings'
|
||||
}).attr('data-html', 'true').attr('data-toggle', 'tooltip'),
|
||||
$('<i>', {
|
||||
class: ['fa', 'fa-fw', 'fa-refresh', config.systemModuleHeadlineIcon, config.systemModuleHeadlineIconRefresh].join(' '),
|
||||
title: 'refresh all'
|
||||
}).attr('data-html', 'true').attr('data-toggle', 'tooltip')
|
||||
);
|
||||
|
||||
moduleElement.append(headlineToolbar);
|
||||
|
||||
// headline
|
||||
var headline = $('<h5>', {
|
||||
class: 'pull-left',
|
||||
text: 'Routes'
|
||||
});
|
||||
|
||||
moduleElement.append(headline);
|
||||
|
||||
// crate new route table
|
||||
var table = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border', config.systemInfoRoutesTableClass].join(' ')
|
||||
});
|
||||
|
||||
moduleElement.append( $(table) );
|
||||
|
||||
// init empty table
|
||||
var routesTable = table.DataTable( {
|
||||
paging: false,
|
||||
ordering: true,
|
||||
order: [ 1, 'asc' ],
|
||||
info: false,
|
||||
searching: false,
|
||||
hover: false,
|
||||
autoWidth: false,
|
||||
rowId: 'systemTo',
|
||||
language: {
|
||||
emptyTable: 'No routes added'
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 0,
|
||||
orderable: true,
|
||||
title: 'system ',
|
||||
class: Util.config.popoverTriggerClass,
|
||||
data: 'systemToData',
|
||||
render: {
|
||||
_: 'name',
|
||||
sort: 'name'
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex) {
|
||||
// init context menu
|
||||
$(cell).initSystemPopover({
|
||||
systemToData: rowData.systemToData
|
||||
});
|
||||
}
|
||||
},{
|
||||
targets: 1,
|
||||
orderable: true,
|
||||
title: '<span title="jumps" data-toggle="tooltip"><i class="fa fa-arrows-h"></i> </span>',
|
||||
width: '18px',
|
||||
class: 'text-right',
|
||||
data: 'jumps',
|
||||
render: {
|
||||
_: 'formatted',
|
||||
sort: 'value'
|
||||
}
|
||||
},{
|
||||
targets: 2,
|
||||
orderable: true,
|
||||
title: '<span title="average security" data-toggle="tooltip">Ø </span>',
|
||||
width: '15px',
|
||||
class: 'text-right',
|
||||
data: 'avgTrueSec',
|
||||
render: {
|
||||
_: 'formatted',
|
||||
sort: 'value'
|
||||
}
|
||||
},{
|
||||
targets: 3,
|
||||
orderable: false,
|
||||
title: 'route',
|
||||
data: 'route'
|
||||
},{
|
||||
targets: 4,
|
||||
title: '',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
width: '10px',
|
||||
class: ['text-center', config.dataTableActionCellClass].join(' '),
|
||||
data: 'reload',
|
||||
render: {
|
||||
_: 'button'
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
var tempTableApi = this.api();
|
||||
|
||||
$(cell).on('click', function(e) {
|
||||
// get current row data (important!)
|
||||
// -> "rowData" param is not current state, values are "on createCell()" state
|
||||
rowData = tempTableApi.row( $(cell).parents('tr')).data();
|
||||
|
||||
var context = {
|
||||
moduleElement: moduleElement,
|
||||
dataTable: tempTableApi
|
||||
};
|
||||
|
||||
var requestData = {
|
||||
routeData: [{
|
||||
mapIds: rowData.mapIds,
|
||||
systemFromData: rowData.systemFromData,
|
||||
systemToData: rowData.systemToData,
|
||||
stargates: rowData.stargates ? 1 : 0,
|
||||
jumpbridges: rowData.jumpbridges ? 1 : 0,
|
||||
wormholes: rowData.wormholes ? 1 : 0,
|
||||
wormholesReduced: rowData.wormholesReduced ? 1 : 0,
|
||||
wormholesCritical: rowData.wormholesCritical ? 1 : 0,
|
||||
wormholesEOL: rowData.wormholesEOL ? 1 : 0
|
||||
}]
|
||||
};
|
||||
|
||||
getRouteData(requestData, context, callbackAddRouteRow);
|
||||
});
|
||||
}
|
||||
},{
|
||||
targets: 5,
|
||||
title: '',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
width: '10px',
|
||||
class: ['text-center', config.dataTableActionCellClass].join(' '),
|
||||
data: 'clear',
|
||||
render: {
|
||||
_: 'button'
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
var tempTableElement = this;
|
||||
|
||||
var confirmationSettings = {
|
||||
container: 'body',
|
||||
placement: 'left',
|
||||
btnCancelClass: 'btn btn-sm btn-default',
|
||||
btnCancelLabel: 'cancel',
|
||||
btnCancelIcon: 'fa fa-fw fa-ban',
|
||||
title: 'delete route',
|
||||
btnOkClass: 'btn btn-sm btn-danger',
|
||||
btnOkLabel: 'delete',
|
||||
btnOkIcon: 'fa fa-fw fa-close',
|
||||
onConfirm : function(e, target){
|
||||
var deleteRowElement = $(cell).parents('tr');
|
||||
tempTableElement.api().rows(deleteRowElement).remove().draw();
|
||||
}
|
||||
};
|
||||
|
||||
// init confirmation dialog
|
||||
$(cell).confirmation(confirmationSettings);
|
||||
}
|
||||
}
|
||||
],
|
||||
drawCallback: function(settings){
|
||||
|
||||
var animationRows = this.api().rows().nodes().to$().filter(function() {
|
||||
return (
|
||||
$(this).data('animationStatus') ||
|
||||
$(this).data('animationTimer')
|
||||
);
|
||||
});
|
||||
|
||||
for(var i = 0; i < animationRows.length; i++){
|
||||
$(animationRows[i]).pulseTableRow($(animationRows[i]).data('animationStatus'));
|
||||
$(animationRows[i]).removeData('animationStatus');
|
||||
}
|
||||
|
||||
},
|
||||
data: [] // will be added dynamic
|
||||
});
|
||||
|
||||
// init tooltips for this module
|
||||
var tooltipElements = moduleElement.find('[data-toggle="tooltip"]');
|
||||
tooltipElements.tooltip({
|
||||
container: 'body'
|
||||
});
|
||||
|
||||
return moduleElement;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* init system popover (e.g. for setWaypoints)
|
||||
* @param options
|
||||
*/
|
||||
$.fn.initSystemPopover = function(options){
|
||||
var elements = $(this);
|
||||
var eventNamespace = 'hideSystemPopup';
|
||||
var systemToData = options.systemToData;
|
||||
|
||||
requirejs(['text!templates/tooltip/system_popover.html', 'mustache'], function (template, Mustache) {
|
||||
var data = {
|
||||
systemToData: systemToData
|
||||
};
|
||||
|
||||
var content = Mustache.render(template, data);
|
||||
|
||||
elements.each(function() {
|
||||
var element = $(this);
|
||||
// destroy "popover" and remove "click" event for animation
|
||||
element.popover('destroy').off();
|
||||
|
||||
// init popover and add specific class to it (for styling)
|
||||
element.popover({
|
||||
html: true,
|
||||
title: systemToData.name,
|
||||
trigger: 'manual',
|
||||
placement: 'top',
|
||||
container: 'body',
|
||||
content: content
|
||||
}).data('bs.popover').tip().addClass('pf-popover');
|
||||
});
|
||||
|
||||
// set popup "close" observer
|
||||
elements.initPopoverClose(eventNamespace);
|
||||
|
||||
// set "open" trigger on "right click"
|
||||
// -> this is not supported by the "trigger" param in .popover();
|
||||
// -> therefore we need to set it up manually
|
||||
elements.on('contextmenu', function(e){
|
||||
e.preventDefault();
|
||||
$(this).popover('show');
|
||||
});
|
||||
|
||||
// set link observer "on shown" event
|
||||
elements.on('shown.bs.popover', function () {
|
||||
var popoverRoot = $(this);
|
||||
|
||||
popoverRoot.data('bs.popover').tip().find('a').on('click', function(){
|
||||
// hint: "data" attributes should be in lower case!
|
||||
var systemData = {
|
||||
name: $(this).data('name'),
|
||||
systemId: $(this).data('systemid')
|
||||
};
|
||||
Util.setDestination(systemData, 'set_destination');
|
||||
|
||||
// close popover
|
||||
popoverRoot.popover('hide');
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* init route module
|
||||
* -> request route path fore "default" trade hub systems
|
||||
* @param moduleElement
|
||||
* @param mapId
|
||||
* @param systemData
|
||||
*/
|
||||
var initModule = function(moduleElement, mapId, systemData){
|
||||
|
||||
var systemFromData = {
|
||||
name: systemData.name,
|
||||
systemId: systemData.systemId
|
||||
};
|
||||
|
||||
var routesTableElement = moduleElement.find('.' + config.systemInfoRoutesTableClass);
|
||||
|
||||
var routesTable = routesTableElement.DataTable();
|
||||
|
||||
// init refresh routes --------------------------------------------------------------------
|
||||
moduleElement.find('.' + config.systemModuleHeadlineIconRefresh).on('click', function(e){
|
||||
updateRoutesTable(moduleElement, routesTable);
|
||||
});
|
||||
|
||||
// init search routes dialog --------------------------------------------------------------
|
||||
moduleElement.find('.' + config.systemModuleHeadlineIconSearch).on('click', function(e){
|
||||
var dialogData = {
|
||||
moduleElement: moduleElement,
|
||||
mapId: mapId,
|
||||
systemFromData: systemFromData,
|
||||
dataTable: routesTable
|
||||
};
|
||||
|
||||
showFindRouteDialog(dialogData);
|
||||
});
|
||||
|
||||
// init settings dialog -------------------------------------------------------------------
|
||||
moduleElement.find('.' + config.systemModuleHeadlineIconSettings).on('click', function(e){
|
||||
var dialogData = {
|
||||
mapId: mapId
|
||||
};
|
||||
|
||||
showSettingsDialog(dialogData, moduleElement, systemFromData, routesTable);
|
||||
});
|
||||
|
||||
// fill routesTable with data -------------------------------------------------------------
|
||||
var promiseStore = MapUtil.getLocaleData('map', mapId);
|
||||
promiseStore.then(function(dataStore) {
|
||||
// selected systems (if already stored)
|
||||
var systemsTo = [{
|
||||
name: 'Jita',
|
||||
systemId: 30000142
|
||||
}];
|
||||
|
||||
if(
|
||||
dataStore &&
|
||||
dataStore.routes
|
||||
){
|
||||
systemsTo = dataStore.routes;
|
||||
}
|
||||
|
||||
drawRouteTable(mapId, moduleElement, systemFromData, routesTable, systemsTo);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
var drawRouteTable = function(mapId, moduleElement, systemFromData, routesTable, systemsTo){
|
||||
var requestRouteData = [];
|
||||
var currentTimestamp = Util.getServerTime().getTime();
|
||||
|
||||
for(var i = 0; i < systemsTo.length; i++){
|
||||
var systemToData = systemsTo[i];
|
||||
|
||||
if(systemFromData.name !== systemToData.name){
|
||||
var cacheKey = 'route_' + mapId + '_' + systemFromData.name.toUpperCase() + '_' + systemToData.name.toUpperCase();
|
||||
|
||||
if(
|
||||
cache.systemRoutes.hasOwnProperty(cacheKey) &&
|
||||
Math.round(
|
||||
( currentTimestamp - (new Date( cache.systemRoutes[cacheKey].updated * 1000).getTime())) / 1000
|
||||
) <= config.routeCacheTTL
|
||||
){
|
||||
// route data is cached (client side)
|
||||
var context = {
|
||||
dataTable: routesTable
|
||||
};
|
||||
|
||||
addRow(context, cache.systemRoutes[cacheKey].data);
|
||||
}else{
|
||||
// get route data
|
||||
var searchData = {
|
||||
mapIds: [mapId],
|
||||
systemFromData: systemFromData,
|
||||
systemToData: systemToData
|
||||
};
|
||||
|
||||
requestRouteData.push( getRouteRequestDataFromRowData( searchData ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check if routes data is not cached and is requested
|
||||
if(requestRouteData.length > 0){
|
||||
var contextData = {
|
||||
moduleElement: moduleElement,
|
||||
dataTable: routesTable
|
||||
};
|
||||
|
||||
var requestData = {
|
||||
routeData: requestRouteData
|
||||
};
|
||||
|
||||
getRouteData(requestData, contextData, callbackAddRouteRow);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* updates an dom element with the system route module
|
||||
* @param mapId
|
||||
* @param systemData
|
||||
*/
|
||||
$.fn.drawSystemRouteModule = function(mapId, systemData){
|
||||
|
||||
var parentElement = $(this);
|
||||
|
||||
// show route module
|
||||
var showModule = function(moduleElement){
|
||||
if(moduleElement){
|
||||
moduleElement.css({ opacity: 0 });
|
||||
parentElement.append(moduleElement);
|
||||
|
||||
moduleElement.velocity('transition.slideDownIn', {
|
||||
duration: Init.animationSpeed.mapModule,
|
||||
delay: Init.animationSpeed.mapModule,
|
||||
complete: function(){
|
||||
initModule(moduleElement, mapId, systemData);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// check if module already exists
|
||||
var moduleElement = parentElement.find('.' + config.systemRouteModuleClass);
|
||||
|
||||
if(moduleElement.length > 0){
|
||||
moduleElement.velocity('transition.slideDownOut', {
|
||||
duration: Init.animationSpeed.mapModule,
|
||||
complete: function(tempElement){
|
||||
$(tempElement).remove();
|
||||
|
||||
moduleElement = getModule();
|
||||
showModule(moduleElement);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
moduleElement = getModule();
|
||||
showModule(moduleElement);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
138
public/js/v1.1.5/build.txt
Normal file
138
public/js/v1.1.5/build.txt
Normal file
@@ -0,0 +1,138 @@
|
||||
|
||||
app/login.js
|
||||
----------------
|
||||
lib/jquery-3.0.0.min.js
|
||||
app/init.js
|
||||
app/config/system_effect.js
|
||||
app/config/signature_type.js
|
||||
lib/bootstrap.min.js
|
||||
lib/bootbox.min.js
|
||||
lib/localforage.min.js
|
||||
lib/velocity.min.js
|
||||
lib/velocity.ui.min.js
|
||||
lib/jquery.mousewheel.min.js
|
||||
lib/jquery.mCustomScrollbar.min.js
|
||||
lib/validator.min.js
|
||||
lib/bootstrap-editable.min.js
|
||||
lib/jquery.easypiechart.min.js
|
||||
lib/jquery.hoverIntent.minified.js
|
||||
lib/bootstrap-confirmation.js
|
||||
lib/bootstrap2-toggle.min.js
|
||||
app/util.js
|
||||
lib/mustache.min.js
|
||||
app/render.js
|
||||
lib/blueimp-helper.js
|
||||
lib/blueimp-gallery.js
|
||||
lib/jquery.lazyload.min.js
|
||||
lib/EasePack.min.js
|
||||
lib/TweenLite.min.js
|
||||
app/ui/header.js
|
||||
lib/jquery.lazylinepainter-1.5.1.min.js
|
||||
app/ui/logo.js
|
||||
app/ui/demo_map.js
|
||||
app/ui/dialog/account_settings.js
|
||||
app/ui/dialog/notification.js
|
||||
app/ui/dialog/manual.js
|
||||
app/ui/dialog/releases.js
|
||||
app/ui/dialog/credit.js
|
||||
app/login.js
|
||||
lib/requirejs/text.js
|
||||
|
||||
app/mappage.js
|
||||
----------------
|
||||
lib/jquery-3.0.0.min.js
|
||||
app/init.js
|
||||
app/config/system_effect.js
|
||||
app/config/signature_type.js
|
||||
lib/bootstrap.min.js
|
||||
lib/bootbox.min.js
|
||||
lib/localforage.min.js
|
||||
lib/velocity.min.js
|
||||
lib/velocity.ui.min.js
|
||||
lib/jquery.mousewheel.min.js
|
||||
lib/jquery.mCustomScrollbar.min.js
|
||||
lib/validator.min.js
|
||||
lib/bootstrap-editable.min.js
|
||||
lib/jquery.easypiechart.min.js
|
||||
lib/jquery.hoverIntent.minified.js
|
||||
lib/bootstrap-confirmation.js
|
||||
lib/bootstrap2-toggle.min.js
|
||||
app/util.js
|
||||
lib/mustache.min.js
|
||||
app/render.js
|
||||
app/logging.js
|
||||
lib/requirejs/text.js
|
||||
text!img/logo.svg!strip
|
||||
text!templates/modules/header.html
|
||||
text!templates/modules/footer.html
|
||||
app/ui/dialog/notification.js
|
||||
app/map/util.js
|
||||
app/ui/dialog/map_info.js
|
||||
app/ui/dialog/account_settings.js
|
||||
app/ui/dialog/manual.js
|
||||
app/ui/dialog/map_settings.js
|
||||
app/ui/dialog/system_effects.js
|
||||
app/ui/dialog/jump_info.js
|
||||
app/ui/dialog/delete_account.js
|
||||
lib/jquery.lazylinepainter-1.5.1.min.js
|
||||
app/ui/logo.js
|
||||
app/ui/dialog/credit.js
|
||||
lib/slidebars.js
|
||||
app/map/system.js
|
||||
lib/dom.jsPlumb-1.7.6.js
|
||||
lib/farahey-0.5.js
|
||||
app/map/magnetizing.js
|
||||
app/map/scrollbar.js
|
||||
lib/jquery.dragToSelect.js
|
||||
lib/select2.min.js
|
||||
app/map/contextmenu.js
|
||||
app/map/overlay.js
|
||||
app/map/map.js
|
||||
app/counter.js
|
||||
app/ui/system_info.js
|
||||
lib/raphael-min.js
|
||||
lib/morris.min.js
|
||||
app/ui/system_graph.js
|
||||
app/ui/system_signature.js
|
||||
app/ui/system_route.js
|
||||
app/ui/system_killboard.js
|
||||
lib/datatables/DataTables-1.10.12/js/jquery.dataTables.min.js
|
||||
lib/datatables/Buttons-1.2.1/js/dataTables.buttons.min.js
|
||||
lib/datatables/Buttons-1.2.1/js/buttons.html5.min.js
|
||||
lib/datatables/Responsive-2.1.0/js/dataTables.responsive.min.js
|
||||
lib/datatables/Select-1.2.0/js/dataTables.select.min.js
|
||||
app/module_map.js
|
||||
app/page.js
|
||||
app/ui/form_element.js
|
||||
app/mappage.js
|
||||
|
||||
app/setup.js
|
||||
----------------
|
||||
lib/jquery-3.0.0.min.js
|
||||
app/init.js
|
||||
app/config/system_effect.js
|
||||
app/config/signature_type.js
|
||||
lib/bootstrap.min.js
|
||||
lib/bootbox.min.js
|
||||
lib/localforage.min.js
|
||||
lib/velocity.min.js
|
||||
lib/velocity.ui.min.js
|
||||
lib/jquery.mousewheel.min.js
|
||||
lib/jquery.mCustomScrollbar.min.js
|
||||
lib/validator.min.js
|
||||
lib/bootstrap-editable.min.js
|
||||
lib/jquery.easypiechart.min.js
|
||||
lib/jquery.hoverIntent.minified.js
|
||||
lib/bootstrap-confirmation.js
|
||||
lib/bootstrap2-toggle.min.js
|
||||
app/util.js
|
||||
app/setup.js
|
||||
|
||||
app/notification.js
|
||||
----------------
|
||||
app/init.js
|
||||
lib/pnotify/pnotify.js
|
||||
lib/pnotify/pnotify.nonblock.js
|
||||
lib/pnotify/pnotify.desktop.js
|
||||
lib/pnotify/pnotify.callbacks.js
|
||||
app/notification.js
|
||||
12
public/js/v1.1.5/lib/EasePack.min.js
vendored
12
public/js/v1.1.5/lib/EasePack.min.js
vendored
@@ -1,12 +0,0 @@
|
||||
/*!
|
||||
* VERSION: beta 1.9.4
|
||||
* DATE: 2014-07-17
|
||||
* UPDATES AND DOCS AT: http://www.greensock.com
|
||||
*
|
||||
* @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
|
||||
* This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
|
||||
* Club GreenSock members, the software agreement that was issued with your membership.
|
||||
*
|
||||
* @author: Jack Doyle, jack@greensock.com
|
||||
**/
|
||||
var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("easing.Back",["easing.Ease"],function(t){var e,i,s,r=_gsScope.GreenSockGlobals||_gsScope,n=r.com.greensock,a=2*Math.PI,o=Math.PI/2,h=n._class,l=function(e,i){var s=h("easing."+e,function(){},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,s},_=t.register||function(){},u=function(t,e,i,s){var r=h("easing."+t,{easeOut:new e,easeIn:new i,easeInOut:new s},!0);return _(r,t),r},c=function(t,e,i){this.t=t,this.v=e,i&&(this.next=i,i.prev=this,this.c=i.v-e,this.gap=i.t-t)},p=function(e,i){var s=h("easing."+e,function(t){this._p1=t||0===t?t:1.70158,this._p2=1.525*this._p1},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,r.config=function(t){return new s(t)},s},f=u("Back",p("BackOut",function(t){return(t-=1)*t*((this._p1+1)*t+this._p1)+1}),p("BackIn",function(t){return t*t*((this._p1+1)*t-this._p1)}),p("BackInOut",function(t){return 1>(t*=2)?.5*t*t*((this._p2+1)*t-this._p2):.5*((t-=2)*t*((this._p2+1)*t+this._p2)+2)})),m=h("easing.SlowMo",function(t,e,i){e=e||0===e?e:.7,null==t?t=.7:t>1&&(t=1),this._p=1!==t?e:0,this._p1=(1-t)/2,this._p2=t,this._p3=this._p1+this._p2,this._calcEnd=i===!0},!0),d=m.prototype=new t;return d.constructor=m,d.getRatio=function(t){var e=t+(.5-t)*this._p;return this._p1>t?this._calcEnd?1-(t=1-t/this._p1)*t:e-(t=1-t/this._p1)*t*t*t*e:t>this._p3?this._calcEnd?1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},m.ease=new m(.7,.7),d.config=m.config=function(t,e,i){return new m(t,e,i)},e=h("easing.SteppedEase",function(t){t=t||1,this._p1=1/t,this._p2=t+1},!0),d=e.prototype=new t,d.constructor=e,d.getRatio=function(t){return 0>t?t=0:t>=1&&(t=.999999999),(this._p2*t>>0)*this._p1},d.config=e.config=function(t){return new e(t)},i=h("easing.RoughEase",function(e){e=e||{};for(var i,s,r,n,a,o,h=e.taper||"none",l=[],_=0,u=0|(e.points||20),p=u,f=e.randomize!==!1,m=e.clamp===!0,d=e.template instanceof t?e.template:null,g="number"==typeof e.strength?.4*e.strength:.4;--p>-1;)i=f?Math.random():1/u*p,s=d?d.getRatio(i):i,"none"===h?r=g:"out"===h?(n=1-i,r=n*n*g):"in"===h?r=i*i*g:.5>i?(n=2*i,r=.5*n*n*g):(n=2*(1-i),r=.5*n*n*g),f?s+=Math.random()*r-.5*r:p%2?s+=.5*r:s-=.5*r,m&&(s>1?s=1:0>s&&(s=0)),l[_++]={x:i,y:s};for(l.sort(function(t,e){return t.x-e.x}),o=new c(1,1,null),p=u;--p>-1;)a=l[p],o=new c(a.x,a.y,o);this._prev=new c(0,0,0!==o.t?o:o.next)},!0),d=i.prototype=new t,d.constructor=i,d.getRatio=function(t){var e=this._prev;if(t>e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&e.t>=t;)e=e.prev;return this._prev=e,e.v+(t-e.t)/e.gap*e.c},d.config=function(t){return new i(t)},i.ease=new i,u("Bounce",l("BounceOut",function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),l("BounceIn",function(t){return 1/2.75>(t=1-t)?1-7.5625*t*t:2/2.75>t?1-(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),l("BounceInOut",function(t){var e=.5>t;return t=e?1-2*t:2*t-1,t=1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),u("Circ",l("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),l("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),l("CircInOut",function(t){return 1>(t*=2)?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),s=function(e,i,s){var r=h("easing."+e,function(t,e){this._p1=t||1,this._p2=e||s,this._p3=this._p2/a*(Math.asin(1/this._p1)||0)},!0),n=r.prototype=new t;return n.constructor=r,n.getRatio=i,n.config=function(t,e){return new r(t,e)},r},u("Elastic",s("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*a/this._p2)+1},.3),s("ElasticIn",function(t){return-(this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*a/this._p2))},.3),s("ElasticInOut",function(t){return 1>(t*=2)?-.5*this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*a/this._p2):.5*this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*a/this._p2)+1},.45)),u("Expo",l("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),l("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),l("ExpoInOut",function(t){return 1>(t*=2)?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),u("Sine",l("SineOut",function(t){return Math.sin(t*o)}),l("SineIn",function(t){return-Math.cos(t*o)+1}),l("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),h("easing.EaseLookup",{find:function(e){return t.map[e]}},!0),_(r.SlowMo,"SlowMo","ease,"),_(i,"RoughEase","ease,"),_(e,"SteppedEase","ease,"),f},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()();
|
||||
12
public/js/v1.1.5/lib/TweenLite.min.js
vendored
12
public/js/v1.1.5/lib/TweenLite.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,190 +0,0 @@
|
||||
/*
|
||||
* blueimp helper JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define, window, document */
|
||||
|
||||
;(function () {
|
||||
'use strict'
|
||||
|
||||
function extend (obj1, obj2) {
|
||||
var prop
|
||||
for (prop in obj2) {
|
||||
if (obj2.hasOwnProperty(prop)) {
|
||||
obj1[prop] = obj2[prop]
|
||||
}
|
||||
}
|
||||
return obj1
|
||||
}
|
||||
|
||||
function Helper (query) {
|
||||
if (!this || this.find !== Helper.prototype.find) {
|
||||
// Called as function instead of as constructor,
|
||||
// so we simply return a new instance:
|
||||
return new Helper(query)
|
||||
}
|
||||
this.length = 0
|
||||
if (query) {
|
||||
if (typeof query === 'string') {
|
||||
query = this.find(query)
|
||||
}
|
||||
if (query.nodeType || query === query.window) {
|
||||
// Single HTML element
|
||||
this.length = 1
|
||||
this[0] = query
|
||||
} else {
|
||||
// HTML element collection
|
||||
var i = query.length
|
||||
this.length = i
|
||||
while (i) {
|
||||
i -= 1
|
||||
this[i] = query[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Helper.extend = extend
|
||||
|
||||
Helper.contains = function (container, element) {
|
||||
do {
|
||||
element = element.parentNode
|
||||
if (element === container) {
|
||||
return true
|
||||
}
|
||||
} while (element)
|
||||
return false
|
||||
}
|
||||
|
||||
Helper.parseJSON = function (string) {
|
||||
return window.JSON && JSON.parse(string)
|
||||
}
|
||||
|
||||
extend(Helper.prototype, {
|
||||
find: function (query) {
|
||||
var container = this[0] || document
|
||||
if (typeof query === 'string') {
|
||||
if (container.querySelectorAll) {
|
||||
query = container.querySelectorAll(query)
|
||||
} else if (query.charAt(0) === '#') {
|
||||
query = container.getElementById(query.slice(1))
|
||||
} else {
|
||||
query = container.getElementsByTagName(query)
|
||||
}
|
||||
}
|
||||
return new Helper(query)
|
||||
},
|
||||
|
||||
hasClass: function (className) {
|
||||
if (!this[0]) {
|
||||
return false
|
||||
}
|
||||
return new RegExp('(^|\\s+)' + className +
|
||||
'(\\s+|$)').test(this[0].className)
|
||||
},
|
||||
|
||||
addClass: function (className) {
|
||||
var i = this.length
|
||||
var element
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
if (!element.className) {
|
||||
element.className = className
|
||||
return this
|
||||
}
|
||||
if (this.hasClass(className)) {
|
||||
return this
|
||||
}
|
||||
element.className += ' ' + className
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
removeClass: function (className) {
|
||||
var regexp = new RegExp('(^|\\s+)' + className + '(\\s+|$)')
|
||||
var i = this.length
|
||||
var element
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
element.className = element.className.replace(regexp, ' ')
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
on: function (eventName, handler) {
|
||||
var eventNames = eventName.split(/\s+/)
|
||||
var i
|
||||
var element
|
||||
while (eventNames.length) {
|
||||
eventName = eventNames.shift()
|
||||
i = this.length
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
if (element.addEventListener) {
|
||||
element.addEventListener(eventName, handler, false)
|
||||
} else if (element.attachEvent) {
|
||||
element.attachEvent('on' + eventName, handler)
|
||||
}
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
off: function (eventName, handler) {
|
||||
var eventNames = eventName.split(/\s+/)
|
||||
var i
|
||||
var element
|
||||
while (eventNames.length) {
|
||||
eventName = eventNames.shift()
|
||||
i = this.length
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
if (element.removeEventListener) {
|
||||
element.removeEventListener(eventName, handler, false)
|
||||
} else if (element.detachEvent) {
|
||||
element.detachEvent('on' + eventName, handler)
|
||||
}
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
empty: function () {
|
||||
var i = this.length
|
||||
var element
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
while (element.hasChildNodes()) {
|
||||
element.removeChild(element.lastChild)
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
first: function () {
|
||||
return new Helper(this[0])
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function () {
|
||||
return Helper
|
||||
})
|
||||
} else {
|
||||
window.blueimp = window.blueimp || {}
|
||||
window.blueimp.helper = Helper
|
||||
}
|
||||
}())
|
||||
6
public/js/v1.1.5/lib/bootbox.min.js
vendored
6
public/js/v1.1.5/lib/bootbox.min.js
vendored
File diff suppressed because one or more lines are too long
249
public/js/v1.1.5/lib/bootstrap-confirmation.js
vendored
249
public/js/v1.1.5/lib/bootstrap-confirmation.js
vendored
@@ -1,249 +0,0 @@
|
||||
+function ($) {
|
||||
'use strict';
|
||||
|
||||
//var for check event at body can have only one.
|
||||
var event_body = false;
|
||||
|
||||
// CONFIRMATION PUBLIC CLASS DEFINITION
|
||||
// ===============================
|
||||
var Confirmation = function (element, options) {
|
||||
var that = this;
|
||||
|
||||
this.init('confirmation', element, options);
|
||||
|
||||
|
||||
$(element).on('show.bs.confirmation', function(e) {
|
||||
that.options.onShow(e, this);
|
||||
|
||||
$(this).addClass('open');
|
||||
|
||||
var options = that.options;
|
||||
var all = options.all_selector;
|
||||
|
||||
if(options.singleton)
|
||||
{
|
||||
$(all).not(that.$element).each(function()
|
||||
{
|
||||
if( $(this).hasClass('open') )
|
||||
{
|
||||
$(this).confirmation('hide');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(element).on('hide.bs.confirmation', function(e) {
|
||||
that.options.onHide(e, this);
|
||||
|
||||
$(this).removeClass('open');
|
||||
});
|
||||
|
||||
$(element).on('shown.bs.confirmation', function(e) {
|
||||
var options = that.options;
|
||||
var all = options.all_selector;
|
||||
|
||||
that.$element.on('click.dismiss.bs.confirmation', '[data-dismiss="confirmation"]', $.proxy(that.hide, that));
|
||||
|
||||
if(that.isPopout()) {
|
||||
if(!event_body) {
|
||||
event_body = $('body').on('click', function (e) {
|
||||
if(that.$element.is(e.target)) return;
|
||||
if(that.$element.has(e.target).length) return;
|
||||
if($('.popover').has(e.target).length) return;
|
||||
|
||||
that.$element.confirmation('hide');
|
||||
|
||||
$('body').unbind(e);
|
||||
|
||||
event_body = false;
|
||||
|
||||
return;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(element).on('click', function(e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
if (!$.fn.popover || !$.fn.tooltip) throw new Error('Confirmation requires popover.js and tooltip.js');
|
||||
|
||||
Confirmation.DEFAULTS = $.extend({}, $.fn.popover.Constructor.DEFAULTS, {
|
||||
placement : 'right',
|
||||
title : 'Are you sure?',
|
||||
btnOkClass : 'btn btn-sm btn-danger',
|
||||
btnOkLabel : 'Delete',
|
||||
btnOkIcon : 'glyphicon glyphicon-ok',
|
||||
btnCancelClass : 'btn btn-sm btn-default',
|
||||
btnCancelLabel : 'Cancel',
|
||||
btnCancelIcon : 'glyphicon glyphicon-remove',
|
||||
href : '#',
|
||||
target : '_self',
|
||||
singleton : true,
|
||||
popout : true,
|
||||
onShow : function(event, element){},
|
||||
onHide : function(event, element){},
|
||||
onConfirm : function(event, element){},
|
||||
onCancel : function(event, element){},
|
||||
template : '<div class="popover"><div class="arrow"></div>'
|
||||
+ '<h3 class="popover-title"></h3>'
|
||||
+ '<div class="popover-content">'
|
||||
+ '<div class="btn-group">'
|
||||
+ '<a data-dismiss="confirmation">No</a>'
|
||||
+ '<a data-apply="confirmation">Yes</a>'
|
||||
+ '</div>'
|
||||
+ '</div>'
|
||||
+ '</div>'
|
||||
});
|
||||
|
||||
|
||||
// NOTE: CONFIRMATION EXTENDS popover.js
|
||||
// ================================
|
||||
Confirmation.prototype = $.extend({}, $.fn.popover.Constructor.prototype);
|
||||
|
||||
Confirmation.prototype.constructor = Confirmation;
|
||||
|
||||
Confirmation.prototype.getDefaults = function () {
|
||||
return Confirmation.DEFAULTS;
|
||||
}
|
||||
|
||||
Confirmation.prototype.setContent = function () {
|
||||
var that = this;
|
||||
var $tip = this.tip();
|
||||
var title = this.getTitle();
|
||||
var $btnOk = $tip.find('[data-apply="confirmation"]');
|
||||
var $btnCancel = $tip.find('[data-dismiss="confirmation"]');
|
||||
var options = this.options
|
||||
|
||||
$btnOk.addClass(this.getBtnOkClass())
|
||||
.html(this.getBtnOkLabel())
|
||||
.prepend($('<i></i>').addClass(this.getBtnOkIcon()), " ")
|
||||
.attr('href', this.getHref())
|
||||
.attr('target', this.getTarget())
|
||||
.off('click').on('click', function(event) {
|
||||
that.$element.confirmation('hide');
|
||||
|
||||
options.onConfirm(event, that.$element);
|
||||
});
|
||||
|
||||
$btnCancel.addClass(this.getBtnCancelClass())
|
||||
.html(this.getBtnCancelLabel())
|
||||
.prepend($('<i></i>').addClass(this.getBtnCancelIcon()), " ")
|
||||
.off('click').on('click', function(event){
|
||||
options.onCancel(event, that.$element);
|
||||
|
||||
that.$element.confirmation('hide');
|
||||
});
|
||||
|
||||
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title);
|
||||
|
||||
$tip.removeClass('fade top bottom left right in');
|
||||
|
||||
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
||||
// this manually by checking the contents.
|
||||
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide();
|
||||
}
|
||||
|
||||
Confirmation.prototype.getBtnOkClass = function () {
|
||||
var $e = this.$element;
|
||||
var o = this.options;
|
||||
|
||||
return $e.attr('data-btnOkClass') || (typeof o.btnOkClass == 'function' ? o.btnOkClass.call($e[0]) : o.btnOkClass);
|
||||
}
|
||||
|
||||
Confirmation.prototype.getBtnOkLabel = function () {
|
||||
var $e = this.$element;
|
||||
var o = this.options;
|
||||
|
||||
return $e.attr('data-btnOkLabel') || (typeof o.btnOkLabel == 'function' ? o.btnOkLabel.call($e[0]) : o.btnOkLabel);
|
||||
}
|
||||
|
||||
Confirmation.prototype.getBtnOkIcon = function () {
|
||||
var $e = this.$element;
|
||||
var o = this.options;
|
||||
|
||||
return $e.attr('data-btnOkIcon') || (typeof o.btnOkIcon == 'function' ? o.btnOkIcon.call($e[0]) : o.btnOkIcon);
|
||||
}
|
||||
|
||||
Confirmation.prototype.getBtnCancelClass = function () {
|
||||
var $e = this.$element;
|
||||
var o = this.options;
|
||||
|
||||
return $e.attr('data-btnCancelClass') || (typeof o.btnCancelClass == 'function' ? o.btnCancelClass.call($e[0]) : o.btnCancelClass);
|
||||
}
|
||||
|
||||
Confirmation.prototype.getBtnCancelLabel = function () {
|
||||
var $e = this.$element;
|
||||
var o = this.options;
|
||||
|
||||
return $e.attr('data-btnCancelLabel') || (typeof o.btnCancelLabel == 'function' ? o.btnCancelLabel.call($e[0]) : o.btnCancelLabel);
|
||||
}
|
||||
|
||||
Confirmation.prototype.getBtnCancelIcon = function () {
|
||||
var $e = this.$element;
|
||||
var o = this.options;
|
||||
|
||||
return $e.attr('data-btnCancelIcon') || (typeof o.btnCancelIcon == 'function' ? o.btnCancelIcon.call($e[0]) : o.btnCancelIcon);
|
||||
}
|
||||
|
||||
Confirmation.prototype.getHref = function () {
|
||||
var $e = this.$element;
|
||||
var o = this.options;
|
||||
|
||||
return $e.attr('data-href') || (typeof o.href == 'function' ? o.href.call($e[0]) : o.href);
|
||||
}
|
||||
|
||||
Confirmation.prototype.getTarget = function () {
|
||||
var $e = this.$element;
|
||||
var o = this.options;
|
||||
|
||||
return $e.attr('data-target') || (typeof o.target == 'function' ? o.target.call($e[0]) : o.target);
|
||||
}
|
||||
|
||||
Confirmation.prototype.isPopout = function () {
|
||||
var popout;
|
||||
var $e = this.$element;
|
||||
var o = this.options;
|
||||
|
||||
popout = $e.attr('data-popout') || (typeof o.popout == 'function' ? o.popout.call($e[0]) : o.popout);
|
||||
|
||||
if(popout == 'false') popout = false;
|
||||
|
||||
return popout
|
||||
}
|
||||
|
||||
|
||||
// CONFIRMATION PLUGIN DEFINITION
|
||||
// =========================
|
||||
var old = $.fn.confirmation;
|
||||
|
||||
$.fn.confirmation = function (option) {
|
||||
var that = this;
|
||||
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var data = $this.data('bs.confirmation');
|
||||
var options = typeof option == 'object' && option;
|
||||
|
||||
options = options || {};
|
||||
options.all_selector = that.selector;
|
||||
|
||||
if (!data && option == 'destroy') return;
|
||||
if (!data) $this.data('bs.confirmation', (data = new Confirmation(this, options)));
|
||||
if (typeof option == 'string') data[option]();
|
||||
});
|
||||
}
|
||||
|
||||
$.fn.confirmation.Constructor = Confirmation
|
||||
|
||||
|
||||
// CONFIRMATION NO CONFLICT
|
||||
// ===================
|
||||
$.fn.confirmation.noConflict = function () {
|
||||
$.fn.confirmation = old;
|
||||
|
||||
return this;
|
||||
}
|
||||
}(jQuery);
|
||||
File diff suppressed because one or more lines are too long
89
public/js/v1.1.5/lib/bootstrap-image-gallery.js
vendored
89
public/js/v1.1.5/lib/bootstrap-image-gallery.js
vendored
@@ -1,87 +1,2 @@
|
||||
/*
|
||||
* Bootstrap Image Gallery
|
||||
* https://github.com/blueimp/Bootstrap-Image-Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/*global define, window */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define([
|
||||
'jquery',
|
||||
'blueImpGallery'
|
||||
], factory)
|
||||
} else {
|
||||
factory(
|
||||
window.jQuery,
|
||||
window.blueimp.Gallery
|
||||
)
|
||||
}
|
||||
}(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
$.extend(Gallery.prototype.options, {
|
||||
useBootstrapModal: true
|
||||
})
|
||||
|
||||
var close = Gallery.prototype.close
|
||||
var imageFactory = Gallery.prototype.imageFactory
|
||||
var videoFactory = Gallery.prototype.videoFactory
|
||||
var textFactory = Gallery.prototype.textFactory
|
||||
|
||||
$.extend(Gallery.prototype, {
|
||||
modalFactory: function (obj, callback, factoryInterface, factory) {
|
||||
if (!this.options.useBootstrapModal || factoryInterface) {
|
||||
return factory.call(this, obj, callback, factoryInterface)
|
||||
}
|
||||
var that = this
|
||||
var modalTemplate = $(this.container).children('.modal')
|
||||
var modal = modalTemplate.clone().css('display', 'block').on('click', function (event) {
|
||||
//var modal = modalTemplate.clone().show().on('click', function (event) {
|
||||
// Close modal if click is outside of modal-content:
|
||||
if (event.target === modal[0] ||
|
||||
event.target === modal.children()[0]) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
that.close()
|
||||
}
|
||||
})
|
||||
var element = factory.call(this, obj, function (event) {
|
||||
callback({
|
||||
type: event.type,
|
||||
target: modal[0]
|
||||
})
|
||||
modal.addClass('in')
|
||||
}, factoryInterface)
|
||||
modal.find('.modal-title').text(element.title || String.fromCharCode(160))
|
||||
modal.find('.modal-body').append(element)
|
||||
|
||||
return modal[0]
|
||||
},
|
||||
|
||||
imageFactory: function (obj, callback, factoryInterface) {
|
||||
return this.modalFactory(obj, callback, factoryInterface, imageFactory)
|
||||
},
|
||||
|
||||
videoFactory: function (obj, callback, factoryInterface) {
|
||||
return this.modalFactory(obj, callback, factoryInterface, videoFactory)
|
||||
},
|
||||
|
||||
textFactory: function (obj, callback, factoryInterface) {
|
||||
return this.modalFactory(obj, callback, factoryInterface, textFactory)
|
||||
},
|
||||
|
||||
close: function () {
|
||||
this.container.find('.modal').removeClass('in')
|
||||
close.call(this)
|
||||
}
|
||||
|
||||
})
|
||||
}))
|
||||
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","blueImpGallery"],t):t(window.jQuery,window.blueimp.Gallery)}(function(t,o){"use strict";t.extend(o.prototype.options,{useBootstrapModal:!0});var e=o.prototype.close,i=o.prototype.imageFactory,n=o.prototype.videoFactory,r=o.prototype.textFactory;t.extend(o.prototype,{modalFactory:function(o,e,i,n){if(!this.options.useBootstrapModal||i)return n.call(this,o,e,i);var r=this,a=t(this.container).children(".modal"),c=a.clone().css("display","block").on("click",function(t){if(t.target===c[0]||t.target===c.children()[0]){t.preventDefault();t.stopPropagation();r.close()}}),l=n.call(this,o,function(t){e({type:t.type,target:c[0]});c.addClass("in")},i);c.find(".modal-title").text(l.title||String.fromCharCode(160));c.find(".modal-body").append(l);return c[0]},imageFactory:function(t,o,e){return this.modalFactory(t,o,e,i)},videoFactory:function(t,o,e){return this.modalFactory(t,o,e,n)},textFactory:function(t,o,e){return this.modalFactory(t,o,e,r)},close:function(){this.container.find(".modal").removeClass("in");e.call(this)}})});
|
||||
//# sourceMappingURL=bootstrap-image-gallery.js.map
|
||||
1
public/js/v1.1.5/lib/bootstrap-image-gallery.js.map
Normal file
1
public/js/v1.1.5/lib/bootstrap-image-gallery.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["bootstrap-image-gallery.js.src.js"],"names":["factory","define","amd","window","jQuery","blueimp","Gallery","$","extend","prototype","options","useBootstrapModal","close","imageFactory","videoFactory","textFactory","modalFactory","obj","callback","factoryInterface","this","call","that","modalTemplate","container","children","modal","clone","css","on","event","target","preventDefault","stopPropagation","element","type","addClass","find","text","title","String","fromCharCode","append","removeClass"],"mappings":"CAaE,SAAUA,GACR,YACsB,mBAAXC,SAAyBA,OAAOC,IACvCD,QACI,SACA,kBACDD,GAEHA,EACIG,OAAOC,OACPD,OAAOE,QAAQC,UAGzB,SAAUC,EAAGD,GACX,YAEAC,GAAEC,OAAOF,EAAQG,UAAUC,SACvBC,mBAAmB,GAGvB,IAAIC,GAAQN,EAAQG,UAAUG,MAC1BC,EAAeP,EAAQG,UAAUI,aACjCC,EAAeR,EAAQG,UAAUK,aACjCC,EAAcT,EAAQG,UAAUM,WAEpCR,GAAEC,OAAOF,EAAQG,WACbO,aAAc,SAAUC,EAAKC,EAAUC,EAAkBnB,GACrD,IAAKoB,KAAKV,QAAQC,mBAAqBQ,EACnC,MAAOnB,GAAQqB,KAAKD,KAAMH,EAAKC,EAAUC,EAE7C,IAAIG,GAAOF,KACPG,EAAgBhB,EAAEa,KAAKI,WAAWC,SAAS,UAC3CC,EAAQH,EAAcI,QAAQC,IAAI,UAAW,SAASC,GAAG,QAAS,SAAUC,GAG5E,GAAIA,EAAMC,SAAWL,EAAM,IACvBI,EAAMC,SAAWL,EAAMD,WAAW,GAAI,CACtCK,EAAME,gBACNF,GAAMG,iBACNX,GAAKV,WAGTsB,EAAUlC,EAAQqB,KAAKD,KAAMH,EAAK,SAAUa,GAC5CZ,GACIiB,KAAML,EAAMK,KACZJ,OAAQL,EAAM,IAElBA,GAAMU,SAAS,OAChBjB,EACHO,GAAMW,KAAK,gBAAgBC,KAAKJ,EAAQK,OAASC,OAAOC,aAAa,KACrEf,GAAMW,KAAK,eAAeK,OAAOR,EAEjC,OAAOR,GAAM,IAGjBb,aAAc,SAAUI,EAAKC,EAAUC,GACnC,MAAOC,MAAKJ,aAAaC,EAAKC,EAAUC,EAAkBN,IAG9DC,aAAc,SAAUG,EAAKC,EAAUC,GACnC,MAAOC,MAAKJ,aAAaC,EAAKC,EAAUC,EAAkBL,IAG9DC,YAAa,SAAUE,EAAKC,EAAUC,GAClC,MAAOC,MAAKJ,aAAaC,EAAKC,EAAUC,EAAkBJ,IAG9DH,MAAO,WACHQ,KAAKI,UAAUa,KAAK,UAAUM,YAAY,KAC1C/B,GAAMS,KAAKD","file":"bootstrap-image-gallery.js.map"}
|
||||
87
public/js/v1.1.5/lib/bootstrap-image-gallery.js.src.js
vendored
Normal file
87
public/js/v1.1.5/lib/bootstrap-image-gallery.js.src.js
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Bootstrap Image Gallery
|
||||
* https://github.com/blueimp/Bootstrap-Image-Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/*global define, window */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define([
|
||||
'jquery',
|
||||
'blueImpGallery'
|
||||
], factory)
|
||||
} else {
|
||||
factory(
|
||||
window.jQuery,
|
||||
window.blueimp.Gallery
|
||||
)
|
||||
}
|
||||
}(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
$.extend(Gallery.prototype.options, {
|
||||
useBootstrapModal: true
|
||||
})
|
||||
|
||||
var close = Gallery.prototype.close
|
||||
var imageFactory = Gallery.prototype.imageFactory
|
||||
var videoFactory = Gallery.prototype.videoFactory
|
||||
var textFactory = Gallery.prototype.textFactory
|
||||
|
||||
$.extend(Gallery.prototype, {
|
||||
modalFactory: function (obj, callback, factoryInterface, factory) {
|
||||
if (!this.options.useBootstrapModal || factoryInterface) {
|
||||
return factory.call(this, obj, callback, factoryInterface)
|
||||
}
|
||||
var that = this
|
||||
var modalTemplate = $(this.container).children('.modal')
|
||||
var modal = modalTemplate.clone().css('display', 'block').on('click', function (event) {
|
||||
//var modal = modalTemplate.clone().show().on('click', function (event) {
|
||||
// Close modal if click is outside of modal-content:
|
||||
if (event.target === modal[0] ||
|
||||
event.target === modal.children()[0]) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
that.close()
|
||||
}
|
||||
})
|
||||
var element = factory.call(this, obj, function (event) {
|
||||
callback({
|
||||
type: event.type,
|
||||
target: modal[0]
|
||||
})
|
||||
modal.addClass('in')
|
||||
}, factoryInterface)
|
||||
modal.find('.modal-title').text(element.title || String.fromCharCode(160))
|
||||
modal.find('.modal-body').append(element)
|
||||
|
||||
return modal[0]
|
||||
},
|
||||
|
||||
imageFactory: function (obj, callback, factoryInterface) {
|
||||
return this.modalFactory(obj, callback, factoryInterface, imageFactory)
|
||||
},
|
||||
|
||||
videoFactory: function (obj, callback, factoryInterface) {
|
||||
return this.modalFactory(obj, callback, factoryInterface, videoFactory)
|
||||
},
|
||||
|
||||
textFactory: function (obj, callback, factoryInterface) {
|
||||
return this.modalFactory(obj, callback, factoryInterface, textFactory)
|
||||
},
|
||||
|
||||
close: function () {
|
||||
this.container.find('.modal').removeClass('in')
|
||||
close.call(this)
|
||||
}
|
||||
|
||||
})
|
||||
}))
|
||||
7
public/js/v1.1.5/lib/bootstrap.min.js
vendored
7
public/js/v1.1.5/lib/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,8 +0,0 @@
|
||||
/*! ========================================================================
|
||||
* Bootstrap Toggle: bootstrap2-toggle.js v2.2.0
|
||||
* http://www.bootstraptoggle.com
|
||||
* ========================================================================
|
||||
* Copyright 2014 Min Hur, The New York Times Company
|
||||
* Licensed under MIT
|
||||
* ======================================================================== */
|
||||
+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-large":"small"===this.options.size?"btn-small":"mini"===this.options.size?"btn-mini":"",c=a('<label class="btn">').html(this.options.on).addClass(this._onstyle+" "+b),d=a('<label class="btn">').html(this.options.off).addClass(this._offstyle+" "+b+" active"),e=a('<span class="toggle-handle btn btn-default">').addClass(b),f=a('<div class="toggle-group">').append(c,d,e),g=a('<div class="toggle btn" data-toggle="toggle">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(b).addClass(this.options.style);this.$element.wrap(g),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:c,$toggleOff:d,$toggleGroup:f}),this.$toggle.append(f);var h=this.options.width||Math.max(c.width(),d.width())+e.outerWidth()/2,i=this.options.height||Math.max(c.height(),d.height());c.addClass("toggle-on"),d.addClass("toggle-off"),this.$toggle.css({width:h,height:i}),this.options.height&&(c.css("line-height",c.height()+"px"),d.css("line-height",d.height()+"px")),this.update(!0),this.trigger(!0)},c.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},c.prototype.on=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),void(a||this.trigger()))},c.prototype.off=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),void(a||this.trigger()))},c.prototype.enable=function(){this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},c.prototype.disable=function(){this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},c.prototype.update=function(a){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(a):this.off(a)},c.prototype.trigger=function(b){this.$element.off("change.bs.toggle"),b||this.$element.change(),this.$element.on("change.bs.toggle",a.proxy(function(){this.update()},this))},c.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var d=a.fn.bootstrapToggle;a.fn.bootstrapToggle=b,a.fn.bootstrapToggle.Constructor=c,a.fn.toggle.noConflict=function(){return a.fn.bootstrapToggle=d,this},a(function(){a("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),a(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(b){var c=a(this).find("input[type=checkbox]");c.bootstrapToggle("toggle"),b.preventDefault()})}(jQuery);
|
||||
File diff suppressed because one or more lines are too long
@@ -1,35 +0,0 @@
|
||||
/*!
|
||||
Buttons for DataTables 1.2.1
|
||||
©2016 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(o){return d(o,window,document)}):"object"===typeof exports?module.exports=function(o,n){o||(o=window);if(!n||!n.fn.dataTable)n=require("datatables.net")(o,n).$;return d(n,o,o.document)}:d(jQuery,window,document)})(function(d,o,n,l){var i=d.fn.dataTable,u=0,v=0,k=i.ext.buttons,m=function(a,b){!0===b&&(b={});d.isArray(b)&&(b={buttons:b});this.c=d.extend(!0,{},m.defaults,b);b.buttons&&(this.c.buttons=b.buttons);
|
||||
this.s={dt:new i.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+u++};this.dom={container:d("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)};this._constructor()};d.extend(m.prototype,{action:function(a,b){var c=this._nodeToButton(a);if(b===l)return c.conf.action;c.conf.action=b;return this},active:function(a,b){var c=this._nodeToButton(a),e=this.c.dom.button.active,c=d(c.node);if(b===l)return c.hasClass(e);c.toggleClass(e,b===l?!0:b);return this},add:function(a,b){var c=
|
||||
this.s.buttons;if("string"===typeof b){for(var e=b.split("-"),c=this.s,d=0,h=e.length-1;d<h;d++)c=c.buttons[1*e[d]];c=c.buttons;b=1*e[e.length-1]}this._expandButton(c,a,!1,b);this._draw();return this},container:function(){return this.dom.container},disable:function(a){a=this._nodeToButton(a);d(a.node).addClass(this.c.dom.button.disabled);return this},destroy:function(){d("body").off("keyup."+this.s.namespace);var a=this.s.buttons.slice(),b,c;b=0;for(c=a.length;b<c;b++)this.remove(a[b].node);this.dom.container.remove();
|
||||
a=this.s.dt.settings()[0];b=0;for(c=a.length;b<c;b++)if(a.inst===this){a.splice(b,1);break}return this},enable:function(a,b){if(!1===b)return this.disable(a);var c=this._nodeToButton(a);d(c.node).removeClass(this.c.dom.button.disabled);return this},name:function(){return this.c.name},node:function(a){a=this._nodeToButton(a);return d(a.node)},remove:function(a){var b=this._nodeToButton(a),c=this._nodeToHost(a),e=this.s.dt;if(b.buttons.length)for(var g=b.buttons.length-1;0<=g;g--)this.remove(b.buttons[g].node);
|
||||
b.conf.destroy&&b.conf.destroy.call(e.button(a),e,d(a),b.conf);this._removeKey(b.conf);d(b.node).remove();a=d.inArray(b,c);c.splice(a,1);return this},text:function(a,b){var c=this._nodeToButton(a),e=this.c.dom.collection.buttonLiner,e=c.inCollection&&e&&e.tag?e.tag:this.c.dom.buttonLiner.tag,g=this.s.dt,h=d(c.node),f=function(a){return"function"===typeof a?a(g,h,c.conf):a};if(b===l)return f(c.conf.text);c.conf.text=b;e?h.children(e).html(f(b)):h.html(f(b));return this},_constructor:function(){var a=
|
||||
this,b=this.s.dt,c=b.settings()[0],e=this.c.buttons;c._buttons||(c._buttons=[]);c._buttons.push({inst:this,name:this.c.name});for(var c=0,g=e.length;c<g;c++)this.add(e[c]);b.on("destroy",function(){a.destroy()});d("body").on("keyup."+this.s.namespace,function(b){if(!n.activeElement||n.activeElement===n.body){var c=String.fromCharCode(b.keyCode).toLowerCase();a.s.listenKeys.toLowerCase().indexOf(c)!==-1&&a._keypress(c,b)}})},_addKey:function(a){a.key&&(this.s.listenKeys+=d.isPlainObject(a.key)?a.key.key:
|
||||
a.key)},_draw:function(a,b){a||(a=this.dom.container,b=this.s.buttons);a.children().detach();for(var c=0,d=b.length;c<d;c++)a.append(b[c].inserter),b[c].buttons&&b[c].buttons.length&&this._draw(b[c].collection,b[c].buttons)},_expandButton:function(a,b,c,e){for(var g=this.s.dt,h=0,b=!d.isArray(b)?[b]:b,f=0,q=b.length;f<q;f++){var j=this._resolveExtends(b[f]);if(j)if(d.isArray(j))this._expandButton(a,j,c,e);else{var p=this._buildButton(j,c);if(p){e!==l?(a.splice(e,0,p),e++):a.push(p);if(p.conf.buttons){var s=
|
||||
this.c.dom.collection;p.collection=d("<"+s.tag+"/>").addClass(s.className);p.conf._collection=p.collection;this._expandButton(p.buttons,p.conf.buttons,!0,e)}j.init&&j.init.call(g.button(p.node),g,d(p.node),j);h++}}}},_buildButton:function(a,b){var c=this.c.dom.button,e=this.c.dom.buttonLiner,g=this.c.dom.collection,h=this.s.dt,f=function(b){return"function"===typeof b?b(h,j,a):b};b&&g.button&&(c=g.button);b&&g.buttonLiner&&(e=g.buttonLiner);if(a.available&&!a.available(h,a))return!1;var q=function(a,
|
||||
b,c,e){e.action.call(b.button(c),a,b,c,e);d(b.table().node()).triggerHandler("buttons-action.dt",[b.button(c),b,c,e])},j=d("<"+c.tag+"/>").addClass(c.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(b){b.preventDefault();!j.hasClass(c.disabled)&&a.action&&q(b,h,j,a);j.blur()}).on("keyup.dtb",function(b){b.keyCode===13&&!j.hasClass(c.disabled)&&a.action&&q(b,h,j,a)});"a"===c.tag.toLowerCase()&&j.attr("href","#");
|
||||
e.tag?(g=d("<"+e.tag+"/>").html(f(a.text)).addClass(e.className),"a"===e.tag.toLowerCase()&&g.attr("href","#"),j.append(g)):j.html(f(a.text));!1===a.enabled&&j.addClass(c.disabled);a.className&&j.addClass(a.className);a.titleAttr&&j.attr("title",a.titleAttr);a.namespace||(a.namespace=".dt-button-"+v++);e=(e=this.c.dom.buttonContainer)&&e.tag?d("<"+e.tag+"/>").addClass(e.className).append(j):j;this._addKey(a);return{conf:a,node:j.get(0),inserter:e,buttons:[],inCollection:b,collection:null}},_nodeToButton:function(a,
|
||||
b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b[c];if(b[c].buttons.length){var g=this._nodeToButton(a,b[c].buttons);if(g)return g}}},_nodeToHost:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b;if(b[c].buttons.length){var g=this._nodeToHost(a,b[c].buttons);if(g)return g}}},_keypress:function(a,b){var c=function(e){for(var g=0,h=e.length;g<h;g++){var f=e[g].conf,q=e[g].node;if(f.key)if(f.key===a)d(q).click();else if(d.isPlainObject(f.key)&&
|
||||
f.key.key===a&&(!f.key.shiftKey||b.shiftKey))if(!f.key.altKey||b.altKey)if(!f.key.ctrlKey||b.ctrlKey)(!f.key.metaKey||b.metaKey)&&d(q).click();e[g].buttons.length&&c(e[g].buttons)}};c(this.s.buttons)},_removeKey:function(a){if(a.key){var b=d.isPlainObject(a.key)?a.key.key:a.key,a=this.s.listenKeys.split(""),b=d.inArray(b,a);a.splice(b,1);this.s.listenKeys=a.join("")}},_resolveExtends:function(a){for(var b=this.s.dt,c,e,g=function(c){for(var e=0;!d.isPlainObject(c)&&!d.isArray(c);){if(c===l)return;
|
||||
if("function"===typeof c){if(c=c(b,a),!c)return!1}else if("string"===typeof c){if(!k[c])throw"Unknown button type: "+c;c=k[c]}e++;if(30<e)throw"Buttons: Too many iterations";}return d.isArray(c)?c:d.extend({},c)},a=g(a);a&&a.extend;){if(!k[a.extend])throw"Cannot extend unknown button type: "+a.extend;var h=g(k[a.extend]);if(d.isArray(h))return h;if(!h)return!1;c=h.className;a=d.extend({},h,a);c&&a.className!==c&&(a.className=c+" "+a.className);var f=a.postfixButtons;if(f){a.buttons||(a.buttons=[]);
|
||||
c=0;for(e=f.length;c<e;c++)a.buttons.push(f[c]);a.postfixButtons=null}if(f=a.prefixButtons){a.buttons||(a.buttons=[]);c=0;for(e=f.length;c<e;c++)a.buttons.splice(c,0,f[c]);a.prefixButtons=null}a.extend=h.extend}return a}});m.background=function(a,b,c){c===l&&(c=400);a?d("<div/>").addClass(b).css("display","none").appendTo("body").fadeIn(c):d("body > div."+b).fadeOut(c,function(){d(this).remove()})};m.instanceSelector=function(a,b){if(!a)return d.map(b,function(a){return a.inst});var c=[],e=d.map(b,
|
||||
function(a){return a.name}),g=function(a){if(d.isArray(a))for(var f=0,q=a.length;f<q;f++)g(a[f]);else"string"===typeof a?-1!==a.indexOf(",")?g(a.split(",")):(a=d.inArray(d.trim(a),e),-1!==a&&c.push(b[a].inst)):"number"===typeof a&&c.push(b[a].inst)};g(a);return c};m.buttonSelector=function(a,b){for(var c=[],e=function(a,b,c){for(var d,g,f=0,h=b.length;f<h;f++)if(d=b[f])g=c!==l?c+f:f+"",a.push({node:d.node,name:d.conf.name,idx:g}),d.buttons&&e(a,d.buttons,g+"-")},g=function(a,b){var f,h,i=[];e(i,b.s.buttons);
|
||||
f=d.map(i,function(a){return a.node});if(d.isArray(a)||a instanceof d){f=0;for(h=a.length;f<h;f++)g(a[f],b)}else if(null===a||a===l||"*"===a){f=0;for(h=i.length;f<h;f++)c.push({inst:b,node:i[f].node})}else if("number"===typeof a)c.push({inst:b,node:b.s.buttons[a].node});else if("string"===typeof a)if(-1!==a.indexOf(",")){i=a.split(",");f=0;for(h=i.length;f<h;f++)g(d.trim(i[f]),b)}else if(a.match(/^\d+(\-\d+)*$/))f=d.map(i,function(a){return a.idx}),c.push({inst:b,node:i[d.inArray(a,f)].node});else if(-1!==
|
||||
a.indexOf(":name")){var k=a.replace(":name","");f=0;for(h=i.length;f<h;f++)i[f].name===k&&c.push({inst:b,node:i[f].node})}else d(f).filter(a).each(function(){c.push({inst:b,node:this})});else"object"===typeof a&&a.nodeName&&(i=d.inArray(a,f),-1!==i&&c.push({inst:b,node:f[i]}))},h=0,f=a.length;h<f;h++)g(b,a[h]);return c};m.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:"dt-button-collection"},
|
||||
button:{tag:"a",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""}}};m.version="1.2.1";d.extend(k,{collection:{text:function(a){return a.i18n("buttons.collection","Collection")},className:"buttons-collection",action:function(a,b,c,e){var a=c.offset(),g=d(b.table().container()),h=!1;d("div.dt-button-background").length&&(h=d("div.dt-button-collection").offset(),d("body").trigger("click.dtb-collection"));e._collection.addClass(e.collectionLayout).css("display",
|
||||
"none").appendTo("body").fadeIn(e.fade);var f=e._collection.css("position");h&&"absolute"===f?e._collection.css({top:h.top+5,left:h.left+5}):"absolute"===f?(e._collection.css({top:a.top+c.outerHeight(),left:a.left}),c=a.left+e._collection.outerWidth(),g=g.offset().left+g.width(),c>g&&e._collection.css("left",a.left-(c-g))):(a=e._collection.height()/2,a>d(o).height()/2&&(a=d(o).height()/2),e._collection.css("marginTop",-1*a));e.background&&m.background(!0,e.backgroundClassName,e.fade);setTimeout(function(){d("div.dt-button-background").on("click.dtb-collection",
|
||||
function(){});d("body").on("click.dtb-collection",function(a){if(!d(a.target).parents().andSelf().filter(e._collection).length){e._collection.fadeOut(e.fade,function(){e._collection.detach()});d("div.dt-button-background").off("click.dtb-collection");m.background(false,e.backgroundClassName,e.fade);d("body").off("click.dtb-collection");b.off("buttons-action.b-internal")}})},10);if(e.autoClose)b.on("buttons-action.b-internal",function(){d("div.dt-button-background").click()})},background:!0,collectionLayout:"",
|
||||
backgroundClassName:"dt-button-background",autoClose:!1,fade:400},copy:function(a,b){if(k.copyHtml5)return"copyHtml5";if(k.copyFlash&&k.copyFlash.available(a,b))return"copyFlash"},csv:function(a,b){if(k.csvHtml5&&k.csvHtml5.available(a,b))return"csvHtml5";if(k.csvFlash&&k.csvFlash.available(a,b))return"csvFlash"},excel:function(a,b){if(k.excelHtml5&&k.excelHtml5.available(a,b))return"excelHtml5";if(k.excelFlash&&k.excelFlash.available(a,b))return"excelFlash"},pdf:function(a,b){if(k.pdfHtml5&&k.pdfHtml5.available(a,
|
||||
b))return"pdfHtml5";if(k.pdfFlash&&k.pdfFlash.available(a,b))return"pdfFlash"},pageLength:function(a){var a=a.settings()[0].aLengthMenu,b=d.isArray(a[0])?a[0]:a,c=d.isArray(a[0])?a[1]:a,e=function(a){return a.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},a.page.len())};return{extend:"collection",text:e,className:"buttons-page-length",autoClose:!0,buttons:d.map(b,function(a,b){return{text:c[b],action:function(b,c){c.page.len(a).draw()},init:function(b,c,d){var e=this,c=function(){e.active(b.page.len()===
|
||||
a)};b.on("length.dt"+d.namespace,c);c()},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}),init:function(a,b,c){var d=this;a.on("length.dt"+c.namespace,function(){d.text(e(a))})},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}});i.Api.register("buttons()",function(a,b){b===l&&(b=a,a=l);return this.iterator(!0,"table",function(c){if(c._buttons)return m.buttonSelector(m.instanceSelector(a,c._buttons),b)},!0)});i.Api.register("button()",function(a,b){var c=this.buttons(a,b);1<c.length&&
|
||||
c.splice(1,c.length);return c});i.Api.registerPlural("buttons().active()","button().active()",function(a){return a===l?this.map(function(a){return a.inst.active(a.node)}):this.each(function(b){b.inst.active(b.node,a)})});i.Api.registerPlural("buttons().action()","button().action()",function(a){return a===l?this.map(function(a){return a.inst.action(a.node)}):this.each(function(b){b.inst.action(b.node,a)})});i.Api.register(["buttons().enable()","button().enable()"],function(a){return this.each(function(b){b.inst.enable(b.node,
|
||||
a)})});i.Api.register(["buttons().disable()","button().disable()"],function(){return this.each(function(a){a.inst.disable(a.node)})});i.Api.registerPlural("buttons().nodes()","button().node()",function(){var a=d();d(this.each(function(b){a=a.add(b.inst.node(b.node))}));return a});i.Api.registerPlural("buttons().text()","button().text()",function(a){return a===l?this.map(function(a){return a.inst.text(a.node)}):this.each(function(b){b.inst.text(b.node,a)})});i.Api.registerPlural("buttons().trigger()",
|
||||
"button().trigger()",function(){return this.each(function(a){a.inst.node(a.node).trigger("click")})});i.Api.registerPlural("buttons().containers()","buttons().container()",function(){var a=d();d(this.each(function(b){a=a.add(b.inst.container())}));return a});i.Api.register("button().add()",function(a,b){1===this.length&&this[0].inst.add(b,a);return this.button(a)});i.Api.register("buttons().destroy()",function(){this.pluck("inst").unique().each(function(a){a.destroy()});return this});i.Api.registerPlural("buttons().remove()",
|
||||
"buttons().remove()",function(){this.each(function(a){a.inst.remove(a.node)});return this});var r;i.Api.register("buttons.info()",function(a,b,c){var e=this;if(!1===a)return d("#datatables_buttons_info").fadeOut(function(){d(this).remove()}),clearTimeout(r),r=null,this;r&&clearTimeout(r);d("#datatables_buttons_info").length&&d("#datatables_buttons_info").remove();d('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a?"<h2>"+a+"</h2>":"").append(d("<div/>")["string"===typeof b?"html":
|
||||
"append"](b)).css("display","none").appendTo("body").fadeIn();c!==l&&0!==c&&(r=setTimeout(function(){e.buttons.info(!1)},c));return this});i.Api.register("buttons.exportData()",function(a){if(this.context.length){for(var b=new i.Api(this.context[0]),c=d.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(a){return e(a)},footer:function(a){return e(a)},body:function(a){return e(a)}}},
|
||||
a),e=function(a){if("string"!==typeof a)return a;c.stripHtml&&(a=a.replace(/<[^>]*>/g,""));c.trim&&(a=a.replace(/^\s+|\s+$/g,""));c.stripNewlines&&(a=a.replace(/\n/g," "));c.decodeEntities&&(t.innerHTML=a,a=t.value);return a},a=b.columns(c.columns).indexes().map(function(a){return c.format.header(b.column(a).header().innerHTML,a)}).toArray(),g=b.table().footer()?b.columns(c.columns).indexes().map(function(a){var d=b.column(a).footer();return c.format.footer(d?d.innerHTML:"",a)}).toArray():null,h=
|
||||
b.rows(c.rows,c.modifier).indexes().toArray(),h=b.cells(h,c.columns).render(c.orthogonal).toArray(),f=a.length,k=0<f?h.length/f:0,j=Array(k),m=0,l=0;l<k;l++){for(var o=Array(f),n=0;n<f;n++)o[n]=c.format.body(h[m],n,l),m++;j[l]=o}return{header:a,footer:g,body:j}}});var t=d("<textarea/>")[0];d.fn.dataTable.Buttons=m;d.fn.DataTable.Buttons=m;d(n).on("init.dt plugin-init.dt",function(a,b){if("dt"===a.namespace){var c=b.oInit.buttons||i.defaults.buttons;c&&!b._buttons&&(new m(b,c)).container()}});i.ext.feature.push({fnInit:function(a){var a=
|
||||
new i.Api(a),b=a.init().buttons||i.defaults.buttons;return(new m(a,b)).container()},cFeature:"B"});return m});
|
||||
@@ -1,166 +0,0 @@
|
||||
/*!
|
||||
DataTables 1.10.12
|
||||
©2008-2015 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(h){"function"===typeof define&&define.amd?define(["jquery"],function(D){return h(D,window,document)}):"object"===typeof exports?module.exports=function(D,I){D||(D=window);I||(I="undefined"!==typeof window?require("jquery"):require("jquery")(D));return h(I,D,D.document)}:h(jQuery,window,document)})(function(h,D,I,k){function X(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),
|
||||
d[c]=e,"o"===b[1]&&X(a[e])});a._hungarianMap=d}function K(a,b,c){a._hungarianMap||X(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),K(a[d],b[d],c)):b[d]=b[e]})}function Da(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&E(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&E(a,a,"sZeroRecords","sLoadingRecords");
|
||||
a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&db(a)}function eb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");"boolean"===typeof a.scrollX&&(a.scrollX=
|
||||
a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&K(m.models.oSearch,a[b])}function fb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;b&&!h.isArray(b)&&(a.aDataSort=[b])}function gb(a){if(!m.__browser){var b={};m.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(h("<div/>").css({position:"absolute",top:1,left:1,
|
||||
width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,m.__browser);a.oScroll.iBarWidth=m.__browser.barWidth}function hb(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==e;)a.hasOwnProperty(d)&&
|
||||
(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Ea(a,b){var c=m.defaults.column,d=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:I.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},m.models.oSearch,c[d]);ja(a,d,h(b).data())}function ja(a,b,c){var b=a.aoColumns[b],d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f=
|
||||
(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(fb(c),K(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),h.extend(b,c),E(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),E(b,c,"aDataSort"));var g=b.mData,j=Q(g),i=b.mRender?Q(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&&
|
||||
(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&&b?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return R(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):
|
||||
!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function Y(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Fa(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&ka(a);u(a,null,"column-sizing",[a])}function Z(a,b){var c=la(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function $(a,b){var c=la(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}
|
||||
function aa(a){var b=0;h.each(a.aoColumns,function(a,d){d.bVisible&&"none"!==h(d.nTh).css("display")&&b++});return b}function la(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Ga(a){var b=a.aoColumns,c=a.aoData,d=m.ext.type.detect,e,f,g,j,i,h,l,q,t;e=0;for(f=b.length;e<f;e++)if(l=b[e],t=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(j=d.length;g<j;g++){i=0;for(h=c.length;i<h;i++){t[i]===k&&(t[i]=B(a,i,e,"type"));q=d[g](t[i],a);if(!q&&
|
||||
g!==d.length-1)break;if("html"===q)break}if(q){l.sType=q;break}}l.sType||(l.sType="string")}}function ib(a,b,c,d){var e,f,g,j,i,n,l=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){n=b[e];var q=n.targets!==k?n.targets:n.aTargets;h.isArray(q)||(q=[q]);f=0;for(g=q.length;f<g;f++)if("number"===typeof q[f]&&0<=q[f]){for(;l.length<=q[f];)Ea(a);d(q[f],n)}else if("number"===typeof q[f]&&0>q[f])d(l.length+q[f],n);else if("string"===typeof q[f]){j=0;for(i=l.length;j<i;j++)("_all"==q[f]||h(l[j].nTh).hasClass(q[f]))&&
|
||||
d(j,n)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function N(a,b,c,d){var e=a.aoData.length,f=h.extend(!0,{},m.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,j=0,i=g.length;j<i;j++)g[j].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ha(a,e,c,d);return e}function ma(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,e){c=Ia(a,e);return N(a,c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw,
|
||||
f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,i=f.fnGetData(g,d,{settings:a,row:b,col:c});if(i===k)return a.iDrawError!=e&&null===j&&(L(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),j;if((i===g||null===i)&&null!==j&&d!==k)i=j;else if("function"===typeof i)return i.call(g);return null===i&&"display"==d?"":i}function jb(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})}
|
||||
function Ja(a){return h.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\./g,".")})}function Q(a){if(h.isPlainObject(a)){var b={};h.each(a,function(a,c){c&&(b[a]=Q(c))});return function(a,c,f,g){var j=b[c]||b._;return j!==k?j(a,c,f,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f,g){return a(b,c,f,g)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var c=function(a,b,f){var g,j;if(""!==f){j=Ja(f);
|
||||
for(var i=0,n=j.length;i<n;i++){f=j[i].match(ba);g=j[i].match(U);if(f){j[i]=j[i].replace(ba,"");""!==j[i]&&(a=a[j[i]]);g=[];j.splice(0,i+1);j=j.join(".");if(h.isArray(a)){i=0;for(n=a.length;i<n;i++)g.push(c(a[i],b,j))}a=f[0].substring(1,f[0].length-1);a=""===a?g:g.join(a);break}else if(g){j[i]=j[i].replace(U,"");a=a[j[i]]();continue}if(null===a||a[j[i]]===k)return k;a=a[j[i]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}function R(a){if(h.isPlainObject(a))return R(a._);
|
||||
if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=Ja(e),f;f=e[e.length-1];for(var g,j,i=0,n=e.length-1;i<n;i++){g=e[i].match(ba);j=e[i].match(U);if(g){e[i]=e[i].replace(ba,"");a[e[i]]=[];f=e.slice();f.splice(0,i+1);g=f.join(".");if(h.isArray(d)){j=0;for(n=d.length;j<n;j++)f={},b(f,d[j],g),a[e[i]].push(f)}else a[e[i]]=d;return}j&&(e[i]=e[i].replace(U,
|
||||
""),a=a[e[i]](d));if(null===a[e[i]]||a[e[i]]===k)a[e[i]]={};a=a[e[i]]}if(f.match(U))a[f.replace(U,"")](d);else a[f.replace(ba,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ka(a){return G(a.aoData,"_aData")}function na(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function oa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,1)}function ca(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);
|
||||
c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=Ia(a,e,d,d===k?k:e._aData).data;else{var j=e.anCells;if(j)if(d!==k)g(j[d],d);else{c=0;for(f=j.length;c<f;c++)g(j[c],c)}}e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==k)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;La(a,e)}}function Ia(a,b,c,d){var e=[],f=b.firstChild,g,j,i=0,n,l=a.aoColumns,q=a._rowReadObject,d=d!==k?d:q?{}:[],t=function(a,b){if("string"===typeof a){var c=a.indexOf("@");
|
||||
-1!==c&&(c=a.substring(c+1),R(a)(d,b.getAttribute(c)))}},S=function(a){if(c===k||c===i)j=l[i],n=h.trim(a.innerHTML),j&&j._bAttrSrc?(R(j.mData._)(d,n),t(j.mData.sort,a),t(j.mData.type,a),t(j.mData.filter,a)):q?(j._setter||(j._setter=R(j.mData)),j._setter(d,n)):d[i]=n;i++};if(f)for(;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)S(f),e.push(f);f=f.nextSibling}else{e=b.anCells;f=0;for(g=e.length;f<g;f++)S(e[f])}if(b=b.firstChild?b:b.nTr)(b=b.getAttribute("id"))&&R(a.rowId)(d,b);return{data:d,cells:e}}
|
||||
function Ha(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],j,i,n,l,q;if(null===e.nTr){j=c||I.createElement("tr");e.nTr=j;e.anCells=g;j._DT_RowIndex=b;La(a,e);l=0;for(q=a.aoColumns.length;l<q;l++){n=a.aoColumns[l];i=c?d[l]:I.createElement(n.sCellType);i._DT_CellIndex={row:b,column:l};g.push(i);if((!c||n.mRender||n.mData!==l)&&(!h.isPlainObject(n.mData)||n.mData._!==l+".display"))i.innerHTML=B(a,b,l,"display");n.sClass&&(i.className+=" "+n.sClass);n.bVisible&&!c?j.appendChild(i):!n.bVisible&&c&&i.parentNode.removeChild(i);
|
||||
n.fnCreatedCell&&n.fnCreatedCell.call(a.oInstance,i,B(a,b,l),f,b,l)}u(a,"aoRowCreatedCallback",null,[j,f,b])}e.nTr.setAttribute("role","row")}function La(a,b){var c=b.nTr,d=b._aData;if(c){var e=a.rowIdFn(d);e&&(c.id=e);d.DT_RowClass&&(e=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?pa(b.__rowc.concat(e)):e,h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&h(c).attr(d.DT_RowAttr);d.DT_RowData&&h(c).data(d.DT_RowData)}}function kb(a){var b,c,d,e,f,g=a.nTHead,j=a.nTFoot,i=0===
|
||||
h("th, td",g).length,n=a.oClasses,l=a.aoColumns;i&&(e=h("<tr/>").appendTo(g));b=0;for(c=l.length;b<c;b++)f=l[b],d=h(f.nTh).addClass(f.sClass),i&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),Ma(a,f.nTh,b))),f.sTitle!=d[0].innerHTML&&d.html(f.sTitle),Na(a,"header")(a,d,f,n);i&&da(a.aoHeader,g);h(g).find(">tr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(n.sHeaderTH);h(j).find(">tr>th, >tr>td").addClass(n.sFooterTH);
|
||||
if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}function ea(a,b,c){var d,e,f,g=[],j=[],i=a.aoColumns.length,n;if(b){c===k&&(c=!1);d=0;for(e=b.length;d<e;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);j.push([])}d=0;for(e=g.length;d<e;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(n=i=1,j[d][f]===k){a.appendChild(g[d][f].cell);
|
||||
for(j[d][f]=1;g[d+i]!==k&&g[d][f].cell==g[d+i][f].cell;)j[d+i][f]=1,i++;for(;g[d][f+n]!==k&&g[d][f].cell==g[d][f+n].cell;){for(c=0;c<i;c++)j[d+c][f+n]=1;n++}h(g[d][f].cell).attr("rowspan",i).attr("colspan",n)}}}}function O(a){var b=u(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,g=a.iInitDisplayStart,j="ssp"==y(a),i=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=j?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=
|
||||
-1);var g=a._iDisplayStart,n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&!lb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:n;for(j=j?0:g;j<f;j++){var l=i[j],q=a.aoData[l];null===q.nTr&&Ha(a,l);l=q.nTr;if(0!==e){var t=d[c%e];q._sRowStripe!=t&&(h(l).removeClass(q._sRowStripe).addClass(t),q._sRowStripe=t)}u(a,"aoRowCallback",null,[l,q._aData,c,j]);b.push(l);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==y(a)?c=f.sLoadingRecords:
|
||||
f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=h("<tr/>",{"class":e?d[0]:""}).append(h("<td />",{valign:"top",colSpan:aa(a),"class":a.oClasses.sRowEmpty}).html(c))[0];u(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ka(a),g,n,i]);u(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ka(a),g,n,i]);d=h(a.nTBody);d.children().detach();d.append(h(b));u(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function T(a,b){var c=a.oFeatures,d=c.bFilter;
|
||||
c.bSort&&mb(a);d?fa(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;O(a);a._drawHold=!1}function nb(a){var b=a.oClasses,c=h(a.nTable),c=h("<div/>").insertBefore(c),d=a.oFeatures,e=h("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,n,l,q,t=0;t<f.length;t++){g=null;j=f[t];if("<"==j){i=h("<div/>")[0];
|
||||
n=f[t+1];if("'"==n||'"'==n){l="";for(q=2;f[t+q]!=n;)l+=f[t+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(n=l.split("."),i.id=n[0].substr(1,n[0].length-1),i.className=n[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;t+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=ob(a);else if("f"==j&&d.bFilter)g=pb(a);else if("r"==j&&d.bProcessing)g=qb(a);else if("t"==j)g=rb(a);else if("i"==j&&d.bInfo)g=sb(a);else if("p"==
|
||||
j&&d.bPaginate)g=tb(a);else if(0!==m.ext.feature.length){i=m.ext.feature;q=0;for(n=i.length;q<n;q++)if(j==i[q].cFeature){g=i[q].fnInit(a);break}}g&&(i=a.aanFeatures,i[j]||(i[j]=[]),i[j].push(g),e.append(g))}c.replaceWith(e);a.nHolding=null}function da(a,b){var c=h(b).children("tr"),d,e,f,g,j,i,n,l,q,t;a.splice(0,a.length);f=0;for(i=c.length;f<i;f++)a.push([]);f=0;for(i=c.length;f<i;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){l=1*e.getAttribute("colspan");
|
||||
q=1*e.getAttribute("rowspan");l=!l||0===l||1===l?1:l;q=!q||0===q||1===q?1:q;g=0;for(j=a[f];j[g];)g++;n=g;t=1===l?!0:!1;for(j=0;j<l;j++)for(g=0;g<q;g++)a[f+g][n+j]={cell:e,unique:t},a[f+g].nTr=d}e=e.nextSibling}}}function qa(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],da(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function ra(a,b,c){u(a,"aoServerParams","serverParams",[b]);if(b&&h.isArray(b)){var d={},
|
||||
e=/(.*?)\[\]$/;h.each(b,function(a,b){var c=b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,g=a.ajax,j=a.oInstance,i=function(b){u(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var n=h.isFunction(f)?f(b,a):f,b=h.isFunction(f)&&n?n:h.extend(!0,b,n);delete g.data}n={data:b,success:function(b){var c=b.error||b.sError;c&&L(a,0,c);a.json=b;i(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=u(a,null,"xhr",
|
||||
[a,null,a.jqXHR]);-1===h.inArray(!0,d)&&("parsererror"==c?L(a,0,"Invalid JSON response",1):4===b.readyState&&L(a,0,"Ajax error",7));C(a,!1)}};a.oAjaxData=b;u(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(n,{url:g||a.sAjaxSource})):h.isFunction(g)?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(n,g)),g.data=f)}function lb(a){return a.bAjaxDataGet?(a.iDraw++,C(a,
|
||||
!0),ra(a,ub(a),function(b){vb(a,b)}),!1):!0}function ub(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,n,l,q=V(a);g=a._iDisplayStart;i=!1!==d.bPaginate?a._iDisplayLength:-1;var k=function(a,b){j.push({name:a,value:b})};k("sEcho",a.iDraw);k("iColumns",c);k("sColumns",G(b,"sName").join(","));k("iDisplayStart",g);k("iDisplayLength",i);var S={draw:a.iDraw,columns:[],order:[],start:g,length:i,search:{value:e.sSearch,regex:e.bRegex}};for(g=0;g<c;g++)n=b[g],
|
||||
l=f[g],i="function"==typeof n.mData?"function":n.mData,S.columns.push({data:i,name:n.sName,searchable:n.bSearchable,orderable:n.bSortable,search:{value:l.sSearch,regex:l.bRegex}}),k("mDataProp_"+g,i),d.bFilter&&(k("sSearch_"+g,l.sSearch),k("bRegex_"+g,l.bRegex),k("bSearchable_"+g,n.bSearchable)),d.bSort&&k("bSortable_"+g,n.bSortable);d.bFilter&&(k("sSearch",e.sSearch),k("bRegex",e.bRegex));d.bSort&&(h.each(q,function(a,b){S.order.push({column:b.col,dir:b.dir});k("iSortCol_"+a,b.col);k("sSortDir_"+
|
||||
a,b.dir)}),k("iSortingCols",q.length));b=m.ext.legacy.ajax;return null===b?a.sAjaxSource?j:S:b?j:S}function vb(a,b){var c=sa(a,b),d=b.sEcho!==k?b.sEcho:b.draw,e=b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(d){if(1*d<a.iDraw)return;a.iDraw=1*d}na(a);a._iRecordsTotal=parseInt(e,10);a._iRecordsDisplay=parseInt(f,10);d=0;for(e=c.length;d<e;d++)N(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;O(a);a._bInitComplete||
|
||||
ta(a,b);a.bAjaxDataGet=!0;C(a,!1)}function sa(a,b){var c=h.isPlainObject(a.ajax)&&a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===c?b.aaData||b[c]:""!==c?Q(c)(b):b}function pb(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",g):j+g,b=h("<div/>",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("<label/>").append(j)),f=function(){var b=!this.value?
|
||||
"":this.value;b!=e.sSearch&&(fa(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,O(a))},g=null!==a.searchDelay?a.searchDelay:"ssp"===y(a)?400:0,i=h("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT",g?Oa(f,g):f).bind("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",c);h(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{i[0]!==I.activeElement&&i.val(e.sSearch)}catch(d){}});
|
||||
return b[0]}function fa(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};Ga(a);if("ssp"!=y(a)){wb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)xb(a,e[b].sSearch,b,e[b].bEscapeRegex!==k?!e[b].bEscapeRegex:e[b].bRegex,e[b].bSmart,e[b].bCaseInsensitive);yb(a)}else f(b);a.bFiltered=!0;u(a,null,"search",[a])}function yb(a){for(var b=
|
||||
m.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var j=[],i=0,n=c.length;i<n;i++)e=c[i],d=a.aoData[e],b[f](a,d._aFilterData,e,d._aData,i)&&j.push(e);c.length=0;h.merge(c,j)}}function xb(a,b,c,d,e,f){if(""!==b)for(var g=a.aiDisplay,d=Pa(b,d,e,f),e=g.length-1;0<=e;e--)b=a.aoData[g[e]]._aFilterData[c],d.test(b)||g.splice(e,1)}function wb(a,b,c,d,e,f){var d=Pa(b,d,e,f),e=a.oPreviousSearch.sSearch,f=a.aiDisplayMaster,g;0!==m.ext.search.length&&(c=!0);g=zb(a);if(0>=b.length)a.aiDisplay=f.slice();
|
||||
else{if(g||c||e.length>b.length||0!==b.indexOf(e)||a.bSorted)a.aiDisplay=f.slice();b=a.aiDisplay;for(c=b.length-1;0<=c;c--)d.test(a.aoData[b[c]]._sFilterRow)||b.splice(c,1)}}function Pa(a,b,c,d){a=b?a:Qa(a);c&&(a="^(?=.*?"+h.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0))var b=a.match(/^"(.*)"$/),a=b?b[1]:a;return a.replace('"',"")}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function zb(a){var b=a.aoColumns,c,d,e,f,g,j,i,h,l=m.ext.type.search;c=!1;d=0;for(f=a.aoData.length;d<
|
||||
f;d++)if(h=a.aoData[d],!h._aFilterData){j=[];e=0;for(g=b.length;e<g;e++)c=b[e],c.bSearchable?(i=B(a,d,e,"filter"),l[c.sType]&&(i=l[c.sType](i)),null===i&&(i=""),"string"!==typeof i&&i.toString&&(i=i.toString())):i="",i.indexOf&&-1!==i.indexOf("&")&&(ua.innerHTML=i,i=Zb?ua.textContent:ua.innerText),i.replace&&(i=i.replace(/[\r\n]/g,"")),j.push(i);h._aFilterData=j;h._sFilterRow=j.join(" ");c=!0}return c}function Ab(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}
|
||||
function Bb(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function sb(a){var b=a.sTableId,c=a.aanFeatures.i,d=h("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Cb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Cb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),
|
||||
g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&(j+=" "+c.sInfoFiltered);j+=c.sInfoPostFix;j=Db(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,d,e,f,g,j));h(b).html(j)}}function Db(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/
|
||||
e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/e)))}function ga(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;var g=a.bDeferLoading;if(a.bInitialised){nb(a);kb(a);ea(a,a.aoHeader);ea(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Fa(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=x(f.sWidth));u(a,null,"preInit",[a]);T(a);e=y(a);if("ssp"!=e||g)"ajax"==e?ra(a,[],function(c){var f=sa(a,c);for(b=0;b<f.length;b++)N(a,f[b]);a.iInitDisplayStart=d;T(a);C(a,!1);ta(a,c)},a):(C(a,!1),
|
||||
ta(a))}else setTimeout(function(){ga(a)},200)}function ta(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&Y(a);u(a,null,"plugin-init",[a,b]);u(a,"aoInitComplete","init",[a,b])}function Ra(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Sa(a);u(a,null,"length",[a,c])}function ob(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=h.isArray(d[0]),f=e?d[0]:d,d=e?d[1]:d,e=h("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}),g=0,j=f.length;g<j;g++)e[0][g]=new Option(d[g],f[g]);var i=
|
||||
h("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(i[0].id=c+"_length");i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",i).val(a._iDisplayLength).bind("change.DT",function(){Ra(a,h(this).val());O(a)});h(a.nTable).bind("length.dt.DT",function(b,c,d){a===c&&h("select",i).val(d)});return i[0]}function tb(a){var b=a.sPaginationType,c=m.ext.pager[b],d="function"===typeof c,e=function(a){O(a)},b=h("<div/>").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;
|
||||
d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),k,l=0;for(k=f.p.length;l<k;l++)Na(a,"pageButton")(a,f.p[l],l,h,b,i)}else c.fnUpdate(a,e)},sName:"pagination"}));return b}function Ta(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"===typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:
|
||||
"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:L(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(u(a,null,"page",[a]),c&&O(a));return b}function qb(a){return h("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",b?"block":"none");u(a,null,"processing",
|
||||
[a,b])}function rb(a){var b=h(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),n=h(b[0].cloneNode(!1)),l=b.children("tfoot");l.length||(l=null);i=h("<div/>",{"class":f.sScrollWrapper}).append(h("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?!d?null:x(d):"100%"}).append(h("<div/>",{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",
|
||||
width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:x(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:x(d):"100%"}).append(h("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",0).append("bottom"===j?g:null).append(b.children("tfoot")))));
|
||||
var b=i.children(),k=b[0],f=b[1],t=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(t.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:ka,sName:"scrolling"});return i[0]}function ka(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,n=j.children("table"),j=a.nScrollBody,l=h(j),q=j.style,t=h(a.nScrollFoot).children("div"),
|
||||
m=t.children("table"),o=h(a.nTHead),F=h(a.nTable),p=F[0],r=p.style,u=a.nTFoot?h(a.nTFoot):null,Eb=a.oBrowser,Ua=Eb.bScrollOversize,s=G(a.aoColumns,"nTh"),P,v,w,y,z=[],A=[],B=[],C=[],D,E=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};v=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==v&&a.scrollBarVis!==k)a.scrollBarVis=v,Y(a);else{a.scrollBarVis=v;F.children("thead, tfoot").remove();u&&(w=u.clone().prependTo(F),P=u.find("tr"),w=
|
||||
w.find("tr"));y=o.clone().prependTo(F);o=o.find("tr");v=y.find("tr");y.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(qa(a,y),function(b,c){D=Z(a,b);c.style.width=a.aoColumns[D].sWidth});u&&J(function(a){a.style.width=""},w);f=F.outerWidth();if(""===c){r.width="100%";if(Ua&&(F.find("tbody").height()>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(F.outerWidth()-b);f=F.outerWidth()}else""!==d&&(r.width=x(d),f=F.outerWidth());J(E,v);J(function(a){B.push(a.innerHTML);
|
||||
z.push(x(h(a).css("width")))},v);J(function(a,b){if(h.inArray(a,s)!==-1)a.style.width=z[b]},o);h(v).height(0);u&&(J(E,w),J(function(a){C.push(a.innerHTML);A.push(x(h(a).css("width")))},w),J(function(a,b){a.style.width=A[b]},P),h(w).height(0));J(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+B[b]+"</div>";a.style.width=z[b]},v);u&&J(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+C[b]+"</div>";a.style.width=
|
||||
A[b]},w);if(F.outerWidth()<f){P=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(Ua&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(P-b);(""===c||""!==d)&&L(a,1,"Possible column misalignment",6)}else P="100%";q.width=x(P);g.width=x(P);u&&(a.nScrollFoot.style.width=x(P));!e&&Ua&&(q.height=x(p.offsetHeight+b));c=F.outerWidth();n[0].style.width=x(c);i.width=x(c);d=F.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+(Eb.bScrollbarLeft?"Left":
|
||||
"Right");i[e]=d?b+"px":"0px";u&&(m[0].style.width=x(c),t[0].style.width=x(c),t[0].style[e]=d?b+"px":"0px");F.children("colgroup").insertBefore(F.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function J(a,b,c){for(var d=0,e=0,f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Fa(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,g=d.sXInner,
|
||||
j=c.length,i=la(a,"bVisible"),n=h("th",a.nTHead),l=b.getAttribute("width"),k=b.parentNode,t=!1,m,o,p=a.oBrowser,d=p.bScrollOversize;(m=b.style.width)&&-1!==m.indexOf("%")&&(l=m);for(m=0;m<i.length;m++)o=c[i[m]],null!==o.sWidth&&(o.sWidth=Fb(o.sWidthOrig,k),t=!0);if(d||!t&&!f&&!e&&j==aa(a)&&j==n.length)for(m=0;m<j;m++)i=Z(a,m),null!==i&&(c[i].sWidth=x(n.eq(m).width()));else{j=h(b).clone().css("visibility","hidden").removeAttr("id");j.find("tbody tr").remove();var r=h("<tr/>").appendTo(j.find("tbody"));
|
||||
j.find("thead, tfoot").remove();j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());j.find("tfoot th, tfoot td").css("width","");n=qa(a,j.find("thead")[0]);for(m=0;m<i.length;m++)o=c[i[m]],n[m].style.width=null!==o.sWidthOrig&&""!==o.sWidthOrig?x(o.sWidthOrig):"",o.sWidthOrig&&f&&h(n[m]).append(h("<div/>").css({width:o.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(m=0;m<i.length;m++)t=i[m],o=c[t],h(Gb(a,t)).clone(!1).append(o.sContentPadding).appendTo(r);h("[name]",
|
||||
j).removeAttr("name");o=h("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(j).appendTo(k);f&&g?j.width(g):f?(j.css("width","auto"),j.removeAttr("width"),j.width()<k.clientWidth&&l&&j.width(k.clientWidth)):e?j.width(k.clientWidth):l&&j.width(l);for(m=e=0;m<i.length;m++)k=h(n[m]),g=k.outerWidth()-k.width(),k=p.bBounding?Math.ceil(n[m].getBoundingClientRect().width):k.outerWidth(),e+=k,c[i[m]].sWidth=x(k-g);b.style.width=x(e);o.remove()}l&&(b.style.width=
|
||||
x(l));if((l||f)&&!a._reszEvt)b=function(){h(D).bind("resize.DT-"+a.sInstance,Oa(function(){Y(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0}function Fb(a,b){if(!a)return 0;var c=h("<div/>").css("width",x(a)).appendTo(b||I.body),d=c[0].offsetWidth;c.remove();return d}function Gb(a,b){var c=Hb(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?h("<td/>").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Hb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=B(a,f,b,"display")+"",c=c.replace($b,
|
||||
""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=f);return e}function x(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function V(a){var b,c,d=[],e=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var n=[];f=function(a){a.length&&!h.isArray(a[0])?n.push(a):h.merge(n,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<n.length;a++){i=n[a][0];f=e[i].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],j=e[g].sType||
|
||||
"string",n[a]._idx===k&&(n[a]._idx=h.inArray(n[a][1],e[g].asSorting)),d.push({src:i,col:g,dir:n[a][1],index:n[a]._idx,type:j,formatter:m.ext.type.order[j+"-pre"]})}return d}function mb(a){var b,c,d=[],e=m.ext.type.order,f=a.aoData,g=0,j,i=a.aiDisplayMaster,h;Ga(a);h=V(a);b=0;for(c=h.length;b<c;b++)j=h[b],j.formatter&&g++,Ib(a,j.col);if("ssp"!=y(a)&&0!==h.length){b=0;for(c=i.length;b<c;b++)d[i[b]]=b;g===h.length?i.sort(function(a,b){var c,e,g,j,i=h.length,k=f[a]._aSortData,m=f[b]._aSortData;for(g=
|
||||
0;g<i;g++)if(j=h[g],c=k[j.col],e=m[j.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===j.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,m=f[a]._aSortData,p=f[b]._aSortData;for(j=0;j<k;j++)if(i=h[j],c=m[i.col],g=p[i.col],i=e[i.type+"-"+i.dir]||e["string-"+i.dir],c=i(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Jb(a){for(var b,c,d=a.aoColumns,e=V(a),a=a.oLanguage.oAria,f=0,g=d.length;f<g;f++){c=d[f];var j=c.asSorting;b=c.sTitle.replace(/<.*?>/g,
|
||||
"");var i=c.nTh;i.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(i.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=j[e[0].index+1]||j[0]):c=j[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);i.setAttribute("aria-label",b)}}function Va(a,b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,
|
||||
G(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);T(a);"function"==typeof d&&d(a)}function Ma(a,b,c,d){var e=a.aoColumns[c];Wa(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Va(a,c,b.shiftKey,d);"ssp"!==y(a)&&C(a,!1)},0)):Va(a,c,b.shiftKey,d))})}
|
||||
function va(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=V(a),e=a.oFeatures,f,g;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++)g=b[e].src,h(G(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;for(f=d.length;e<f;e++)g=d[e].src,h(G(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Ib(a,b){var c=a.aoColumns[b],d=m.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,$(a,b)));for(var f,g=m.ext.type.order[c.sType+"-pre"],j=0,i=a.aoData.length;j<i;j++)if(c=a.aoData[j],
|
||||
c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[j]:B(a,j,b,"sort"),c._aSortData[b]=g?g(f):f}function wa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),search:Ab(a.oPreviousSearch),columns:h.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:Ab(a.aoPreSearchCols[d])}})};u(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,
|
||||
b)}}function Kb(a){var b,c,d=a.aoColumns;if(a.oFeatures.bStateSave){var e=a.fnStateLoadCallback.call(a.oInstance,a);if(e&&e.time&&(b=u(a,"aoStateLoadParams","stateLoadParams",[a,e]),-1===h.inArray(!1,b)&&(b=a.iStateDuration,!(0<b&&e.time<+new Date-1E3*b)&&d.length===e.columns.length))){a.oLoadedState=h.extend(!0,{},e);e.start!==k&&(a._iDisplayStart=e.start,a.iInitDisplayStart=e.start);e.length!==k&&(a._iDisplayLength=e.length);e.order!==k&&(a.aaSorting=[],h.each(e.order,function(b,c){a.aaSorting.push(c[0]>=
|
||||
d.length?[0,c[1]]:c)}));e.search!==k&&h.extend(a.oPreviousSearch,Bb(e.search));b=0;for(c=e.columns.length;b<c;b++){var f=e.columns[b];f.visible!==k&&(d[b].bVisible=f.visible);f.search!==k&&h.extend(a.aoPreSearchCols[b],Bb(f.search))}u(a,"aoStateLoaded","stateLoaded",[a,e])}}}function xa(a){var b=m.settings,a=h.inArray(a,G(b,"nTable"));return-1!==a?b[a]:null}function L(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+
|
||||
d);if(b)D.console&&console.log&&console.log(c);else if(b=m.ext,b=b.sErrMode||b.errMode,a&&u(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function E(a,b,c,d){h.isArray(c)?h.each(c,function(c,d){h.isArray(d)?E(a,b,d[0],d[1]):E(a,b,d)}):(d===k&&(d=c),b[c]!==k&&(a[d]=b[c]))}function Lb(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],h.isPlainObject(d)?(h.isPlainObject(a[e])||(a[e]={}),h.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==
|
||||
e&&h.isArray(d)?d.slice():d);return a}function Wa(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).bind("selectstart.DT",function(){return!1})}function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function u(a,b,c,d){var e=[];b&&(e=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=h.Event(c+".dt"),h(a.nTable).trigger(b,d),e.push(b.result));return e}function Sa(a){var b=a._iDisplayStart,
|
||||
c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Na(a,b){var c=a.renderer,d=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function ya(a,b){var c=[],c=Mb.numbers_length,d=Math.floor(c/2);b<=c?c=W(0,b):a<=d?(c=W(0,c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=W(b-(c-2),b):(c=W(a-d+2,a+d-1),c.push("ellipsis"),
|
||||
c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function db(a){h.each({num:function(b){return za(b,a)},"num-fmt":function(b){return za(b,a,Xa)},"html-num":function(b){return za(b,a,Aa)},"html-num-fmt":function(b){return za(b,a,Aa,Xa)}},function(b,c){v.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(v.type.search[b+a]=v.type.search.html)})}function Nb(a){return function(){var b=[xa(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return m.ext.internal[a].apply(this,
|
||||
b)}}var m=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new r(xa(this[v.iApiIndex])):new r(this)};this.fnAddData=function(a,b){var c=this.api(!0),d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1):
|
||||
(""!==d.sX||""!==d.sY)&&ka(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a,
|
||||
c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),
|
||||
[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return xa(this[v.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=
|
||||
function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();(d===k||d)&&h.draw();return 0};this.fnVersionCheck=v.fnVersionCheck;var b=this,c=a===k,d=this.length;c&&(a={});this.oApi=this.internal=v.internal;for(var e in m.ext.internal)e&&(this[e]=Nb(e));this.each(function(){var e={},e=1<d?Lb(e,a,!0):a,g=0,j,i=this.getAttribute("id"),n=!1,l=m.defaults,q=h(this);if("table"!=
|
||||
this.nodeName.toLowerCase())L(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{eb(l);fb(l.column);K(l,l,!0);K(l.column,l.column,!0);K(l,h.extend(e,q.data()));var t=m.settings,g=0;for(j=t.length;g<j;g++){var p=t[g];if(p.nTable==this||p.nTHead.parentNode==this||p.nTFoot&&p.nTFoot.parentNode==this){g=e.bRetrieve!==k?e.bRetrieve:l.bRetrieve;if(c||g)return p.oInstance;if(e.bDestroy!==k?e.bDestroy:l.bDestroy){p.oInstance.fnDestroy();break}else{L(p,0,"Cannot reinitialise DataTable",3);
|
||||
return}}if(p.sTableId==this.id){t.splice(g,1);break}}if(null===i||""===i)this.id=i="DataTables_Table_"+m.ext._unique++;var o=h.extend(!0,{},m.models.oSettings,{sDestroyWidth:q[0].style.width,sInstance:i,sTableId:i});o.nTable=this;o.oApi=b.internal;o.oInit=e;t.push(o);o.oInstance=1===b.length?b:q.dataTable();eb(e);e.oLanguage&&Da(e.oLanguage);e.aLengthMenu&&!e.iDisplayLength&&(e.iDisplayLength=h.isArray(e.aLengthMenu[0])?e.aLengthMenu[0][0]:e.aLengthMenu[0]);e=Lb(h.extend(!0,{},l),e);E(o.oFeatures,
|
||||
e,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));E(o,e,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols",
|
||||
"aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);E(o.oScroll,e,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);E(o.oLanguage,e,"fnInfoCallback");z(o,"aoDrawCallback",e.fnDrawCallback,"user");z(o,"aoServerParams",e.fnServerParams,"user");z(o,"aoStateSaveParams",e.fnStateSaveParams,"user");z(o,"aoStateLoadParams",e.fnStateLoadParams,"user");z(o,"aoStateLoaded",e.fnStateLoaded,"user");z(o,"aoRowCallback",e.fnRowCallback,
|
||||
"user");z(o,"aoRowCreatedCallback",e.fnCreatedRow,"user");z(o,"aoHeaderCallback",e.fnHeaderCallback,"user");z(o,"aoFooterCallback",e.fnFooterCallback,"user");z(o,"aoInitComplete",e.fnInitComplete,"user");z(o,"aoPreDrawCallback",e.fnPreDrawCallback,"user");o.rowIdFn=Q(e.rowId);gb(o);i=o.oClasses;e.bJQueryUI?(h.extend(i,m.ext.oJUIClasses,e.oClasses),e.sDom===l.sDom&&"lfrtip"===l.sDom&&(o.sDom='<"H"lfr>t<"F"ip>'),o.renderer)?h.isPlainObject(o.renderer)&&!o.renderer.header&&(o.renderer.header="jqueryui"):
|
||||
o.renderer="jqueryui":h.extend(i,m.ext.classes,e.oClasses);q.addClass(i.sTable);o.iInitDisplayStart===k&&(o.iInitDisplayStart=e.iDisplayStart,o._iDisplayStart=e.iDisplayStart);null!==e.iDeferLoading&&(o.bDeferLoading=!0,g=h.isArray(e.iDeferLoading),o._iRecordsDisplay=g?e.iDeferLoading[0]:e.iDeferLoading,o._iRecordsTotal=g?e.iDeferLoading[1]:e.iDeferLoading);var r=o.oLanguage;h.extend(!0,r,e.oLanguage);""!==r.sUrl&&(h.ajax({dataType:"json",url:r.sUrl,success:function(a){Da(a);K(l.oLanguage,a);h.extend(true,
|
||||
r,a);ga(o)},error:function(){ga(o)}}),n=!0);null===e.asStripeClasses&&(o.asStripeClasses=[i.sStripeOdd,i.sStripeEven]);var g=o.asStripeClasses,v=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(g,function(a){return v.hasClass(a)}))&&(h("tbody tr",this).removeClass(g.join(" ")),o.asDestroyStripes=g.slice());t=[];g=this.getElementsByTagName("thead");0!==g.length&&(da(o.aoHeader,g[0]),t=qa(o));if(null===e.aoColumns){p=[];g=0;for(j=t.length;g<j;g++)p.push(null)}else p=e.aoColumns;g=0;for(j=
|
||||
p.length;g<j;g++)Ea(o,t?t[g]:null);ib(o,e.aoColumnDefs,p,function(a,b){ja(o,a,b)});if(v.length){var s=function(a,b){return a.getAttribute("data-"+b)!==null?b:null};h(v[0]).children("th, td").each(function(a,b){var c=o.aoColumns[a];if(c.mData===a){var d=s(b,"sort")||s(b,"order"),e=s(b,"filter")||s(b,"search");if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:k,type:d!==null?a+".@data-"+d:k,filter:e!==null?a+".@data-"+e:k};ja(o,a)}}})}var w=o.oFeatures;e.bStateSave&&(w.bStateSave=
|
||||
!0,Kb(o,e),z(o,"aoDrawCallback",wa,"state_save"));if(e.aaSorting===k){t=o.aaSorting;g=0;for(j=t.length;g<j;g++)t[g][1]=o.aoColumns[g].asSorting[0]}va(o);w.bSort&&z(o,"aoDrawCallback",function(){if(o.bSorted){var a=V(o),b={};h.each(a,function(a,c){b[c.src]=c.dir});u(o,null,"order",[o,a,b]);Jb(o)}});z(o,"aoDrawCallback",function(){(o.bSorted||y(o)==="ssp"||w.bDeferRender)&&va(o)},"sc");g=q.children("caption").each(function(){this._captionSide=q.css("caption-side")});j=q.children("thead");0===j.length&&
|
||||
(j=h("<thead/>").appendTo(this));o.nTHead=j[0];j=q.children("tbody");0===j.length&&(j=h("<tbody/>").appendTo(this));o.nTBody=j[0];j=q.children("tfoot");if(0===j.length&&0<g.length&&(""!==o.oScroll.sX||""!==o.oScroll.sY))j=h("<tfoot/>").appendTo(this);0===j.length||0===j.children().length?q.addClass(i.sNoFooter):0<j.length&&(o.nTFoot=j[0],da(o.aoFooter,o.nTFoot));if(e.aaData)for(g=0;g<e.aaData.length;g++)N(o,e.aaData[g]);else(o.bDeferLoading||"dom"==y(o))&&ma(o,h(o.nTBody).children("tr"));o.aiDisplay=
|
||||
o.aiDisplayMaster.slice();o.bInitialised=!0;!1===n&&ga(o)}});b=null;return this},v,r,p,s,Ya={},Ob=/[\r\n]/g,Aa=/<.*?>/g,ac=/^[\w\+\-]/,bc=/[\w\+\-]$/,cc=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),Xa=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,M=function(a){return!a||!0===a||"-"===a?!0:!1},Pb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Qb=function(a,b){Ya[b]||(Ya[b]=RegExp(Qa(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,
|
||||
"").replace(Ya[b],"."):a},Za=function(a,b,c){var d="string"===typeof a;if(M(a))return!0;b&&d&&(a=Qb(a,b));c&&d&&(a=a.replace(Xa,""));return!isNaN(parseFloat(a))&&isFinite(a)},Rb=function(a,b,c){return M(a)?!0:!(M(a)||"string"===typeof a)?null:Za(a.replace(Aa,""),b,c)?!0:null},G=function(a,b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<f;e++)a[e]&&d.push(a[e][b]);return d},ha=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==k)for(;f<g;f++)a[b[f]][c]&&
|
||||
e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},W=function(a,b){var c=[],d;b===k?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Sb=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},pa=function(a){var b=[],c,d,e=a.length,f,g=0;d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b};m.util={throttle:function(a,b){var c=b!==k?b:200,d,e;return function(){var b=this,g=+new Date,h=arguments;d&&g<d+c?(clearTimeout(e),
|
||||
e=setTimeout(function(){d=k;a.apply(b,h)},c)):(d=g,a.apply(b,h))}},escapeRegex:function(a){return a.replace(cc,"\\$1")}};var A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},ba=/\[.*?\]$/,U=/\(\)$/,Qa=m.util.escapeRegex,ua=h("<div>")[0],Zb=ua.textContent!==k,$b=/<.*?>/g,Oa=m.util.throttle,Tb=[],w=Array.prototype,dc=function(a){var b,c,d=m.settings,e=h.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=h.inArray(a,e),-1!==b?[d[b]]:
|
||||
null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=h(a):a instanceof h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};r=function(a,b){if(!(this instanceof r))return new r(a,b);var c=[],d=function(a){(a=dc(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=pa(c);b&&h.merge(this,b);this.selector={rows:null,cols:null,opts:null};r.extend(this,this,Tb)};
|
||||
m.Api=r;h.extend(r.prototype,{any:function(){return 0!==this.count()},concat:w.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new r(b[a],this[a]):null},filter:function(a){var b=[];if(w.filter)b=w.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new r(this.context,b)},flatten:function(){var a=
|
||||
[];return new r(this.context,a.concat.apply(a,this.toArray()))},join:w.join,indexOf:w.indexOf||function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,d){var e=[],f,g,h,i,n,l=this.context,m,t,p=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);g=0;for(h=l.length;g<h;g++){var o=new r(l[g]);if("table"===b)f=c.call(o,l[g],g),f!==k&&e.push(f);else if("columns"===b||"rows"===b)f=c.call(o,l[g],this[g],g),f!==k&&e.push(f);else if("column"===b||"column-rows"===
|
||||
b||"row"===b||"cell"===b){t=this[g];"column-rows"===b&&(m=Ba(l[g],p.opts));i=0;for(n=t.length;i<n;i++)f=t[i],f="cell"===b?c.call(o,l[g],f.row,f.column,g,i):c.call(o,l[g],f,g,i,m),f!==k&&e.push(f)}}return e.length||d?(a=new r(l,a?e.concat.apply([],e):e),b=a.selector,b.rows=p.rows,b.cols=p.cols,b.opts=p.opts,a):this},lastIndexOf:w.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(w.map)b=w.map.call(this,a,this);else for(var c=
|
||||
0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new r(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:w.pop,push:w.push,reduce:w.reduce||function(a,b){return hb(this,a,b,0,this.length,1)},reduceRight:w.reduceRight||function(a,b){return hb(this,a,b,this.length-1,-1,-1)},reverse:w.reverse,selector:null,shift:w.shift,sort:w.sort,splice:w.splice,toArray:function(){return w.slice.call(this)},to$:function(){return h(this)},toJQuery:function(){return h(this)},
|
||||
unique:function(){return new r(this.context,pa(this))},unshift:w.unshift});r.extend=function(a,b,c){if(c.length&&b&&(b instanceof r||b.__dt_wrapper)){var d,e,f,g=function(a,b,c){return function(){var d=b.apply(a,arguments);r.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<e;d++)f=c[d],b[f.name]="function"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,r.extend(a,b[f.name],f.propExt)}};r.register=p=function(a,b){if(h.isArray(a))for(var c=0,d=a.length;c<
|
||||
d;c++)r.register(a[c],b);else for(var e=a.split("."),f=Tb,g,j,c=0,d=e.length;c<d;c++){g=(j=-1!==e[c].indexOf("()"))?e[c].replace("()",""):e[c];var i;a:{i=0;for(var n=f.length;i<n;i++)if(f[i].name===g){i=f[i];break a}i=null}i||(i={name:g,val:{},methodExt:[],propExt:[]},f.push(i));c===d-1?i.val=b:f=j?i.methodExt:i.propExt}};r.registerPlural=s=function(a,b,c){r.register(a,c);r.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof r?a.length?h.isArray(a[0])?new r(a.context,
|
||||
a[0]):a[0]:k:a})};p("tables()",function(a){var b;if(a){b=r;var c=this.context;if("number"===typeof a)a=[c[a]];else var d=h.map(c,function(a){return a.nTable}),a=h(d).filter(a).map(function(){var a=h.inArray(this,d);return c[a]}).toArray();b=new b(a)}else b=this;return b});p("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new r(b[0]):a});s("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});s("tables().body()","table().body()",
|
||||
function(){return this.iterator("table",function(a){return a.nTBody},1)});s("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});s("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});s("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});p("draw()",function(a){return this.iterator("table",function(b){"page"===
|
||||
a?O(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),T(b,!1===a))})});p("page()",function(a){return a===k?this.page.info().page:this.iterator("table",function(b){Ta(b,a)})});p("page.info()",function(){if(0===this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,
|
||||
serverSide:"ssp"===y(a)}});p("page.len()",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength:k:this.iterator("table",function(b){Ra(b,a)})});var Ub=function(a,b,c){if(c){var d=new r(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==y(a))T(a,b);else{C(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();ra(a,[],function(c){na(a);for(var c=sa(a,c),d=0,e=c.length;d<e;d++)N(a,c[d]);T(a,b);C(a,!1)})}};p("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});
|
||||
p("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});p("ajax.reload()",function(a,b){return this.iterator("table",function(c){Ub(c,!1===b,a)})});p("ajax.url()",function(a){var b=this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){h.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});p("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Ub(c,
|
||||
!1===b,a)})});var $a=function(a,b,c,d,e){var f=[],g,j,i,n,l,m;i=typeof b;if(!b||"string"===i||"function"===i||b.length===k)b=[b];i=0;for(n=b.length;i<n;i++){j=b[i]&&b[i].split?b[i].split(","):[b[i]];l=0;for(m=j.length;l<m;l++)(g=c("string"===typeof j[l]?h.trim(j[l]):j[l]))&&g.length&&(f=f.concat(g))}a=v.selector[a];if(a.length){i=0;for(n=a.length;i<n;i++)f=a[i](d,e,f)}return pa(f)},ab=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:"none",order:"current",
|
||||
page:"all"},a)},bb=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Ba=function(a,b){var c,d,e,f=[],g=a.aiDisplay;c=a.aiDisplayMaster;var j=b.search;d=b.order;e=b.page;if("ssp"==y(a))return"removed"===j?[]:W(0,c.length);if("current"==e){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(g[c])}else if("current"==d||"applied"==d)f="none"==j?c.slice():"applied"==j?g.slice():h.map(c,function(a){return-1===
|
||||
h.inArray(a,g)?a:null});else if("index"==d||"original"==d){c=0;for(d=a.aoData.length;c<d;c++)"none"==j?f.push(c):(e=h.inArray(c,g),(-1===e&&"removed"==j||0<=e&&"applied"==j)&&f.push(c))}return f};p("rows()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=ab(b),c=this.iterator("table",function(c){var e=b;return $a("row",a,function(a){var b=Pb(a);if(b!==null&&!e)return[b];var j=Ba(c,e);if(b!==null&&h.inArray(b,j)!==-1)return[b];if(!a)return j;if(typeof a==="function")return h.map(j,function(b){var e=
|
||||
c.aoData[b];return a(b,e._aData,e.nTr)?b:null});b=Sb(ha(c.aoData,j,"nTr"));if(a.nodeName){if(a._DT_RowIndex!==k)return[a._DT_RowIndex];if(a._DT_CellIndex)return[a._DT_CellIndex.row];b=h(a).closest("*[data-dt-row]");return b.length?[b.data("dt-row")]:[]}if(typeof a==="string"&&a.charAt(0)==="#"){j=c.aIds[a.replace(/^#/,"")];if(j!==k)return[j.idx]}return h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},c,e)},1);c.selector.rows=a;c.selector.opts=b;return c});p("rows().nodes()",function(){return this.iterator("row",
|
||||
function(a,b){return a.aoData[b].nTr||k},1)});p("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return ha(a.aoData,b,"_aData")},1)});s("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData},1)});s("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){ca(b,c,a)})});s("rows().indexes()","row().index()",function(){return this.iterator("row",
|
||||
function(a,b){return b},1)});s("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new r(c,b)});s("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h,i,n,l;e.splice(c,1);g=0;for(h=e.length;g<h;g++)if(i=e[g],l=i.anCells,null!==i.nTr&&(i.nTr._DT_RowIndex=g),null!==l){i=0;for(n=
|
||||
l.length;i<n;i++)l[i]._DT_CellIndex.row=g}oa(b.aiDisplayMaster,c);oa(b.aiDisplay,c);oa(a[d],c,!1);Sa(b);c=b.rowIdFn(f._aData);c!==k&&delete b.aIds[c]});this.iterator("table",function(a){for(var c=0,d=a.aoData.length;c<d;c++)a.aoData[c].idx=c});return this});p("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?h.push(ma(b,c)[0]):h.push(N(b,c));return h},1),c=this.rows(-1);c.pop();h.merge(c,b);
|
||||
return c});p("row()",function(a,b){return bb(this.rows(a,b))});p("row().data()",function(a){var b=this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;b[0].aoData[this[0]]._aData=a;ca(b[0],this[0],"data");return this});p("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});p("row.add()",function(a){a instanceof h&&a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?
|
||||
ma(b,a)[0]:N(b,a)});return this.row(b[0])});var cb=function(a,b){var c=a.context;if(c.length&&(c=c[0].aoData[b!==k?b:a[0]])&&c._details)c._details.remove(),c._detailsShow=k,c._details=k},Vb=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];if(d._details){(d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach();var e=c[0],f=new r(e),g=e.aoData;f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<G(g,"_details").length&&(f.on("draw.dt.DT_details",
|
||||
function(a,b){e===b&&f.rows({page:"current"}).eq(0).each(function(a){a=g[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on("column-visibility.dt.DT_details",function(a,b){if(e===b)for(var c,d=aa(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children("td[colspan]").attr("colspan",d)}),f.on("destroy.dt.DT_details",function(a,b){if(e===b)for(var c=0,d=g.length;c<d;c++)g[c]._details&&cb(f,c)}))}}};p("row().child()",function(a,b){var c=this.context;if(a===k)return c.length&&this.length?
|
||||
c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1===a)cb(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(h.isArray(a)||a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&"tr"===a.nodeName.toLowerCase()?e.push(a):(c=h("<tr><td/></tr>").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=aa(d),e.push(c[0]))};f(a,b);c._details&&c._details.remove();c._details=h(e);c._detailsShow&&c._details.insertAfter(c.nTr)}return this});
|
||||
p(["row().child.show()","row().child().show()"],function(){Vb(this,!0);return this});p(["row().child.hide()","row().child().hide()"],function(){Vb(this,!1);return this});p(["row().child.remove()","row().child().remove()"],function(){cb(this);return this});p("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var ec=/^(.+):(name|visIdx|visible)$/,Wb=function(a,b,c,d,e){for(var c=[],d=0,f=e.length;d<f;d++)c.push(B(a,e[d],b));
|
||||
return c};p("columns()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=ab(b),c=this.iterator("table",function(c){var e=a,f=b,g=c.aoColumns,j=G(g,"sName"),i=G(g,"nTh");return $a("column",e,function(a){var b=Pb(a);if(a==="")return W(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a==="function"){var e=Ba(c,f);return h.map(g,function(b,f){return a(f,Wb(c,f,0,0,e),i[f])?f:null})}var k=typeof a==="string"?a.match(ec):"";if(k)switch(k[2]){case "visIdx":case "visible":b=parseInt(k[1],
|
||||
10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null});return[m[m.length+b]]}return[Z(c,b)];case "name":return h.map(j,function(a,b){return a===k[1]?b:null});default:return[]}if(a.nodeName&&a._DT_CellIndex)return[a._DT_CellIndex.column];b=h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray();if(b.length||!a.nodeName)return b;b=h(a).closest("*[data-dt-column]");return b.length?[b.data("dt-column")]:[]},c,f)},1);c.selector.cols=a;c.selector.opts=b;return c});s("columns().header()",
|
||||
"column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});s("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});s("columns().data()","column().data()",function(){return this.iterator("column-rows",Wb,1)});s("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});s("columns().cache()","column().cache()",
|
||||
function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ha(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});s("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ha(a.aoData,e,"anCells",b)},1)});s("columns().visible()","column().visible()",function(a,b){var c=this.iterator("column",function(b,c){if(a===k)return b.aoColumns[c].bVisible;var f=b.aoColumns,g=f[c],j=b.aoData,i,n,l;if(a!==k&&g.bVisible!==a){if(a){var m=
|
||||
h.inArray(!0,G(f,"bVisible"),c+1);i=0;for(n=j.length;i<n;i++)l=j[i].nTr,f=j[i].anCells,l&&l.insertBefore(f[c],f[m]||null)}else h(G(b.aoData,"anCells",c)).detach();g.bVisible=a;ea(b,b.aoHeader);ea(b,b.aoFooter);wa(b)}});a!==k&&(this.iterator("column",function(c,e){u(c,null,"column-visibility",[c,e,a,b])}),(b===k||b)&&this.columns.adjust());return c});s("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?$(b,c):c},1)});p("columns.adjust()",
|
||||
function(){return this.iterator("table",function(a){Y(a)},1)});p("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return Z(c,b);if("fromData"===a||"toVisible"===a)return $(c,b)}});p("column()",function(a,b){return bb(this.columns(a,b))});p("cells()",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator("table",function(b){var d=a,e=ab(c),f=
|
||||
b.aoData,g=Ba(b,e),j=Sb(ha(f,g,"anCells")),i=h([].concat.apply([],j)),l,n=b.aoColumns.length,m,p,r,u,v,s;return $a("cell",d,function(a){var c=typeof a==="function";if(a===null||a===k||c){m=[];p=0;for(r=g.length;p<r;p++){l=g[p];for(u=0;u<n;u++){v={row:l,column:u};if(c){s=f[l];a(v,B(b,l,u),s.anCells?s.anCells[u]:null)&&m.push(v)}else m.push(v)}}return m}if(h.isPlainObject(a))return[a];c=i.filter(a).map(function(a,b){return{row:b._DT_CellIndex.row,column:b._DT_CellIndex.column}}).toArray();if(c.length||
|
||||
!a.nodeName)return c;s=h(a).closest("*[data-dt-row]");return s.length?[{row:s.data("dt-row"),column:s.data("dt-column")}]:[]},b,e)});var d=this.columns(b,c),e=this.rows(a,c),f,g,j,i,n,l=this.iterator("table",function(a,b){f=[];g=0;for(j=e[b].length;g<j;g++){i=0;for(n=d[b].length;i<n;i++)f.push({row:e[b][g],column:d[b][i]})}return f},1);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});s("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b])&&
|
||||
a.anCells?a.anCells[c]:k},1)});p("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});s("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});s("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return B(b,c,d,a)},1)});s("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,
|
||||
b,c){return{row:b,column:c,columnVisible:$(a,c)}},1)});s("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){ca(b,c,a,d)})});p("cell()",function(a,b,c){return bb(this.cells(a,b,c))});p("cell().data()",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?B(b[0],c[0].row,c[0].column):k;jb(b[0],c[0].row,c[0].column,a);ca(b[0],c[0].row,"data",c[0].column);return this});p("order()",function(a,b){var c=this.context;if(a===k)return 0!==
|
||||
c.length?c[0].aaSorting:k;"number"===typeof a?a=[[a,b]]:a.length&&!h.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting=a.slice()})});p("order.listener()",function(a,b,c){return this.iterator("table",function(d){Ma(d,a,b,c)})});p("order.fixed()",function(a){if(!a){var b=this.context,b=b.length?b[0].aaSortingFixed:k;return h.isArray(b)?{pre:b}:b}return this.iterator("table",function(b){b.aaSortingFixed=h.extend(!0,{},a)})});p(["columns().order()",
|
||||
"column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];h.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});p("search()",function(a,b,c,d){var e=this.context;return a===k?0!==e.length?e[0].oPreviousSearch.sSearch:k:this.iterator("table",function(e){e.oFeatures.bFilter&&fa(e,h.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});s("columns().search()","column().search()",function(a,
|
||||
b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===k)return g[f].sSearch;e.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),fa(e,e.oPreviousSearch,1))})});p("state()",function(){return this.context.length?this.context[0].oSavedState:null});p("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});p("state.loaded()",function(){return this.context.length?
|
||||
this.context[0].oLoadedState:null});p("state.save()",function(){return this.iterator("table",function(a){wa(a)})});m.versionCheck=m.fnVersionCheck=function(a){for(var b=m.version.split("."),a=a.split("."),c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;h.each(m.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?h("table",e.nScrollFoot)[0]:
|
||||
null;if(e.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(m.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable});return b?new r(c):c};m.camelToHungarian=K;p("$()",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){p(b+"()",function(){var a=Array.prototype.slice.call(arguments);a[0].match(/\.dt\b/)||
|
||||
(a[0]+=".dt");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});p("clear()",function(){return this.iterator("table",function(a){na(a)})});p("settings()",function(){return new r(this.context,this.context)});p("init()",function(){var a=this.context;return a.length?a[0].oInit:null});p("data()",function(){return this.iterator("table",function(a){return G(a.aoData,"_aData")}).flatten()});p("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,
|
||||
d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),p;b.bDestroying=!0;u(b,"aoDestroyCallback","destroy",[b]);a||(new r(b)).columns().visible(!0);k.unbind(".DT").find(":not(tbody *)").unbind(".DT");h(D).unbind(".DT-"+b.sInstance);e!=g.parentNode&&(i.children("thead").detach(),i.append(g));j&&e!=j.parentNode&&(i.children("tfoot").detach(),i.append(j));b.aaSorting=[];b.aaSortingFixed=[];va(b);h(l).removeClass(b.asStripeClasses.join(" "));
|
||||
h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);b.bJUI&&(h("th span."+d.sSortIcon+", td span."+d.sSortIcon,g).detach(),h("th, td",g).each(function(){var a=h("div."+d.sSortJUIWrapper,this);h(this).append(a.contents());a.detach()}));f.children().detach();f.append(l);g=a?"remove":"detach";i[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),i.css("width",b.sDestroyWidth).removeClass(d.sTable),(p=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%
|
||||
p])}));c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,1)})});h.each(["column","row","cell"],function(a,b){p(b+"s().every()",function(a){var d=this.selector.opts,e=this;return this.iterator(b,function(f,g,h,i,n){a.call(e[b](g,"cell"===b?h:d,"cell"===b?d:k),g,h,i,n)})})});p("i18n()",function(a,b,c){var d=this.context[0],a=Q(a)(d.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:a._);return a.replace("%d",c)});m.version="1.10.12";m.settings=[];m.models={};m.models.oSearch={bCaseInsensitive:!0,
|
||||
sSearch:"",bRegex:!1,bSmart:!0};m.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,
|
||||
sTitle:null,sType:null,sWidth:null,sWidthOrig:null};m.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,
|
||||
fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===
|
||||
a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",
|
||||
sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},m.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",
|
||||
renderer:null,rowId:"DT_RowId"};X(m.defaults);m.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};X(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,
|
||||
bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],
|
||||
aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,
|
||||
fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=
|
||||
this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};m.ext=v={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},
|
||||
header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(v,{afnFiltering:v.search,aTypes:v.type.detect,ofnSearch:v.type.search,oSort:v.type.order,afnSortData:v.order,aoFeatures:v.feature,oApi:v.internal,oStdClasses:v.classes,oPagination:v.pager});h.extend(m.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",
|
||||
sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",
|
||||
sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var Ca="",Ca="",H=Ca+"ui-state-default",ia=Ca+"css_right ui-icon ui-icon-",Xb=Ca+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";h.extend(m.ext.oJUIClasses,
|
||||
m.ext.classes,{sPageButton:"fg-button ui-button "+H,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:H+" sorting_asc",sSortDesc:H+" sorting_desc",sSortable:H+" sorting",sSortableAsc:H+" sorting_asc_disabled",sSortableDesc:H+" sorting_desc_disabled",sSortableNone:H+" sorting_disabled",sSortJUIAsc:ia+"triangle-1-n",sSortJUIDesc:ia+"triangle-1-s",sSortJUI:ia+"carat-2-n-s",
|
||||
sSortJUIAscAllowed:ia+"carat-1-n",sSortJUIDescAllowed:ia+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+H,sScrollFoot:"dataTables_scrollFoot "+H,sHeaderTH:H,sFooterTH:H,sJUIHeader:Xb+" ui-corner-tl ui-corner-tr",sJUIFooter:Xb+" ui-corner-bl ui-corner-br"});var Mb=m.ext.pager;h.extend(Mb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[ya(a,
|
||||
b)]},simple_numbers:function(a,b){return["previous",ya(a,b),"next"]},full_numbers:function(a,b){return["first","previous",ya(a,b),"next","last"]},_numbers:ya,numbers_length:7});h.extend(!0,m.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,j=a.oLanguage.oPaginate,i=a.oLanguage.oAria.paginate||{},k,l,m=0,p=function(b,d){var o,r,u,s,v=function(b){Ta(a,b.data.action,true)};o=0;for(r=d.length;o<r;o++){s=d[o];if(h.isArray(s)){u=h("<"+(s.DT_el||"div")+"/>").appendTo(b);p(u,s)}else{k=null;
|
||||
l="";switch(s){case "ellipsis":b.append('<span class="ellipsis">…</span>');break;case "first":k=j.sFirst;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "previous":k=j.sPrevious;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "next":k=j.sNext;l=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;case "last":k=j.sLast;l=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;default:k=s+1;l=e===s?g.sPageButtonActive:""}if(k!==null){u=h("<a>",{"class":g.sPageButton+" "+l,"aria-controls":a.sTableId,"aria-label":i[s],
|
||||
"data-dt-idx":m,tabindex:a.iTabIndex,id:c===0&&typeof s==="string"?a.sTableId+"_"+s:null}).html(k).appendTo(b);Wa(u,{action:s},v);m++}}}},r;try{r=h(b).find(I.activeElement).data("dt-idx")}catch(o){}p(h(b).empty(),d);r&&h(b).find("[data-dt-idx="+r+"]").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&(!ac.test(a)||!bc.test(a)))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||M(a)?"date":
|
||||
null},function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c,!0)?"html-num-fmt"+c:null},function(a){return M(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(m.ext.type.search,{html:function(a){return M(a)?a:"string"===typeof a?a.replace(Ob," ").replace(Aa,""):""},string:function(a){return M(a)?a:"string"===typeof a?a.replace(Ob,
|
||||
" "):a}});var za=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Qb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(v.type.order,{"date-pre":function(a){return Date.parse(a)||0},"html-pre":function(a){return M(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return M(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,
|
||||
b){return a<b?1:a>b?-1:0}});db("");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,b,c,d){h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on("order.dt.DT",function(e,
|
||||
f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]=="asc"?d.sSortJUIAsc:h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});var Yb=function(a){return"string"===typeof a?a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):a};m.render={number:function(a,
|
||||
b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return Yb(f);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}},text:function(){return{display:Yb}}};h.extend(m.ext.internal,{_fnExternApiFunc:Nb,_fnBuildAjax:ra,_fnAjaxUpdate:lb,_fnAjaxParameters:ub,_fnAjaxUpdateDraw:vb,_fnAjaxDataSrc:sa,_fnAddColumn:Ea,_fnColumnOptions:ja,
|
||||
_fnAdjustColumnSizing:Y,_fnVisibleToColumnIndex:Z,_fnColumnIndexToVisible:$,_fnVisbleColumns:aa,_fnGetColumns:la,_fnColumnTypes:Ga,_fnApplyColumnDefs:ib,_fnHungarianMap:X,_fnCamelToHungarian:K,_fnLanguageCompat:Da,_fnBrowserDetect:gb,_fnAddData:N,_fnAddTr:ma,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:B,_fnSetCellData:jb,_fnSplitObjNotation:Ja,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:R,
|
||||
_fnGetDataMaster:Ka,_fnClearTable:na,_fnDeleteIndex:oa,_fnInvalidate:ca,_fnGetRowElements:Ia,_fnCreateTr:Ha,_fnBuildHead:kb,_fnDrawHead:ea,_fnDraw:O,_fnReDraw:T,_fnAddOptionsHtml:nb,_fnDetectHeader:da,_fnGetUniqueThs:qa,_fnFeatureHtmlFilter:pb,_fnFilterComplete:fa,_fnFilterCustom:yb,_fnFilterColumn:xb,_fnFilter:wb,_fnFilterCreateSearch:Pa,_fnEscapeRegex:Qa,_fnFilterData:zb,_fnFeatureHtmlInfo:sb,_fnUpdateInfo:Cb,_fnInfoMacros:Db,_fnInitialise:ga,_fnInitComplete:ta,_fnLengthChange:Ra,_fnFeatureHtmlLength:ob,
|
||||
_fnFeatureHtmlPaginate:tb,_fnPageChange:Ta,_fnFeatureHtmlProcessing:qb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:rb,_fnScrollDraw:ka,_fnApplyToChildren:J,_fnCalculateColumnWidths:Fa,_fnThrottle:Oa,_fnConvertToWidth:Fb,_fnGetWidestNode:Gb,_fnGetMaxLenString:Hb,_fnStringToCss:x,_fnSortFlatten:V,_fnSort:mb,_fnSortAria:Jb,_fnSortListener:Va,_fnSortAttachListener:Ma,_fnSortingClasses:va,_fnSortData:Ib,_fnSaveState:wa,_fnLoadState:Kb,_fnSettingsFromNode:xa,_fnLog:L,_fnMap:E,_fnBindAction:Wa,_fnCallbackReg:z,
|
||||
_fnCallbackFire:u,_fnLengthOverflow:Sa,_fnRenderer:Na,_fnDataSource:y,_fnRowAttributes:La,_fnCalculateEnd:function(){}});h.fn.dataTable=m;m.$=h;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable});
|
||||
@@ -1,26 +0,0 @@
|
||||
/*!
|
||||
Responsive 2.1.0
|
||||
2014-2016 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(l){return c(l,window,document)}):"object"===typeof exports?module.exports=function(l,k){l||(l=window);if(!k||!k.fn.dataTable)k=require("datatables.net")(l,k).$;return c(k,l,l.document)}:c(jQuery,window,document)})(function(c,l,k,p){var m=c.fn.dataTable,j=function(a,b){if(!m.versionCheck||!m.versionCheck("1.10.3"))throw"DataTables Responsive requires DataTables 1.10.3 or newer";this.s={dt:new m.Api(a),columns:[],
|
||||
current:[]};this.s.dt.settings()[0].responsive||(b&&"string"===typeof b.details?b.details={type:b.details}:b&&!1===b.details?b.details={type:!1}:b&&!0===b.details&&(b.details={type:"inline"}),this.c=c.extend(!0,{},j.defaults,m.defaults.responsive,b),a.responsive=this,this._constructor())};c.extend(j.prototype,{_constructor:function(){var a=this,b=this.s.dt,d=b.settings()[0],e=c(l).width();b.settings()[0]._responsive=this;c(l).on("resize.dtr orientationchange.dtr",m.util.throttle(function(){var b=
|
||||
c(l).width();b!==e&&(a._resize(),e=b)}));d.oApi._fnCallbackReg(d,"aoRowCreatedCallback",function(e){-1!==c.inArray(!1,a.s.current)&&c("td, th",e).each(function(e){e=b.column.index("toData",e);!1===a.s.current[e]&&c(this).css("display","none")})});b.on("destroy.dtr",function(){b.off(".dtr");c(b.table().body()).off(".dtr");c(l).off("resize.dtr orientationchange.dtr");c.each(a.s.current,function(b,e){!1===e&&a._setColumnVis(b,!0)})});this.c.breakpoints.sort(function(a,b){return a.width<b.width?1:a.width>
|
||||
b.width?-1:0});this._classLogic();this._resizeAuto();d=this.c.details;!1!==d.type&&(a._detailsInit(),b.on("column-visibility.dtr",function(){a._classLogic();a._resizeAuto();a._resize()}),b.on("draw.dtr",function(){a._redrawChildren()}),c(b.table().node()).addClass("dtr-"+d.type));b.on("column-reorder.dtr",function(){a._classLogic();a._resizeAuto();a._resize()});b.on("column-sizing.dtr",function(){a._resizeAuto();a._resize()});b.on("init.dtr",function(){a._resizeAuto();a._resize();c.inArray(false,
|
||||
a.s.current)&&b.columns.adjust()});this._resize()},_columnsVisiblity:function(a){var b=this.s.dt,d=this.s.columns,e,f,g=d.map(function(a,b){return{columnIdx:b,priority:a.priority}}).sort(function(a,b){return a.priority!==b.priority?a.priority-b.priority:a.columnIdx-b.columnIdx}),h=c.map(d,function(b){return b.auto&&null===b.minWidth?!1:!0===b.auto?"-":-1!==c.inArray(a,b.includeIn)}),n=0;e=0;for(f=h.length;e<f;e++)!0===h[e]&&(n+=d[e].minWidth);e=b.settings()[0].oScroll;e=e.sY||e.sX?e.iBarWidth:0;b=
|
||||
b.table().container().offsetWidth-e-n;e=0;for(f=h.length;e<f;e++)d[e].control&&(b-=d[e].minWidth);n=!1;e=0;for(f=g.length;e<f;e++){var i=g[e].columnIdx;"-"===h[i]&&(!d[i].control&&d[i].minWidth)&&(n||0>b-d[i].minWidth?(n=!0,h[i]=!1):h[i]=!0,b-=d[i].minWidth)}g=!1;e=0;for(f=d.length;e<f;e++)if(!d[e].control&&!d[e].never&&!h[e]){g=!0;break}e=0;for(f=d.length;e<f;e++)d[e].control&&(h[e]=g);-1===c.inArray(!0,h)&&(h[0]=!0);return h},_classLogic:function(){var a=this,b=this.c.breakpoints,d=this.s.dt,e=
|
||||
d.columns().eq(0).map(function(a){var b=this.column(a),e=b.header().className,a=d.settings()[0].aoColumns[a].responsivePriority;a===p&&(b=c(b.header()).data("priority"),a=b!==p?1*b:1E4);return{className:e,includeIn:[],auto:!1,control:!1,never:e.match(/\bnever\b/)?!0:!1,priority:a}}),f=function(a,b){var d=e[a].includeIn;-1===c.inArray(b,d)&&d.push(b)},g=function(c,d,i,g){if(i)if("max-"===i){g=a._find(d).width;d=0;for(i=b.length;d<i;d++)b[d].width<=g&&f(c,b[d].name)}else if("min-"===i){g=a._find(d).width;
|
||||
d=0;for(i=b.length;d<i;d++)b[d].width>=g&&f(c,b[d].name)}else{if("not-"===i){d=0;for(i=b.length;d<i;d++)-1===b[d].name.indexOf(g)&&f(c,b[d].name)}}else e[c].includeIn.push(d)};e.each(function(a,e){for(var d=a.className.split(" "),f=!1,j=0,l=d.length;j<l;j++){var k=c.trim(d[j]);if("all"===k){f=!0;a.includeIn=c.map(b,function(a){return a.name});return}if("none"===k||a.never){f=!0;return}if("control"===k){f=!0;a.control=!0;return}c.each(b,function(a,b){var d=b.name.split("-"),c=k.match(RegExp("(min\\-|max\\-|not\\-)?("+
|
||||
d[0]+")(\\-[_a-zA-Z0-9])?"));c&&(f=!0,c[2]===d[0]&&c[3]==="-"+d[1]?g(e,b.name,c[1],c[2]+c[3]):c[2]===d[0]&&!c[3]&&g(e,b.name,c[1],c[2]))})}f||(a.auto=!0)});this.s.columns=e},_detailsDisplay:function(a,b){var d=this,e=this.s.dt,f=this.c.details;if(f&&!1!==f.type){var g=f.display(a,b,function(){return f.renderer(e,a[0],d._detailsObj(a[0]))});(!0===g||!1===g)&&c(e.table().node()).triggerHandler("responsive-display.dt",[e,a,g,b])}},_detailsInit:function(){var a=this,b=this.s.dt,d=this.c.details;"inline"===
|
||||
d.type&&(d.target="td:first-child, th:first-child");b.on("draw.dtr",function(){a._tabIndexes()});a._tabIndexes();c(b.table().body()).on("keyup.dtr","td, th",function(a){a.keyCode===13&&c(this).data("dtr-keyboard")&&c(this).click()});var e=d.target;c(b.table().body()).on("click.dtr mousedown.dtr mouseup.dtr","string"===typeof e?e:"td, th",function(d){if(c(b.table().node()).hasClass("collapsed")&&b.row(c(this).closest("tr")).length){if(typeof e==="number"){var g=e<0?b.columns().eq(0).length+e:e;if(b.cell(this).index().column!==
|
||||
g)return}g=b.row(c(this).closest("tr"));d.type==="click"?a._detailsDisplay(g,false):d.type==="mousedown"?c(this).css("outline","none"):d.type==="mouseup"&&c(this).blur().css("outline","")}})},_detailsObj:function(a){var b=this,d=this.s.dt;return c.map(this.s.columns,function(e,c){if(!e.never&&!e.control)return{title:d.settings()[0].aoColumns[c].sTitle,data:d.cell(a,c).render(b.c.orthogonal),hidden:d.column(c).visible()&&!b.s.current[c],columnIndex:c,rowIndex:a}})},_find:function(a){for(var b=this.c.breakpoints,
|
||||
d=0,c=b.length;d<c;d++)if(b[d].name===a)return b[d]},_redrawChildren:function(){var a=this,b=this.s.dt;b.rows({page:"current"}).iterator("row",function(c,e){b.row(e);a._detailsDisplay(b.row(e),!0)})},_resize:function(){var a=this,b=this.s.dt,d=c(l).width(),e=this.c.breakpoints,f=e[0].name,g=this.s.columns,h,j=this.s.current.slice();for(h=e.length-1;0<=h;h--)if(d<=e[h].width){f=e[h].name;break}var i=this._columnsVisiblity(f);this.s.current=i;e=!1;h=0;for(d=g.length;h<d;h++)if(!1===i[h]&&!g[h].never&&
|
||||
!g[h].control){e=!0;break}c(b.table().node()).toggleClass("collapsed",e);var k=!1;b.columns().eq(0).each(function(b,c){i[c]!==j[c]&&(k=!0,a._setColumnVis(b,i[c]))});k&&(this._redrawChildren(),c(b.table().node()).trigger("responsive-resize.dt",[b,this.s.current]))},_resizeAuto:function(){var a=this.s.dt,b=this.s.columns;if(this.c.auto&&-1!==c.inArray(!0,c.map(b,function(a){return a.auto}))){a.table().node();var d=a.table().node().cloneNode(!1),e=c(a.table().header().cloneNode(!1)).appendTo(d),f=c(a.table().body()).clone(!1,
|
||||
!1).empty().appendTo(d),g=a.columns().header().filter(function(b){return a.column(b).visible()}).to$().clone(!1).css("display","table-cell");c(f).append(c(a.rows({page:"current"}).nodes()).clone(!1)).find("th, td").css("display","");if(f=a.table().footer()){var f=c(f.cloneNode(!1)).appendTo(d),h=a.columns().footer().filter(function(b){return a.column(b).visible()}).to$().clone(!1).css("display","table-cell");c("<tr/>").append(h).appendTo(f)}c("<tr/>").append(g).appendTo(e);"inline"===this.c.details.type&&
|
||||
c(d).addClass("dtr-inline collapsed");c(d).find("[name]").removeAttr("name");d=c("<div/>").css({width:1,height:1,overflow:"hidden"}).append(d);d.insertBefore(a.table().node());g.each(function(c){c=a.column.index("fromVisible",c);b[c].minWidth=this.offsetWidth||0});d.remove()}},_setColumnVis:function(a,b){var d=this.s.dt,e=b?"":"none";c(d.column(a).header()).css("display",e);c(d.column(a).footer()).css("display",e);d.column(a).nodes().to$().css("display",e)},_tabIndexes:function(){var a=this.s.dt,
|
||||
b=a.cells({page:"current"}).nodes().to$(),d=a.settings()[0],e=this.c.details.target;b.filter("[data-dtr-keyboard]").removeData("[data-dtr-keyboard]");c("number"===typeof e?":eq("+e+")":e,a.rows({page:"current"}).nodes()).attr("tabIndex",d.iTabIndex).data("dtr-keyboard",1)}});j.breakpoints=[{name:"desktop",width:Infinity},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}];j.display={childRow:function(a,b,d){if(b){if(c(a.node()).hasClass("parent"))return a.child(d(),
|
||||
"child").show(),!0}else{if(a.child.isShown())return a.child(!1),c(a.node()).removeClass("parent"),!1;a.child(d(),"child").show();c(a.node()).addClass("parent");return!0}},childRowImmediate:function(a,b,d){if(!b&&a.child.isShown()||!a.responsive.hasHidden())return a.child(!1),c(a.node()).removeClass("parent"),!1;a.child(d(),"child").show();c(a.node()).addClass("parent");return!0},modal:function(a){return function(b,d,e){if(d)c("div.dtr-modal-content").empty().append(e());else{var f=function(){g.remove();
|
||||
c(k).off("keypress.dtr")},g=c('<div class="dtr-modal"/>').append(c('<div class="dtr-modal-display"/>').append(c('<div class="dtr-modal-content"/>').append(e())).append(c('<div class="dtr-modal-close">×</div>').click(function(){f()}))).append(c('<div class="dtr-modal-background"/>').click(function(){f()})).appendTo("body");c(k).on("keyup.dtr",function(a){27===a.keyCode&&(a.stopPropagation(),f())})}a&&a.header&&c("div.dtr-modal-content").prepend("<h2>"+a.header(b)+"</h2>")}}};j.renderer={listHidden:function(){return function(a,
|
||||
b,d){return(a=c.map(d,function(a){return a.hidden?'<li data-dtr-index="'+a.columnIndex+'" data-dt-row="'+a.rowIndex+'" data-dt-column="'+a.columnIndex+'"><span class="dtr-title">'+a.title+'</span> <span class="dtr-data">'+a.data+"</span></li>":""}).join(""))?c('<ul data-dtr-index="'+b+'"/>').append(a):!1}},tableAll:function(a){a=c.extend({tableClass:""},a);return function(b,d,e){b=c.map(e,function(a){return'<tr data-dt-row="'+a.rowIndex+'" data-dt-column="'+a.columnIndex+'"><td>'+a.title+":</td> <td>"+
|
||||
a.data+"</td></tr>"}).join("");return c('<table class="'+a.tableClass+'" width="100%"/>').append(b)}}};j.defaults={breakpoints:j.breakpoints,auto:!0,details:{display:j.display.childRow,renderer:j.renderer.listHidden(),target:0,type:"inline"},orthogonal:"display"};var o=c.fn.dataTable.Api;o.register("responsive()",function(){return this});o.register("responsive.index()",function(a){a=c(a);return{column:a.data("dtr-index"),row:a.parent().data("dtr-index")}});o.register("responsive.rebuild()",function(){return this.iterator("table",
|
||||
function(a){a._responsive&&a._responsive._classLogic()})});o.register("responsive.recalc()",function(){return this.iterator("table",function(a){a._responsive&&(a._responsive._resizeAuto(),a._responsive._resize())})});o.register("responsive.hasHidden()",function(){var a=this.context[0];return a._responsive?-1!==c.inArray(!1,a._responsive.s.current):!1});j.version="2.1.0";c.fn.dataTable.Responsive=j;c.fn.DataTable.Responsive=j;c(k).on("preInit.dt.dtr",function(a,b){if("dt"===a.namespace&&(c(b.nTable).hasClass("responsive")||
|
||||
c(b.nTable).hasClass("dt-responsive")||b.oInit.responsive||m.defaults.responsive)){var d=b.oInit.responsive;!1!==d&&new j(b,c.isPlainObject(d)?d:{})}});return j});
|
||||
@@ -1,26 +0,0 @@
|
||||
/*!
|
||||
Select for DataTables 1.2.0
|
||||
2015-2016 SpryMedia Ltd - datatables.net/license/mit
|
||||
*/
|
||||
(function(e){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(i){return e(i,window,document)}):"object"===typeof exports?module.exports=function(i,l){i||(i=window);if(!l||!l.fn.dataTable)l=require("datatables.net")(i,l).$;return e(l,i,i.document)}:e(jQuery,window,document)})(function(e,i,l,h){function t(b,a,c){var d;d=function(c,a){if(c>a)var d=a,a=c,c=d;var f=!1;return b.columns(":visible").indexes().filter(function(b){b===c&&(f=!0);return b===a?(f=!1,!0):f})};var f=
|
||||
function(c,a){var d=b.rows({search:"applied"}).indexes();if(d.indexOf(c)>d.indexOf(a))var f=a,a=c,c=f;var e=!1;return d.filter(function(b){b===c&&(e=!0);return b===a?(e=!1,!0):e})};!b.cells({selected:!0}).any()&&!c?(d=d(0,a.column),c=f(0,a.row)):(d=d(c.column,a.column),c=f(c.row,a.row));c=b.cells(c,d).flatten();b.cells(a,{selected:!0}).any()?b.cells(c).deselect():b.cells(c).select()}function r(b){var a=b.settings()[0]._select.selector;e(b.table().body()).off("mousedown.dtSelect",a).off("mouseup.dtSelect",
|
||||
a).off("click.dtSelect",a);e("body").off("click.dtSelect")}function v(b){var a=e(b.table().body()),c=b.settings()[0],d=c._select.selector;a.on("mousedown.dtSelect",d,function(c){if(c.shiftKey||c.metaKey||c.ctrlKey)a.css("-moz-user-select","none").one("selectstart.dtSelect",d,function(){return!1})}).on("mouseup.dtSelect",d,function(){a.css("-moz-user-select","")}).on("click.dtSelect",d,function(c){var a=b.select.items();if(!i.getSelection||!i.getSelection().toString()){var d=b.settings()[0];if(e(c.target).closest("div.dataTables_wrapper")[0]==
|
||||
b.table().container()){var g=b.cell(e(c.target).closest("td, th"));if(g.any()){var h=e.Event("user-select.dt");k(b,h,[a,g,c]);h.isDefaultPrevented()||(h=g.index(),"row"===a?(a=h.row,s(c,b,d,"row",a)):"column"===a?(a=g.index().column,s(c,b,d,"column",a)):"cell"===a&&(a=g.index(),s(c,b,d,"cell",a)),d._select_lastCell=h)}}}});e("body").on("click.dtSelect",function(a){c._select.blurable&&!e(a.target).parents().filter(b.table().container()).length&&(e(a.target).parents("div.DTE").length||p(c,!0))})}function k(b,
|
||||
a,c,d){if(!d||b.flatten().length)"string"===typeof a&&(a+=".dt"),c.unshift(b),e(b.table().node()).triggerHandler(a,c)}function w(b){var a=b.settings()[0];if(a._select.info&&a.aanFeatures.i){var c=e('<span class="select-info"/>'),d=function(a,d){c.append(e('<span class="select-item"/>').append(b.i18n("select."+a+"s",{_:"%d "+a+"s selected","0":"",1:"1 "+a+" selected"},d)))};d("row",b.rows({selected:!0}).flatten().length);d("column",b.columns({selected:!0}).flatten().length);d("cell",b.cells({selected:!0}).flatten().length);
|
||||
e.each(a.aanFeatures.i,function(a,b){var b=e(b),d=b.children("span.select-info");d.length&&d.remove();""!==c.text()&&b.append(c)})}}function x(b,a,c,d){var f=b[a+"s"]({search:"applied"}).indexes(),d=e.inArray(d,f),m=e.inArray(c,f);if(!b[a+"s"]({selected:!0}).any()&&-1===d)f.splice(e.inArray(c,f)+1,f.length);else{if(d>m)var j=m,m=d,d=j;f.splice(m+1,f.length);f.splice(0,d)}b[a](c,{selected:!0}).any()?(f.splice(e.inArray(c,f),1),b[a+"s"](f).deselect()):b[a+"s"](f).select()}function p(b,a){if(a||"single"===
|
||||
b._select.style){var c=new g.Api(b);c.rows({selected:!0}).deselect();c.columns({selected:!0}).deselect();c.cells({selected:!0}).deselect()}}function s(b,a,c,d,f){var e=a.select.style(),j=a[d](f,{selected:!0}).any();"os"===e?b.ctrlKey||b.metaKey?a[d](f).select(!j):b.shiftKey?"cell"===d?t(a,f,c._select_lastCell||null):x(a,d,f,c._select_lastCell?c._select_lastCell[d]:null):(b=a[d+"s"]({selected:!0}),j&&1===b.flatten().length?a[d](f).deselect():(b.deselect(),a[d](f).select())):"multi+shift"==e?b.shiftKey?
|
||||
"cell"===d?t(a,f,c._select_lastCell||null):x(a,d,f,c._select_lastCell?c._select_lastCell[d]:null):a[d](f).select(!j):a[d](f).select(!j)}function q(b,a){return function(c){return c.i18n("buttons."+b,a)}}var g=e.fn.dataTable;g.select={};g.select.version="1.2.0";g.select.init=function(b){var a=b.settings()[0],c=a.oInit.select,d=g.defaults.select,c=c===h?d:c,d="row",f="api",m=!1,j=!0,u="td, th",i="selected";a._select={};if(!0===c)f="os";else if("string"===typeof c)f=c;else if(e.isPlainObject(c)&&(c.blurable!==
|
||||
h&&(m=c.blurable),c.info!==h&&(j=c.info),c.items!==h&&(d=c.items),c.style!==h&&(f=c.style),c.selector!==h&&(u=c.selector),c.className!==h))i=c.className;b.select.selector(u);b.select.items(d);b.select.style(f);b.select.blurable(m);b.select.info(j);a._select.className=i;e.fn.dataTable.ext.order["select-checkbox"]=function(a,c){return this.api().column(c,{order:"index"}).nodes().map(function(c){return"row"===a._select.items?e(c).parent().hasClass(a._select.className):"cell"===a._select.items?e(c).hasClass(a._select.className):
|
||||
!1})};e(b.table().node()).hasClass("selectable")&&b.select.style("os")};e.each([{type:"row",prop:"aoData"},{type:"column",prop:"aoColumns"}],function(b,a){g.ext.selector[a.type].push(function(c,b,f){var b=b.selected,e,j=[];if(b===h)return f;for(var g=0,i=f.length;g<i;g++)e=c[a.prop][f[g]],(!0===b&&!0===e._select_selected||!1===b&&!e._select_selected)&&j.push(f[g]);return j})});g.ext.selector.cell.push(function(b,a,c){var a=a.selected,d,f=[];if(a===h)return c;for(var e=0,g=c.length;e<g;e++)d=b.aoData[c[e].row],
|
||||
(!0===a&&d._selected_cells&&!0===d._selected_cells[c[e].column]||!1===a&&(!d._selected_cells||!d._selected_cells[c[e].column]))&&f.push(c[e]);return f});var n=g.Api.register,o=g.Api.registerPlural;n("select()",function(){return this.iterator("table",function(b){g.select.init(new g.Api(b))})});n("select.blurable()",function(b){return b===h?this.context[0]._select.blurable:this.iterator("table",function(a){a._select.blurable=b})});n("select.info()",function(b){return w===h?this.context[0]._select.info:
|
||||
this.iterator("table",function(a){a._select.info=b})});n("select.items()",function(b){return b===h?this.context[0]._select.items:this.iterator("table",function(a){a._select.items=b;k(new g.Api(a),"selectItems",[b])})});n("select.style()",function(b){return b===h?this.context[0]._select.style:this.iterator("table",function(a){a._select.style=b;if(!a._select_init){var c=new g.Api(a);a.aoRowCreatedCallback.push({fn:function(c,b,d){b=a.aoData[d];b._select_selected&&e(c).addClass(a._select.className);
|
||||
c=0;for(d=a.aoColumns.length;c<d;c++)(a.aoColumns[c]._select_selected||b._selected_cells&&b._selected_cells[c])&&e(b.anCells[c]).addClass(a._select.className)},sName:"select-deferRender"});c.on("preXhr.dt.dtSelect",function(){var a=c.rows({selected:!0}).ids(!0).filter(function(c){return c!==h}),b=c.cells({selected:!0}).eq(0).map(function(a){var b=c.row(a.row).id(!0);return b?{row:b,column:a.column}:h}).filter(function(c){return c!==h});c.one("draw.dt.dtSelect",function(){c.rows(a).select();b.any()&&
|
||||
b.each(function(a){c.cells(a.row,a.column).select()})})});c.on("draw.dtSelect.dt select.dtSelect.dt deselect.dtSelect.dt info.dt",function(){w(c)});c.on("destroy.dtSelect",function(){r(c);c.off(".dtSelect")})}var d=new g.Api(a);r(d);"api"!==b&&v(d);k(new g.Api(a),"selectStyle",[b])})});n("select.selector()",function(b){return b===h?this.context[0]._select.selector:this.iterator("table",function(a){r(new g.Api(a));a._select.selector=b;"api"!==a._select.style&&v(new g.Api(a))})});o("rows().select()",
|
||||
"row().select()",function(b){var a=this;if(!1===b)return this.deselect();this.iterator("row",function(c,a){p(c);c.aoData[a]._select_selected=!0;e(c.aoData[a].nTr).addClass(c._select.className)});this.iterator("table",function(c,b){k(a,"select",["row",a[b]],!0)});return this});o("columns().select()","column().select()",function(b){var a=this;if(!1===b)return this.deselect();this.iterator("column",function(a,b){p(a);a.aoColumns[b]._select_selected=!0;var f=(new g.Api(a)).column(b);e(f.header()).addClass(a._select.className);
|
||||
e(f.footer()).addClass(a._select.className);f.nodes().to$().addClass(a._select.className)});this.iterator("table",function(c,b){k(a,"select",["column",a[b]],!0)});return this});o("cells().select()","cell().select()",function(b){var a=this;if(!1===b)return this.deselect();this.iterator("cell",function(a,b,f){p(a);b=a.aoData[b];b._selected_cells===h&&(b._selected_cells=[]);b._selected_cells[f]=!0;b.anCells&&e(b.anCells[f]).addClass(a._select.className)});this.iterator("table",function(b,d){k(a,"select",
|
||||
["cell",a[d]],!0)});return this});o("rows().deselect()","row().deselect()",function(){var b=this;this.iterator("row",function(a,b){a.aoData[b]._select_selected=!1;e(a.aoData[b].nTr).removeClass(a._select.className)});this.iterator("table",function(a,c){k(b,"deselect",["row",b[c]],!0)});return this});o("columns().deselect()","column().deselect()",function(){var b=this;this.iterator("column",function(a,b){a.aoColumns[b]._select_selected=!1;var d=new g.Api(a),f=d.column(b);e(f.header()).removeClass(a._select.className);
|
||||
e(f.footer()).removeClass(a._select.className);d.cells(null,b).indexes().each(function(b){var c=a.aoData[b.row],d=c._selected_cells;c.anCells&&(!d||!d[b.column])&&e(c.anCells[b.column]).removeClass(a._select.className)})});this.iterator("table",function(a,c){k(b,"deselect",["column",b[c]],!0)});return this});o("cells().deselect()","cell().deselect()",function(){var b=this;this.iterator("cell",function(a,b,d){b=a.aoData[b];b._selected_cells[d]=!1;b.anCells&&!a.aoColumns[d]._select_selected&&e(b.anCells[d]).removeClass(a._select.className)});
|
||||
this.iterator("table",function(a,c){k(b,"deselect",["cell",b[c]],!0)});return this});e.extend(g.ext.buttons,{selected:{text:q("selected","Selected"),className:"buttons-selected",init:function(b){var a=this;b.on("draw.dt.DT select.dt.DT deselect.dt.DT",function(){var b=a.rows({selected:!0}).any()||a.columns({selected:!0}).any()||a.cells({selected:!0}).any();a.enable(b)});this.disable()}},selectedSingle:{text:q("selectedSingle","Selected single"),className:"buttons-selected-single",init:function(b){var a=
|
||||
this;b.on("draw.dt.DT select.dt.DT deselect.dt.DT",function(){var c=b.rows({selected:!0}).flatten().length+b.columns({selected:!0}).flatten().length+b.cells({selected:!0}).flatten().length;a.enable(1===c)});this.disable()}},selectAll:{text:q("selectAll","Select all"),className:"buttons-select-all",action:function(){this[this.select.items()+"s"]().select()}},selectNone:{text:q("selectNone","Deselect all"),className:"buttons-select-none",action:function(){p(this.settings()[0],!0)},init:function(b){var a=
|
||||
this;b.on("draw.dt.DT select.dt.DT deselect.dt.DT",function(){var c=b.rows({selected:!0}).flatten().length+b.columns({selected:!0}).flatten().length+b.cells({selected:!0}).flatten().length;a.enable(0<c)});this.disable()}}});e.each(["Row","Column","Cell"],function(b,a){var c=a.toLowerCase();g.ext.buttons["select"+a+"s"]={text:q("select"+a+"s","Select "+c+"s"),className:"buttons-select-"+c+"s",action:function(){this.select.items(c)},init:function(a){var b=this;a.on("selectItems.dt.DT",function(a,d,
|
||||
e){b.active(e===c)})}}});e(l).on("preInit.dt.dtSelect",function(b,a){"dt"===b.namespace&&g.select.init(new g.Api(a))});return g.select});
|
||||
@@ -1,350 +0,0 @@
|
||||
;(function() {
|
||||
|
||||
var root = this;
|
||||
var Farahey;
|
||||
if (typeof exports !== 'undefined') {
|
||||
Farahey = exports;
|
||||
} else {
|
||||
Farahey = root.Farahey = {};
|
||||
}
|
||||
|
||||
var findInsertionPoint = function(sortedArr, val, comparator) {
|
||||
var low = 0, high = sortedArr.length;
|
||||
var mid = -1, c = 0;
|
||||
while(low < high) {
|
||||
mid = parseInt((low + high)/2);
|
||||
c = comparator(sortedArr[mid], val);
|
||||
if(c < 0) {
|
||||
low = mid + 1;
|
||||
}else if(c > 0) {
|
||||
high = mid;
|
||||
}else {
|
||||
return mid;
|
||||
}
|
||||
}
|
||||
return low;
|
||||
},
|
||||
geomSupport = typeof jsPlumbGeom !== "undefined" ? jsPlumbGeom : Biltong,
|
||||
insertSorted = function(array, value, comparator) {
|
||||
var ip = findInsertionPoint(array, value, comparator);
|
||||
array.splice(ip, 0, value);
|
||||
},
|
||||
distanceFromOriginComparator = function(r1, r2, origin) {
|
||||
var d1 = geomSupport.lineLength(origin, [ r1.x + (r1.w / 2), r1.y + (r1.h / 2)]),
|
||||
d2 = geomSupport.lineLength(origin, [ r2.x + (r2.w / 2), r2.y + (r2.h / 2)]);
|
||||
|
||||
return d1 < d2 ? -1 : d1 == d2 ? 0 : 1;
|
||||
},
|
||||
EntryComparator = function(origin, getSize) {
|
||||
var _origin = origin,
|
||||
_cache = {},
|
||||
_get = function(entry) {
|
||||
if (!_cache[entry[1]]) {
|
||||
var s = getSize(entry[2]);
|
||||
_cache[entry[1]] = {
|
||||
l:entry[0][0],
|
||||
t:entry[0][1],
|
||||
w:s[0],
|
||||
h:s[1],
|
||||
center:[entry[0][0] + (s[0] / 2), entry[0][1] + (s[1] / 2) ]
|
||||
};
|
||||
}
|
||||
return _cache[entry[1]];
|
||||
}
|
||||
this.setOrigin = function(o) {
|
||||
_origin = o;
|
||||
_cache = {};
|
||||
};
|
||||
this.compare = function(e1, e2) {
|
||||
var d1 = geomSupport.lineLength(_origin, _get(e1).center),
|
||||
d2 = geomSupport.lineLength(_origin, _get(e2).center);
|
||||
|
||||
return d1 < d2 ? -1 : d1 == d2 ? 0 : 1;
|
||||
};
|
||||
};
|
||||
|
||||
var _isOnEdge = function(r, axis, dim, v) { return (r[axis] <= v && v <= r[axis] + r[dim]); },
|
||||
_xAdj = [ function(r1, r2) { return r1.x + r1.w - r2.x; }, function(r1, r2) { return r1.x - (r2.x + r2.w); } ],
|
||||
_yAdj = [ function(r1, r2) { return r1.y + r1.h - r2.y; }, function(r1, r2) { return r1.y - (r2.y + r2.h); } ],
|
||||
_adj = [ null, [ _xAdj[0], _yAdj[1] ], [ _xAdj[0], _yAdj[0] ], [ _xAdj[1], _yAdj[0] ], [ _xAdj[1], _yAdj[1] ] ],
|
||||
_genAdj = function(r1, r2, m, b, s) {
|
||||
if (isNaN(m)) m = 0;
|
||||
var y = r2.y + r2.h,
|
||||
x = (m == Infinity || m == -Infinity) ? r2.x + (r2.w / 2) : (y - b) / m,
|
||||
theta = Math.atan(m);
|
||||
|
||||
if (_isOnEdge(r2, "x", "w", x)) {
|
||||
var rise = _adj[s][1](r1, r2),
|
||||
hyp = rise / Math.sin(theta),
|
||||
run = hyp * Math.cos(theta);
|
||||
return { left:run, top:rise };
|
||||
}
|
||||
else {
|
||||
var run = _adj[s][0](r1, r2),
|
||||
hyp = run / Math.cos(theta),
|
||||
rise = hyp * Math.sin(theta);
|
||||
return { left:run, top:rise };
|
||||
}
|
||||
},
|
||||
/*
|
||||
* Calculates how far to move r2 from r1 so that it no longer overlaps.
|
||||
* if origin is supplied, then it means we want r2 to move along a vector joining r2's center to that point.
|
||||
* otherwise we want it to move along a vector joining the two rectangle centers.
|
||||
*/
|
||||
_calculateSpacingAdjustment = Farahey.calculateSpacingAdjustment = function(r1, r2) {
|
||||
var c1 = r1.center || [ r1.x + (r1.w / 2), r1.y + (r1.h / 2) ],
|
||||
c2 = r2.center || [ r2.x + (r2.w / 2), r2.y + (r2.h / 2) ],
|
||||
m = geomSupport.gradient(c1, c2),
|
||||
s = geomSupport.quadrant(c1, c2),
|
||||
b = (m == Infinity || m == -Infinity || isNaN(m)) ? 0 : c1[1] - (m * c1[0]);
|
||||
|
||||
return _genAdj(r1, r2, m, b, s);
|
||||
},
|
||||
// calculate a padded rectangle for the given element with offset & size, and desired padding.
|
||||
_paddedRectangle = Farahey.paddedRectangle = function(o, s, p) {
|
||||
return { x:o[0] - p[0], y: o[1] - p[1], w:s[0] + (2 * p[0]), h:s[1] + (2 * p[1]) };
|
||||
},
|
||||
_magnetize = function(positionArray, positions, sizes, padding,
|
||||
constrain, origin, filter,
|
||||
updateOnStep, stepInterval, stepCallback)
|
||||
{
|
||||
origin = origin || [0,0];
|
||||
stepCallback = stepCallback || function() { };
|
||||
|
||||
var focus = _paddedRectangle(origin, [1,1], padding),
|
||||
iterations = 100, iteration = 1, uncleanRun = true, adjustBy, constrainedAdjustment,
|
||||
_movedElements = {},
|
||||
_move = function(id, o, x, y) {
|
||||
_movedElements[id] = true;
|
||||
o[0] += x;
|
||||
o[1] += y;
|
||||
},
|
||||
step = function() {
|
||||
for (var i = 0; i < positionArray.length; i++) {
|
||||
var o1 = positions[positionArray[i][1]],
|
||||
oid = positionArray[i][1],
|
||||
a1 = positionArray[i][2], // angle to node from magnet origin
|
||||
s1 = sizes[positionArray[i][1]],
|
||||
// create a rectangle for first element: this encompasses the element and padding on each
|
||||
//side
|
||||
r1 = _paddedRectangle(o1, s1, padding);
|
||||
|
||||
if (filter(positionArray[i][1]) && geomSupport.intersects(focus, r1)) {
|
||||
adjustBy = _calculateSpacingAdjustment(focus, r1);
|
||||
constrainedAdjustment = constrain(positionArray[i][1], o1, adjustBy);
|
||||
_move(oid, o1, constrainedAdjustment.left, constrainedAdjustment.top);
|
||||
}
|
||||
|
||||
// now move others to account for this one, if necessary.
|
||||
// reset rectangle for node
|
||||
r1 = _paddedRectangle(o1, s1, padding);
|
||||
for (var j = 0; j < positionArray.length; j++) {
|
||||
if (i != j) {
|
||||
var o2 = positions[positionArray[j][1]],
|
||||
a2 = positionArray[j][2], // angle to node from magnet origin
|
||||
s2 = sizes[positionArray[j][1]],
|
||||
// create a rectangle for the second element, again by putting padding of the desired
|
||||
// amount around the bounds of the element.
|
||||
r2 = _paddedRectangle(o2, s2, padding);
|
||||
|
||||
// if the two rectangles intersect then figure out how much to move the second one by.
|
||||
if (geomSupport.intersects(r1, r2)) {
|
||||
// TODO in 0.3, instead of moving neither, the other node should move.
|
||||
if (filter(positionArray[j][1])) {
|
||||
uncleanRun = true;
|
||||
adjustBy = _calculateSpacingAdjustment(r1, r2),
|
||||
constrainedAdjustment = constrain(positionArray[j][1], o2, adjustBy);
|
||||
|
||||
_move(positionArray[j][1], o2, constrainedAdjustment.left, constrainedAdjustment.top);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (updateOnStep)
|
||||
stepCallback();
|
||||
|
||||
if (uncleanRun && iteration < iterations) {
|
||||
uncleanRun = false;
|
||||
iteration++;
|
||||
if (updateOnStep) {
|
||||
window.setTimeout(step, stepInterval);
|
||||
}
|
||||
else
|
||||
step();
|
||||
}
|
||||
};
|
||||
|
||||
step();
|
||||
return _movedElements;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @name Magnetizer
|
||||
* @classdesc Applies repulsive magnetism to a set of elements relative to a given point, with a specified
|
||||
* amount of padding around the point.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name Magnetizer#constructor
|
||||
* @function
|
||||
* @param {Selector|Element} [container] Element that contains the elements to magnetize. Only required if you intend to use the `executeAtEvent` method.
|
||||
* @param {Function} [getContainerPosition] Function that returns the position of the container (as an object of the form `{left:.., top:..}`) when requested. Only required if you intend to use the `executeAtEvent` method.
|
||||
* @param {Function} getPosition A function that takes an element id and returns its position. It does not matter to which element this position is computed as long as you remain consistent with this method, `setPosition` and the `origin` property.
|
||||
* @param {Function} setPosition A function that takes an element id and position, and sets it. See note about offset parent above.
|
||||
* @param {Function} getSize A function that takes an element id and returns its size, in pixels.
|
||||
* @param {Integer[]} [padding] Optional padding for x and y directions. Defaults to 20 pixels in each direction.
|
||||
* @param {Function} [constrain] Optional function that takes an id and a proposed amount of movement in each axis, and returns the allowed amount of movement in each axis. You can use this to constrain your elements to a grid, for instance, or a path, etc.
|
||||
* @param {Integer[]} [origin] The origin of magnetization, in pixels. Defaults to 0,0. You can also supply this to the `execute` call.
|
||||
* @param {Selector|String[]|Element[]} elements List of elements on which to operate.
|
||||
* @param {Boolean} [executeNow=false] Whether or not to execute the routine immediately.
|
||||
* @param {Function} [filter] Optional function that takes an element id and returns whether or not that element can be moved.
|
||||
* @param {Boolean} [orderByDistanceFromOrigin=false] Whether or not to sort elements first by distance from origin. Can have better results but takes more time.
|
||||
*/
|
||||
root.Magnetizer = function(params) {
|
||||
var getPosition = params.getPosition,
|
||||
getSize = params.getSize,
|
||||
getId = params.getId,
|
||||
setPosition = params.setPosition,
|
||||
padding = params.padding || [20, 20],
|
||||
// expects a { left:.., top:... } object. returns how far it can actually go.
|
||||
constrain = params.constrain || function(id, current, delta) { return delta; },
|
||||
positionArray = [],
|
||||
positions = {},
|
||||
sizes = {},
|
||||
elements = params.elements || [],
|
||||
origin = params.origin || [0,0],
|
||||
executeNow = params.executeNow,
|
||||
minx, miny, maxx, maxy,
|
||||
getOrigin = this.getOrigin = function() { return origin; },
|
||||
filter = params.filter || function(_) { return true; },
|
||||
orderByDistanceFromOrigin = params.orderByDistanceFromOrigin,
|
||||
comparator = new EntryComparator(origin, getSize),
|
||||
updateOnStep = params.updateOnStep,
|
||||
stepInterval = params.stepInterval || 350,
|
||||
originDebugMarker,
|
||||
debug = params.debug,
|
||||
createOriginDebugger = function() {
|
||||
var d = document.createElement("div");
|
||||
d.style.position = "absolute";
|
||||
d.style.width = "10px";
|
||||
d.style.height = "10px";
|
||||
d.style.backgroundColor = "red";
|
||||
document.body.appendChild(d);
|
||||
originDebugMarker = d;
|
||||
},
|
||||
_addToPositionArray = function(p) {
|
||||
if (!orderByDistanceFromOrigin || positionArray.length == 0)
|
||||
positionArray.push(p);
|
||||
else {
|
||||
insertSorted(positionArray, p, comparator.compare);
|
||||
}
|
||||
},
|
||||
_updatePositions = function() {
|
||||
comparator.setOrigin(origin);
|
||||
positionArray = []; positions = {}; sizes = {};
|
||||
minx = miny = Infinity;
|
||||
maxx = maxy = -Infinity;
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var p = getPosition(elements[i]),
|
||||
s = getSize(elements[i]),
|
||||
id = getId(elements[i]);
|
||||
|
||||
positions[id] = [p.left, p.top];
|
||||
_addToPositionArray([ [p.left, p.top], id, elements[i]]);
|
||||
sizes[id] = s;
|
||||
minx = Math.min(minx, p.left);
|
||||
miny = Math.min(miny, p.top);
|
||||
maxx = Math.max(maxx, p.left + s[0]);
|
||||
maxy = Math.max(maxy, p.top + s[1]);
|
||||
}
|
||||
},
|
||||
_run = function() {
|
||||
if (elements.length > 1) {
|
||||
var _movedElements = _magnetize(positionArray, positions, sizes, padding, constrain, origin, filter, updateOnStep, stepInterval, _positionElements);
|
||||
_positionElements(_movedElements);
|
||||
}
|
||||
},
|
||||
_positionElements = function(_movedElements) {
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var id = getId(elements[i]);
|
||||
if (_movedElements[id])
|
||||
setPosition(elements[i], { left:positions[id][0], top:positions[id][1] });
|
||||
}
|
||||
},
|
||||
setOrigin = function(o) {
|
||||
if (o != null) {
|
||||
origin = o;
|
||||
comparator.setOrigin(o);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @name Magnetizer#execute
|
||||
* @function
|
||||
* @desc Runs the magnetize routine.
|
||||
* @param {Integer[]} [o] Optional origin to use. You may have set this in the constructor and do not wish to supply it, or you may be happy with the default of [0,0].
|
||||
*/
|
||||
this.execute = function(o) {
|
||||
setOrigin(o);
|
||||
_updatePositions();
|
||||
_run();
|
||||
};
|
||||
|
||||
/**
|
||||
* @name Magnetizer#executeAtCenter
|
||||
* @function
|
||||
* @desc Computes the center of all the nodes and then uses that as the magnetization origin when it runs the routine.
|
||||
*/
|
||||
this.executeAtCenter = function() {
|
||||
_updatePositions();
|
||||
setOrigin([
|
||||
(minx + maxx) / 2,
|
||||
(miny + maxy) / 2
|
||||
]);
|
||||
_run();
|
||||
};
|
||||
|
||||
/**
|
||||
* @name Magnetizer#executeAtEvent
|
||||
* @function
|
||||
* @desc Runs the magnetize routine using the location of the given event as the origin. To use this
|
||||
* method you need to have provided a `container`, and a `getContainerPosition` function to the
|
||||
* constructor.
|
||||
* @param {Event} e Event to get origin location from.
|
||||
*/
|
||||
this.executeAtEvent = function(e) {
|
||||
var c = params.container,
|
||||
o = params.getContainerPosition(c),
|
||||
x = e.pageX - o.left + c[0].scrollLeft,
|
||||
y = e.pageY - o.top + c[0].scrollTop;
|
||||
|
||||
if (debug) {
|
||||
originDebugMarker.style.left = e.pageX + "px";
|
||||
originDebugMarker.style.top = e.pageY + "px";
|
||||
}
|
||||
|
||||
this.execute([x,y]);
|
||||
};
|
||||
|
||||
/**
|
||||
* @name Magnetize#setElements
|
||||
* @function
|
||||
* @desc Sets the current list of elements.
|
||||
* @param {Object[]} _els List of elements, in whatever format the magnetizer is setup to use.
|
||||
*/
|
||||
this.setElements = function(_els) {
|
||||
elements = _els;
|
||||
};
|
||||
|
||||
|
||||
if (debug)
|
||||
createOriginDebugger();
|
||||
|
||||
if (executeNow) this.execute();
|
||||
|
||||
};
|
||||
}).call(this);
|
||||
|
||||
4
public/js/v1.1.5/lib/jquery-3.0.0.min.js
vendored
4
public/js/v1.1.5/lib/jquery-3.0.0.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,377 +0,0 @@
|
||||
/*
|
||||
@title:
|
||||
Drag to Select
|
||||
|
||||
@version:
|
||||
1.1
|
||||
|
||||
@author:
|
||||
Andreas Lagerkvist
|
||||
|
||||
@date:
|
||||
2009-04-06
|
||||
|
||||
@url:
|
||||
http://andreaslagerkvist.com/jquery/drag-to-select/
|
||||
|
||||
@license:
|
||||
http://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
@copyright:
|
||||
2008 Andreas Lagerkvist (andreaslagerkvist.com)
|
||||
|
||||
@requires:
|
||||
jquery, jquery.dragToSelect.css
|
||||
|
||||
@does:
|
||||
Use this plug-in to allow your users to select certain elements by dragging a "select box". Works very similar to how you can drag-n-select files and folders in most OS:es.
|
||||
|
||||
@howto:
|
||||
$('#my-files').dragToSelect(selectables: 'li'); would make every li in the #my-files-element selectable by dragging. The li:s will recieve a "selected"-class when they are within range of the select box when user drops.
|
||||
|
||||
Make sure a parent-element of the selectables has position: relative as well as overflow: auto or scroll.
|
||||
|
||||
@exampleHTML:
|
||||
<ul>
|
||||
<li><img src="http://exscale.se/__files/3d/lamp-and-mates/lamp-and-mates-01_small.jpg" alt="Lamp and Mates" /></li>
|
||||
<li><img src="http://exscale.se/__files/3d/stugan-winter_small.jpg" alt="The Cottage - Winter time" /></li>
|
||||
<li><img src="http://exscale.se/__files/3d/ps2_small.jpg" alt="PS2" /></li>
|
||||
</ul>
|
||||
|
||||
@exampleJS:
|
||||
$('#jquery-drag-to-select-example').dragToSelect({
|
||||
selectables: 'li',
|
||||
onHide: function () {
|
||||
alert($('#jquery-drag-to-select-example li.selected').length + ' selected');
|
||||
}
|
||||
});
|
||||
*/
|
||||
jQuery.fn.dragToSelect = function (conf) {
|
||||
var c = typeof(conf) == 'object' ? conf : {};
|
||||
|
||||
// Config
|
||||
var config = jQuery.extend({
|
||||
className: 'pf-map-drag-to-select',
|
||||
activeClass: 'active',
|
||||
disabledClass: 'disabled',
|
||||
selectedClass: 'pf-system-selected',
|
||||
ignoredClass: 'pf-system-locked', // do not select locked systems
|
||||
scrollTH: 10,
|
||||
percentCovered: 25,
|
||||
selectables: false,
|
||||
autoScroll: false,
|
||||
selectOnMove: false,
|
||||
onShow: function () {return true;},
|
||||
onHide: function () {return true;},
|
||||
onRefresh: function () {return true;}
|
||||
}, c);
|
||||
|
||||
var realParent = jQuery(this);
|
||||
var parent = realParent;
|
||||
|
||||
var animationFrameId;
|
||||
var mouseIsDown = false;
|
||||
var lastMousePosition = { x: 0, y: 0 };
|
||||
|
||||
// deselected items
|
||||
var deselectedItems = $();
|
||||
|
||||
do {
|
||||
if (/auto|scroll|hidden/.test(parent.css('overflow'))) {
|
||||
break;
|
||||
}
|
||||
parent = parent.parent();
|
||||
} while (parent[0].parentNode);
|
||||
|
||||
// Does user want to disable dragToSelect
|
||||
if (conf == 'disable') {
|
||||
parent.addClass(config.disabledClass);
|
||||
return this;
|
||||
}
|
||||
else if (conf == 'enable') {
|
||||
parent.removeClass(config.disabledClass);
|
||||
return this;
|
||||
}
|
||||
|
||||
var parentOffset = parent.offset();
|
||||
var parentDim = {
|
||||
left: parentOffset.left,
|
||||
top: parentOffset.top,
|
||||
width: parent.width(),
|
||||
height: parent.height()
|
||||
};
|
||||
|
||||
// Current origin of select box
|
||||
var selectBoxOrigin = {
|
||||
left: 0,
|
||||
top: 0
|
||||
};
|
||||
|
||||
// Create select box
|
||||
var selectBox = jQuery('<div/>')
|
||||
.appendTo(parent)
|
||||
.attr('class', config.className)
|
||||
.css('position', 'absolute');
|
||||
|
||||
// Shows the select box
|
||||
var showSelectBox = function (e) {
|
||||
if (parent.is('.' + config.disabledClass)) {
|
||||
return;
|
||||
}
|
||||
|
||||
selectBoxOrigin.left = e.pageX - parentDim.left + parent[0].scrollLeft;
|
||||
selectBoxOrigin.top = e.pageY - parentDim.top + parent[0].scrollTop;
|
||||
|
||||
var css = {
|
||||
left: selectBoxOrigin.left + 'px',
|
||||
top: selectBoxOrigin.top + 'px',
|
||||
width: '1px',
|
||||
height: '1px'
|
||||
};
|
||||
selectBox.addClass(config.activeClass).css(css);
|
||||
|
||||
config.onShow();
|
||||
};
|
||||
|
||||
// Refreshes the select box dimensions and possibly position
|
||||
var refreshSelectBox = function () {
|
||||
var refreshed = false;
|
||||
|
||||
if (!selectBox.is('.' + config.activeClass) || parent.is('.' + config.disabledClass)) {
|
||||
return refreshed;
|
||||
}
|
||||
|
||||
// get scroll position
|
||||
var leftScroll = 0;
|
||||
var rightScroll = 0;
|
||||
|
||||
if(realParent.data('scrollLeft')){
|
||||
leftScroll = realParent.data('scrollLeft');
|
||||
}
|
||||
|
||||
if(realParent.data('scrollRight')){
|
||||
rightScroll = realParent.data('scrollRight');
|
||||
}
|
||||
|
||||
var left = lastMousePosition.x - parentDim.left + parent[0].scrollLeft;
|
||||
var top = lastMousePosition.y - parentDim.top + parent[0].scrollTop;
|
||||
var newLeft = left;
|
||||
var newTop = top;
|
||||
var tempWidth = selectBoxOrigin.left - newLeft ;
|
||||
var newHeight = selectBoxOrigin.top - newTop;
|
||||
newLeft = selectBoxOrigin.left - leftScroll;
|
||||
var newWidth = left - selectBoxOrigin.left;
|
||||
|
||||
|
||||
if(newWidth < 0){
|
||||
newLeft = newLeft - tempWidth ;
|
||||
newWidth = newWidth * -1;
|
||||
}
|
||||
|
||||
|
||||
if (top > selectBoxOrigin.top) {
|
||||
newTop = selectBoxOrigin.top;
|
||||
newHeight = top - selectBoxOrigin.top;
|
||||
}
|
||||
|
||||
// check if dimension has changed -> save performance
|
||||
var dimensionHash = [newWidth, newHeight].join('_');
|
||||
|
||||
if(selectBox.data('dimension-hash') !== dimensionHash){
|
||||
selectBox.data('dimension-hash', dimensionHash);
|
||||
var css = {
|
||||
left: newLeft + 'px',
|
||||
top: newTop + 'px',
|
||||
width: newWidth + 'px',
|
||||
height: newHeight + 'px'
|
||||
};
|
||||
|
||||
selectBox.css(css);
|
||||
config.onRefresh();
|
||||
refreshed = true;
|
||||
}
|
||||
|
||||
return refreshed;
|
||||
};
|
||||
|
||||
// Hides the select box
|
||||
var hideSelectBox = function () {
|
||||
if (!selectBox.is('.' + config.activeClass) || parent.is('.' + config.disabledClass)) {
|
||||
return;
|
||||
}
|
||||
if (config.onHide(selectBox, deselectedItems) !== false) {
|
||||
selectBox.removeClass(config.activeClass);
|
||||
}
|
||||
};
|
||||
|
||||
// Scrolls parent if needed
|
||||
var scrollPerhaps = function (e) {
|
||||
if (!selectBox.is('.' + config.activeClass) || parent.is('.' + config.disabledClass)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Scroll down
|
||||
if ((e.pageY + config.scrollTH) > (parentDim.top + parentDim.height)) {
|
||||
parent[0].scrollTop += config.scrollTH;
|
||||
}
|
||||
// Scroll up
|
||||
if ((e.pageY - config.scrollTH) < parentDim.top) {
|
||||
parent[0].scrollTop -= config.scrollTH;
|
||||
}
|
||||
// Scroll right
|
||||
if ((e.pageX + config.scrollTH) > (parentDim.left + parentDim.width)) {
|
||||
parent[0].scrollLeft += config.scrollTH;
|
||||
}
|
||||
// Scroll left
|
||||
if ((e.pageX - config.scrollTH) < parentDim.left) {
|
||||
parent[0].scrollLeft -= config.scrollTH;
|
||||
}
|
||||
};
|
||||
|
||||
// Selects all the elements in the select box's range
|
||||
var selectElementsInRange = function () {
|
||||
if (!selectBox.is('.' + config.activeClass) || parent.is('.' + config.disabledClass)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var selectables = realParent.find(config.selectables + ':not(.' + config.ignoredClass + ')');
|
||||
var selectBoxOffset = selectBox.offset();
|
||||
var selectBoxDim = {
|
||||
left: selectBoxOffset.left,
|
||||
top: selectBoxOffset.top,
|
||||
width: selectBox.width(),
|
||||
height: selectBox.height()
|
||||
};
|
||||
|
||||
selectables.each(function (i) {
|
||||
var el = $(this);
|
||||
var elOffset = el.offset();
|
||||
var elDim = {
|
||||
left: elOffset.left,
|
||||
top: elOffset.top,
|
||||
width: el.width(),
|
||||
height: el.height()
|
||||
};
|
||||
|
||||
if (percentCovered(selectBoxDim, elDim) > config.percentCovered) {
|
||||
el.addClass(config.selectedClass);
|
||||
// remove element from "deselected" elements (e.g on add -> remove -> add scenario)
|
||||
deselectedItems = deselectedItems.not(el);
|
||||
}else {
|
||||
|
||||
if(el.hasClass(config.selectedClass)){
|
||||
el.removeClass(config.selectedClass);
|
||||
deselectedItems = deselectedItems.add(el);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Returns the amount (in %) that dim1 covers dim2
|
||||
var percentCovered = function (dim1, dim2) {
|
||||
// The whole thing is covering the whole other thing
|
||||
if (
|
||||
(dim1.left <= dim2.left) &&
|
||||
(dim1.top <= dim2.top) &&
|
||||
((dim1.left + dim1.width) >= (dim2.left + dim2.width)) &&
|
||||
((dim1.top + dim1.height) > (dim2.top + dim2.height))
|
||||
) {
|
||||
return 100;
|
||||
}
|
||||
// Only parts may be covered, calculate percentage
|
||||
else {
|
||||
dim1.right = dim1.left + dim1.width;
|
||||
dim1.bottom = dim1.top + dim1.height;
|
||||
dim2.right = dim2.left + dim2.width;
|
||||
dim2.bottom = dim2.top + dim2.height;
|
||||
|
||||
var l = Math.max(dim1.left, dim2.left);
|
||||
var r = Math.min(dim1.right, dim2.right);
|
||||
var t = Math.max(dim1.top, dim2.top);
|
||||
var b = Math.min(dim1.bottom, dim2.bottom);
|
||||
|
||||
if (b >= t && r >= l) {
|
||||
/* $('<div/>').appendTo(document.body).css({
|
||||
background: 'red',
|
||||
position: 'absolute',
|
||||
left: l + 'px',
|
||||
top: t + 'px',
|
||||
width: (r - l) + 'px',
|
||||
height: (b - t) + 'px',
|
||||
zIndex: 100
|
||||
}); */
|
||||
|
||||
var percent = (((r - l) * (b - t)) / (dim2.width * dim2.height)) * 100;
|
||||
|
||||
// alert(percent + '% covered')
|
||||
|
||||
return percent;
|
||||
}
|
||||
}
|
||||
// Nothing covered, return 0
|
||||
return 0;
|
||||
};
|
||||
|
||||
// Event functions ----------------------------------------------------------------------------
|
||||
var mousemoveCallback = function(){
|
||||
if(mouseIsDown){
|
||||
var refreshed = refreshSelectBox();
|
||||
|
||||
if(refreshed && config.selectables && config.selectOnMove){
|
||||
selectElementsInRange();
|
||||
}
|
||||
|
||||
// recursive re-call on next render
|
||||
animationFrameId = requestAnimationFrame(mousemoveCallback);
|
||||
}
|
||||
}
|
||||
|
||||
var mouseupCallback = function(){
|
||||
if (config.selectables){
|
||||
selectElementsInRange();
|
||||
}
|
||||
hideSelectBox();
|
||||
|
||||
// stop animation frame and "reset" to default
|
||||
cancelAnimationFrame(animationFrameId);
|
||||
mouseIsDown = false;
|
||||
// reset deselected item array
|
||||
deselectedItems = $();
|
||||
}
|
||||
|
||||
// Do the right stuff then return this --------------------------------------------------------
|
||||
|
||||
selectBox.mousemove(function(e){
|
||||
lastMousePosition.x = e.pageX;
|
||||
lastMousePosition.y = e.pageY;
|
||||
e.preventDefault();
|
||||
}).mouseup(mouseupCallback);
|
||||
|
||||
parent.mousedown(function(e){
|
||||
if (
|
||||
e.which === 1 && // left mouse down
|
||||
e.target === realParent[0] // prevent while dragging a system :)
|
||||
) {
|
||||
|
||||
// Make sure user isn't clicking scrollbar (or disallow clicks far to the right actually)
|
||||
if ((e.pageX + 20) > jQuery(document.body).width()) {
|
||||
return;
|
||||
}
|
||||
|
||||
showSelectBox(e);
|
||||
mouseIsDown = true;
|
||||
animationFrameId = requestAnimationFrame(mousemoveCallback);
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
}).mousemove(function(e){
|
||||
lastMousePosition.x = e.pageX;
|
||||
lastMousePosition.y = e.pageY;
|
||||
e.preventDefault();
|
||||
}).mouseup(mouseupCallback);
|
||||
|
||||
|
||||
// Be nice
|
||||
return this;
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
/**!
|
||||
* easyPieChart
|
||||
* Lightweight plugin to render simple, animated and retina optimized pie charts
|
||||
*
|
||||
* @license
|
||||
* @author Robert Fleischmann <rendro87@gmail.com> (http://robert-fleischmann.de)
|
||||
* @version 2.1.6
|
||||
**/
|
||||
!function(a,b){"object"==typeof exports?module.exports=b(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],b):b(a.jQuery)}(this,function(a){var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"undefined"!=typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;window.devicePixelRatio>1&&(f=window.devicePixelRatio,d.style.width=d.style.height=[b.size,"px"].join(""),d.width=d.height=b.size*f,e.scale(f,f)),e.translate(b.size/2,b.size/2),e.rotate((-0.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=0>=c?!0:!1;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var d=24;d>0;--d)d%6===0?(c=b.scaleLength,a=0):(c=.6*b.scaleLength,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/12);e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){b.scaleColor||b.trackColor?e.getImageData&&e.putImageData?c?e.putImageData(c,0,0):(k(),c=e.getImageData(0,0,b.size*f,b.size*f)):(this.clear(),k()):this.clear(),e.lineCap=b.lineCap;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,1>b?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(){},onStep:function(){},onStop:function(){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;for(var b in d)d.hasOwnProperty(b)&&(e[b]=c&&"undefined"!=typeof c[b]?c[b]:d[b],"function"==typeof e[b]&&(e[b]=e[b].bind(this)));e.easing="string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?jQuery.easing[e.easing]:d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),this.renderer=new e.renderer(a,e),this.renderer.draw(f),a.dataset&&a.dataset.percent?this.update(parseFloat(a.dataset.percent)):a.getAttribute&&a.getAttribute("data-percent")&&this.update(parseFloat(a.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};a.fn.easyPieChart=function(b){return this.each(function(){var d;a.data(this,"easyPieChart")||(d=a.extend({},b,a(this).data()),a.data(this,"easyPieChart",new c(this,d)))})}});
|
||||
25
public/js/v1.1.5/lib/jquery.fullscreen.min.js
vendored
25
public/js/v1.1.5/lib/jquery.fullscreen.min.js
vendored
File diff suppressed because one or more lines are too long
1
public/js/v1.1.5/lib/jquery.fullscreen.min.js.map
Normal file
1
public/js/v1.1.5/lib/jquery.fullscreen.min.js.map
Normal file
File diff suppressed because one or more lines are too long
23
public/js/v1.1.5/lib/jquery.fullscreen.min.js.src.js
Normal file
23
public/js/v1.1.5/lib/jquery.fullscreen.min.js.src.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1,9 +0,0 @@
|
||||
/*!
|
||||
* hoverIntent v1.8.0 // 2014.06.29 // jQuery v1.9.1+
|
||||
* http://cherne.net/brian/resources/jquery.hoverIntent.html
|
||||
*
|
||||
* You may use hoverIntent under the terms of the MIT license. Basically that
|
||||
* means you are free to use hoverIntent as long as this header is left intact.
|
||||
* Copyright 2007, 2014 Brian Cherne
|
||||
*/
|
||||
(function($){$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var cfg={interval:100,sensitivity:6,timeout:0};if(typeof handlerIn==="object"){cfg=$.extend(cfg,handlerIn)}else{if($.isFunction(handlerOut)){cfg=$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector})}else{cfg=$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut})}}var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(Math.sqrt((pX-cX)*(pX-cX)+(pY-cY)*(pY-cY))<cfg.sensitivity){$(ob).off("mousemove.hoverIntent",track);ob.hoverIntent_s=true;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=false;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=$.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type==="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).on("mousemove.hoverIntent",track);if(!ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).off("mousemove.hoverIntent",track);if(ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}})(jQuery);
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Lazy Line Painter
|
||||
* SVG Stroke animation.
|
||||
*
|
||||
* https://github.com/camoconnell/lazy-line-painter
|
||||
* http://www.camoconnell.com
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
*
|
||||
*/
|
||||
(function(e){var g={init:function(a){return this.each(function(){var b=e(this),c=b.data("lazyLinePainter");b.addClass("lazy-line");if(!c){var c=e.extend({width:null,height:null,strokeWidth:2,strokeColor:"#000",strokeOverColor:null,strokeCap:"round",strokeJoin:"round",strokeOpacity:1,arrowEnd:"none",onComplete:null,onStart:null,delay:null,overrideKey:null,drawSequential:!0,speedMultiplier:1,reverse:!1,responsive:!1},a),d=c.overrideKey?c.overrideKey:b.attr("id").replace("#",""),f=c.svgData[d].dimensions.width,
|
||||
l=c.svgData[d].dimensions.height;c.svgData=c.svgData[d].strokepath;null===c.width&&(c.width=f);null===c.height&&(c.height=l);c.responsive||b.css({width:c.width,height:c.height});d="0 0 "+f+" "+l;f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttributeNS(null,"viewBox",d);f.setAttribute("xmlns","http://www.w3.org/2000/svg");c.svg=e(f);b.append(c.svg);b.data("lazyLinePainter",c)}})},paint:function(){return this.each(function(){var a=e(this).data("lazyLinePainter"),b=function(){a.paths=
|
||||
[];a.longestDuration=0;for(var b=a.playhead=0,d=0,f=0,d=0;d<a.svgData.length;d++)b=a.svgData[d].duration*a.speedMultiplier,f+=b;for(d=0;d<a.svgData.length;d++){var e=m(a,d),h=e.getTotalLength();e.style.strokeDasharray=h+" "+h;e.style.strokeDashoffset=h;e.style.display="block";e.getBoundingClientRect();b=a.svgData[d].duration*a.speedMultiplier;b>a.longestDuration&&(a.longestDuration=b);var g;g=a.reverse?f-=b:a.playhead;a.paths.push({duration:b,drawStartTime:g,path:e,length:h});a.playhead+=b}a.totalDuration=
|
||||
a.drawSequential?a.playhead:a.longestDuration;a.rAF=requestAnimationFrame(function(b){k(b,a)});if(null!==a.onStart)a.onStart()};null===a.delay?b():setTimeout(b,a.delay)})},pauseResume:function(){return this.each(function(){var a=e(this).data("lazyLinePainter");a.paused?(a.paused=!1,requestAnimationFrame(function(b){n(b,a)})):(a.paused=!0,cancelAnimationFrame(a.rAF))})},erase:function(){return this.each(function(){var a=e(this).data("lazyLinePainter");a.startTime=null;a.elapsedTime=null;cancelAnimationFrame(a.rAF);
|
||||
a.svg.empty()})},destroy:function(){return this.each(function(){var a=e(this);a.removeData("lazyLinePainter");a.remove()})}},n=function(a,b){b.startTime=a-b.elapsedTime;requestAnimationFrame(function(a){k(a,b)})},k=function(a,b){b.startTime||(b.startTime=a);b.elapsedTime=a-b.startTime;for(var c=0;c<b.paths.length;c++){var d;b.drawSequential?(d=b.elapsedTime-b.paths[c].drawStartTime,0>d&&(d=0)):d=b.elapsedTime;d<b.paths[c].duration&&0<d?(d=d/b.paths[c].duration*b.paths[c].length,b.paths[c].path.style.strokeDashoffset=
|
||||
b.reverse||b.svgData[c].reverse?-b.paths[c].length+d:b.paths[c].length-d):d>b.paths[c].duration&&(b.paths[c].path.style.strokeDashoffset=0)}if(b.elapsedTime<b.totalDuration)b.rAF=requestAnimationFrame(function(a){k(a,b)});else if(null!==b.onComplete)b.onComplete()},m=function(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg","path"),d=e(c);a.svg.append(d);d.attr(p(a,a.svgData[b]));return c},p=function(a,b){return{d:b.path,stroke:b.strokeColor?b.strokeColor:a.strokeColor,"fill-opacity":0,
|
||||
"stroke-opacity":b.strokeOpacity?b.strokeOpacity:a.strokeOpacity,"stroke-width":b.strokeWidth?b.strokeWidth:a.strokeWidth,"stroke-linecap":b.strokeCap?b.strokeCap:a.strokeCap,"stroke-linejoin":b.strokeJoin?b.strokeJoin:a.strokeJoin}};e.fn.lazylinepainter=function(a){if(g[a])return g[a].apply(this,Array.prototype.slice.call(arguments,1));if("object"!==typeof a&&a)console.log("opps - issue finding method");else return g.init.apply(this,arguments)}})(jQuery);
|
||||
2
public/js/v1.1.5/lib/jquery.lazyload.min.js
vendored
2
public/js/v1.1.5/lib/jquery.lazyload.min.js
vendored
@@ -1,2 +0,0 @@
|
||||
/*! Lazy Load 1.9.5 - MIT license - Copyright 2010-2015 Mika Tuupola */
|
||||
!function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!1,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);
|
||||
File diff suppressed because one or more lines are too long
@@ -1,8 +0,0 @@
|
||||
/*!
|
||||
* jQuery Mousewheel 3.1.13
|
||||
*
|
||||
* Copyright 2015 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
|
||||
File diff suppressed because one or more lines are too long
1
public/js/v1.1.5/lib/jsPlumb-2.0.5.js.map
Normal file
1
public/js/v1.1.5/lib/jsPlumb-2.0.5.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
7
public/js/v1.1.5/lib/localforage.min.js
vendored
7
public/js/v1.1.5/lib/localforage.min.js
vendored
File diff suppressed because one or more lines are too long
7
public/js/v1.1.5/lib/morris.min.js
vendored
7
public/js/v1.1.5/lib/morris.min.js
vendored
File diff suppressed because one or more lines are too long
1
public/js/v1.1.5/lib/mustache.min.js
vendored
1
public/js/v1.1.5/lib/mustache.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,176 +1,2 @@
|
||||
// Buttons
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as a module.
|
||||
define('pnotify.buttons', ['jquery', 'pnotify'], factory);
|
||||
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
|
||||
// CommonJS
|
||||
module.exports = factory(require('jquery'), require('./pnotify'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(root.jQuery, root.PNotify);
|
||||
}
|
||||
}(this, function($, PNotify){
|
||||
PNotify.prototype.options.buttons = {
|
||||
// Provide a button for the user to manually close the notice.
|
||||
closer: true,
|
||||
// Only show the closer button on hover.
|
||||
closer_hover: true,
|
||||
// Provide a button for the user to manually stick the notice.
|
||||
sticker: true,
|
||||
// Only show the sticker button on hover.
|
||||
sticker_hover: true,
|
||||
// Show the buttons even when the nonblock module is in use.
|
||||
show_on_nonblock: false,
|
||||
// The various displayed text, helps facilitating internationalization.
|
||||
labels: {
|
||||
close: "Close",
|
||||
stick: "Stick",
|
||||
unstick: "Unstick"
|
||||
},
|
||||
// The classes to use for button icons. Leave them null to use the classes from the styling you're using.
|
||||
classes: {
|
||||
closer: null,
|
||||
pin_up: null,
|
||||
pin_down: null
|
||||
}
|
||||
};
|
||||
PNotify.prototype.modules.buttons = {
|
||||
closer: null,
|
||||
sticker: null,
|
||||
|
||||
init: function(notice, options){
|
||||
var that = this;
|
||||
notice.elem.on({
|
||||
"mouseenter": function(e){
|
||||
// Show the buttons.
|
||||
if (that.options.sticker && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
|
||||
that.sticker.trigger("pnotify:buttons:toggleStick").css("visibility", "visible");
|
||||
}
|
||||
if (that.options.closer && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
|
||||
that.closer.css("visibility", "visible");
|
||||
}
|
||||
},
|
||||
"mouseleave": function(e){
|
||||
// Hide the buttons.
|
||||
if (that.options.sticker_hover) {
|
||||
that.sticker.css("visibility", "hidden");
|
||||
}
|
||||
if (that.options.closer_hover) {
|
||||
that.closer.css("visibility", "hidden");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Provide a button to stick the notice.
|
||||
this.sticker = $("<div />", {
|
||||
"class": "ui-pnotify-sticker",
|
||||
"aria-role": "button",
|
||||
"aria-pressed": notice.options.hide ? "false" : "true",
|
||||
"tabindex": "0",
|
||||
"title": notice.options.hide ? options.labels.stick : options.labels.unstick,
|
||||
"css": {
|
||||
"cursor": "pointer",
|
||||
"visibility": options.sticker_hover ? "hidden" : "visible"
|
||||
},
|
||||
"click": function(){
|
||||
notice.options.hide = !notice.options.hide;
|
||||
if (notice.options.hide) {
|
||||
notice.queueRemove();
|
||||
} else {
|
||||
notice.cancelRemove();
|
||||
}
|
||||
$(this).trigger("pnotify:buttons:toggleStick");
|
||||
}
|
||||
})
|
||||
.bind("pnotify:buttons:toggleStick", function(){
|
||||
var pin_up = that.options.classes.pin_up === null ? notice.styles.pin_up : that.options.classes.pin_up;
|
||||
var pin_down = that.options.classes.pin_down === null ? notice.styles.pin_down : that.options.classes.pin_down;
|
||||
$(this)
|
||||
.attr("title", notice.options.hide ? that.options.labels.stick : that.options.labels.unstick)
|
||||
.children()
|
||||
.attr("class", "")
|
||||
.addClass(notice.options.hide ? pin_up : pin_down)
|
||||
.attr("aria-pressed", notice.options.hide ? "false" : "true");
|
||||
})
|
||||
.append("<span />")
|
||||
.trigger("pnotify:buttons:toggleStick")
|
||||
.prependTo(notice.container);
|
||||
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.sticker.css("display", "none");
|
||||
}
|
||||
|
||||
// Provide a button to close the notice.
|
||||
this.closer = $("<div />", {
|
||||
"class": "ui-pnotify-closer",
|
||||
"aria-role": "button",
|
||||
"tabindex": "0",
|
||||
"title": options.labels.close,
|
||||
"css": {"cursor": "pointer", "visibility": options.closer_hover ? "hidden" : "visible"},
|
||||
"click": function(){
|
||||
notice.remove(false);
|
||||
that.sticker.css("visibility", "hidden");
|
||||
that.closer.css("visibility", "hidden");
|
||||
}
|
||||
})
|
||||
.append($("<span />", {"class": options.classes.closer === null ? notice.styles.closer : options.classes.closer}))
|
||||
.prependTo(notice.container);
|
||||
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.closer.css("display", "none");
|
||||
}
|
||||
},
|
||||
update: function(notice, options){
|
||||
// Update the sticker and closer buttons.
|
||||
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.closer.css("display", "none");
|
||||
} else if (options.closer) {
|
||||
this.closer.css("display", "block");
|
||||
}
|
||||
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.sticker.css("display", "none");
|
||||
} else if (options.sticker) {
|
||||
this.sticker.css("display", "block");
|
||||
}
|
||||
// Update the sticker icon.
|
||||
this.sticker.trigger("pnotify:buttons:toggleStick");
|
||||
// Update the close icon.
|
||||
this.closer.find("span").attr("class", "").addClass(options.classes.closer === null ? notice.styles.closer : options.classes.closer);
|
||||
// Update the hover status of the buttons.
|
||||
if (options.sticker_hover) {
|
||||
this.sticker.css("visibility", "hidden");
|
||||
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.sticker.css("visibility", "visible");
|
||||
}
|
||||
if (options.closer_hover) {
|
||||
this.closer.css("visibility", "hidden");
|
||||
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.closer.css("visibility", "visible");
|
||||
}
|
||||
}
|
||||
};
|
||||
$.extend(PNotify.styling.brighttheme, {
|
||||
closer: "brighttheme-icon-closer",
|
||||
pin_up: "brighttheme-icon-sticker",
|
||||
pin_down: "brighttheme-icon-sticker brighttheme-icon-stuck"
|
||||
});
|
||||
$.extend(PNotify.styling.jqueryui, {
|
||||
closer: "ui-icon ui-icon-close",
|
||||
pin_up: "ui-icon ui-icon-pin-w",
|
||||
pin_down: "ui-icon ui-icon-pin-s"
|
||||
});
|
||||
$.extend(PNotify.styling.bootstrap2, {
|
||||
closer: "icon-remove",
|
||||
pin_up: "icon-pause",
|
||||
pin_down: "icon-play"
|
||||
});
|
||||
$.extend(PNotify.styling.bootstrap3, {
|
||||
closer: "glyphicon glyphicon-remove",
|
||||
pin_up: "glyphicon glyphicon-pause",
|
||||
pin_down: "glyphicon glyphicon-play"
|
||||
});
|
||||
$.extend(PNotify.styling.fontawesome, {
|
||||
closer: "fa fa-times",
|
||||
pin_up: "fa fa-pause",
|
||||
pin_down: "fa fa-play"
|
||||
});
|
||||
}));
|
||||
!function(o,i){"function"==typeof define&&define.amd?define("pnotify.buttons",["jquery","pnotify"],i):"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("jquery"),require("./pnotify")):i(o.jQuery,o.PNotify)}(this,function(o,i){i.prototype.options.buttons={closer:!0,closer_hover:!0,sticker:!0,sticker_hover:!0,show_on_nonblock:!1,labels:{close:"Close",stick:"Stick",unstick:"Unstick"},classes:{closer:null,pin_up:null,pin_down:null}};i.prototype.modules.buttons={closer:null,sticker:null,init:function(i,s){var n=this;i.elem.on({mouseenter:function(o){!n.options.sticker||i.options.nonblock&&i.options.nonblock.nonblock&&!n.options.show_on_nonblock||n.sticker.trigger("pnotify:buttons:toggleStick").css("visibility","visible");!n.options.closer||i.options.nonblock&&i.options.nonblock.nonblock&&!n.options.show_on_nonblock||n.closer.css("visibility","visible")},mouseleave:function(o){n.options.sticker_hover&&n.sticker.css("visibility","hidden");n.options.closer_hover&&n.closer.css("visibility","hidden")}});this.sticker=o("<div />",{"class":"ui-pnotify-sticker","aria-role":"button","aria-pressed":i.options.hide?"false":"true",tabindex:"0",title:i.options.hide?s.labels.stick:s.labels.unstick,css:{cursor:"pointer",visibility:s.sticker_hover?"hidden":"visible"},click:function(){i.options.hide=!i.options.hide;i.options.hide?i.queueRemove():i.cancelRemove();o(this).trigger("pnotify:buttons:toggleStick")}}).bind("pnotify:buttons:toggleStick",function(){var s=null===n.options.classes.pin_up?i.styles.pin_up:n.options.classes.pin_up,e=null===n.options.classes.pin_down?i.styles.pin_down:n.options.classes.pin_down;o(this).attr("title",i.options.hide?n.options.labels.stick:n.options.labels.unstick).children().attr("class","").addClass(i.options.hide?s:e).attr("aria-pressed",i.options.hide?"false":"true")}).append("<span />").trigger("pnotify:buttons:toggleStick").prependTo(i.container);(!s.sticker||i.options.nonblock&&i.options.nonblock.nonblock&&!s.show_on_nonblock)&&this.sticker.css("display","none");this.closer=o("<div />",{"class":"ui-pnotify-closer","aria-role":"button",tabindex:"0",title:s.labels.close,css:{cursor:"pointer",visibility:s.closer_hover?"hidden":"visible"},click:function(){i.remove(!1);n.sticker.css("visibility","hidden");n.closer.css("visibility","hidden")}}).append(o("<span />",{"class":null===s.classes.closer?i.styles.closer:s.classes.closer})).prependTo(i.container);(!s.closer||i.options.nonblock&&i.options.nonblock.nonblock&&!s.show_on_nonblock)&&this.closer.css("display","none")},update:function(o,i){!i.closer||o.options.nonblock&&o.options.nonblock.nonblock&&!i.show_on_nonblock?this.closer.css("display","none"):i.closer&&this.closer.css("display","block");!i.sticker||o.options.nonblock&&o.options.nonblock.nonblock&&!i.show_on_nonblock?this.sticker.css("display","none"):i.sticker&&this.sticker.css("display","block");this.sticker.trigger("pnotify:buttons:toggleStick");this.closer.find("span").attr("class","").addClass(null===i.classes.closer?o.styles.closer:i.classes.closer);i.sticker_hover?this.sticker.css("visibility","hidden"):o.options.nonblock&&o.options.nonblock.nonblock&&!i.show_on_nonblock||this.sticker.css("visibility","visible");i.closer_hover?this.closer.css("visibility","hidden"):o.options.nonblock&&o.options.nonblock.nonblock&&!i.show_on_nonblock||this.closer.css("visibility","visible")}};o.extend(i.styling.brighttheme,{closer:"brighttheme-icon-closer",pin_up:"brighttheme-icon-sticker",pin_down:"brighttheme-icon-sticker brighttheme-icon-stuck"});o.extend(i.styling.jqueryui,{closer:"ui-icon ui-icon-close",pin_up:"ui-icon ui-icon-pin-w",pin_down:"ui-icon ui-icon-pin-s"});o.extend(i.styling.bootstrap2,{closer:"icon-remove",pin_up:"icon-pause",pin_down:"icon-play"});o.extend(i.styling.bootstrap3,{closer:"glyphicon glyphicon-remove",pin_up:"glyphicon glyphicon-pause",pin_down:"glyphicon glyphicon-play"});o.extend(i.styling.fontawesome,{closer:"fa fa-times",pin_up:"fa fa-pause",pin_down:"fa fa-play"})});
|
||||
//# sourceMappingURL=pnotify.buttons.js.map
|
||||
1
public/js/v1.1.5/lib/pnotify/pnotify.buttons.js.map
Normal file
1
public/js/v1.1.5/lib/pnotify/pnotify.buttons.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["pnotify.buttons.js.src.js"],"names":["root","factory","define","amd","exports","module","require","jQuery","PNotify","this","$","prototype","options","buttons","closer","closer_hover","sticker","sticker_hover","show_on_nonblock","labels","close","stick","unstick","classes","pin_up","pin_down","modules","init","notice","that","elem","on","mouseenter","e","nonblock","trigger","css","mouseleave","class","aria-role","aria-pressed","hide","tabindex","title","cursor","visibility","click","queueRemove","cancelRemove","bind","styles","attr","children","addClass","append","prependTo","container","remove","update","find","extend","styling","brighttheme","jqueryui","bootstrap2","bootstrap3","fontawesome"],"mappings":"CACC,SAAUA,EAAMC,GACS,kBAAXC,SAAyBA,OAAOC,IAEvCD,OAAO,mBAAoB,SAAU,WAAYD,GACvB,gBAAZG,UAA0C,mBAAXC,QAE7CA,OAAOD,QAAUH,EAAQK,QAAQ,UAAWA,QAAQ,cAGpDL,EAAQD,EAAKO,OAAQP,EAAKQ,UAEhCC,KAAM,SAASC,EAAGF,GAChBA,EAAQG,UAAUC,QAAQC,SAEtBC,QAAQ,EAERC,cAAc,EAEdC,SAAS,EAETC,eAAe,EAEfC,kBAAkB,EAElBC,QACIC,MAAO,QACPC,MAAO,QACPC,QAAS,WAGbC,SACIT,OAAQ,KACRU,OAAQ,KACRC,SAAU,MAGlBjB,GAAQG,UAAUe,QAAQb,SACtBC,OAAQ,KACRE,QAAS,KAETW,KAAM,SAASC,EAAQhB,GACnB,GAAIiB,GAAOpB,IACXmB,GAAOE,KAAKC,IACRC,WAAc,SAASC,IAEfJ,EAAKjB,QAAQI,SAAcY,EAAOhB,QAAQsB,UAAYN,EAAOhB,QAAQsB,SAASA,WAAaL,EAAKjB,QAAQM,kBACxGW,EAAKb,QAAQmB,QAAQ,+BAA+BC,IAAI,aAAc,YAEtEP,EAAKjB,QAAQE,QAAac,EAAOhB,QAAQsB,UAAYN,EAAOhB,QAAQsB,SAASA,WAAaL,EAAKjB,QAAQM,kBACvGW,EAAKf,OAAOsB,IAAI,aAAc,YAGtCC,WAAc,SAASJ,GAEfJ,EAAKjB,QAAQK,eACbY,EAAKb,QAAQoB,IAAI,aAAc,SAE/BP,GAAKjB,QAAQG,cACbc,EAAKf,OAAOsB,IAAI,aAAc,YAM1C3B,MAAKO,QAAUN,EAAE,WACb4B,QAAS,qBACTC,YAAa,SACbC,eAAgBZ,EAAOhB,QAAQ6B,KAAO,QAAU,OAChDC,SAAY,IACZC,MAASf,EAAOhB,QAAQ6B,KAAO7B,EAAQO,OAAOE,MAAQT,EAAQO,OAAOG,QACrEc,KACIQ,OAAU,UACVC,WAAcjC,EAAQK,cAAgB,SAAW,WAErD6B,MAAS,WACLlB,EAAOhB,QAAQ6B,MAAQb,EAAOhB,QAAQ6B,IAClCb,GAAOhB,QAAQ6B,KACfb,EAAOmB,cAEPnB,EAAOoB,cAEXtC,GAAED,MAAM0B,QAAQ,kCAGvBc,KAAK,8BAA+B,WACjC,GAAIzB,GAAyC,OAAhCK,EAAKjB,QAAQW,QAAQC,OAAkBI,EAAOsB,OAAO1B,OAASK,EAAKjB,QAAQW,QAAQC,OAC5FC,EAA6C,OAAlCI,EAAKjB,QAAQW,QAAQE,SAAoBG,EAAOsB,OAAOzB,SAAWI,EAAKjB,QAAQW,QAAQE,QACtGf,GAAED,MACD0C,KAAK,QAASvB,EAAOhB,QAAQ6B,KAAOZ,EAAKjB,QAAQO,OAAOE,MAAQQ,EAAKjB,QAAQO,OAAOG,SACpF8B,WACAD,KAAK,QAAS,IACdE,SAASzB,EAAOhB,QAAQ6B,KAAOjB,EAASC,GACxC0B,KAAK,eAAgBvB,EAAOhB,QAAQ6B,KAAO,QAAU,UAEzDa,OAAO,YACPnB,QAAQ,+BACRoB,UAAU3B,EAAO4B,aACb5C,EAAQI,SAAYY,EAAOhB,QAAQsB,UAAYN,EAAOhB,QAAQsB,SAASA,WAAatB,EAAQM,mBAC7FT,KAAKO,QAAQoB,IAAI,UAAW,OAIhC3B,MAAKK,OAASJ,EAAE,WACZ4B,QAAS,oBACTC,YAAa,SACbG,SAAY,IACZC,MAAS/B,EAAQO,OAAOC,MACxBgB,KAAQQ,OAAU,UAAWC,WAAcjC,EAAQG,aAAe,SAAW,WAC7E+B,MAAS,WACLlB,EAAO6B,QAAO,EACd5B,GAAKb,QAAQoB,IAAI,aAAc,SAC/BP,GAAKf,OAAOsB,IAAI,aAAc,aAGrCkB,OAAO5C,EAAE,YAAa4B,QAAoC,OAA3B1B,EAAQW,QAAQT,OAAkBc,EAAOsB,OAAOpC,OAASF,EAAQW,QAAQT,UACxGyC,UAAU3B,EAAO4B,aACb5C,EAAQE,QAAWc,EAAOhB,QAAQsB,UAAYN,EAAOhB,QAAQsB,SAASA,WAAatB,EAAQM,mBAC5FT,KAAKK,OAAOsB,IAAI,UAAW,SAGnCsB,OAAQ,SAAS9B,EAAQhB,IAEhBA,EAAQE,QAAWc,EAAOhB,QAAQsB,UAAYN,EAAOhB,QAAQsB,SAASA,WAAatB,EAAQM,iBAC5FT,KAAKK,OAAOsB,IAAI,UAAW,QACpBxB,EAAQE,QACfL,KAAKK,OAAOsB,IAAI,UAAW,UAE1BxB,EAAQI,SAAYY,EAAOhB,QAAQsB,UAAYN,EAAOhB,QAAQsB,SAASA,WAAatB,EAAQM,iBAC7FT,KAAKO,QAAQoB,IAAI,UAAW,QACrBxB,EAAQI,SACfP,KAAKO,QAAQoB,IAAI,UAAW,QAGhC3B,MAAKO,QAAQmB,QAAQ,8BAErB1B,MAAKK,OAAO6C,KAAK,QAAQR,KAAK,QAAS,IAAIE,SAAoC,OAA3BzC,EAAQW,QAAQT,OAAkBc,EAAOsB,OAAOpC,OAASF,EAAQW,QAAQT,OAEzHF,GAAQK,cACRR,KAAKO,QAAQoB,IAAI,aAAc,UACtBR,EAAOhB,QAAQsB,UAAYN,EAAOhB,QAAQsB,SAASA,WAAatB,EAAQM,kBACjFT,KAAKO,QAAQoB,IAAI,aAAc,UAE/BxB,GAAQG,aACRN,KAAKK,OAAOsB,IAAI,aAAc,UACrBR,EAAOhB,QAAQsB,UAAYN,EAAOhB,QAAQsB,SAASA,WAAatB,EAAQM,kBACjFT,KAAKK,OAAOsB,IAAI,aAAc,YAI1C1B,GAAEkD,OAAOpD,EAAQqD,QAAQC,aACrBhD,OAAQ,0BACRU,OAAQ,2BACRC,SAAU,mDAEdf,GAAEkD,OAAOpD,EAAQqD,QAAQE,UACrBjD,OAAQ,wBACRU,OAAQ,wBACRC,SAAU,yBAEdf,GAAEkD,OAAOpD,EAAQqD,QAAQG,YACrBlD,OAAQ,cACRU,OAAQ,aACRC,SAAU,aAEdf,GAAEkD,OAAOpD,EAAQqD,QAAQI,YACrBnD,OAAQ,6BACRU,OAAQ,4BACRC,SAAU,4BAEdf,GAAEkD,OAAOpD,EAAQqD,QAAQK,aACrBpD,OAAQ,cACRU,OAAQ,cACRC,SAAU","file":"pnotify.buttons.js.map"}
|
||||
176
public/js/v1.1.5/lib/pnotify/pnotify.buttons.js.src.js
Normal file
176
public/js/v1.1.5/lib/pnotify/pnotify.buttons.js.src.js
Normal file
@@ -0,0 +1,176 @@
|
||||
// Buttons
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as a module.
|
||||
define('pnotify.buttons', ['jquery', 'pnotify'], factory);
|
||||
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
|
||||
// CommonJS
|
||||
module.exports = factory(require('jquery'), require('./pnotify'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(root.jQuery, root.PNotify);
|
||||
}
|
||||
}(this, function($, PNotify){
|
||||
PNotify.prototype.options.buttons = {
|
||||
// Provide a button for the user to manually close the notice.
|
||||
closer: true,
|
||||
// Only show the closer button on hover.
|
||||
closer_hover: true,
|
||||
// Provide a button for the user to manually stick the notice.
|
||||
sticker: true,
|
||||
// Only show the sticker button on hover.
|
||||
sticker_hover: true,
|
||||
// Show the buttons even when the nonblock module is in use.
|
||||
show_on_nonblock: false,
|
||||
// The various displayed text, helps facilitating internationalization.
|
||||
labels: {
|
||||
close: "Close",
|
||||
stick: "Stick",
|
||||
unstick: "Unstick"
|
||||
},
|
||||
// The classes to use for button icons. Leave them null to use the classes from the styling you're using.
|
||||
classes: {
|
||||
closer: null,
|
||||
pin_up: null,
|
||||
pin_down: null
|
||||
}
|
||||
};
|
||||
PNotify.prototype.modules.buttons = {
|
||||
closer: null,
|
||||
sticker: null,
|
||||
|
||||
init: function(notice, options){
|
||||
var that = this;
|
||||
notice.elem.on({
|
||||
"mouseenter": function(e){
|
||||
// Show the buttons.
|
||||
if (that.options.sticker && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
|
||||
that.sticker.trigger("pnotify:buttons:toggleStick").css("visibility", "visible");
|
||||
}
|
||||
if (that.options.closer && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
|
||||
that.closer.css("visibility", "visible");
|
||||
}
|
||||
},
|
||||
"mouseleave": function(e){
|
||||
// Hide the buttons.
|
||||
if (that.options.sticker_hover) {
|
||||
that.sticker.css("visibility", "hidden");
|
||||
}
|
||||
if (that.options.closer_hover) {
|
||||
that.closer.css("visibility", "hidden");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Provide a button to stick the notice.
|
||||
this.sticker = $("<div />", {
|
||||
"class": "ui-pnotify-sticker",
|
||||
"aria-role": "button",
|
||||
"aria-pressed": notice.options.hide ? "false" : "true",
|
||||
"tabindex": "0",
|
||||
"title": notice.options.hide ? options.labels.stick : options.labels.unstick,
|
||||
"css": {
|
||||
"cursor": "pointer",
|
||||
"visibility": options.sticker_hover ? "hidden" : "visible"
|
||||
},
|
||||
"click": function(){
|
||||
notice.options.hide = !notice.options.hide;
|
||||
if (notice.options.hide) {
|
||||
notice.queueRemove();
|
||||
} else {
|
||||
notice.cancelRemove();
|
||||
}
|
||||
$(this).trigger("pnotify:buttons:toggleStick");
|
||||
}
|
||||
})
|
||||
.bind("pnotify:buttons:toggleStick", function(){
|
||||
var pin_up = that.options.classes.pin_up === null ? notice.styles.pin_up : that.options.classes.pin_up;
|
||||
var pin_down = that.options.classes.pin_down === null ? notice.styles.pin_down : that.options.classes.pin_down;
|
||||
$(this)
|
||||
.attr("title", notice.options.hide ? that.options.labels.stick : that.options.labels.unstick)
|
||||
.children()
|
||||
.attr("class", "")
|
||||
.addClass(notice.options.hide ? pin_up : pin_down)
|
||||
.attr("aria-pressed", notice.options.hide ? "false" : "true");
|
||||
})
|
||||
.append("<span />")
|
||||
.trigger("pnotify:buttons:toggleStick")
|
||||
.prependTo(notice.container);
|
||||
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.sticker.css("display", "none");
|
||||
}
|
||||
|
||||
// Provide a button to close the notice.
|
||||
this.closer = $("<div />", {
|
||||
"class": "ui-pnotify-closer",
|
||||
"aria-role": "button",
|
||||
"tabindex": "0",
|
||||
"title": options.labels.close,
|
||||
"css": {"cursor": "pointer", "visibility": options.closer_hover ? "hidden" : "visible"},
|
||||
"click": function(){
|
||||
notice.remove(false);
|
||||
that.sticker.css("visibility", "hidden");
|
||||
that.closer.css("visibility", "hidden");
|
||||
}
|
||||
})
|
||||
.append($("<span />", {"class": options.classes.closer === null ? notice.styles.closer : options.classes.closer}))
|
||||
.prependTo(notice.container);
|
||||
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.closer.css("display", "none");
|
||||
}
|
||||
},
|
||||
update: function(notice, options){
|
||||
// Update the sticker and closer buttons.
|
||||
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.closer.css("display", "none");
|
||||
} else if (options.closer) {
|
||||
this.closer.css("display", "block");
|
||||
}
|
||||
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.sticker.css("display", "none");
|
||||
} else if (options.sticker) {
|
||||
this.sticker.css("display", "block");
|
||||
}
|
||||
// Update the sticker icon.
|
||||
this.sticker.trigger("pnotify:buttons:toggleStick");
|
||||
// Update the close icon.
|
||||
this.closer.find("span").attr("class", "").addClass(options.classes.closer === null ? notice.styles.closer : options.classes.closer);
|
||||
// Update the hover status of the buttons.
|
||||
if (options.sticker_hover) {
|
||||
this.sticker.css("visibility", "hidden");
|
||||
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.sticker.css("visibility", "visible");
|
||||
}
|
||||
if (options.closer_hover) {
|
||||
this.closer.css("visibility", "hidden");
|
||||
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
|
||||
this.closer.css("visibility", "visible");
|
||||
}
|
||||
}
|
||||
};
|
||||
$.extend(PNotify.styling.brighttheme, {
|
||||
closer: "brighttheme-icon-closer",
|
||||
pin_up: "brighttheme-icon-sticker",
|
||||
pin_down: "brighttheme-icon-sticker brighttheme-icon-stuck"
|
||||
});
|
||||
$.extend(PNotify.styling.jqueryui, {
|
||||
closer: "ui-icon ui-icon-close",
|
||||
pin_up: "ui-icon ui-icon-pin-w",
|
||||
pin_down: "ui-icon ui-icon-pin-s"
|
||||
});
|
||||
$.extend(PNotify.styling.bootstrap2, {
|
||||
closer: "icon-remove",
|
||||
pin_up: "icon-pause",
|
||||
pin_down: "icon-play"
|
||||
});
|
||||
$.extend(PNotify.styling.bootstrap3, {
|
||||
closer: "glyphicon glyphicon-remove",
|
||||
pin_up: "glyphicon glyphicon-pause",
|
||||
pin_down: "glyphicon glyphicon-play"
|
||||
});
|
||||
$.extend(PNotify.styling.fontawesome, {
|
||||
closer: "fa fa-times",
|
||||
pin_up: "fa fa-pause",
|
||||
pin_down: "fa fa-play"
|
||||
});
|
||||
}));
|
||||
@@ -1,50 +0,0 @@
|
||||
// Callbacks
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as a module.
|
||||
define('pnotify.callbacks', ['jquery', 'pnotify'], factory);
|
||||
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
|
||||
// CommonJS
|
||||
module.exports = factory(require('jquery'), require('./pnotify'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(root.jQuery, root.PNotify);
|
||||
}
|
||||
}(this, function($, PNotify){
|
||||
var _init = PNotify.prototype.init,
|
||||
_open = PNotify.prototype.open,
|
||||
_remove = PNotify.prototype.remove;
|
||||
PNotify.prototype.init = function(){
|
||||
if (this.options.before_init) {
|
||||
this.options.before_init(this.options);
|
||||
}
|
||||
_init.apply(this, arguments);
|
||||
if (this.options.after_init) {
|
||||
this.options.after_init(this);
|
||||
}
|
||||
};
|
||||
PNotify.prototype.open = function(){
|
||||
var ret;
|
||||
if (this.options.before_open) {
|
||||
ret = this.options.before_open(this);
|
||||
}
|
||||
if (ret !== false) {
|
||||
_open.apply(this, arguments);
|
||||
if (this.options.after_open) {
|
||||
this.options.after_open(this);
|
||||
}
|
||||
}
|
||||
};
|
||||
PNotify.prototype.remove = function(timer_hide){
|
||||
var ret;
|
||||
if (this.options.before_close) {
|
||||
ret = this.options.before_close(this, timer_hide);
|
||||
}
|
||||
if (ret !== false) {
|
||||
_remove.apply(this, arguments);
|
||||
if (this.options.after_close) {
|
||||
this.options.after_close(this, timer_hide);
|
||||
}
|
||||
}
|
||||
};
|
||||
}));
|
||||
@@ -1,154 +0,0 @@
|
||||
// Desktop
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as a module.
|
||||
define('pnotify.desktop', ['jquery', 'pnotify'], factory);
|
||||
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
|
||||
// CommonJS
|
||||
module.exports = factory(require('jquery'), require('./pnotify'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(root.jQuery, root.PNotify);
|
||||
}
|
||||
}(this, function($, PNotify){
|
||||
var permission;
|
||||
var notify = function(title, options){
|
||||
// Memoize based on feature detection.
|
||||
if ("Notification" in window) {
|
||||
notify = function (title, options) {
|
||||
return new Notification(title, options);
|
||||
};
|
||||
} else if ("mozNotification" in navigator) {
|
||||
notify = function (title, options) {
|
||||
// Gecko < 22
|
||||
return navigator.mozNotification
|
||||
.createNotification(title, options.body, options.icon)
|
||||
.show();
|
||||
};
|
||||
} else if ("webkitNotifications" in window) {
|
||||
notify = function (title, options) {
|
||||
return window.webkitNotifications.createNotification(
|
||||
options.icon,
|
||||
title,
|
||||
options.body
|
||||
);
|
||||
};
|
||||
} else {
|
||||
notify = function (title, options) {
|
||||
return null;
|
||||
};
|
||||
}
|
||||
return notify(title, options);
|
||||
};
|
||||
|
||||
|
||||
PNotify.prototype.options.desktop = {
|
||||
// Display the notification as a desktop notification.
|
||||
desktop: false,
|
||||
// If desktop notifications are not supported or allowed, fall back to a regular notice.
|
||||
fallback: true,
|
||||
// The URL of the icon to display. If false, no icon will show. If null, a default icon will show.
|
||||
icon: null,
|
||||
// Using a tag lets you update an existing notice, or keep from duplicating notices between tabs.
|
||||
// If you leave tag null, one will be generated, facilitating the "update" function.
|
||||
// see: http://www.w3.org/TR/notifications/#tags-example
|
||||
tag: null
|
||||
};
|
||||
PNotify.prototype.modules.desktop = {
|
||||
tag: null,
|
||||
icon: null,
|
||||
genNotice: function(notice, options){
|
||||
if (options.icon === null) {
|
||||
this.icon = "http://sciactive.com/pnotify/includes/desktop/"+notice.options.type+".png";
|
||||
} else if (options.icon === false) {
|
||||
this.icon = null;
|
||||
} else {
|
||||
this.icon = options.icon;
|
||||
}
|
||||
if (this.tag === null || options.tag !== null) {
|
||||
this.tag = options.tag === null ? "PNotify-"+Math.round(Math.random() * 1000000) : options.tag;
|
||||
}
|
||||
notice.desktop = notify(notice.options.title, {
|
||||
icon: this.icon,
|
||||
body: options.text || notice.options.text,
|
||||
tag: this.tag
|
||||
});
|
||||
if (!("close" in notice.desktop) && ("cancel" in notice.desktop)) {
|
||||
notice.desktop.close = function(){
|
||||
notice.desktop.cancel();
|
||||
};
|
||||
}
|
||||
notice.desktop.onclick = function(){
|
||||
notice.elem.trigger("click");
|
||||
};
|
||||
notice.desktop.onclose = function(){
|
||||
if (notice.state !== "closing" && notice.state !== "closed") {
|
||||
notice.remove();
|
||||
}
|
||||
};
|
||||
},
|
||||
init: function(notice, options){
|
||||
if (!options.desktop)
|
||||
return;
|
||||
permission = PNotify.desktop.checkPermission();
|
||||
if (permission !== 0) {
|
||||
// Keep the notice from opening if fallback is false.
|
||||
if (!options.fallback) {
|
||||
notice.options.auto_display = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.genNotice(notice, options);
|
||||
},
|
||||
update: function(notice, options, oldOpts){
|
||||
if ((permission !== 0 && options.fallback) || !options.desktop)
|
||||
return;
|
||||
this.genNotice(notice, options);
|
||||
},
|
||||
beforeOpen: function(notice, options){
|
||||
if ((permission !== 0 && options.fallback) || !options.desktop)
|
||||
return;
|
||||
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
|
||||
},
|
||||
afterOpen: function(notice, options){
|
||||
if ((permission !== 0 && options.fallback) || !options.desktop)
|
||||
return;
|
||||
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
|
||||
if ("show" in notice.desktop) {
|
||||
notice.desktop.show();
|
||||
}
|
||||
},
|
||||
beforeClose: function(notice, options){
|
||||
if ((permission !== 0 && options.fallback) || !options.desktop)
|
||||
return;
|
||||
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
|
||||
},
|
||||
afterClose: function(notice, options){
|
||||
if ((permission !== 0 && options.fallback) || !options.desktop)
|
||||
return;
|
||||
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
|
||||
if ("close" in notice.desktop) {
|
||||
notice.desktop.close();
|
||||
}
|
||||
}
|
||||
};
|
||||
PNotify.desktop = {
|
||||
permission: function(){
|
||||
if (typeof Notification !== "undefined" && "requestPermission" in Notification) {
|
||||
Notification.requestPermission();
|
||||
} else if ("webkitNotifications" in window) {
|
||||
window.webkitNotifications.requestPermission();
|
||||
}
|
||||
},
|
||||
checkPermission: function(){
|
||||
if (typeof Notification !== "undefined" && "permission" in Notification) {
|
||||
return (Notification.permission === "granted" ? 0 : 1);
|
||||
} else if ("webkitNotifications" in window) {
|
||||
return window.webkitNotifications.checkPermission() == 0 ? 0 : 1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
permission = PNotify.desktop.checkPermission();
|
||||
}));
|
||||
@@ -1,873 +0,0 @@
|
||||
/*
|
||||
PNotify 3.0.0 sciactive.com/pnotify/
|
||||
(C) 2015 Hunter Perrin; Google, Inc.
|
||||
license Apache-2.0
|
||||
*/
|
||||
/*
|
||||
* ====== PNotify ======
|
||||
*
|
||||
* http://sciactive.com/pnotify/
|
||||
*
|
||||
* Copyright 2009-2015 Hunter Perrin
|
||||
* Copyright 2015 Google, Inc.
|
||||
*
|
||||
* Licensed under Apache License, Version 2.0.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as a module.
|
||||
define('pnotify', ['jquery'], function($){
|
||||
return factory($, root);
|
||||
});
|
||||
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
|
||||
// CommonJS
|
||||
module.exports = factory(require('jquery'), global || root);
|
||||
} else {
|
||||
// Browser globals
|
||||
root.PNotify = factory(root.jQuery, root);
|
||||
}
|
||||
}(this, function($, root){
|
||||
var init = function(root){
|
||||
var default_stack = {
|
||||
dir1: "down",
|
||||
dir2: "left",
|
||||
push: "bottom",
|
||||
spacing1: 36,
|
||||
spacing2: 36,
|
||||
context: $("body"),
|
||||
modal: false
|
||||
};
|
||||
var posTimer, // Position all timer.
|
||||
body,
|
||||
jwindow = $(root);
|
||||
// Set global variables.
|
||||
var do_when_ready = function(){
|
||||
body = $("body");
|
||||
PNotify.prototype.options.stack.context = body;
|
||||
jwindow = $(root);
|
||||
// Reposition the notices when the window resizes.
|
||||
jwindow.bind('resize', function(){
|
||||
if (posTimer) {
|
||||
clearTimeout(posTimer);
|
||||
}
|
||||
posTimer = setTimeout(function(){
|
||||
PNotify.positionAll(true);
|
||||
}, 10);
|
||||
});
|
||||
};
|
||||
var createStackOverlay = function(stack) {
|
||||
var overlay = $("<div />", {"class": "ui-pnotify-modal-overlay"});
|
||||
overlay.prependTo(stack.context);
|
||||
if (stack.overlay_close) {
|
||||
// Close the notices on overlay click.
|
||||
overlay.click(function(){
|
||||
PNotify.removeStack(stack);
|
||||
});
|
||||
}
|
||||
return overlay;
|
||||
};
|
||||
var PNotify = function(options){
|
||||
this.parseOptions(options);
|
||||
this.init();
|
||||
};
|
||||
$.extend(PNotify.prototype, {
|
||||
// The current version of PNotify.
|
||||
version: "3.0.0",
|
||||
|
||||
// === Options ===
|
||||
|
||||
// Options defaults.
|
||||
options: {
|
||||
// The notice's title.
|
||||
title: false,
|
||||
// Whether to escape the content of the title. (Not allow HTML.)
|
||||
title_escape: false,
|
||||
// The notice's text.
|
||||
text: false,
|
||||
// Whether to escape the content of the text. (Not allow HTML.)
|
||||
text_escape: false,
|
||||
// What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", or "fontawesome".)
|
||||
styling: "brighttheme",
|
||||
// Additional classes to be added to the notice. (For custom styling.)
|
||||
addclass: "",
|
||||
// Class to be added to the notice for corner styling.
|
||||
cornerclass: "",
|
||||
// Display the notice when it is created.
|
||||
auto_display: true,
|
||||
// Width of the notice.
|
||||
width: "300px",
|
||||
// Minimum height of the notice. It will expand to fit content.
|
||||
min_height: "16px",
|
||||
// Type of the notice. "notice", "info", "success", or "error".
|
||||
type: "notice",
|
||||
// Set icon to true to use the default icon for the selected
|
||||
// style/type, false for no icon, or a string for your own icon class.
|
||||
icon: true,
|
||||
// The animation to use when displaying and hiding the notice. "none"
|
||||
// and "fade" are supported through CSS. Others are supported
|
||||
// through the Animate module and Animate.css.
|
||||
animation: "fade",
|
||||
// Speed at which the notice animates in and out. "slow", "normal",
|
||||
// or "fast". Respectively, 600ms, 400ms, 200ms.
|
||||
animate_speed: "normal",
|
||||
// Display a drop shadow.
|
||||
shadow: true,
|
||||
// After a delay, remove the notice.
|
||||
hide: true,
|
||||
// Delay in milliseconds before the notice is removed.
|
||||
delay: 8000,
|
||||
// Reset the hide timer if the mouse moves over the notice.
|
||||
mouse_reset: true,
|
||||
// Remove the notice's elements from the DOM after it is removed.
|
||||
remove: true,
|
||||
// Change new lines to br tags.
|
||||
insert_brs: true,
|
||||
// Whether to remove notices from the global array.
|
||||
destroy: true,
|
||||
// The stack on which the notices will be placed. Also controls the
|
||||
// direction the notices stack.
|
||||
stack: default_stack
|
||||
},
|
||||
|
||||
// === Modules ===
|
||||
|
||||
// This object holds all the PNotify modules. They are used to provide
|
||||
// additional functionality.
|
||||
modules: {},
|
||||
// This runs an event on all the modules.
|
||||
runModules: function(event, arg){
|
||||
var curArg;
|
||||
for (var module in this.modules) {
|
||||
curArg = ((typeof arg === "object" && module in arg) ? arg[module] : arg);
|
||||
if (typeof this.modules[module][event] === 'function') {
|
||||
this.modules[module].notice = this;
|
||||
this.modules[module].options = typeof this.options[module] === 'object' ? this.options[module] : {};
|
||||
this.modules[module][event](this, typeof this.options[module] === 'object' ? this.options[module] : {}, curArg);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// === Class Variables ===
|
||||
|
||||
state: "initializing", // The state can be "initializing", "opening", "open", "closing", and "closed".
|
||||
timer: null, // Auto close timer.
|
||||
animTimer: null, // Animation timer.
|
||||
styles: null,
|
||||
elem: null,
|
||||
container: null,
|
||||
title_container: null,
|
||||
text_container: null,
|
||||
animating: false, // Stores what is currently being animated (in or out).
|
||||
timerHide: false, // Stores whether the notice was hidden by a timer.
|
||||
|
||||
// === Events ===
|
||||
|
||||
init: function(){
|
||||
var that = this;
|
||||
|
||||
// First and foremost, we don't want our module objects all referencing the prototype.
|
||||
this.modules = {};
|
||||
$.extend(true, this.modules, PNotify.prototype.modules);
|
||||
|
||||
// Get our styling object.
|
||||
if (typeof this.options.styling === "object") {
|
||||
this.styles = this.options.styling;
|
||||
} else {
|
||||
this.styles = PNotify.styling[this.options.styling];
|
||||
}
|
||||
|
||||
// Create our widget.
|
||||
// Stop animation, reset the removal timer when the user mouses over.
|
||||
this.elem = $("<div />", {
|
||||
"class": "ui-pnotify "+this.options.addclass,
|
||||
"css": {"display": "none"},
|
||||
"aria-live": "assertive",
|
||||
"aria-role": "alertdialog",
|
||||
"mouseenter": function(e){
|
||||
if (that.options.mouse_reset && that.animating === "out") {
|
||||
if (!that.timerHide) {
|
||||
return;
|
||||
}
|
||||
that.cancelRemove();
|
||||
}
|
||||
// Stop the close timer.
|
||||
if (that.options.hide && that.options.mouse_reset) {
|
||||
that.cancelRemove();
|
||||
}
|
||||
},
|
||||
"mouseleave": function(e){
|
||||
// Start the close timer.
|
||||
if (that.options.hide && that.options.mouse_reset && that.animating !== "out") {
|
||||
that.queueRemove();
|
||||
}
|
||||
PNotify.positionAll();
|
||||
}
|
||||
});
|
||||
// Maybe we need to fade in/out.
|
||||
if (this.options.animation === "fade") {
|
||||
this.elem.addClass("ui-pnotify-fade-"+this.options.animate_speed);
|
||||
}
|
||||
// Create a container for the notice contents.
|
||||
this.container = $("<div />", {
|
||||
"class": this.styles.container+" ui-pnotify-container "+(this.options.type === "error" ? this.styles.error : (this.options.type === "info" ? this.styles.info : (this.options.type === "success" ? this.styles.success : this.styles.notice))),
|
||||
"role": "alert"
|
||||
}).appendTo(this.elem);
|
||||
if (this.options.cornerclass !== "") {
|
||||
this.container.removeClass("ui-corner-all").addClass(this.options.cornerclass);
|
||||
}
|
||||
// Create a drop shadow.
|
||||
if (this.options.shadow) {
|
||||
this.container.addClass("ui-pnotify-shadow");
|
||||
}
|
||||
|
||||
|
||||
// Add the appropriate icon.
|
||||
if (this.options.icon !== false) {
|
||||
$("<div />", {"class": "ui-pnotify-icon"})
|
||||
.append($("<span />", {"class": this.options.icon === true ? (this.options.type === "error" ? this.styles.error_icon : (this.options.type === "info" ? this.styles.info_icon : (this.options.type === "success" ? this.styles.success_icon : this.styles.notice_icon))) : this.options.icon}))
|
||||
.prependTo(this.container);
|
||||
}
|
||||
|
||||
// Add a title.
|
||||
this.title_container = $("<h4 />", {
|
||||
"class": "ui-pnotify-title"
|
||||
})
|
||||
.appendTo(this.container);
|
||||
if (this.options.title === false) {
|
||||
this.title_container.hide();
|
||||
} else if (this.options.title_escape) {
|
||||
this.title_container.text(this.options.title);
|
||||
} else {
|
||||
this.title_container.html(this.options.title);
|
||||
}
|
||||
|
||||
// Add text.
|
||||
this.text_container = $("<div />", {
|
||||
"class": "ui-pnotify-text",
|
||||
"aria-role": "alert"
|
||||
})
|
||||
.appendTo(this.container);
|
||||
if (this.options.text === false) {
|
||||
this.text_container.hide();
|
||||
} else if (this.options.text_escape) {
|
||||
this.text_container.text(this.options.text);
|
||||
} else {
|
||||
this.text_container.html(this.options.insert_brs ? String(this.options.text).replace(/\n/g, "<br />") : this.options.text);
|
||||
}
|
||||
|
||||
// Set width and min height.
|
||||
if (typeof this.options.width === "string") {
|
||||
this.elem.css("width", this.options.width);
|
||||
}
|
||||
if (typeof this.options.min_height === "string") {
|
||||
this.container.css("min-height", this.options.min_height);
|
||||
}
|
||||
|
||||
|
||||
// Add the notice to the notice array.
|
||||
if (this.options.stack.push === "top") {
|
||||
PNotify.notices = $.merge([this], PNotify.notices);
|
||||
} else {
|
||||
PNotify.notices = $.merge(PNotify.notices, [this]);
|
||||
}
|
||||
// Now position all the notices if they are to push to the top.
|
||||
if (this.options.stack.push === "top") {
|
||||
this.queuePosition(false, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Mark the stack so it won't animate the new notice.
|
||||
this.options.stack.animation = false;
|
||||
|
||||
// Run the modules.
|
||||
this.runModules('init');
|
||||
|
||||
// Display the notice.
|
||||
if (this.options.auto_display) {
|
||||
this.open();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// This function is for updating the notice.
|
||||
update: function(options){
|
||||
// Save old options.
|
||||
var oldOpts = this.options;
|
||||
// Then update to the new options.
|
||||
this.parseOptions(oldOpts, options);
|
||||
// Maybe we need to fade in/out.
|
||||
this.elem.removeClass("ui-pnotify-fade-slow ui-pnotify-fade-normal ui-pnotify-fade-fast");
|
||||
if (this.options.animation === "fade") {
|
||||
this.elem.addClass("ui-pnotify-fade-"+this.options.animate_speed);
|
||||
}
|
||||
// Update the corner class.
|
||||
if (this.options.cornerclass !== oldOpts.cornerclass) {
|
||||
this.container.removeClass("ui-corner-all "+oldOpts.cornerclass).addClass(this.options.cornerclass);
|
||||
}
|
||||
// Update the shadow.
|
||||
if (this.options.shadow !== oldOpts.shadow) {
|
||||
if (this.options.shadow) {
|
||||
this.container.addClass("ui-pnotify-shadow");
|
||||
} else {
|
||||
this.container.removeClass("ui-pnotify-shadow");
|
||||
}
|
||||
}
|
||||
// Update the additional classes.
|
||||
if (this.options.addclass === false) {
|
||||
this.elem.removeClass(oldOpts.addclass);
|
||||
} else if (this.options.addclass !== oldOpts.addclass) {
|
||||
this.elem.removeClass(oldOpts.addclass).addClass(this.options.addclass);
|
||||
}
|
||||
// Update the title.
|
||||
if (this.options.title === false) {
|
||||
this.title_container.slideUp("fast");
|
||||
} else if (this.options.title !== oldOpts.title) {
|
||||
if (this.options.title_escape) {
|
||||
this.title_container.text(this.options.title);
|
||||
} else {
|
||||
this.title_container.html(this.options.title);
|
||||
}
|
||||
if (oldOpts.title === false) {
|
||||
this.title_container.slideDown(200);
|
||||
}
|
||||
}
|
||||
// Update the text.
|
||||
if (this.options.text === false) {
|
||||
this.text_container.slideUp("fast");
|
||||
} else if (this.options.text !== oldOpts.text) {
|
||||
if (this.options.text_escape) {
|
||||
this.text_container.text(this.options.text);
|
||||
} else {
|
||||
this.text_container.html(this.options.insert_brs ? String(this.options.text).replace(/\n/g, "<br />") : this.options.text);
|
||||
}
|
||||
if (oldOpts.text === false) {
|
||||
this.text_container.slideDown(200);
|
||||
}
|
||||
}
|
||||
// Change the notice type.
|
||||
if (this.options.type !== oldOpts.type)
|
||||
this.container.removeClass(
|
||||
this.styles.error+" "+this.styles.notice+" "+this.styles.success+" "+this.styles.info
|
||||
).addClass(this.options.type === "error" ?
|
||||
this.styles.error :
|
||||
(this.options.type === "info" ?
|
||||
this.styles.info :
|
||||
(this.options.type === "success" ?
|
||||
this.styles.success :
|
||||
this.styles.notice
|
||||
)
|
||||
)
|
||||
);
|
||||
if (this.options.icon !== oldOpts.icon || (this.options.icon === true && this.options.type !== oldOpts.type)) {
|
||||
// Remove any old icon.
|
||||
this.container.find("div.ui-pnotify-icon").remove();
|
||||
if (this.options.icon !== false) {
|
||||
// Build the new icon.
|
||||
$("<div />", {"class": "ui-pnotify-icon"})
|
||||
.append($("<span />", {"class": this.options.icon === true ? (this.options.type === "error" ? this.styles.error_icon : (this.options.type === "info" ? this.styles.info_icon : (this.options.type === "success" ? this.styles.success_icon : this.styles.notice_icon))) : this.options.icon}))
|
||||
.prependTo(this.container);
|
||||
}
|
||||
}
|
||||
// Update the width.
|
||||
if (this.options.width !== oldOpts.width) {
|
||||
this.elem.animate({width: this.options.width});
|
||||
}
|
||||
// Update the minimum height.
|
||||
if (this.options.min_height !== oldOpts.min_height) {
|
||||
this.container.animate({minHeight: this.options.min_height});
|
||||
}
|
||||
// Update the timed hiding.
|
||||
if (!this.options.hide) {
|
||||
this.cancelRemove();
|
||||
} else if (!oldOpts.hide) {
|
||||
this.queueRemove();
|
||||
}
|
||||
this.queuePosition(true);
|
||||
|
||||
// Run the modules.
|
||||
this.runModules('update', oldOpts);
|
||||
return this;
|
||||
},
|
||||
|
||||
// Display the notice.
|
||||
open: function(){
|
||||
this.state = "opening";
|
||||
// Run the modules.
|
||||
this.runModules('beforeOpen');
|
||||
|
||||
var that = this;
|
||||
// If the notice is not in the DOM, append it.
|
||||
if (!this.elem.parent().length) {
|
||||
this.elem.appendTo(this.options.stack.context ? this.options.stack.context : body);
|
||||
}
|
||||
// Try to put it in the right position.
|
||||
if (this.options.stack.push !== "top") {
|
||||
this.position(true);
|
||||
}
|
||||
this.animateIn(function(){
|
||||
that.queuePosition(true);
|
||||
|
||||
// Now set it to hide.
|
||||
if (that.options.hide) {
|
||||
that.queueRemove();
|
||||
}
|
||||
|
||||
that.state = "open";
|
||||
|
||||
// Run the modules.
|
||||
that.runModules('afterOpen');
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// Remove the notice.
|
||||
remove: function(timer_hide) {
|
||||
this.state = "closing";
|
||||
this.timerHide = !!timer_hide; // Make sure it's a boolean.
|
||||
// Run the modules.
|
||||
this.runModules('beforeClose');
|
||||
|
||||
var that = this;
|
||||
if (this.timer) {
|
||||
root.clearTimeout(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
this.animateOut(function(){
|
||||
that.state = "closed";
|
||||
// Run the modules.
|
||||
that.runModules('afterClose');
|
||||
that.queuePosition(true);
|
||||
// If we're supposed to remove the notice from the DOM, do it.
|
||||
if (that.options.remove) {
|
||||
that.elem.detach();
|
||||
}
|
||||
// Run the modules.
|
||||
that.runModules('beforeDestroy');
|
||||
// Remove object from PNotify.notices to prevent memory leak (issue #49)
|
||||
// unless destroy is off
|
||||
if (that.options.destroy) {
|
||||
if (PNotify.notices !== null) {
|
||||
var idx = $.inArray(that,PNotify.notices);
|
||||
if (idx !== -1) {
|
||||
PNotify.notices.splice(idx,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Run the modules.
|
||||
that.runModules('afterDestroy');
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// === Class Methods ===
|
||||
|
||||
// Get the DOM element.
|
||||
get: function(){
|
||||
return this.elem;
|
||||
},
|
||||
|
||||
// Put all the options in the right places.
|
||||
parseOptions: function(options, moreOptions){
|
||||
this.options = $.extend(true, {}, PNotify.prototype.options);
|
||||
// This is the only thing that *should* be copied by reference.
|
||||
this.options.stack = PNotify.prototype.options.stack;
|
||||
var optArray = [options, moreOptions], curOpts;
|
||||
for (var curIndex=0; curIndex < optArray.length; curIndex++) {
|
||||
curOpts = optArray[curIndex];
|
||||
if (typeof curOpts === "undefined") {
|
||||
break;
|
||||
}
|
||||
if (typeof curOpts !== 'object') {
|
||||
this.options.text = curOpts;
|
||||
} else {
|
||||
for (var option in curOpts) {
|
||||
if (this.modules[option]) {
|
||||
// Avoid overwriting module defaults.
|
||||
$.extend(true, this.options[option], curOpts[option]);
|
||||
} else {
|
||||
this.options[option] = curOpts[option];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Animate the notice in.
|
||||
animateIn: function(callback){
|
||||
// Declare that the notice is animating in.
|
||||
this.animating = "in";
|
||||
var that = this;
|
||||
callback = (function(){
|
||||
if (that.animTimer) {
|
||||
clearTimeout(that.animTimer);
|
||||
}
|
||||
if (that.animating !== "in") {
|
||||
return;
|
||||
}
|
||||
if (that.elem.is(":visible")) {
|
||||
if (this) {
|
||||
this.call();
|
||||
}
|
||||
// Declare that the notice has completed animating.
|
||||
that.animating = false;
|
||||
} else {
|
||||
that.animTimer = setTimeout(callback, 40);
|
||||
}
|
||||
}).bind(callback);
|
||||
|
||||
if (this.options.animation === "fade") {
|
||||
this.elem.one('webkitTransitionEnd mozTransitionEnd MSTransitionEnd oTransitionEnd transitionend', callback).addClass("ui-pnotify-in");
|
||||
this.elem.css("opacity"); // This line is necessary for some reason. Some notices don't fade without it.
|
||||
this.elem.addClass("ui-pnotify-fade-in");
|
||||
// Just in case the event doesn't fire, call it after 650 ms.
|
||||
this.animTimer = setTimeout(callback, 650);
|
||||
} else {
|
||||
this.elem.addClass("ui-pnotify-in");
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// Animate the notice out.
|
||||
animateOut: function(callback){
|
||||
// Declare that the notice is animating out.
|
||||
this.animating = "out";
|
||||
var that = this;
|
||||
callback = (function(){
|
||||
if (that.animTimer) {
|
||||
clearTimeout(that.animTimer);
|
||||
}
|
||||
if (that.animating !== "out") {
|
||||
return;
|
||||
}
|
||||
if (that.elem.css("opacity") == "0" || !that.elem.is(":visible")) {
|
||||
that.elem.removeClass("ui-pnotify-in");
|
||||
if (this) {
|
||||
this.call();
|
||||
}
|
||||
// Declare that the notice has completed animating.
|
||||
that.animating = false;
|
||||
} else {
|
||||
// In case this was called before the notice finished animating.
|
||||
that.animTimer = setTimeout(callback, 40);
|
||||
}
|
||||
}).bind(callback);
|
||||
|
||||
if (this.options.animation === "fade") {
|
||||
this.elem.one('webkitTransitionEnd mozTransitionEnd MSTransitionEnd oTransitionEnd transitionend', callback).removeClass("ui-pnotify-fade-in");
|
||||
// Just in case the event doesn't fire, call it after 650 ms.
|
||||
this.animTimer = setTimeout(callback, 650);
|
||||
} else {
|
||||
this.elem.removeClass("ui-pnotify-in");
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// Position the notice. dont_skip_hidden causes the notice to
|
||||
// position even if it's not visible.
|
||||
position: function(dontSkipHidden){
|
||||
// Get the notice's stack.
|
||||
var stack = this.options.stack,
|
||||
elem = this.elem;
|
||||
if (typeof stack.context === "undefined") {
|
||||
stack.context = body;
|
||||
}
|
||||
if (!stack) {
|
||||
return;
|
||||
}
|
||||
if (typeof stack.nextpos1 !== "number") {
|
||||
stack.nextpos1 = stack.firstpos1;
|
||||
}
|
||||
if (typeof stack.nextpos2 !== "number") {
|
||||
stack.nextpos2 = stack.firstpos2;
|
||||
}
|
||||
if (typeof stack.addpos2 !== "number") {
|
||||
stack.addpos2 = 0;
|
||||
}
|
||||
var hidden = !elem.hasClass("ui-pnotify-in");
|
||||
// Skip this notice if it's not shown.
|
||||
if (!hidden || dontSkipHidden) {
|
||||
if (stack.modal) {
|
||||
if (stack.overlay) {
|
||||
stack.overlay.show();
|
||||
} else {
|
||||
stack.overlay = createStackOverlay(stack);
|
||||
}
|
||||
}
|
||||
// Add animate class by default.
|
||||
elem.addClass("ui-pnotify-move");
|
||||
var curpos1, curpos2;
|
||||
// Calculate the current pos1 value.
|
||||
var csspos1;
|
||||
switch (stack.dir1) {
|
||||
case "down":
|
||||
csspos1 = "top";
|
||||
break;
|
||||
case "up":
|
||||
csspos1 = "bottom";
|
||||
break;
|
||||
case "left":
|
||||
csspos1 = "right";
|
||||
break;
|
||||
case "right":
|
||||
csspos1 = "left";
|
||||
break;
|
||||
}
|
||||
curpos1 = parseInt(elem.css(csspos1).replace(/(?:\..*|[^0-9.])/g, ''));
|
||||
if (isNaN(curpos1)) {
|
||||
curpos1 = 0;
|
||||
}
|
||||
// Remember the first pos1, so the first visible notice goes there.
|
||||
if (typeof stack.firstpos1 === "undefined" && !hidden) {
|
||||
stack.firstpos1 = curpos1;
|
||||
stack.nextpos1 = stack.firstpos1;
|
||||
}
|
||||
// Calculate the current pos2 value.
|
||||
var csspos2;
|
||||
switch (stack.dir2) {
|
||||
case "down":
|
||||
csspos2 = "top";
|
||||
break;
|
||||
case "up":
|
||||
csspos2 = "bottom";
|
||||
break;
|
||||
case "left":
|
||||
csspos2 = "right";
|
||||
break;
|
||||
case "right":
|
||||
csspos2 = "left";
|
||||
break;
|
||||
}
|
||||
curpos2 = parseInt(elem.css(csspos2).replace(/(?:\..*|[^0-9.])/g, ''));
|
||||
if (isNaN(curpos2)) {
|
||||
curpos2 = 0;
|
||||
}
|
||||
// Remember the first pos2, so the first visible notice goes there.
|
||||
if (typeof stack.firstpos2 === "undefined" && !hidden) {
|
||||
stack.firstpos2 = curpos2;
|
||||
stack.nextpos2 = stack.firstpos2;
|
||||
}
|
||||
// Check that it's not beyond the viewport edge.
|
||||
if (
|
||||
(stack.dir1 === "down" && stack.nextpos1 + elem.height() > (stack.context.is(body) ? jwindow.height() : stack.context.prop('scrollHeight')) ) ||
|
||||
(stack.dir1 === "up" && stack.nextpos1 + elem.height() > (stack.context.is(body) ? jwindow.height() : stack.context.prop('scrollHeight')) ) ||
|
||||
(stack.dir1 === "left" && stack.nextpos1 + elem.width() > (stack.context.is(body) ? jwindow.width() : stack.context.prop('scrollWidth')) ) ||
|
||||
(stack.dir1 === "right" && stack.nextpos1 + elem.width() > (stack.context.is(body) ? jwindow.width() : stack.context.prop('scrollWidth')) )
|
||||
) {
|
||||
// If it is, it needs to go back to the first pos1, and over on pos2.
|
||||
stack.nextpos1 = stack.firstpos1;
|
||||
stack.nextpos2 += stack.addpos2 + (typeof stack.spacing2 === "undefined" ? 25 : stack.spacing2);
|
||||
stack.addpos2 = 0;
|
||||
}
|
||||
if (typeof stack.nextpos2 === "number") {
|
||||
if (!stack.animation) {
|
||||
elem.removeClass("ui-pnotify-move");
|
||||
elem.css(csspos2, stack.nextpos2+"px");
|
||||
elem.css(csspos2);
|
||||
elem.addClass("ui-pnotify-move");
|
||||
} else {
|
||||
elem.css(csspos2, stack.nextpos2+"px");
|
||||
}
|
||||
}
|
||||
// Keep track of the widest/tallest notice in the column/row, so we can push the next column/row.
|
||||
switch (stack.dir2) {
|
||||
case "down":
|
||||
case "up":
|
||||
if (elem.outerHeight(true) > stack.addpos2) {
|
||||
stack.addpos2 = elem.height();
|
||||
}
|
||||
break;
|
||||
case "left":
|
||||
case "right":
|
||||
if (elem.outerWidth(true) > stack.addpos2) {
|
||||
stack.addpos2 = elem.width();
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Move the notice on dir1.
|
||||
if (typeof stack.nextpos1 === "number") {
|
||||
if (!stack.animation) {
|
||||
elem.removeClass("ui-pnotify-move");
|
||||
elem.css(csspos1, stack.nextpos1+"px");
|
||||
elem.css(csspos1);
|
||||
elem.addClass("ui-pnotify-move");
|
||||
} else {
|
||||
elem.css(csspos1, stack.nextpos1+"px");
|
||||
}
|
||||
}
|
||||
// Calculate the next dir1 position.
|
||||
switch (stack.dir1) {
|
||||
case "down":
|
||||
case "up":
|
||||
stack.nextpos1 += elem.height() + (typeof stack.spacing1 === "undefined" ? 25 : stack.spacing1);
|
||||
break;
|
||||
case "left":
|
||||
case "right":
|
||||
stack.nextpos1 += elem.width() + (typeof stack.spacing1 === "undefined" ? 25 : stack.spacing1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
// Queue the position all function so it doesn't run repeatedly and
|
||||
// use up resources.
|
||||
queuePosition: function(animate, milliseconds){
|
||||
if (posTimer) {
|
||||
clearTimeout(posTimer);
|
||||
}
|
||||
if (!milliseconds) {
|
||||
milliseconds = 10;
|
||||
}
|
||||
posTimer = setTimeout(function(){
|
||||
PNotify.positionAll(animate);
|
||||
}, milliseconds);
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
// Cancel any pending removal timer.
|
||||
cancelRemove: function(){
|
||||
if (this.timer) {
|
||||
root.clearTimeout(this.timer);
|
||||
}
|
||||
if (this.animTimer) {
|
||||
root.clearTimeout(this.animTimer);
|
||||
}
|
||||
if (this.state === "closing") {
|
||||
// If it's animating out, stop it.
|
||||
this.state = "open";
|
||||
this.animating = false;
|
||||
this.elem.addClass("ui-pnotify-in");
|
||||
if (this.options.animation === "fade") {
|
||||
this.elem.addClass("ui-pnotify-fade-in");
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
// Queue a removal timer.
|
||||
queueRemove: function(){
|
||||
var that = this;
|
||||
// Cancel any current removal timer.
|
||||
this.cancelRemove();
|
||||
this.timer = root.setTimeout(function(){
|
||||
that.remove(true);
|
||||
}, (isNaN(this.options.delay) ? 0 : this.options.delay));
|
||||
return this;
|
||||
}
|
||||
});
|
||||
// These functions affect all notices.
|
||||
$.extend(PNotify, {
|
||||
// This holds all the notices.
|
||||
notices: [],
|
||||
reload: init,
|
||||
removeAll: function(){
|
||||
$.each(PNotify.notices, function(){
|
||||
if (this.remove) {
|
||||
this.remove(false);
|
||||
}
|
||||
});
|
||||
},
|
||||
removeStack: function(stack){
|
||||
$.each(PNotify.notices, function(){
|
||||
if (this.remove && this.options.stack === stack) {
|
||||
this.remove(false);
|
||||
}
|
||||
});
|
||||
},
|
||||
positionAll: function(animate){
|
||||
// This timer is used for queueing this function so it doesn't run
|
||||
// repeatedly.
|
||||
if (posTimer) {
|
||||
clearTimeout(posTimer);
|
||||
}
|
||||
posTimer = null;
|
||||
// Reset the next position data.
|
||||
if (PNotify.notices && PNotify.notices.length) {
|
||||
$.each(PNotify.notices, function(){
|
||||
var s = this.options.stack;
|
||||
if (!s) {
|
||||
return;
|
||||
}
|
||||
if (s.overlay) {
|
||||
s.overlay.hide();
|
||||
}
|
||||
s.nextpos1 = s.firstpos1;
|
||||
s.nextpos2 = s.firstpos2;
|
||||
s.addpos2 = 0;
|
||||
s.animation = animate;
|
||||
});
|
||||
$.each(PNotify.notices, function(){
|
||||
this.position();
|
||||
});
|
||||
} else {
|
||||
var s = PNotify.prototype.options.stack;
|
||||
if (s) {
|
||||
delete s.nextpos1;
|
||||
delete s.nextpos2;
|
||||
}
|
||||
}
|
||||
},
|
||||
styling: {
|
||||
brighttheme: {
|
||||
// Bright Theme doesn't require any UI libraries.
|
||||
container: "brighttheme",
|
||||
notice: "brighttheme-notice",
|
||||
notice_icon: "brighttheme-icon-notice",
|
||||
info: "brighttheme-info",
|
||||
info_icon: "brighttheme-icon-info",
|
||||
success: "brighttheme-success",
|
||||
success_icon: "brighttheme-icon-success",
|
||||
error: "brighttheme-error",
|
||||
error_icon: "brighttheme-icon-error"
|
||||
},
|
||||
jqueryui: {
|
||||
container: "ui-widget ui-widget-content ui-corner-all",
|
||||
notice: "ui-state-highlight",
|
||||
// (The actual jQUI notice icon looks terrible.)
|
||||
notice_icon: "ui-icon ui-icon-info",
|
||||
info: "",
|
||||
info_icon: "ui-icon ui-icon-info",
|
||||
success: "ui-state-default",
|
||||
success_icon: "ui-icon ui-icon-circle-check",
|
||||
error: "ui-state-error",
|
||||
error_icon: "ui-icon ui-icon-alert"
|
||||
},
|
||||
bootstrap3: {
|
||||
container: "alert",
|
||||
notice: "alert-warning",
|
||||
notice_icon: "glyphicon glyphicon-exclamation-sign",
|
||||
info: "alert-info",
|
||||
info_icon: "glyphicon glyphicon-info-sign",
|
||||
success: "alert-success",
|
||||
success_icon: "glyphicon glyphicon-ok-sign",
|
||||
error: "alert-danger",
|
||||
error_icon: "glyphicon glyphicon-warning-sign"
|
||||
}
|
||||
}
|
||||
});
|
||||
/*
|
||||
* uses icons from http://fontawesome.io/
|
||||
* version 4.0.3
|
||||
*/
|
||||
PNotify.styling.fontawesome = $.extend({}, PNotify.styling.bootstrap3);
|
||||
$.extend(PNotify.styling.fontawesome, {
|
||||
notice_icon: "fa fa-exclamation-circle",
|
||||
info_icon: "fa fa-info",
|
||||
success_icon: "fa fa-check",
|
||||
error_icon: "fa fa-warning"
|
||||
});
|
||||
|
||||
if (root.document.body) {
|
||||
do_when_ready();
|
||||
} else {
|
||||
$(do_when_ready);
|
||||
}
|
||||
return PNotify;
|
||||
};
|
||||
return init(root);
|
||||
}));
|
||||
@@ -1,156 +0,0 @@
|
||||
// Nonblock
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as a module.
|
||||
define('pnotify.nonblock', ['jquery', 'pnotify'], factory);
|
||||
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
|
||||
// CommonJS
|
||||
module.exports = factory(require('jquery'), require('./pnotify'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(root.jQuery, root.PNotify);
|
||||
}
|
||||
}(this, function($, PNotify){
|
||||
// Some useful regexes.
|
||||
var re_on = /^on/,
|
||||
re_mouse_events = /^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,
|
||||
re_ui_events = /^(focus|blur|select|change|reset)$|^key(press|down|up)$/,
|
||||
re_html_events = /^(scroll|resize|(un)?load|abort|error)$/;
|
||||
// Fire a DOM event.
|
||||
var dom_event = function(e, orig_e){
|
||||
var event_object;
|
||||
e = e.toLowerCase();
|
||||
if (document.createEvent && this.dispatchEvent) {
|
||||
// FireFox, Opera, Safari, Chrome
|
||||
e = e.replace(re_on, '');
|
||||
if (e.match(re_mouse_events)) {
|
||||
// This allows the click event to fire on the notice. There is
|
||||
// probably a much better way to do it.
|
||||
$(this).offset();
|
||||
event_object = document.createEvent("MouseEvents");
|
||||
event_object.initMouseEvent(
|
||||
e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail,
|
||||
orig_e.screenX, orig_e.screenY, orig_e.clientX, orig_e.clientY,
|
||||
orig_e.ctrlKey, orig_e.altKey, orig_e.shiftKey, orig_e.metaKey, orig_e.button, orig_e.relatedTarget
|
||||
);
|
||||
} else if (e.match(re_ui_events)) {
|
||||
event_object = document.createEvent("UIEvents");
|
||||
event_object.initUIEvent(e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail);
|
||||
} else if (e.match(re_html_events)) {
|
||||
event_object = document.createEvent("HTMLEvents");
|
||||
event_object.initEvent(e, orig_e.bubbles, orig_e.cancelable);
|
||||
}
|
||||
if (!event_object) return;
|
||||
this.dispatchEvent(event_object);
|
||||
} else {
|
||||
// Internet Explorer
|
||||
if (!e.match(re_on)) e = "on"+e;
|
||||
event_object = document.createEventObject(orig_e);
|
||||
this.fireEvent(e, event_object);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// This keeps track of the last element the mouse was over, so
|
||||
// mouseleave, mouseenter, etc can be called.
|
||||
var nonblock_last_elem;
|
||||
// This is used to pass events through the notice if it is non-blocking.
|
||||
var nonblock_pass = function(notice, e, e_name){
|
||||
notice.elem.addClass("ui-pnotify-nonblock-hide");
|
||||
var element_below = document.elementFromPoint(e.clientX, e.clientY);
|
||||
notice.elem.removeClass("ui-pnotify-nonblock-hide");
|
||||
var jelement_below = $(element_below);
|
||||
var cursor_style = jelement_below.css("cursor");
|
||||
if (cursor_style === "auto" && element_below.tagName === "A") {
|
||||
cursor_style = "pointer";
|
||||
}
|
||||
notice.elem.css("cursor", cursor_style !== "auto" ? cursor_style : "default");
|
||||
// If the element changed, call mouseenter, mouseleave, etc.
|
||||
if (!nonblock_last_elem || nonblock_last_elem.get(0) != element_below) {
|
||||
if (nonblock_last_elem) {
|
||||
dom_event.call(nonblock_last_elem.get(0), "mouseleave", e.originalEvent);
|
||||
dom_event.call(nonblock_last_elem.get(0), "mouseout", e.originalEvent);
|
||||
}
|
||||
dom_event.call(element_below, "mouseenter", e.originalEvent);
|
||||
dom_event.call(element_below, "mouseover", e.originalEvent);
|
||||
}
|
||||
dom_event.call(element_below, e_name, e.originalEvent);
|
||||
// Remember the latest element the mouse was over.
|
||||
nonblock_last_elem = jelement_below;
|
||||
};
|
||||
|
||||
|
||||
PNotify.prototype.options.nonblock = {
|
||||
// Create a non-blocking notice. It lets the user click elements underneath it.
|
||||
nonblock: false
|
||||
};
|
||||
PNotify.prototype.modules.nonblock = {
|
||||
init: function(notice, options){
|
||||
var that = this;
|
||||
notice.elem.on({
|
||||
"mouseenter": function(e){
|
||||
if (that.options.nonblock) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
if (that.options.nonblock) {
|
||||
// If it's non-blocking, animate to the other opacity.
|
||||
notice.elem.addClass("ui-pnotify-nonblock-fade");
|
||||
}
|
||||
},
|
||||
"mouseleave": function(e){
|
||||
if (that.options.nonblock) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
nonblock_last_elem = null;
|
||||
notice.elem.css("cursor", "auto");
|
||||
// Animate back to the normal opacity.
|
||||
if (that.options.nonblock && notice.animating !== "out") {
|
||||
notice.elem.removeClass("ui-pnotify-nonblock-fade");
|
||||
}
|
||||
},
|
||||
"mouseover": function(e){
|
||||
if (that.options.nonblock) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
},
|
||||
"mouseout": function(e){
|
||||
if (that.options.nonblock) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
},
|
||||
"mousemove": function(e){
|
||||
if (that.options.nonblock) {
|
||||
e.stopPropagation();
|
||||
nonblock_pass(notice, e, "onmousemove");
|
||||
}
|
||||
},
|
||||
"mousedown": function(e){
|
||||
if (that.options.nonblock) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
nonblock_pass(notice, e, "onmousedown");
|
||||
}
|
||||
},
|
||||
"mouseup": function(e){
|
||||
if (that.options.nonblock) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
nonblock_pass(notice, e, "onmouseup");
|
||||
}
|
||||
},
|
||||
"click": function(e){
|
||||
if (that.options.nonblock) {
|
||||
e.stopPropagation();
|
||||
nonblock_pass(notice, e, "onclick");
|
||||
}
|
||||
},
|
||||
"dblclick": function(e){
|
||||
if (that.options.nonblock) {
|
||||
e.stopPropagation();
|
||||
nonblock_pass(notice, e, "ondblclick");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}));
|
||||
11
public/js/v1.1.5/lib/raphael-min.js
vendored
11
public/js/v1.1.5/lib/raphael-min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/js/v1.1.5/lib/require.js.map
Normal file
1
public/js/v1.1.5/lib/require.js.map
Normal file
File diff suppressed because one or more lines are too long
36
public/js/v1.1.5/lib/require.js.src.js
Normal file
36
public/js/v1.1.5/lib/require.js.src.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
RequireJS 2.2.0 Copyright jQuery Foundation and other contributors.
|
||||
Released under MIT license, http://github.com/requirejs/requirejs/LICENSE
|
||||
*/
|
||||
var requirejs,require,define;
|
||||
(function(ga){function ka(b,c,d,g){return g||""}function K(b){return"[object Function]"===Q.call(b)}function L(b){return"[object Array]"===Q.call(b)}function y(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function X(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));--d);}}function x(b,c){return la.call(b,c)}function e(b,c){return x(b,c)&&b[c]}function D(b,c){for(var d in b)if(x(b,d)&&c(b[d],d))break}function Y(b,c,d,g){c&&D(c,function(c,e){if(d||!x(b,e))!g||"object"!==
|
||||
typeof c||!c||L(c)||K(c)||c instanceof RegExp?b[e]=c:(b[e]||(b[e]={}),Y(b[e],c,d,g))});return b}function z(b,c){return function(){return c.apply(b,arguments)}}function ha(b){throw b;}function ia(b){if(!b)return b;var c=ga;y(b.split("."),function(b){c=c[b]});return c}function F(b,c,d,g){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=g;d&&(c.originalError=d);return c}function ma(b){function c(a,n,b){var h,k,f,c,d,l,g,r;n=n&&n.split("/");var q=p.map,m=q&&q["*"];
|
||||
if(a){a=a.split("/");k=a.length-1;p.nodeIdCompat&&U.test(a[k])&&(a[k]=a[k].replace(U,""));"."===a[0].charAt(0)&&n&&(k=n.slice(0,n.length-1),a=k.concat(a));k=a;for(f=0;f<k.length;f++)c=k[f],"."===c?(k.splice(f,1),--f):".."===c&&0!==f&&(1!==f||".."!==k[2])&&".."!==k[f-1]&&0<f&&(k.splice(f-1,2),f-=2);a=a.join("/")}if(b&&q&&(n||m)){k=a.split("/");f=k.length;a:for(;0<f;--f){d=k.slice(0,f).join("/");if(n)for(c=n.length;0<c;--c)if(b=e(q,n.slice(0,c).join("/")))if(b=e(b,d)){h=b;l=f;break a}!g&&m&&e(m,d)&&
|
||||
(g=e(m,d),r=f)}!h&&g&&(h=g,l=r);h&&(k.splice(0,l,h),a=k.join("/"))}return(h=e(p.pkgs,a))?h:a}function d(a){E&&y(document.getElementsByTagName("script"),function(n){if(n.getAttribute("data-requiremodule")===a&&n.getAttribute("data-requirecontext")===l.contextName)return n.parentNode.removeChild(n),!0})}function m(a){var n=e(p.paths,a);if(n&&L(n)&&1<n.length)return n.shift(),l.require.undef(a),l.makeRequire(null,{skipMap:!0})([a]),!0}function r(a){var n,b=a?a.indexOf("!"):-1;-1<b&&(n=a.substring(0,
|
||||
b),a=a.substring(b+1,a.length));return[n,a]}function q(a,n,b,h){var k,f,d=null,g=n?n.name:null,p=a,q=!0,m="";a||(q=!1,a="_@r"+(Q+=1));a=r(a);d=a[0];a=a[1];d&&(d=c(d,g,h),f=e(v,d));a&&(d?m=f&&f.normalize?f.normalize(a,function(a){return c(a,g,h)}):-1===a.indexOf("!")?c(a,g,h):a:(m=c(a,g,h),a=r(m),d=a[0],m=a[1],b=!0,k=l.nameToUrl(m)));b=!d||f||b?"":"_unnormalized"+(T+=1);return{prefix:d,name:m,parentMap:n,unnormalized:!!b,url:k,originalName:p,isDefine:q,id:(d?d+"!"+m:m)+b}}function u(a){var b=a.id,
|
||||
c=e(t,b);c||(c=t[b]=new l.Module(a));return c}function w(a,b,c){var h=a.id,k=e(t,h);if(!x(v,h)||k&&!k.defineEmitComplete)if(k=u(a),k.error&&"error"===b)c(k.error);else k.on(b,c);else"defined"===b&&c(v[h])}function A(a,b){var c=a.requireModules,h=!1;if(b)b(a);else if(y(c,function(b){if(b=e(t,b))b.error=a,b.events.error&&(h=!0,b.emit("error",a))}),!h)g.onError(a)}function B(){V.length&&(y(V,function(a){var b=a[0];"string"===typeof b&&(l.defQueueMap[b]=!0);G.push(a)}),V=[])}function C(a){delete t[a];
|
||||
delete Z[a]}function J(a,b,c){var h=a.map.id;a.error?a.emit("error",a.error):(b[h]=!0,y(a.depMaps,function(h,f){var d=h.id,g=e(t,d);!g||a.depMatched[f]||c[d]||(e(b,d)?(a.defineDep(f,v[d]),a.check()):J(g,b,c))}),c[h]=!0)}function H(){var a,b,c=(a=1E3*p.waitSeconds)&&l.startTime+a<(new Date).getTime(),h=[],k=[],f=!1,g=!0;if(!aa){aa=!0;D(Z,function(a){var l=a.map,e=l.id;if(a.enabled&&(l.isDefine||k.push(a),!a.error))if(!a.inited&&c)m(e)?f=b=!0:(h.push(e),d(e));else if(!a.inited&&a.fetched&&l.isDefine&&
|
||||
(f=!0,!l.prefix))return g=!1});if(c&&h.length)return a=F("timeout","Load timeout for modules: "+h,null,h),a.contextName=l.contextName,A(a);g&&y(k,function(a){J(a,{},{})});c&&!b||!f||!E&&!ja||ba||(ba=setTimeout(function(){ba=0;H()},50));aa=!1}}function I(a){x(v,a[0])||u(q(a[0],null,!0)).init(a[1],a[2])}function O(a){a=a.currentTarget||a.srcElement;var b=l.onScriptLoad;a.detachEvent&&!ca?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=l.onScriptError;a.detachEvent&&!ca||a.removeEventListener("error",
|
||||
b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function P(){var a;for(B();G.length;){a=G.shift();if(null===a[0])return A(F("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));I(a)}l.defQueueMap={}}var aa,da,l,R,ba,p={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},t={},Z={},ea={},G=[],v={},W={},fa={},Q=1,T=1;R={require:function(a){return a.require?a.require:a.require=l.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?
|
||||
v[a.map.id]=a.exports:a.exports=v[a.map.id]={}},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return e(p.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};da=function(a){this.events=e(ea,a.id)||{};this.map=a;this.shim=e(p.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};da.prototype={init:function(a,b,c,h){h=h||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&
|
||||
(c=z(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=c;this.inited=!0;this.ignore=h.ignore;h.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,--this.depCount,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;l.startTime=(new Date).getTime();var a=this.map;if(this.shim)l.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],z(this,function(){return a.prefix?this.callPlugin():
|
||||
this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=this.map.url;W[a]||(W[a]=!0,l.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var h=this.exports,k=this.factory;if(!this.inited)x(l.defQueueMap,c)||this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(K(k)){if(this.events.error&&this.map.isDefine||g.onError!==
|
||||
ha)try{h=l.execCb(c,k,b,h)}catch(d){a=d}else h=l.execCb(c,k,b,h);this.map.isDefine&&void 0===h&&((b=this.module)?h=b.exports:this.usingExports&&(h=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",A(this.error=a)}else h=k;this.exports=h;if(this.map.isDefine&&!this.ignore&&(v[c]=h,g.onResourceLoad)){var f=[];y(this.depMaps,function(a){f.push(a.normalizedMap||a)});g.onResourceLoad(l,this.map,f)}C(c);
|
||||
this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var a=this.map,b=a.id,d=q(a.prefix);this.depMaps.push(d);w(d,"defined",z(this,function(h){var k,f,d=e(fa,this.map.id),M=this.map.name,r=this.map.parentMap?this.map.parentMap.name:null,m=l.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(h.normalize&&(M=h.normalize(M,function(a){return c(a,r,!0)})||
|
||||
""),f=q(a.prefix+"!"+M,this.map.parentMap),w(f,"defined",z(this,function(a){this.map.normalizedMap=f;this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),h=e(t,f.id)){this.depMaps.push(f);if(this.events.error)h.on("error",z(this,function(a){this.emit("error",a)}));h.enable()}}else d?(this.map.url=l.nameToUrl(d),this.load()):(k=z(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),k.error=z(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];D(t,function(a){0===
|
||||
a.map.id.indexOf(b+"_unnormalized")&&C(a.map.id)});A(a)}),k.fromText=z(this,function(h,c){var d=a.name,f=q(d),M=S;c&&(h=c);M&&(S=!1);u(f);x(p.config,b)&&(p.config[d]=p.config[b]);try{g.exec(h)}catch(e){return A(F("fromtexteval","fromText eval for "+b+" failed: "+e,e,[b]))}M&&(S=!0);this.depMaps.push(f);l.completeLoad(d);m([d],k)}),h.load(a.name,m,k,p))}));l.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){Z[this.map.id]=this;this.enabling=this.enabled=!0;y(this.depMaps,z(this,function(a,
|
||||
b){var c,h;if("string"===typeof a){a=q(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=e(R,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;w(a,"defined",z(this,function(a){this.undefed||(this.defineDep(b,a),this.check())}));this.errback?w(a,"error",z(this,this.errback)):this.events.error&&w(a,"error",z(this,function(a){this.emit("error",a)}))}c=a.id;h=t[c];x(R,c)||!h||h.enabled||l.enable(a,this)}));D(this.pluginMaps,z(this,function(a){var b=e(t,a.id);
|
||||
b&&!b.enabled&&l.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){y(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};l={config:p,contextName:b,registry:t,defined:v,urlFetched:W,defQueue:G,defQueueMap:{},Module:da,makeModuleMap:q,nextTick:g.nextTick,onError:A,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");if("string"===typeof a.urlArgs){var b=
|
||||
a.urlArgs;a.urlArgs=function(a,c){return(-1===c.indexOf("?")?"?":"&")+b}}var c=p.shim,h={paths:!0,bundles:!0,config:!0,map:!0};D(a,function(a,b){h[b]?(p[b]||(p[b]={}),Y(p[b],a,!0,!0)):p[b]=a});a.bundles&&D(a.bundles,function(a,b){y(a,function(a){a!==b&&(fa[a]=b)})});a.shim&&(D(a.shim,function(a,b){L(a)&&(a={deps:a});!a.exports&&!a.init||a.exportsFn||(a.exportsFn=l.makeShimExports(a));c[b]=a}),p.shim=c);a.packages&&y(a.packages,function(a){var b;a="string"===typeof a?{name:a}:a;b=a.name;a.location&&
|
||||
(p.paths[b]=a.location);p.pkgs[b]=a.name+"/"+(a.main||"main").replace(na,"").replace(U,"")});D(t,function(a,b){a.inited||a.map.unnormalized||(a.map=q(b,null,!0))});(a.deps||a.callback)&&l.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ga,arguments));return b||a.exports&&ia(a.exports)}},makeRequire:function(a,n){function m(c,d,f){var e,r;n.enableBuildCallback&&d&&K(d)&&(d.__requireJsBuild=!0);if("string"===typeof c){if(K(d))return A(F("requireargs",
|
||||
"Invalid require call"),f);if(a&&x(R,c))return R[c](t[a.id]);if(g.get)return g.get(l,c,a,m);e=q(c,a,!1,!0);e=e.id;return x(v,e)?v[e]:A(F("notloaded",'Module name "'+e+'" has not been loaded yet for context: '+b+(a?"":". Use require([])")))}P();l.nextTick(function(){P();r=u(q(null,a));r.skipMap=n.skipMap;r.init(c,d,f,{enabled:!0});H()});return m}n=n||{};Y(m,{isBrowser:E,toUrl:function(b){var d,f=b.lastIndexOf("."),g=b.split("/")[0];-1!==f&&("."!==g&&".."!==g||1<f)&&(d=b.substring(f,b.length),b=b.substring(0,
|
||||
f));return l.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return x(v,q(b,a,!1,!0).id)},specified:function(b){b=q(b,a,!1,!0).id;return x(v,b)||x(t,b)}});a||(m.undef=function(b){B();var c=q(b,a,!0),f=e(t,b);f.undefed=!0;d(b);delete v[b];delete W[c.url];delete ea[b];X(G,function(a,c){a[0]===b&&G.splice(c,1)});delete l.defQueueMap[b];f&&(f.events.defined&&(ea[b]=f.events),C(b))});return m},enable:function(a){e(t,a.id)&&u(a).enable()},completeLoad:function(a){var b,c,d=e(p.shim,a)||{},g=d.exports;
|
||||
for(B();G.length;){c=G.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);I(c)}l.defQueueMap={};c=e(t,a);if(!b&&!x(v,a)&&c&&!c.inited)if(!p.enforceDefine||g&&ia(g))I([a,d.deps||[],d.exportsFn]);else return m(a)?void 0:A(F("nodefine","No define call for "+a,null,[a]));H()},nameToUrl:function(a,b,c){var d,k,f,m;(d=e(p.pkgs,a))&&(a=d);if(d=e(fa,a))return l.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=p.paths;k=a.split("/");for(f=k.length;0<f;--f)if(m=k.slice(0,f).join("/"),
|
||||
m=e(d,m)){L(m)&&(m=m[0]);k.splice(0,f,m);break}d=k.join("/");d+=b||(/^data\:|^blob\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":p.baseUrl)+d}return p.urlArgs&&!/^blob\:/.test(d)?d+p.urlArgs(a,d):d},load:function(a,b){g.load(l,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||oa.test((a.currentTarget||a.srcElement).readyState))N=null,a=O(a),l.completeLoad(a.id)},onScriptError:function(a){var b=O(a);if(!m(b.id)){var c=[];
|
||||
D(t,function(a,d){0!==d.indexOf("_@r")&&y(a.depMaps,function(a){if(a.id===b.id)return c.push(d),!0})});return A(F("scripterror",'Script error for "'+b.id+(c.length?'", needed by: '+c.join(", "):'"'),a,[b.id]))}}};l.require=l.makeRequire();return l}function pa(){if(N&&"interactive"===N.readyState)return N;X(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return N=b});return N}var g,B,C,H,O,I,N,P,u,T,qa=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ra=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
|
||||
U=/\.js$/,na=/^\.\//;B=Object.prototype;var Q=B.toString,la=B.hasOwnProperty,E=!("undefined"===typeof window||"undefined"===typeof navigator||!window.document),ja=!E&&"undefined"!==typeof importScripts,oa=E&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,ca="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),J={},w={},V=[],S=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(K(requirejs))return;w=requirejs;requirejs=void 0}"undefined"===typeof require||
|
||||
K(require)||(w=require,require=void 0);g=requirejs=function(b,c,d,m){var r,q="_";L(b)||"string"===typeof b||(r=b,L(c)?(b=c,c=d,d=m):b=[]);r&&r.context&&(q=r.context);(m=e(J,q))||(m=J[q]=g.s.newContext(q));r&&m.configure(r);return m.require(b,c,d)};g.config=function(b){return g(b)};g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.2.0";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=E;B=g.s={contexts:J,newContext:ma};g({});y(["toUrl",
|
||||
"undef","defined","specified"],function(b){g[b]=function(){var c=J._;return c.require[b].apply(c,arguments)}});E&&(C=B.head=document.getElementsByTagName("head")[0],H=document.getElementsByTagName("base")[0])&&(C=B.head=H.parentNode);g.onError=ha;g.createNode=function(b,c,d){c=b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var m=b&&b.config||
|
||||
{},e;if(E){e=g.createNode(m,c,d);e.setAttribute("data-requirecontext",b.contextName);e.setAttribute("data-requiremodule",c);!e.attachEvent||e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code")||ca?(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)):(S=!0,e.attachEvent("onreadystatechange",b.onScriptLoad));e.src=d;if(m.onNodeCreated)m.onNodeCreated(e,m,c,d);P=e;H?C.insertBefore(e,H):C.appendChild(e);P=null;return e}if(ja)try{setTimeout(function(){},
|
||||
0),importScripts(d),b.completeLoad(c)}catch(q){b.onError(F("importscripts","importScripts failed for "+c+" at "+d,q,[c]))}};E&&!w.skipDataMain&&X(document.getElementsByTagName("script"),function(b){C||(C=b.parentNode);if(O=b.getAttribute("data-main"))return u=O,w.baseUrl||-1!==u.indexOf("!")||(I=u.split("/"),u=I.pop(),T=I.length?I.join("/")+"/":"./",w.baseUrl=T),u=u.replace(U,""),g.jsExtRegExp.test(u)&&(u=O),w.deps=w.deps?w.deps.concat(u):[u],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&
|
||||
(d=c,c=b,b=null);L(c)||(d=c,c=null);!c&&K(d)&&(c=[],d.length&&(d.toString().replace(qa,ka).replace(ra,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));S&&(e=P||pa())&&(b||(b=e.getAttribute("data-requiremodule")),g=J[e.getAttribute("data-requirecontext")]);g?(g.defQueue.push([b,c,d]),g.defQueueMap[b]=!0):V.push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(w)}})(this);
|
||||
@@ -1,390 +0,0 @@
|
||||
/**
|
||||
* @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
|
||||
* Available via the MIT or new BSD license.
|
||||
* see: http://github.com/requirejs/text for details
|
||||
*/
|
||||
/*jslint regexp: true */
|
||||
/*global require, XMLHttpRequest, ActiveXObject,
|
||||
define, window, process, Packages,
|
||||
java, location, Components, FileUtils */
|
||||
|
||||
define(['module'], function (module) {
|
||||
'use strict';
|
||||
|
||||
var text, fs, Cc, Ci, xpcIsWindows,
|
||||
progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
|
||||
xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
|
||||
bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
|
||||
hasLocation = typeof location !== 'undefined' && location.href,
|
||||
defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
|
||||
defaultHostName = hasLocation && location.hostname,
|
||||
defaultPort = hasLocation && (location.port || undefined),
|
||||
buildMap = {},
|
||||
masterConfig = (module.config && module.config()) || {};
|
||||
|
||||
text = {
|
||||
version: '2.0.12',
|
||||
|
||||
strip: function (content) {
|
||||
//Strips <?xml ...?> declarations so that external SVG and XML
|
||||
//documents can be added to a document without worry. Also, if the string
|
||||
//is an HTML document, only the part inside the body tag is returned.
|
||||
if (content) {
|
||||
content = content.replace(xmlRegExp, "");
|
||||
var matches = content.match(bodyRegExp);
|
||||
if (matches) {
|
||||
content = matches[1];
|
||||
}
|
||||
} else {
|
||||
content = "";
|
||||
}
|
||||
return content;
|
||||
},
|
||||
|
||||
jsEscape: function (content) {
|
||||
return content.replace(/(['\\])/g, '\\$1')
|
||||
.replace(/[\f]/g, "\\f")
|
||||
.replace(/[\b]/g, "\\b")
|
||||
.replace(/[\n]/g, "\\n")
|
||||
.replace(/[\t]/g, "\\t")
|
||||
.replace(/[\r]/g, "\\r")
|
||||
.replace(/[\u2028]/g, "\\u2028")
|
||||
.replace(/[\u2029]/g, "\\u2029");
|
||||
},
|
||||
|
||||
createXhr: masterConfig.createXhr || function () {
|
||||
//Would love to dump the ActiveX crap in here. Need IE 6 to die first.
|
||||
var xhr, i, progId;
|
||||
if (typeof XMLHttpRequest !== "undefined") {
|
||||
return new XMLHttpRequest();
|
||||
} else if (typeof ActiveXObject !== "undefined") {
|
||||
for (i = 0; i < 3; i += 1) {
|
||||
progId = progIds[i];
|
||||
try {
|
||||
xhr = new ActiveXObject(progId);
|
||||
} catch (e) {}
|
||||
|
||||
if (xhr) {
|
||||
progIds = [progId]; // so faster next time
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return xhr;
|
||||
},
|
||||
|
||||
/**
|
||||
* Parses a resource name into its component parts. Resource names
|
||||
* look like: module/name.ext!strip, where the !strip part is
|
||||
* optional.
|
||||
* @param {String} name the resource name
|
||||
* @returns {Object} with properties "moduleName", "ext" and "strip"
|
||||
* where strip is a boolean.
|
||||
*/
|
||||
parseName: function (name) {
|
||||
var modName, ext, temp,
|
||||
strip = false,
|
||||
index = name.indexOf("."),
|
||||
isRelative = name.indexOf('./') === 0 ||
|
||||
name.indexOf('../') === 0;
|
||||
|
||||
if (index !== -1 && (!isRelative || index > 1)) {
|
||||
modName = name.substring(0, index);
|
||||
ext = name.substring(index + 1, name.length);
|
||||
} else {
|
||||
modName = name;
|
||||
}
|
||||
|
||||
temp = ext || modName;
|
||||
index = temp.indexOf("!");
|
||||
if (index !== -1) {
|
||||
//Pull off the strip arg.
|
||||
strip = temp.substring(index + 1) === "strip";
|
||||
temp = temp.substring(0, index);
|
||||
if (ext) {
|
||||
ext = temp;
|
||||
} else {
|
||||
modName = temp;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
moduleName: modName,
|
||||
ext: ext,
|
||||
strip: strip
|
||||
};
|
||||
},
|
||||
|
||||
xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
|
||||
|
||||
/**
|
||||
* Is an URL on another domain. Only works for browser use, returns
|
||||
* false in non-browser environments. Only used to know if an
|
||||
* optimized .js version of a text resource should be loaded
|
||||
* instead.
|
||||
* @param {String} url
|
||||
* @returns Boolean
|
||||
*/
|
||||
useXhr: function (url, protocol, hostname, port) {
|
||||
var uProtocol, uHostName, uPort,
|
||||
match = text.xdRegExp.exec(url);
|
||||
if (!match) {
|
||||
return true;
|
||||
}
|
||||
uProtocol = match[2];
|
||||
uHostName = match[3];
|
||||
|
||||
uHostName = uHostName.split(':');
|
||||
uPort = uHostName[1];
|
||||
uHostName = uHostName[0];
|
||||
|
||||
return (!uProtocol || uProtocol === protocol) &&
|
||||
(!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&
|
||||
((!uPort && !uHostName) || uPort === port);
|
||||
},
|
||||
|
||||
finishLoad: function (name, strip, content, onLoad) {
|
||||
content = strip ? text.strip(content) : content;
|
||||
if (masterConfig.isBuild) {
|
||||
buildMap[name] = content;
|
||||
}
|
||||
onLoad(content);
|
||||
},
|
||||
|
||||
load: function (name, req, onLoad, config) {
|
||||
//Name has format: some.module.filext!strip
|
||||
//The strip part is optional.
|
||||
//if strip is present, then that means only get the string contents
|
||||
//inside a body tag in an HTML string. For XML/SVG content it means
|
||||
//removing the <?xml ...?> declarations so the content can be inserted
|
||||
//into the current doc without problems.
|
||||
|
||||
// Do not bother with the work if a build and text will
|
||||
// not be inlined.
|
||||
if (config && config.isBuild && !config.inlineText) {
|
||||
onLoad();
|
||||
return;
|
||||
}
|
||||
|
||||
masterConfig.isBuild = config && config.isBuild;
|
||||
|
||||
var parsed = text.parseName(name),
|
||||
nonStripName = parsed.moduleName +
|
||||
(parsed.ext ? '.' + parsed.ext : ''),
|
||||
url = req.toUrl(nonStripName),
|
||||
useXhr = (masterConfig.useXhr) ||
|
||||
text.useXhr;
|
||||
|
||||
// Do not load if it is an empty: url
|
||||
if (url.indexOf('empty:') === 0) {
|
||||
onLoad();
|
||||
return;
|
||||
}
|
||||
|
||||
//Load the text. Use XHR if possible and in a browser.
|
||||
if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
|
||||
text.get(url, function (content) {
|
||||
text.finishLoad(name, parsed.strip, content, onLoad);
|
||||
}, function (err) {
|
||||
if (onLoad.error) {
|
||||
onLoad.error(err);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//Need to fetch the resource across domains. Assume
|
||||
//the resource has been optimized into a JS module. Fetch
|
||||
//by the module name + extension, but do not include the
|
||||
//!strip part to avoid file system issues.
|
||||
req([nonStripName], function (content) {
|
||||
text.finishLoad(parsed.moduleName + '.' + parsed.ext,
|
||||
parsed.strip, content, onLoad);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
write: function (pluginName, moduleName, write, config) {
|
||||
if (buildMap.hasOwnProperty(moduleName)) {
|
||||
var content = text.jsEscape(buildMap[moduleName]);
|
||||
write.asModule(pluginName + "!" + moduleName,
|
||||
"define(function () { return '" +
|
||||
content +
|
||||
"';});\n");
|
||||
}
|
||||
},
|
||||
|
||||
writeFile: function (pluginName, moduleName, req, write, config) {
|
||||
var parsed = text.parseName(moduleName),
|
||||
extPart = parsed.ext ? '.' + parsed.ext : '',
|
||||
nonStripName = parsed.moduleName + extPart,
|
||||
//Use a '.js' file name so that it indicates it is a
|
||||
//script that can be loaded across domains.
|
||||
fileName = req.toUrl(parsed.moduleName + extPart) + '.js';
|
||||
|
||||
//Leverage own load() method to load plugin value, but only
|
||||
//write out values that do not have the strip argument,
|
||||
//to avoid any potential issues with ! in file names.
|
||||
text.load(nonStripName, req, function (value) {
|
||||
//Use own write() method to construct full module value.
|
||||
//But need to create shell that translates writeFile's
|
||||
//write() to the right interface.
|
||||
var textWrite = function (contents) {
|
||||
return write(fileName, contents);
|
||||
};
|
||||
textWrite.asModule = function (moduleName, contents) {
|
||||
return write.asModule(moduleName, fileName, contents);
|
||||
};
|
||||
|
||||
text.write(pluginName, nonStripName, textWrite, config);
|
||||
}, config);
|
||||
}
|
||||
};
|
||||
|
||||
if (masterConfig.env === 'node' || (!masterConfig.env &&
|
||||
typeof process !== "undefined" &&
|
||||
process.versions &&
|
||||
!!process.versions.node &&
|
||||
!process.versions['node-webkit'])) {
|
||||
//Using special require.nodeRequire, something added by r.js.
|
||||
fs = require.nodeRequire('fs');
|
||||
|
||||
text.get = function (url, callback, errback) {
|
||||
try {
|
||||
var file = fs.readFileSync(url, 'utf8');
|
||||
//Remove BOM (Byte Mark Order) from utf8 files if it is there.
|
||||
if (file.indexOf('\uFEFF') === 0) {
|
||||
file = file.substring(1);
|
||||
}
|
||||
callback(file);
|
||||
} catch (e) {
|
||||
if (errback) {
|
||||
errback(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
} else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
|
||||
text.createXhr())) {
|
||||
text.get = function (url, callback, errback, headers) {
|
||||
var xhr = text.createXhr(), header;
|
||||
xhr.open('GET', url, true);
|
||||
|
||||
//Allow plugins direct access to xhr headers
|
||||
if (headers) {
|
||||
for (header in headers) {
|
||||
if (headers.hasOwnProperty(header)) {
|
||||
xhr.setRequestHeader(header.toLowerCase(), headers[header]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Allow overrides specified in config
|
||||
if (masterConfig.onXhr) {
|
||||
masterConfig.onXhr(xhr, url);
|
||||
}
|
||||
|
||||
xhr.onreadystatechange = function (evt) {
|
||||
var status, err;
|
||||
//Do not explicitly handle errors, those should be
|
||||
//visible via console output in the browser.
|
||||
if (xhr.readyState === 4) {
|
||||
status = xhr.status || 0;
|
||||
if (status > 399 && status < 600) {
|
||||
//An http 4xx or 5xx error. Signal an error.
|
||||
err = new Error(url + ' HTTP status: ' + status);
|
||||
err.xhr = xhr;
|
||||
if (errback) {
|
||||
errback(err);
|
||||
}
|
||||
} else {
|
||||
callback(xhr.responseText);
|
||||
}
|
||||
|
||||
if (masterConfig.onXhrComplete) {
|
||||
masterConfig.onXhrComplete(xhr, url);
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
} else if (masterConfig.env === 'rhino' || (!masterConfig.env &&
|
||||
typeof Packages !== 'undefined' && typeof java !== 'undefined')) {
|
||||
//Why Java, why is this so awkward?
|
||||
text.get = function (url, callback) {
|
||||
var stringBuffer, line,
|
||||
encoding = "utf-8",
|
||||
file = new java.io.File(url),
|
||||
lineSeparator = java.lang.System.getProperty("line.separator"),
|
||||
input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
|
||||
content = '';
|
||||
try {
|
||||
stringBuffer = new java.lang.StringBuffer();
|
||||
line = input.readLine();
|
||||
|
||||
// Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
|
||||
// http://www.unicode.org/faq/utf_bom.html
|
||||
|
||||
// Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
|
||||
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
|
||||
if (line && line.length() && line.charAt(0) === 0xfeff) {
|
||||
// Eat the BOM, since we've already found the encoding on this file,
|
||||
// and we plan to concatenating this buffer with others; the BOM should
|
||||
// only appear at the top of a file.
|
||||
line = line.substring(1);
|
||||
}
|
||||
|
||||
if (line !== null) {
|
||||
stringBuffer.append(line);
|
||||
}
|
||||
|
||||
while ((line = input.readLine()) !== null) {
|
||||
stringBuffer.append(lineSeparator);
|
||||
stringBuffer.append(line);
|
||||
}
|
||||
//Make sure we return a JavaScript string and not a Java string.
|
||||
content = String(stringBuffer.toString()); //String
|
||||
} finally {
|
||||
input.close();
|
||||
}
|
||||
callback(content);
|
||||
};
|
||||
} else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
|
||||
typeof Components !== 'undefined' && Components.classes &&
|
||||
Components.interfaces)) {
|
||||
//Avert your gaze!
|
||||
Cc = Components.classes;
|
||||
Ci = Components.interfaces;
|
||||
Components.utils['import']('resource://gre/modules/FileUtils.jsm');
|
||||
xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);
|
||||
|
||||
text.get = function (url, callback) {
|
||||
var inStream, convertStream, fileObj,
|
||||
readData = {};
|
||||
|
||||
if (xpcIsWindows) {
|
||||
url = url.replace(/\//g, '\\');
|
||||
}
|
||||
|
||||
fileObj = new FileUtils.File(url);
|
||||
|
||||
//XPCOM, you so crazy
|
||||
try {
|
||||
inStream = Cc['@mozilla.org/network/file-input-stream;1']
|
||||
.createInstance(Ci.nsIFileInputStream);
|
||||
inStream.init(fileObj, 1, 0, false);
|
||||
|
||||
convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
|
||||
.createInstance(Ci.nsIConverterInputStream);
|
||||
convertStream.init(inStream, "utf-8", inStream.available(),
|
||||
Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
|
||||
|
||||
convertStream.readString(inStream.available(), readData);
|
||||
convertStream.close();
|
||||
inStream.close();
|
||||
callback(readData.value);
|
||||
} catch (e) {
|
||||
throw new Error((fileObj && fileObj.path || '') + ': ' + e);
|
||||
}
|
||||
};
|
||||
}
|
||||
return text;
|
||||
});
|
||||
3
public/js/v1.1.5/lib/select2.min.js
vendored
3
public/js/v1.1.5/lib/select2.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,349 +0,0 @@
|
||||
// -----------------------------------
|
||||
// Slidebars
|
||||
// Version 0.10
|
||||
// http://plugins.adchsm.me/slidebars/
|
||||
//
|
||||
// Written by Adam Smith
|
||||
// http://www.adchsm.me/
|
||||
//
|
||||
// Released under MIT License
|
||||
// http://plugins.adchsm.me/slidebars/license.txt
|
||||
//
|
||||
// ---------------------
|
||||
// Index of Slidebars.js
|
||||
//
|
||||
// 001 - Default Settings
|
||||
// 002 - Feature Detection
|
||||
// 003 - User Agents
|
||||
// 004 - Setup
|
||||
// 005 - Animation
|
||||
// 006 - Operations
|
||||
// 007 - API
|
||||
// 008 - User Input
|
||||
|
||||
;(function($) {
|
||||
|
||||
$.slidebars = function(options) {
|
||||
|
||||
// ----------------------
|
||||
// 001 - Default Settings
|
||||
|
||||
var settings = $.extend({
|
||||
siteClose: true, // true or false - Enable closing of Slidebars by clicking on #sb-site.
|
||||
scrollLock: false, // true or false - Prevent scrolling of site when a Slidebar is open.
|
||||
disableOver: false, // integer or false - Hide Slidebars over a specific width.
|
||||
hideControlClasses: false // true or false - Hide controls at same width as disableOver.
|
||||
}, options);
|
||||
|
||||
// -----------------------
|
||||
// 002 - Feature Detection
|
||||
|
||||
var test = document.createElement('div').style, // Create element to test on.
|
||||
supportTransition = false, // Variable for testing transitions.
|
||||
supportTransform = false; // variable for testing transforms.
|
||||
|
||||
// Test for CSS Transitions
|
||||
if (test.MozTransition === '' || test.WebkitTransition === '' || test.OTransition === '' || test.transition === '') supportTransition = true;
|
||||
|
||||
// Test for CSS Transforms
|
||||
if (test.MozTransform === '' || test.WebkitTransform === '' || test.OTransform === '' || test.transform === '') supportTransform = true;
|
||||
|
||||
// -----------------
|
||||
// 003 - User Agents
|
||||
|
||||
var ua = navigator.userAgent, // Get user agent string.
|
||||
android = false, // Variable for storing android version.
|
||||
iOS = false; // Variable for storing iOS version.
|
||||
|
||||
if (/Android/.test(ua)) { // Detect Android in user agent string.
|
||||
android = ua.substr(ua.indexOf('Android')+8, 3); // Set version of Android.
|
||||
} else if (/(iPhone|iPod|iPad)/.test(ua)) { // Detect iOS in user agent string.
|
||||
iOS = ua.substr(ua.indexOf('OS ')+3, 3).replace('_', '.'); // Set version of iOS.
|
||||
}
|
||||
|
||||
if (android && android < 3 || iOS && iOS < 5) $('html').addClass('sb-static'); // Add helper class for older versions of Android & iOS.
|
||||
|
||||
// -----------
|
||||
// 004 - Setup
|
||||
|
||||
// Site container
|
||||
var $site = $('#sb-site, .sb-site-container'); // Cache the selector.
|
||||
|
||||
// Left Slidebar
|
||||
if ($('.sb-left').length) { // Check if the left Slidebar exists.
|
||||
var $left = $('.sb-left'), // Cache the selector.
|
||||
leftActive = false; // Used to check whether the left Slidebar is open or closed.
|
||||
}
|
||||
|
||||
// Right Slidebar
|
||||
if ($('.sb-right').length) { // Check if the right Slidebar exists.
|
||||
var $right = $('.sb-right'), // Cache the selector.
|
||||
rightActive = false; // Used to check whether the right Slidebar is open or closed.
|
||||
}
|
||||
|
||||
var init = false, // Initialisation variable.
|
||||
windowWidth = $(window).width(), // Get width of window.
|
||||
$controls = $('.sb-toggle-left, .sb-toggle-right, .sb-open-left, .sb-open-right, .sb-close'), // Cache the control classes.
|
||||
$slide = $('.sb-slide'); // Cache users elements to animate.
|
||||
|
||||
// Initailise Slidebars
|
||||
function initialise() {
|
||||
if (!settings.disableOver || (typeof settings.disableOver === 'number' && settings.disableOver >= windowWidth)) { // False or larger than window size.
|
||||
init = true; // true enabled Slidebars to open.
|
||||
$('html').addClass('sb-init'); // Add helper class.
|
||||
if (settings.hideControlClasses) $controls.removeClass('sb-hide'); // Remove class just incase Slidebars was originally disabled.
|
||||
css(); // Set required inline styles.
|
||||
} else if (typeof settings.disableOver === 'number' && settings.disableOver < windowWidth) { // Less than window size.
|
||||
init = false; // false stop Slidebars from opening.
|
||||
$('html').removeClass('sb-init'); // Remove helper class.
|
||||
if (settings.hideControlClasses) $controls.addClass('sb-hide'); // Hide controls
|
||||
$site.css('minHeight', ''); // Remove minimum height.
|
||||
if (leftActive || rightActive) close(); // Close Slidebars if open.
|
||||
}
|
||||
}
|
||||
initialise();
|
||||
|
||||
// Inline CSS
|
||||
function css() {
|
||||
// Set minimum height.
|
||||
$site.css('minHeight', ''); // Reset minimum height.
|
||||
$site.css('minHeight', $('html').height() + 'px'); // Set minimum height of the site to the minimum height of the html.
|
||||
|
||||
// Custom Slidebar widths.
|
||||
if ($left && $left.hasClass('sb-width-custom')) $left.css('width', $left.attr('data-sb-width')); // Set user custom width.
|
||||
if ($right && $right.hasClass('sb-width-custom')) $right.css('width', $right.attr('data-sb-width')); // Set user custom width.
|
||||
|
||||
// Set off-canvas margins for Slidebars with push and overlay animations.
|
||||
if ($left && ($left.hasClass('sb-style-push') || $left.hasClass('sb-style-overlay'))) $left.css('marginLeft', '-' + $left.css('width'));
|
||||
if ($right && ($right.hasClass('sb-style-push') || $right.hasClass('sb-style-overlay'))) $right.css('marginRight', '-' + $right.css('width'));
|
||||
|
||||
// Site scroll locking.
|
||||
if (settings.scrollLock) $('html').addClass('sb-scroll-lock');
|
||||
}
|
||||
|
||||
// Resize Functions
|
||||
$(window).resize(function() {
|
||||
var resizedWindowWidth = $(window).width(); // Get resized window width.
|
||||
if (windowWidth !== resizedWindowWidth) { // Slidebars is running and window was actually resized.
|
||||
windowWidth = resizedWindowWidth; // Set the new window width.
|
||||
initialise(); // Call initalise to see if Slidebars should still be running.
|
||||
if (leftActive) open('left'); // If left Slidebar is open, calling open will ensure it is the correct size.
|
||||
if (rightActive) open('right'); // If right Slidebar is open, calling open will ensure it is the correct size.
|
||||
}
|
||||
});
|
||||
// I may include a height check along side a width check here in future.
|
||||
|
||||
// ---------------
|
||||
// 005 - Animation
|
||||
|
||||
var animation; // Animation type.
|
||||
|
||||
// Set animation type.
|
||||
if (supportTransition && supportTransform) { // Browser supports css transitions and transforms.
|
||||
animation = 'translate'; // Translate for browsers that support it.
|
||||
if (android && android < 4.4) animation = 'side'; // Android supports both, but can't translate any fixed positions, so use left instead.
|
||||
} else {
|
||||
animation = 'jQuery'; // Browsers that don't support css transitions and transitions.
|
||||
}
|
||||
|
||||
// Animate mixin.
|
||||
function animate(object, amount, side) {
|
||||
// Choose selectors depending on animation style.
|
||||
var selector;
|
||||
|
||||
if (object.hasClass('sb-style-push')) {
|
||||
selector = $site.add(object).add($slide); // Push - Animate site, Slidebar and user elements.
|
||||
} else if (object.hasClass('sb-style-overlay')) {
|
||||
selector = object; // Overlay - Animate Slidebar only.
|
||||
} else {
|
||||
selector = $site.add($slide); // Reveal - Animate site and user elements.
|
||||
}
|
||||
|
||||
// Apply animation
|
||||
if (animation === 'translate') {
|
||||
selector.css('transform', 'translate(' + amount + ')'); // Apply the animation.
|
||||
|
||||
} else if (animation === 'side') {
|
||||
if (amount[0] === '-') amount = amount.substr(1); // Remove the '-' from the passed amount for side animations.
|
||||
if (amount !== '0px') selector.css(side, '0px'); // Add a 0 value so css transition works.
|
||||
setTimeout(function() { // Set a timeout to allow the 0 value to be applied above.
|
||||
selector.css(side, amount); // Apply the animation.
|
||||
}, 1);
|
||||
|
||||
} else if (animation === 'jQuery') {
|
||||
if (amount[0] === '-') amount = amount.substr(1); // Remove the '-' from the passed amount for jQuery animations.
|
||||
var properties = {};
|
||||
properties[side] = amount;
|
||||
selector.stop().animate(properties, 400); // Stop any current jQuery animation before starting another.
|
||||
}
|
||||
|
||||
// If closed, remove the inline styling on completion of the animation.
|
||||
setTimeout(function() {
|
||||
if (amount === '0px') {
|
||||
selector.removeAttr('style');
|
||||
css();
|
||||
}
|
||||
}, 400);
|
||||
}
|
||||
|
||||
// ----------------
|
||||
// 006 - Operations
|
||||
|
||||
// Open a Slidebar
|
||||
function open(side) {
|
||||
// Check to see if opposite Slidebar is open.
|
||||
if (side === 'left' && $left && rightActive || side === 'right' && $right && leftActive) { // It's open, close it, then continue.
|
||||
close();
|
||||
setTimeout(proceed, 400);
|
||||
} else { // Its not open, continue.
|
||||
proceed();
|
||||
}
|
||||
|
||||
// Open
|
||||
function proceed() {
|
||||
if (init && side === 'left' && $left) { // Slidebars is initiated, left is in use and called to open.
|
||||
$('html').addClass('sb-active sb-active-left'); // Add active classes.
|
||||
$left.addClass('sb-active');
|
||||
animate($left, $left.css('width'), 'left'); // Animation
|
||||
setTimeout(function() { leftActive = true; }, 400); // Set active variables.
|
||||
} else if (init && side === 'right' && $right) { // Slidebars is initiated, right is in use and called to open.
|
||||
$('html').addClass('sb-active sb-active-right'); // Add active classes.
|
||||
$right.addClass('sb-active');
|
||||
animate($right, '-' + $right.css('width'), 'right'); // Animation
|
||||
setTimeout(function() { rightActive = true; }, 400); // Set active variables.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Close either Slidebar
|
||||
function close(link) {
|
||||
if (leftActive || rightActive) { // If a Slidebar is open.
|
||||
if (leftActive) {
|
||||
animate($left, '0px', 'left'); // Animation
|
||||
leftActive = false;
|
||||
}
|
||||
if (rightActive) {
|
||||
animate($right, '0px', 'right'); // Animation
|
||||
rightActive = false;
|
||||
}
|
||||
|
||||
setTimeout(function() { // Wait for closing animation to finish.
|
||||
$('html').removeClass('sb-active sb-active-left sb-active-right'); // Remove active classes.
|
||||
if ($left) $left.removeClass('sb-active');
|
||||
if ($right) $right.removeClass('sb-active');
|
||||
if (typeof link !== 'undefined') window.location = link; // If a link has been passed to the function, go to it.
|
||||
}, 400);
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle either Slidebar
|
||||
function toggle(side) {
|
||||
if (side === 'left' && $left) { // If left Slidebar is called and in use.
|
||||
if (!leftActive) {
|
||||
open('left'); // Slidebar is closed, open it.
|
||||
} else {
|
||||
close(); // Slidebar is open, close it.
|
||||
}
|
||||
}
|
||||
if (side === 'right' && $right) { // If right Slidebar is called and in use.
|
||||
if (!rightActive) {
|
||||
open('right'); // Slidebar is closed, open it.
|
||||
} else {
|
||||
close(); // Slidebar is open, close it.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------
|
||||
// 007 - API
|
||||
|
||||
this.slidebars = {
|
||||
open: open, // Maps user variable name to the open method.
|
||||
close: close, // Maps user variable name to the close method.
|
||||
toggle: toggle, // Maps user variable name to the toggle method.
|
||||
init: function() { // Returns true or false whether Slidebars are running or not.
|
||||
return init; // Returns true or false whether Slidebars are running.
|
||||
},
|
||||
active: function(side) { // Returns true or false whether Slidebar is open or closed.
|
||||
if (side === 'left' && $left) return leftActive;
|
||||
if (side === 'right' && $right) return rightActive;
|
||||
},
|
||||
destroy: function(side) { // Removes the Slidebar from the DOM.
|
||||
if (side === 'left' && $left) {
|
||||
if (leftActive) close(); // Close if its open.
|
||||
setTimeout(function() {
|
||||
$left.remove(); // Remove it.
|
||||
$left = false; // Set variable to false so it cannot be opened again.
|
||||
}, 400);
|
||||
}
|
||||
if (side === 'right' && $right) {
|
||||
if (rightActive) close(); // Close if its open.
|
||||
setTimeout(function() {
|
||||
$right.remove(); // Remove it.
|
||||
$right = false; // Set variable to false so it cannot be opened again.
|
||||
}, 400);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ----------------
|
||||
// 008 - User Input
|
||||
|
||||
function eventHandler(event, selector) {
|
||||
event.stopPropagation(); // Stop event bubbling.
|
||||
event.preventDefault(); // Prevent default behaviour
|
||||
if (event.type === 'touchend') selector.off('click'); // If event type was touch turn off clicks to prevent phantom clicks.
|
||||
}
|
||||
|
||||
// Toggle left Slidebar
|
||||
$('.sb-toggle-left').on('touchend click', function(event) {
|
||||
eventHandler(event, $(this)); // Handle the event.
|
||||
toggle('left'); // Toggle the left Slidbar.
|
||||
});
|
||||
|
||||
// Toggle right Slidebar
|
||||
$('.sb-toggle-right').on('touchend click', function(event) {
|
||||
eventHandler(event, $(this)); // Handle the event.
|
||||
toggle('right'); // Toggle the right Slidbar.
|
||||
});
|
||||
|
||||
// Open left Slidebar
|
||||
$('.sb-open-left').on('touchend click', function(event) {
|
||||
eventHandler(event, $(this)); // Handle the event.
|
||||
open('left'); // Open the left Slidebar.
|
||||
});
|
||||
|
||||
// Open right Slidebar
|
||||
$('.sb-open-right').on('touchend click', function(event) {
|
||||
eventHandler(event, $(this)); // Handle the event.
|
||||
open('right'); // Open the right Slidebar.
|
||||
});
|
||||
|
||||
// Close a Slidebar
|
||||
$('.sb-close').on('touchend click', function(event) {
|
||||
eventHandler(event, $(this)); // Handle the event.
|
||||
var link;
|
||||
|
||||
// Close Slidebar via link
|
||||
if ( $(this).parents('.sb-slidebar') ) {
|
||||
if ( $(this).is('a') ) {
|
||||
link = $(this).attr('href');
|
||||
} else if ( $(this).children('a') ) {
|
||||
link = $(this).children('a').attr('href');
|
||||
}
|
||||
}
|
||||
|
||||
close(link); // Close Slidebar and pass link.
|
||||
});
|
||||
|
||||
// Close Slidebar via site
|
||||
$site.on('touchend click', function(event) {
|
||||
if (settings.siteClose && (leftActive || rightActive)) { // If settings permit closing by site and left or right Slidebar is open.
|
||||
eventHandler(event, $(this)); // Handle the event.
|
||||
close(); // Close it.
|
||||
}
|
||||
});
|
||||
|
||||
}; // End Slidebars function.
|
||||
|
||||
}) (jQuery);
|
||||
9
public/js/v1.1.5/lib/validator.min.js
vendored
9
public/js/v1.1.5/lib/validator.min.js
vendored
File diff suppressed because one or more lines are too long
4
public/js/v1.1.5/lib/velocity.min.js
vendored
4
public/js/v1.1.5/lib/velocity.min.js
vendored
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user