From 682fe756e1ac1decd808d34cb3d8fc660252d8cb Mon Sep 17 00:00:00 2001 From: Exodus4D Date: Thu, 15 Jun 2017 18:19:35 +0200 Subject: [PATCH] - build JS resources for v1.2.4 --- app/pathfinder.ini | 2 +- public/js/v1.2.4/app.js | 173 + public/js/v1.2.4/app/admin.js | 49 + public/js/v1.2.4/app/config/signature_type.js | 420 + public/js/v1.2.4/app/config/system_effect.js | 733 + public/js/v1.2.4/app/counter.js | 90 + public/js/v1.2.4/app/init.js | 452 + public/js/v1.2.4/app/key.js | 442 + public/js/v1.2.4/app/logging.js | 531 + public/js/v1.2.4/app/login.js | 853 ++ public/js/v1.2.4/app/map/contextmenu.js | 132 + public/js/v1.2.4/app/map/local.js | 584 + public/js/v1.2.4/app/map/magnetizing.js | 180 + public/js/v1.2.4/app/map/map.js | 3385 ++++ public/js/v1.2.4/app/map/overlay.js | 770 + public/js/v1.2.4/app/map/scrollbar.js | 75 + public/js/v1.2.4/app/map/system.js | 245 + public/js/v1.2.4/app/map/util.js | 667 + public/js/v1.2.4/app/map/worker.js | 127 + public/js/v1.2.4/app/mappage.js | 384 + public/js/v1.2.4/app/module_map.js | 782 + public/js/v1.2.4/app/notification.js | 190 + public/js/v1.2.4/app/page.js | 1213 ++ public/js/v1.2.4/app/render.js | 69 + public/js/v1.2.4/app/setup.js | 175 + public/js/v1.2.4/app/ui/demo_map.js | 314 + .../v1.2.4/app/ui/dialog/account_settings.js | 211 + public/js/v1.2.4/app/ui/dialog/credit.js | 51 + .../js/v1.2.4/app/ui/dialog/delete_account.js | 116 + public/js/v1.2.4/app/ui/dialog/jump_info.js | 38 + public/js/v1.2.4/app/ui/dialog/manual.js | 172 + public/js/v1.2.4/app/ui/dialog/map_info.js | 907 ++ .../js/v1.2.4/app/ui/dialog/map_settings.js | 643 + .../js/v1.2.4/app/ui/dialog/notification.js | 88 + public/js/v1.2.4/app/ui/dialog/releases.js | 84 + public/js/v1.2.4/app/ui/dialog/shortcuts.js | 50 + public/js/v1.2.4/app/ui/dialog/stats.js | 711 + .../js/v1.2.4/app/ui/dialog/system_effects.js | 107 + public/js/v1.2.4/app/ui/form_element.js | 291 + public/js/v1.2.4/app/ui/header.js | 239 + public/js/v1.2.4/app/ui/logo.js | 150 + public/js/v1.2.4/app/ui/system_graph.js | 241 + public/js/v1.2.4/app/ui/system_info.js | 516 + public/js/v1.2.4/app/ui/system_killboard.js | 494 + public/js/v1.2.4/app/ui/system_route.js | 1109 ++ public/js/v1.2.4/app/ui/system_signature.js | 2456 +++ public/js/v1.2.4/app/util.js | 2200 +++ public/js/v1.2.4/app/worker/map.js | 162 + public/js/v1.2.4/app/worker/message.js | 55 + public/js/v1.2.4/lib/EasePack.min.js | 12 + public/js/v1.2.4/lib/TweenLite.min.js | 12 + public/js/v1.2.4/lib/blueimp-gallery.js | 1377 ++ public/js/v1.2.4/lib/blueimp-helper.js | 190 + public/js/v1.2.4/lib/bootbox.min.js | 6 + .../js/v1.2.4/lib/bootstrap-confirmation.js | 263 + .../js/v1.2.4/lib/bootstrap-editable.min.js | 7 + .../js/v1.2.4/lib/bootstrap-image-gallery.js | 87 + public/js/v1.2.4/lib/bootstrap.min.js | 7 + public/js/v1.2.4/lib/bootstrap2-toggle.min.js | 8 + .../Buttons-1.2.1/js/buttons.html5.min.js | 26 + .../js/dataTables.buttons.min.js | 35 + .../js/jquery.dataTables.min.js | 166 + .../js/dataTables.responsive.min.js | 26 + .../Select-1.2.0/js/dataTables.select.min.js | 26 + public/js/v1.2.4/lib/dom.jsPlumb-1.7.6.js | 12729 +++++++++++++++ public/js/v1.2.4/lib/farahey-0.5.js | 350 + public/js/v1.2.4/lib/jquery-3.1.1.min.js | 4 + public/js/v1.2.4/lib/jquery.dragToSelect.js | 377 + .../js/v1.2.4/lib/jquery.easypiechart.min.js | 9 + public/js/v1.2.4/lib/jquery.fullscreen.min.js | 28 + .../v1.2.4/lib/jquery.hoverIntent.minified.js | 9 + .../lib/jquery.lazylinepainter-1.5.1.min.js | 17 + public/js/v1.2.4/lib/jquery.lazyload.min.js | 2 + .../v1.2.4/lib/jquery.mCustomScrollbar.min.js | 3 + public/js/v1.2.4/lib/jquery.mousewheel.min.js | 8 + public/js/v1.2.4/lib/jquery.peity.min.js | 13 + public/js/v1.2.4/lib/jsPlumb-2.0.5.js | 12733 ++++++++++++++++ public/js/v1.2.4/lib/localforage.min.js | 7 + public/js/v1.2.4/lib/morris.min.js | 7 + public/js/v1.2.4/lib/mustache.min.js | 1 + .../js/v1.2.4/lib/pnotify/pnotify.buttons.js | 176 + .../v1.2.4/lib/pnotify/pnotify.callbacks.js | 50 + .../js/v1.2.4/lib/pnotify/pnotify.desktop.js | 154 + public/js/v1.2.4/lib/pnotify/pnotify.js | 873 ++ .../js/v1.2.4/lib/pnotify/pnotify.nonblock.js | 156 + public/js/v1.2.4/lib/raphael-min.js | 11 + public/js/v1.2.4/lib/require.js | 36 + public/js/v1.2.4/lib/requirejs/text.js | 390 + public/js/v1.2.4/lib/select2.min.js | 3 + public/js/v1.2.4/lib/slidebars.js | 349 + public/js/v1.2.4/lib/validator.min.js | 9 + public/js/v1.2.4/lib/velocity.min.js | 4 + public/js/v1.2.4/lib/velocity.ui.min.js | 1 + 93 files changed, 54884 insertions(+), 1 deletion(-) create mode 100644 public/js/v1.2.4/app.js create mode 100644 public/js/v1.2.4/app/admin.js create mode 100644 public/js/v1.2.4/app/config/signature_type.js create mode 100644 public/js/v1.2.4/app/config/system_effect.js create mode 100644 public/js/v1.2.4/app/counter.js create mode 100644 public/js/v1.2.4/app/init.js create mode 100644 public/js/v1.2.4/app/key.js create mode 100644 public/js/v1.2.4/app/logging.js create mode 100644 public/js/v1.2.4/app/login.js create mode 100644 public/js/v1.2.4/app/map/contextmenu.js create mode 100644 public/js/v1.2.4/app/map/local.js create mode 100644 public/js/v1.2.4/app/map/magnetizing.js create mode 100644 public/js/v1.2.4/app/map/map.js create mode 100644 public/js/v1.2.4/app/map/overlay.js create mode 100644 public/js/v1.2.4/app/map/scrollbar.js create mode 100644 public/js/v1.2.4/app/map/system.js create mode 100644 public/js/v1.2.4/app/map/util.js create mode 100644 public/js/v1.2.4/app/map/worker.js create mode 100644 public/js/v1.2.4/app/mappage.js create mode 100644 public/js/v1.2.4/app/module_map.js create mode 100644 public/js/v1.2.4/app/notification.js create mode 100644 public/js/v1.2.4/app/page.js create mode 100644 public/js/v1.2.4/app/render.js create mode 100644 public/js/v1.2.4/app/setup.js create mode 100644 public/js/v1.2.4/app/ui/demo_map.js create mode 100644 public/js/v1.2.4/app/ui/dialog/account_settings.js create mode 100644 public/js/v1.2.4/app/ui/dialog/credit.js create mode 100644 public/js/v1.2.4/app/ui/dialog/delete_account.js create mode 100644 public/js/v1.2.4/app/ui/dialog/jump_info.js create mode 100644 public/js/v1.2.4/app/ui/dialog/manual.js create mode 100644 public/js/v1.2.4/app/ui/dialog/map_info.js create mode 100644 public/js/v1.2.4/app/ui/dialog/map_settings.js create mode 100644 public/js/v1.2.4/app/ui/dialog/notification.js create mode 100644 public/js/v1.2.4/app/ui/dialog/releases.js create mode 100644 public/js/v1.2.4/app/ui/dialog/shortcuts.js create mode 100644 public/js/v1.2.4/app/ui/dialog/stats.js create mode 100644 public/js/v1.2.4/app/ui/dialog/system_effects.js create mode 100644 public/js/v1.2.4/app/ui/form_element.js create mode 100644 public/js/v1.2.4/app/ui/header.js create mode 100644 public/js/v1.2.4/app/ui/logo.js create mode 100644 public/js/v1.2.4/app/ui/system_graph.js create mode 100644 public/js/v1.2.4/app/ui/system_info.js create mode 100644 public/js/v1.2.4/app/ui/system_killboard.js create mode 100644 public/js/v1.2.4/app/ui/system_route.js create mode 100644 public/js/v1.2.4/app/ui/system_signature.js create mode 100644 public/js/v1.2.4/app/util.js create mode 100644 public/js/v1.2.4/app/worker/map.js create mode 100644 public/js/v1.2.4/app/worker/message.js create mode 100644 public/js/v1.2.4/lib/EasePack.min.js create mode 100644 public/js/v1.2.4/lib/TweenLite.min.js create mode 100644 public/js/v1.2.4/lib/blueimp-gallery.js create mode 100644 public/js/v1.2.4/lib/blueimp-helper.js create mode 100644 public/js/v1.2.4/lib/bootbox.min.js create mode 100644 public/js/v1.2.4/lib/bootstrap-confirmation.js create mode 100644 public/js/v1.2.4/lib/bootstrap-editable.min.js create mode 100644 public/js/v1.2.4/lib/bootstrap-image-gallery.js create mode 100644 public/js/v1.2.4/lib/bootstrap.min.js create mode 100644 public/js/v1.2.4/lib/bootstrap2-toggle.min.js create mode 100644 public/js/v1.2.4/lib/datatables/Buttons-1.2.1/js/buttons.html5.min.js create mode 100644 public/js/v1.2.4/lib/datatables/Buttons-1.2.1/js/dataTables.buttons.min.js create mode 100644 public/js/v1.2.4/lib/datatables/DataTables-1.10.12/js/jquery.dataTables.min.js create mode 100644 public/js/v1.2.4/lib/datatables/Responsive-2.1.0/js/dataTables.responsive.min.js create mode 100644 public/js/v1.2.4/lib/datatables/Select-1.2.0/js/dataTables.select.min.js create mode 100644 public/js/v1.2.4/lib/dom.jsPlumb-1.7.6.js create mode 100644 public/js/v1.2.4/lib/farahey-0.5.js create mode 100644 public/js/v1.2.4/lib/jquery-3.1.1.min.js create mode 100644 public/js/v1.2.4/lib/jquery.dragToSelect.js create mode 100644 public/js/v1.2.4/lib/jquery.easypiechart.min.js create mode 100644 public/js/v1.2.4/lib/jquery.fullscreen.min.js create mode 100644 public/js/v1.2.4/lib/jquery.hoverIntent.minified.js create mode 100644 public/js/v1.2.4/lib/jquery.lazylinepainter-1.5.1.min.js create mode 100644 public/js/v1.2.4/lib/jquery.lazyload.min.js create mode 100644 public/js/v1.2.4/lib/jquery.mCustomScrollbar.min.js create mode 100644 public/js/v1.2.4/lib/jquery.mousewheel.min.js create mode 100644 public/js/v1.2.4/lib/jquery.peity.min.js create mode 100644 public/js/v1.2.4/lib/jsPlumb-2.0.5.js create mode 100644 public/js/v1.2.4/lib/localforage.min.js create mode 100644 public/js/v1.2.4/lib/morris.min.js create mode 100644 public/js/v1.2.4/lib/mustache.min.js create mode 100644 public/js/v1.2.4/lib/pnotify/pnotify.buttons.js create mode 100644 public/js/v1.2.4/lib/pnotify/pnotify.callbacks.js create mode 100644 public/js/v1.2.4/lib/pnotify/pnotify.desktop.js create mode 100644 public/js/v1.2.4/lib/pnotify/pnotify.js create mode 100644 public/js/v1.2.4/lib/pnotify/pnotify.nonblock.js create mode 100644 public/js/v1.2.4/lib/raphael-min.js create mode 100644 public/js/v1.2.4/lib/require.js create mode 100644 public/js/v1.2.4/lib/requirejs/text.js create mode 100644 public/js/v1.2.4/lib/select2.min.js create mode 100644 public/js/v1.2.4/lib/slidebars.js create mode 100644 public/js/v1.2.4/lib/validator.min.js create mode 100644 public/js/v1.2.4/lib/velocity.min.js create mode 100644 public/js/v1.2.4/lib/velocity.ui.min.js diff --git a/app/pathfinder.ini b/app/pathfinder.ini index cbc2ad3c..ea009265 100644 --- a/app/pathfinder.ini +++ b/app/pathfinder.ini @@ -3,7 +3,7 @@ [PATHFINDER] NAME = Pathfinder ; installed version (used for CSS/JS cache busting) -VERSION = v1.2.3 +VERSION = v1.2.4 ; contact information [optional] CONTACT = https://github.com/exodus4d ; public contact email [optional] diff --git a/public/js/v1.2.4/app.js b/public/js/v1.2.4/app.js new file mode 100644 index 00000000..3bd05f73 --- /dev/null +++ b/public/js/v1.2.4/app.js @@ -0,0 +1,173 @@ +// 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 + admin: './app/admin', // initial start "admin page" view + + jquery: 'lib/jquery-3.1.1.min', // v3.1.1 jQuery + bootstrap: 'lib/bootstrap.min', // v3.3.0 Bootstrap js code - http://getbootstrap.com/javascript + text: 'lib/requirejs/text', // v2.0.12 A RequireJS/AMD loader plugin for loading text resources. + mustache: 'lib/mustache.min', // v1.0.0 Javascript template engine - http://mustache.github.io + localForage: 'lib/localforage.min', // v1.4.2 localStorage library - https://mozilla.github.io/localForage + velocity: 'lib/velocity.min', // v1.4.1 animation engine - http://julian.com/research/velocity + velocityUI: 'lib/velocity.ui.min', // v5.2.0 plugin for velocity - http://julian.com/research/velocity/#uiPack + slidebars: 'lib/slidebars', // v0.10 Slidebars - side menu plugin http://plugins.adchsm.me/slidebars + jsPlumb: 'lib/dom.jsPlumb-1.7.6', // v1.7.6 jsPlumb (Vanilla)- main map draw plugin https://jsplumbtoolkit.com + farahey: 'lib/farahey-0.5', // v0.5 jsPlumb "magnetizing" extension - https://github.com/jsplumb/farahey + customScrollbar: 'lib/jquery.mCustomScrollbar.min', // v3.1.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 + peityInlineChart: 'lib/jquery.peity.min', // v3.2.0 Inline Chart - http://benpickles.github.io/peity/ + dragToSelect: 'lib/jquery.dragToSelect', // v1.1 Drag to Select - http://andreaslagerkvist.com/jquery/drag-to-select + hoverIntent: 'lib/jquery.hoverIntent.minified', // v1.8.0 Hover intention - http://cherne.net/brian/resources/jquery.hoverIntent.html + fullScreen: 'lib/jquery.fullscreen.min', // v0.6.0 Full screen mode - https://github.com/private-face/jquery.fullscreen + select2: 'lib/select2.min', // v4.0.3 Drop Down customization - https://select2.github.io + validator: 'lib/validator.min', // v0.10.1 Validator for Bootstrap 3 - https://github.com/1000hz/bootstrap-validator + lazylinepainter: 'lib/jquery.lazylinepainter-1.5.1.min', // v1.5.1 SVG line animation plugin - http://lazylinepainter.info + blueImpGallery: 'lib/blueimp-gallery', // v2.21.3 Image Gallery - https://github.com/blueimp/Gallery + blueImpGalleryHelper: 'lib/blueimp-helper', // helper function for Blue Imp Gallery + blueImpGalleryBootstrap: 'lib/bootstrap-image-gallery', // v3.4.2 Bootstrap extension for Blue Imp Gallery - https://blueimp.github.io/Bootstrap-Image-Gallery + bootstrapConfirmation: 'lib/bootstrap-confirmation', // v1.0.5 Bootstrap extension for inline confirm dialog - https://github.com/tavicu/bs-confirmation + bootstrapToggle: 'lib/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'] + }, + peityInlineChart: { + deps : ['jquery'] + }, + dragToSelect: { + deps : ['jquery'] + }, + hoverIntent: { + deps : ['jquery'] + }, + fullScreen: { + deps : ['jquery'] + }, + select2: { + deps : ['jquery'], + exports: 'Select2' + }, + validator: { + deps : ['jquery', 'bootstrap'] + }, + lazylinepainter: { + deps : ['jquery', 'bootstrap'] + }, + blueImpGallery: { + deps : ['jquery'] + }, + bootstrapConfirmation: { + deps : ['bootstrap'] + }, + bootstrapToggle: { + deps : ['jquery'] + }, + lazyload: { + deps : ['jquery'] + } + } +}); + +// 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] ); diff --git a/public/js/v1.2.4/app/admin.js b/public/js/v1.2.4/app/admin.js new file mode 100644 index 00000000..aecb732a --- /dev/null +++ b/public/js/v1.2.4/app/admin.js @@ -0,0 +1,49 @@ +/** + * Main "admin" page + */ + +define([ + 'jquery', + 'app/init', + 'app/util', + 'datatables.net', + 'datatables.net-buttons', + 'datatables.net-buttons-html', + 'datatables.net-responsive', + 'datatables.net-select' +], function($, Init, Util) { + + 'use strict'; + + let config = { + splashOverlayClass: 'pf-splash' // class for "splash" overlay + }; + + /** + * main init "admin" page + */ + $(function(){ + // set Dialog default config + Util.initDefaultBootboxConfig(); + + // hide splash loading animation + $('.' + config.splashOverlayClass).hideSplashOverlay(); + + + let systemsDataTable = $('.dataTable').dataTable( { + pageLength: 100, + paging: true, + ordering: true, + autoWidth: false, + hover: false, + language: { + emptyTable: 'No members', + zeroRecords: 'No members found', + lengthMenu: 'Show _MENU_ members', + info: 'Showing _START_ to _END_ of _TOTAL_ members' + } + }); + + + }); +}); \ No newline at end of file diff --git a/public/js/v1.2.4/app/config/signature_type.js b/public/js/v1.2.4/app/config/signature_type.js new file mode 100644 index 00000000..5110501a --- /dev/null +++ b/public/js/v1.2.4/app/config/signature_type.js @@ -0,0 +1,420 @@ +/** + * 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 + let 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 + let 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 + let 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', //* + 7: 'Bountiful 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', //* + 6: 'Infrequent 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: 'C248 - 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: 'M267 - C3', + 8: 'O477 - C3', + 9: 'X877 - C4', + 10: 'Y683 - C4', + 11: 'H296 - C5', + 12: 'H900 - C5', + 13: 'H296 - C5', + 14: 'N062 - C5', // ?? + 15: 'V911 - C5', + 16: 'U574 - C6', + 17: 'V753 - C6', + 18: 'W237 - C6', + 19: 'B274 - HS', + 20: 'D792 - HS', + 21: 'D845 - HS', + 22: 'N110 - HS', + 23: 'A239 - LS', + 24: 'C391 - LS', + 25: 'J244 - LS', + 26: 'U201 - LS', // ?? + 27: 'U210 - LS', + 28: 'C248 - 0.0', + 29: 'E545 - 0.0', + 30: 'K346 - 0.0', + 31: 'Z060 - 0.0' + } + } + }, // system type (k-space) + 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; +}); diff --git a/public/js/v1.2.4/app/config/system_effect.js b/public/js/v1.2.4/app/config/system_effect.js new file mode 100644 index 00000000..fe97afa2 --- /dev/null +++ b/public/js/v1.2.4/app/config/system_effect.js @@ -0,0 +1,733 @@ +/** + * Created by exodus4d on 06.07.2015. + * static system effects + */ + + +define([], function() { + + 'use strict'; + + // system effects + let 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; +}); \ No newline at end of file diff --git a/public/js/v1.2.4/app/counter.js b/public/js/v1.2.4/app/counter.js new file mode 100644 index 00000000..040a0e02 --- /dev/null +++ b/public/js/v1.2.4/app/counter.js @@ -0,0 +1,90 @@ +define([ + 'jquery', + 'app/init', + 'app/util' +], function($, Init, Util) { + 'use strict'; + + let config = { + counterDigitSmallClass: 'pf-digit-counter-small', + counterDigitLargeClass: 'pf-digit-counter-large' + }; + + /** + * update element with time information + * @param element + * @param tempDate + */ + let updateDateDiff = function(element, tempDate){ + let diff = Util.getTimeDiffParts(tempDate, new Date()); + let days = diff.days; + let hrs = diff.hours; + let min = diff.min; + let leftSec = diff.sec; + let value = []; + + if( + days > 0 || + value.length > 0 + ){ + value.push('' + days + 'd' + ''); + } + if( + hrs > 0 || + value.length > 0 + ){ + value.push('' + hrs + 'h' + ''); + } + if( + min > 0 || + value.length > 0 + ){ + value.push('' + min + 'm' + ''); + } + + if( + leftSec >= 0 || + value.length > 0 + ){ + value.push('' + leftSec + 's' + ''); + } + + element.html(value.join(' ')); + }; + + /** + * init a live counter based on a unix timestamp + * @returns {*} + */ + $.fn.initTimestampCounter = function(){ + return this.each(function(){ + let element = $(this); + let timestamp = parseInt( element.text() ); + + // do not init twice + if(timestamp > 0){ + // mark as init + element.attr('data-counter', 'init'); + + let date = new Date( timestamp * 1000); + + updateDateDiff(element, date); + + // show element (if invisible) after first update + element.css({'visibility': 'initial'}); + + let 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); + } + }); + }; +}); diff --git a/public/js/v1.2.4/app/init.js b/public/js/v1.2.4/app/init.js new file mode 100644 index 00000000..f0826162 --- /dev/null +++ b/public/js/v1.2.4/app/init.js @@ -0,0 +1,452 @@ +/** + * Init + */ + +define(['jquery'], function($) { + + 'use strict'; + + let 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 + openIngameWindow: 'api/user/openIngameWindow', // ajax URL - open inGame Window + 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 + getAccessData: 'api/map/getAccessData', // ajax URL - get map access tokens (WebSocket) + updateMapData: 'api/map/updateData', // ajax URL - main map update trigger + updateUserData: 'api/map/updateUserData', // ajax URL - main map user data trigger + // map API + saveMap: 'api/map/save', // ajax URL - save/update map + deleteMap: 'api/map/delete', // ajax URL - delete map + importMap: 'api/map/import', // ajax URL - import map + getMapConnectionData: 'api/map/getConnectionData', // ajax URL - get connection data + // system API + searchSystem: 'api/system/search', // ajax URL - search system by name + saveSystem: 'api/system/save', // ajax URL - saves system to map + deleteSystem: 'api/system/delete', // ajax URL - delete system from map + getSystemGraphData: 'api/system/graphData', // ajax URL - get all system graph data + getConstellationData: 'api/system/constellationData', // ajax URL - get system constellation data + setDestination: 'api/system/setDestination', // ajax URL - set destination + // 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 + // stats API + getStatisticsData: 'api/statistic/getData', // ajax URL - get statistics data (activity log) + // GitHub API + gitHubReleases: 'api/github/releases' // ajax URL - get release info from GitHub + }, + url: { + ccpImageServer: '//image.eveonline.com/', // CCP image Server + zKillboard: '//zkillboard.com/api/' // killboard api + }, + breakpoints: [ + { name: 'desktop', width: Infinity }, + { name: 'tablet', width: 1200 }, + { name: 'fablet', width: 780 }, + { name: 'phone', width: 480 } + ], + animationSpeed: { + splashOverlay: 300, // "splash" loading overlay + headerLink: 100, // links in head bar + mapOverlay: 200, // show/hide duration for map overlays + mapOverlayLocal: 180, // show/hide duration for map "local" overlay + mapMoveSystem: 180, // system position has changed animation + mapDeleteSystem: 200, // remove system from map + mapModule: 200, // show/hide of an map module + dialogEvents: 180 // dialog events /slide/show/... + }, + syncStatus: { + type: 'ajax', + webSocket: { + status: 'closed', + class: 'txt-color-danger', + timestamp: undefined + }, + sharedWorker: { + status: 'offline', // SharedWorker status + class: 'txt-color-danger', + timestamp: undefined + }, + ajax: { + status: 'enabled', + class: 'txt-color-success', + timestamp: undefined + } + }, + performanceLogging: { + keyServerMapData: 'UPDATE_SERVER_MAP', // ajax request update map data + keyClientMapData: 'UPDATE_CLIENT_MAP', // update client map data + keyServerUserData: 'UPDATE_SERVER_USER_DATA', // ajax request update map user data + keyClientUserData: 'UPDATE_CLIENT_USER_DATA', // update client map user data + }, + 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: ' 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; +}); diff --git a/public/js/v1.2.4/app/key.js b/public/js/v1.2.4/app/key.js new file mode 100644 index 00000000..01a04cdb --- /dev/null +++ b/public/js/v1.2.4/app/key.js @@ -0,0 +1,442 @@ +define([ + 'jquery' +], function($) { + 'use strict'; + + let allCombo = { + // global ------------------------------------------------------------------------------------------- + tabReload: { + group: 'global', + label: 'Close open dialog', + keyNames: ['ESC'] + }, + // signature ---------------------------------------------------------------------------------------- + signatureSelect: { + group: 'signatures', + label: 'Select multiple rows', + keyNames: ['CONTROL', 'CLICK'] + } + }; + + let allEvents = { + // global ------------------------------------------------------------------------------------------- + tabReload: { + group: 'global', + label: 'Reload tab', + keyNames: ['CONTROL', 'R'] + }, + signaturePaste: { + group: 'global', + label: 'Paste signatures from clipboard', + keyNames: ['CONTROL', 'V'], + alias: 'paste' + }, + + // map ---------------------------------------------------------------------------------------------- + mapSystemAdd: { + group: 'map', + label: 'Add new system', + keyNames: ['CONTROL', 'S'] + }, + mapSystemsSelect: { + group: 'map', + label: 'Select all systems', + keyNames: ['CONTROL', 'A'] + }, + mapSystemsDelete: { + group: 'map', + label: 'Delete selected systems', + keyNames: ['CONTROL', 'D'] + } + }; + + let groups = { + global: { + label: 'Global' + }, + map: { + label: 'Map' + }, + signatures: { + label: 'Signature' + } + }; + + /** + * enables some console.log() information + * @type {boolean} + */ + let debug = false; + + /** + * check interval for "new" active keys + * @type {number} + */ + let keyWatchPeriod = 100; + + /** + * DOM data key for an element that lists all active events (comma separated) + * @type {string} + */ + let dataKeyEvents = 'key-events'; + + /** + * DOM data key prefix whether domElement that holds the trigger needs to be "focused" + * @type {string} + */ + let dataKeyFocusPrefix = 'key-focus-'; + + /** + * DOM data key that holds the callback function for that element + * @type {string} + */ + let dataKeyCallbackPrefix = 'key-callback-'; + + /** + * check if module is initiated + */ + let isInit = false; + + /** + * global key map holds all active (hold down) keys + * @type {{}} + */ + let map = {}; + + /** + * show debug information in console + * @param msg + * @param element + */ + let debugWatchKey = (msg, element) => { + if(debug){ + console.info(msg, element); + } + }; + + /** + * get all active (hold down) keys at this moment + * @returns {Array} + */ + let getActiveKeys = () => { + return Object.keys(map); + }; + + /** + * callback function that compares two arrays + * @param element + * @param index + * @param array + */ + let compareKeyLists = function(element, index, array) { + return this.find(x => x === element); + }; + + /** + * get event names that COULD lead to a "full" event (not all keys pressed yet) + * @param keyList + * @returns {Array} + */ + let checkEventNames = (keyList) => { + let incompleteEvents = []; + for(let event in allEvents){ + // check if "some" or "all" keys are pressed for en event + if( keyList.every(compareKeyLists, allEvents[event].keyNames) ){ + incompleteEvents.push(event); + } + } + + return incompleteEvents; + }; + + /** + * get all event names + * @returns {Array} + */ + let getAllEventNames = () => { + let eventNames = []; + for(let event in allEvents){ + eventNames.push(event); + } + return eventNames; + }; + + /** + * get all event names that matches a given keyList + * @param keyList + * @param checkEvents + * @returns {Array} + */ + let getMatchingEventNames = (keyList, checkEvents) => { + checkEvents = checkEvents || getAllEventNames(); + let events = []; + + for(let event of checkEvents){ + // check if both key arrays are equal + if( + allEvents[event].keyNames.every(compareKeyLists, keyList) && + keyList.every(compareKeyLists, allEvents[event].keyNames) + ){ + events.push(event); + } + } + + return events; + }; + + /** + * init global keyWatch interval and check for event trigger (hotKey combinations) + */ + let init = () => { + if( !isInit ){ + // key watch loop ------------------------------------------------------------------------------- + let prevActiveKeys = []; + + /** + * + * @param e + * @returns {number} 0: no keys hold, 1: invalid match, 2: partial match, 3: match, 4: alias match, 5: event(s) fired + */ + let checkForEvents = (e) => { + let status = 0; + + // get all pressed keys + let activeKeys = getActiveKeys(); + debugWatchKey('activeKeys', activeKeys); + + // check if "active" keys has changes since last loop + if(activeKeys.length){ + // check for "incomplete" events (not all keys pressed yet) + let incompleteEvents = checkEventNames(activeKeys); + if(incompleteEvents.length){ + // "some" event keys pressed OR "all" keys pressed + status = 2; + + // check if key combo matches a registered (valid) event + let events = getMatchingEventNames(activeKeys, incompleteEvents); + if(events.length){ + status = 3; + // check events if there are attached elements to it + events.forEach((event) => { + // skip events that has an alias and should not be triggered by key combo + if( !allEvents[event].alias ){ + if(allEvents[event].elements){ + // search for callback functions attached to each element + allEvents[event].elements.forEach((domElement) => { + let domElementObj = $(domElement); + // check if event on this element requires active "focus" + let optFocus = domElementObj.data(dataKeyFocusPrefix + event); + + if( !( + optFocus && + document.activeElement !== domElement + ) + ){ + // execute callback if valid + let callback = domElementObj.data(dataKeyCallbackPrefix + event); + if(typeof callback === 'function'){ + status = 5; + callback.call(domElement, domElement, e); + } + } + }); + } + }else{ + status = 4; + } + + }); + } + }else{ + // invalid combo + status = 1; + } + } + + // store current keys for next loop check + prevActiveKeys = activeKeys; + + return status; + }; + + // set key-events ------------------------------------------------------------------------------- + let evKeyDown = (e) => { + // exclude some HTML Tags from watcher + if( + e.target.tagName !== 'INPUT' && + e.target.tagName !== 'TEXTAREA' + ){ + let key = e.key.toUpperCase(); + map[key] = true; + + // check for any shortcut combo that triggers an event + let status = checkForEvents(e); + + if( + status === 2 || + status === 3 || + status === 5 + ){ + // prevent SOME browser default actions -> we want 'Pathfinder' shortcuts :) + e.preventDefault(); + } + } + }; + + let evKeyUp = (e) => { + let key = e.key.toUpperCase(); + + if(map.hasOwnProperty(key)){ + delete map[key]; + } + }; + + let container = $('body'); + container.on('keydown', evKeyDown); + container.on('keyup', evKeyUp); + + // global dom remove listener ------------------------------------------------------------------- + // -> check whether the removed element had an event listener active and removes them. + document.body.addEventListener ('DOMNodeRemoved', function(e){ + if(typeof e.target.getAttribute === 'function'){ + let eventNames = e.target.getAttribute(dataKeyEvents); + if(eventNames){ + eventNames.split(',').forEach((event) => { + let index = allEvents[event].elements.indexOf(e.target); + if(index > -1){ + // remove element from event list + allEvents[event].elements.splice(index, 1); + } + }); + } + } + }, false); + + isInit = true; + } + }; + + /** + * add a new "shortCut" combination (event) to a DOM element + * @param event + * @param callback + * @param options + */ + $.fn.watchKey = function(event, callback, options){ + + // default options for keyWatcher on elements + let defaultOptions = { + focus: false, // element must be focused (active) + bubbling: true // elements deeper (children) in the DOM can bubble the event up + }; + + let customOptions = $.extend(true, {}, defaultOptions, options ); + + return this.each((i, domElement) => { + let element = $(domElement); + + // init global key events + init(); + + // check if event is "valid" (exists) and is not already set for this element + let validEvent = false; + if(allEvents[event].elements){ + if(allEvents[event].elements.indexOf(domElement) === -1){ + validEvent = true; + }else{ + console.warn('Event "' + event + '" already set'); + } + }else{ + validEvent = true; + allEvents[event].elements = []; + } + + if(validEvent){ + // store callback options to dom element + if(customOptions.focus){ + let dataAttr = dataKeyFocusPrefix + event; + element.data(dataAttr, true); + + // check if DOM element has "tabindex" attr -> required to manually set focus() to it + if(!domElement.hasAttribute('tabindex')){ + domElement.setAttribute('tabindex', 0); + } + + // element requires a "focus" listener + element.off('click.focusKeyWatcher').on('click.focusKeyWatcher', function(e){ + if( + e.target === this || + customOptions.bubbling + ){ + this.focus(); + debugWatchKey('focus set:', this); + } + }); + } + + // check if is key combo has a native JS event that should be used instead + if(allEvents[event].alias){ + element.on(allEvents[event].alias, callback); + }else{ + // store callback function to dom element + let dataAttr = dataKeyCallbackPrefix + event; + element.data(dataAttr, callback); + } + + // add eventName to dom element as attribute ---------------------------------------------------- + let currentEventNames = element.attr(dataKeyEvents) ? element.attr(dataKeyEvents).split(',') : []; + currentEventNames.push(event); + element.attr(dataKeyEvents, currentEventNames.join(',')); + + // store domElement to event (global) + allEvents[event].elements.push(domElement); + + debugWatchKey('new event "' + event + '" registered', domElement); + } + }); + }; + + /** + * get a array with all available shortcut groups and their events + * @returns {Array} + */ + let getGroupedShortcuts = () => { + let result = $.extend(true, {}, groups); + + // add combos and events to groups + let allEntries = [allCombo, allEvents]; + for(let i = 0; i < allEntries.length; i++){ + for(let event in allEntries[i]){ + let data = allEntries[i][event]; + + //format keyNames for UI + let keyNames = data.keyNames.map( (key) => { + if(key === 'CONTROL'){ + key = 'ctrl'; + } + return key; + }); + + let newEventData = { + label: data.label, + keyNames: keyNames + }; + + if( result[data.group].events ){ + result[data.group].events.push(newEventData); + }else{ + result[data.group].events = [newEventData]; + } + } + } + + // convert obj into array + result = Object.values(result); + + return result; + }; + + return { + getGroupedShortcuts: getGroupedShortcuts + }; +}); \ No newline at end of file diff --git a/public/js/v1.2.4/app/logging.js b/public/js/v1.2.4/app/logging.js new file mode 100644 index 00000000..61f62e94 --- /dev/null +++ b/public/js/v1.2.4/app/logging.js @@ -0,0 +1,531 @@ +/** + * logging + */ + +define([ + 'jquery', + 'app/init', + 'app/util', + 'bootbox' +], function($, Init, Util, bootbox) { + + 'use strict'; + + let logData = []; // cache object for all log entries + let logDataTable = null; // "Datatables" Object + + // Morris charts data + let maxGraphDataCount = 30; // max date entries for a graph + let chartData = {}; // chart Data object for all Morris Log graphs + + let config = { + taskDialogId: 'pf-task-dialog', // id for map "task manager" dialog + dialogDynamicAreaClass: 'pf-dynamic-area', // class for dynamic areas + timestampCounterClass: 'pf-timestamp-counter', // class for "timestamp" counter + taskDialogStatusAreaClass: 'pf-task-dialog-status', // class for "status" dynamic area + taskDialogLogTableAreaClass: 'pf-task-dialog-table', // class for "log table" dynamic area + logGraphClass: 'pf-log-graph', // class for all log Morris graphs + tableToolsClass: 'pf-table-tools' // class for table tools + }; + + /** + * get log time string + * @returns {string} + */ + let getLogTime = function(){ + let serverTime = Util.getServerTime(); + let logTime = serverTime.toLocaleTimeString('en-US', { hour12: false }); + + return logTime; + }; + + /** + * updated "sync status" dynamic dialog area + */ + let updateSyncStatus = function(){ + + // check if task manager dialog is open + let logDialog = $('#' + config.taskDialogId); + if(logDialog.length){ + // dialog is open + requirejs(['text!templates/modules/sync_status.html', 'mustache'], function(templateSyncStatus, Mustache) { + let data = { + timestampCounterClass: config.timestampCounterClass, + syncStatus: Init.syncStatus, + isWebSocket: () => { + return (Util.getSyncType() === 'webSocket'); + }, + isAjax: () => { + return (Util.getSyncType() === 'ajax'); + } + }; + + let syncStatusElement = $( Mustache.render(templateSyncStatus, data ) ); + + logDialog.find('.' + config.taskDialogStatusAreaClass).html( syncStatusElement ); + + logDialog.find('.' + config.timestampCounterClass).initTimestampCounter(); + + syncStatusElement.initTooltips({ + placement: 'right' + }); + }); + } + + }; + + /** + * shows the logging dialog + */ + let showDialog = function(){ + // dialog content + + requirejs(['text!templates/dialog/task_manager.html', 'mustache'], function(templateTaskManagerDialog, Mustache) { + let data = { + id: config.taskDialogId, + dialogDynamicAreaClass: config.dialogDynamicAreaClass, + taskDialogStatusAreaClass: config.taskDialogStatusAreaClass, + taskDialogLogTableAreaClass: config.taskDialogLogTableAreaClass, + tableActionBarClass: config.tableToolsClass + }; + + let contentTaskManager = $( Mustache.render(templateTaskManagerDialog, data) ); + + let rowElementGraphs = contentTaskManager.find('.row'); + let taskDialogLogTableAreaElement = contentTaskManager.find('.' + config.taskDialogLogTableAreaClass); + + let logTable = $('', { + class: ['compact', 'stripe', 'order-column', 'row-border'].join(' ') + }); + + taskDialogLogTableAreaElement.append(logTable); + + // init log table + logDataTable = logTable.DataTable({ + paging: true, + ordering: true, + order: [ 1, 'desc' ], + autoWidth: false, + hover: false, + pageLength: 10, + lengthMenu: [[5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, 'All']], + 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: '', + width: '18px', + searchable: false, + class: ['text-center'].join(' '), + data: 'status' + },{ + targets: 1, + title: '  ', + width: '50px', + searchable: true, + class: 'text-right', + data: 'time' + },{ + targets: 2, + title: '  ', + 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 + let logDialog = bootbox.dialog({ + title: 'Task-Manager', + message: contentTaskManager, + size: 'large', + buttons: { + close: { + label: 'close', + className: 'btn-default' + } + } + }); + + // modal dialog is shown + logDialog.on('shown.bs.modal', function(e) { + updateSyncStatus(); + + // show Morris graphs ---------------------------------------------------------- + + // function for chart label formation + let labelYFormat = function(y){ + return Math.round(y) + 'ms'; + }; + + for(let key in chartData) { + if(chartData.hasOwnProperty(key)) { + // create a chart for each key + + let colElementGraph = $('
', { + class: ['col-md-6'].join(' ') + }); + + + // graph element + let graphElement = $('
', { + class: config.logGraphClass + }); + + let graphArea = $('
', { + class: config.dialogDynamicAreaClass + }).append( graphElement ); + + // headline + let headline = $('

', { + text: key + }).prepend( + $('', { + class: ['txt-color', 'txt-color-grayLight'].join(' '), + text: 'Prozess-ID: ' + }) + ); + + // show update ping between function calls + let updateElement = $('', { + class: ['txt-color', 'txt-color-blue', 'pull-right'].join(' ') + }); + headline.append(updateElement).append('
'); + + // show average execution time + let averageElement = $('', { + 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 + }); + + updateLogGraph(key); + + graphArea.hideLoadingAnimation(); + + } + } + + // ------------------------------------------------------------------------------ + // add dataTable buttons (extension) + + let buttons = new $.fn.dataTable.Buttons( logDataTable, { + buttons: [ + { + extend: 'copy', + className: 'btn btn-sm btn-default', + text: ' copy' + },{ + extend: 'csv', + className: 'btn btn-sm btn-default', + text: ' 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 (let 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 (if undefined -> just update graph with current data) + */ + let 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 + if(duration !== undefined){ + chartData[key].data.unshift(duration); + } + + if(chartData[key].data.length > maxGraphDataCount){ + chartData[key].data = chartData[key].data.slice(0, maxGraphDataCount); + } + + function getGraphData(data) { + let tempChartData = { + data: [], + dataSum: 0, + average: 0 + }; + + for(let x = 0; x < maxGraphDataCount; x++){ + let 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; + } + + let tempChartData = getGraphData(chartData[key].data); + + // add new data to graph (Morris chart) - if is already initialized + if(chartData[key].graph !== null){ + let avgElement = chartData[key].averageElement; + let updateElement = chartData[key].updateElement; + + let 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'; + + let avgStatus = getLogStatusByDuration(key, tempChartData.average); + let 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('slow connection'); + }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} + */ + let getLogStatusByDuration = function(logKey, logDuration){ + let 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} + */ + let getLogTypeIconClass = function(logType){ + + let logIconClass = ''; + + switch(logType){ + case 'client': + logIconClass = 'fa-user'; + break; + case 'server': + logIconClass = 'fa-download'; + break; + } + + return logIconClass; + }; + + /** + * init logging -> set global log events + */ + let init = function(){ + + let maxEntries = 150; + + $(window).on('pf:syncStatus', function(){ + updateSyncStatus(); + }); + + // set global logging listener + $(window).on('pf:log', function(e, logKey, options){ + + // check required logging information + if( + options && + options.duration && + options.description + ){ + let logDescription = options.description; + let logDuration = options.duration; + let logType = options.type; + + // check log status by duration + let logStatus = getLogStatusByDuration(logKey, logDuration); + let statusClass = Util.getLogInfo( logStatus, 'class' ); + let typeIconClass = getLogTypeIconClass(logType); + + // update graph data + updateLogGraph(logKey, logDuration); + + let logRowData = { + status: '', + time: getLogTime(), + duration: '' + logDuration + 'ms', + description: logDescription, + type: '', + 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 --------------------------------- + let 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 + }; +}); \ No newline at end of file diff --git a/public/js/v1.2.4/app/login.js b/public/js/v1.2.4/app/login.js new file mode 100644 index 00000000..2d189bb4 --- /dev/null +++ b/public/js/v1.2.4/app/login.js @@ -0,0 +1,853 @@ +/** + * Main loginPage application + */ + +define([ + 'jquery', + 'app/init', + 'app/util', + 'app/render', + 'blueImpGallery', + 'bootbox', + 'lazyload', + 'app/ui/header', + 'app/ui/logo', + 'app/ui/demo_map', + 'dialog/account_settings', + 'dialog/notification', + 'dialog/manual', + 'dialog/releases', + 'dialog/credit' +], function($, Init, Util, Render, Gallery, bootbox) { + + 'use strict'; + + let config = { + splashOverlayClass: 'pf-splash', // class for "splash" overlay + + // header + headerId: 'pf-landing-top', // id for header + headerContainerId: 'pf-header-container', // id for header container + logoContainerId: 'pf-logo-container', // id for main header logo container + headHeaderMapId: 'pf-header-map', // id for header image (svg animation) + + // map bg + headMapBgId: 'pf-header-map-bg', // id for header background container + mapNeocomId: 'pf-map-neocom', // id for map "neocom" image + mapBrowserId: 'pf-map-browser', // id for "browser" image + mapBgImageId: 'pf-map-bg-image', // id for "background" map image + + // navigation + navigationElementId: 'pf-navbar', // id for navbar element + navigationLinkManualClass: 'pf-navbar-manual', // class for "manual" trigger link + navigationLinkLicenseClass: 'pf-navbar-license', // class for "license" trigger link + navigationVersionLinkClass: 'pf-navbar-version-info', // class for "version information" + + // cookie hint + cookieHintId: 'pf-cookie-hint', // id for "cookie hint" element + + // login + ssoButtonClass: 'pf-sso-login-button', // class for SSO login button + + // character select + characterSelectionClass: 'pf-character-selection', // class for character panel wrapper + characterRowAnimateClass: 'pf-character-row-animate', // class for character panel row during animation + characterImageWrapperClass: 'pf-character-image-wrapper', // class for image wrapper (animated) + characterImageInfoClass: 'pf-character-info', // class for character info layer (visible on hover) + dynamicMessageContainerClass: 'pf-dynamic-message-container', // class for "dynamic" (JS) message container + + // gallery + galleryId: 'pf-gallery', // id for gallery container + galleryThumbImageClass: 'pf-landing-image-preview', // class for gallery thumb images + galleryThumbContainerId: 'pf-landing-gallery-thumb-container', // id for gallery thumb images + galleryCarouselId: 'pf-landing-gallery-carousel', // id for "carousel" element + + // notification panel + notificationPanelId: 'pf-notification-panel', // id for "notification panel" (e.g. last update information) + + // sticky panel + stickyPanelClass: 'pf-landing-sticky-panel', // class for sticky panels + stickyPanelServerId: 'pf-landing-server-panel', // id for EVE Online server status panel + stickyPanelAdminId: 'pf-landing-admin-panel', // id for admin login panel + + // animation + animateElementClass: 'pf-animate-on-visible', // class for elements that will be animated to show + + defaultAcceptCookieExpire: 365 // default expire for "accept coolies" cookie + }; + + /** + * set a cookie + * @param cname + * @param cvalue + * @param exdays + */ + let setCookie = function(cname, cvalue, exdays) { + let d = new Date(); + d.setTime(d.getTime() + (exdays*24*60*60*1000)); + let expires = 'expires=' + d.toUTCString(); + let path = 'path=' + Util.getDocumentPath(); + document.cookie = cname + '=' + cvalue + '; ' + expires + '; ' + path; + }; + + /** + * get cookie value by name + * @param cname + * @returns {*} + */ + let getCookie = function(cname) { + let name = cname + '='; + let ca = document.cookie.split(';'); + + for(let i = 0; i { + let adminPanel = $('#' + config.stickyPanelAdminId); + adminPanel.css({bottom: ((direction === 'up') ? '+' : '-') + '=35px'}); + }; + + /** + * set page observer + */ + let setPageObserver = function(){ + let cookieHintElement = $('#' + config.cookieHintId); + + // cookie hint -------------------------------------------------------- + cookieHintElement.on('show.bs.collapse', function () { + // move admin panel upwards (prevents overlapping with cookie notice) + moveAdminPanel('up'); + }); + + cookieHintElement.on('hidden.bs.collapse', function () { + moveAdminPanel('down'); + }); + + if(getCookie('cookie') !== '1'){ + // hint not excepted + cookieHintElement.collapse('show'); + + // show Cookie accept hint on SSO login button + let confirmationSettings = { + container: 'body', + placement: 'bottom', + btnOkClass: 'btn btn-sm btn-default', + btnOkLabel: 'dismiss', + btnOkIcon: 'fa fa-fw fa-sign-in', + title: 'Accept cookies', + btnCancelClass: 'btn btn-sm btn-success', + btnCancelLabel: 'accept', + btnCancelIcon: 'fa fa-fw fa-check', + onCancel: function(e, target){ + // "Accept cookies" + setCookie('cookie', 1, config.defaultAcceptCookieExpire); + + // set "default" href + let href = $(target).data('bs.confirmation').getHref(); + $(e.target).attr('href', href); + }, + onConfirm : function(e, target){ + // "NO cookies" => trigger "default" href link action + }, + href: function(target){ + return $(target).attr('href'); + } + }; + + $('.' + config.ssoButtonClass).confirmation(confirmationSettings); + } + + cookieHintElement.find('.btn-success').on('click', function(){ + setCookie('cookie', 1, config.defaultAcceptCookieExpire); + }); + + // manual ------------------------------------------------------------- + $('.' + config.navigationLinkManualClass).on('click', function(e){ + e.preventDefault(); + $.fn.showMapManual(); + }); + + // license ------------------------------------------------------------ + $('.' + config.navigationLinkLicenseClass).on('click', function(e){ + e.preventDefault(); + $.fn.showCreditsDialog(false, true); + }); + + // releases ----------------------------------------------------------- + setVersionLinkObserver(); + + // tooltips ----------------------------------------------------------- + let mapTooltipOptions = { + toggle: 'tooltip', + delay: 150 + }; + + let tooltipElements = $('[title]').not('.slide img'); + tooltipElements.tooltip(mapTooltipOptions); + + // initial show some tooltips + tooltipElements.filter('[data-show="1"]').tooltip('show'); + }; + + /** + * init image carousel + */ + let initCarousel = function(){ + + // check if carousel exists + if($('#' + config.galleryCarouselId).length === 0){ + return; + } + + // extent "blueimp" gallery for a textFactory method to show HTML templates + Gallery.prototype.textFactory = function (obj, callback) { + let newSlideContent = $('
') + .addClass('text-content') + .attr('imgTitle', obj.title); + + let moduleConfig = { + name: obj.href, // template name + position: newSlideContent, + functions: { + after: function(){ + // element inserted -> load complete + callback({ + type: 'complete', + target: newSlideContent[0] + }); + } + } + }; + + // render HTML file (template) + let moduleData = { + id: config.headHeaderMapId, + bgId: config.headMapBgId, + neocomId: config.mapNeocomId, + browserId: config.mapBrowserId, + mapBgImageId: config.mapBgImageId + }; + + Render.showModule(moduleConfig, moduleData); + + return newSlideContent[0]; + }; + + // initialize carousel ------------------------------------------------ + let carousel = new Gallery([ + { + imgTitle: 'Browser', + href: 'ui/map', + type: 'text/html' + }, + { + href: 'public/img/landing/responsive.jpg', + imgTitle: 'Responsive layout', + type: 'image/jpg', + thumbnail: '' + }, + { + href: 'public/img/landing/pathfinder_1.jpg', + imgTitle: 'Map view', + type: 'image/jpg', + thumbnail: '' + }, + { + href: 'public/img/landing/pathfinder_3.jpg', + imgTitle: 'Map information', + type: 'image/jpg', + thumbnail: '' + }, + { + href: 'public/img/landing/pathfinder_2.jpg', + imgTitle: 'System information', + type: 'image/jpg', + thumbnail: '' + } + ], { + container: '#' + config.galleryCarouselId, + carousel: true, + startSlideshow: false, + titleProperty: 'imgTitle', + transitionSpeed: 600, + slideshowInterval: 5000, + onopened: function () { + // Callback function executed when the Gallery has been initialized + // and the initialization transition has been completed. + // -> show "demo" map + + // set title for first slide + $( this.options.container ).find( this.options.titleElement).text('Browser view'); + + $('#' + config.headHeaderMapId).drawDemoMap(function(){ + + // zoom map SVGs + $('#' + config.headHeaderMapId + ' svg').velocity({ + scaleX: 0.66, + scaleY: 0.66 + }, { + duration: 360 + }); + + // position map container + $('#' + config.headHeaderMapId).velocity({ + marginTop: '130px', + marginLeft: '-50px' + }, { + duration: 360, + complete: function(){ + // show browser + $('#' + config.mapBrowserId).velocity('transition.slideUpBigIn', { + duration: 360, + complete: function(){ + // show neocom + $('#' + config.mapNeocomId).velocity('transition.slideLeftIn', { + duration: 180 + }); + + // show background + $('#' + config.mapBgImageId).velocity('transition.shrinkIn', { + duration: 360 + }); + + // when map is shown -> start carousel looping + carousel.play(); + } + }); + } + }); + }); + + } + }); + }; + + /** + * get all thumbnail elements + * @returns {*|jQuery|HTMLElement} + */ + let getThumbnailElements = function(){ + return $('a[data-gallery="#' + config.galleryId + '"]').not('.disabled'); + }; + + /** + * init gallery for thumbnail elements + * @param newElements + */ + let initGallery = function(newElements){ + if( newElements.length > 0){ + // We have to add ALL thumbnail elements to the gallery! + // -> even those wthat are invisible (not lazyLoaded) now! + // -> This is required for "swipe" through all images + let allThumbLinks = getThumbnailElements(); + + requirejs(['blueImpGalleryBootstrap'], function() { + $(newElements).each(function() { + let borderless = false; + + let galleryElement = $('#' + config.galleryId); + galleryElement.data('useBootstrapModal', !borderless); + galleryElement.toggleClass('blueimp-gallery-controls', borderless); + + $(this).on('click', function(e){ + e.preventDefault(); + + e = e || window.event; + let target = e.target || e.srcElement; + let link = target.src ? target.parentNode : target; + + let options = { + index: link, + event: e, + container: '#' + config.galleryId, + titleProperty: 'description' + }; + + new Gallery(allThumbLinks, options); + }); + }); + }); + } + }; + + /** + * init "YouTube" video preview + */ + let initYoutube = function(){ + + $('.youtube').each(function() { + // Based on the YouTube ID, we can easily find the thumbnail image + $(this).css('background-image', 'url(//i.ytimg.com/vi/' + this.id + '/sddefault.jpg)'); + + // Overlay the Play icon to make it look like a video player + $(this).append($('
', {'class': 'play'})); + + $(document).delegate('#' + this.id, 'click', function() { + // Create an iFrame with autoplay set to true + let iFrameUrl = '//www.youtube.com/embed/' + this.id + '?autoplay=1&autohide=1'; + if ( $(this).data('params') ){ + iFrameUrl += '&'+$(this).data('params'); + } + + // The height and width of the iFrame should be the same as parent + let iFrame = $('