diff --git a/app/main/controller/api/route.php b/app/main/controller/api/route.php index 018ba2c1..4d0ec012 100644 --- a/app/main/controller/api/route.php +++ b/app/main/controller/api/route.php @@ -589,8 +589,8 @@ class Route extends \Controller\AccessController { ]; $returnRoutData = [ - 'systemFrom' => $routeData['systemFrom'], - 'systemTo' => $routeData['systemTo'], + 'systemFromData' => $routeData['systemFromData'], + 'systemToData' => $routeData['systemToData'], 'maps' => $mapData, 'mapIds' => $mapIds ]; @@ -599,10 +599,14 @@ class Route extends \Controller\AccessController { $returnRoutData += $filterData; if(count($mapIds) > 0){ + $systemFrom = $routeData['systemFromData']['name']; + $systemTo = $routeData['systemToData']['name']; + + $cacheKey = $this->getRouteCacheKey( $mapIds, - $routeData['systemFrom'], - $routeData['systemTo'], + $systemFrom, + $systemTo, $filterData ); @@ -614,7 +618,7 @@ class Route extends \Controller\AccessController { $this->initJumpData($mapIds, $filterData); // no cached route data found - $foundRoutData = $this->findRoute($routeData['systemFrom'], $routeData['systemTo']); + $foundRoutData = $this->findRoute($systemFrom, $systemTo); $returnRoutData = array_merge($returnRoutData, $foundRoutData); // cache if route was found diff --git a/app/main/model/mapmodel.php b/app/main/model/mapmodel.php index b633a7a2..4eab5a9d 100644 --- a/app/main/model/mapmodel.php +++ b/app/main/model/mapmodel.php @@ -218,7 +218,7 @@ class MapModel extends BasicModel { $systemController = new System(); $systems = $systemController->getSystemModelByIds([$systemId]); $system = reset($systems); - $system->mapId = $this->id; + $system->mapId = $this->_id; return $system; } diff --git a/app/pathfinder.ini b/app/pathfinder.ini index b64952ab..7a0decfb 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.1.0 +VERSION = v1.1.1 ; contact information [optional] CONTACT = https://github.com/exodus4d ; public contact email [optional] diff --git a/js/app.js b/js/app.js index e8cab2ad..070abb46 100644 --- a/js/app.js +++ b/js/app.js @@ -44,7 +44,7 @@ requirejs.config({ 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.0 Drop Down customization - https://select2.github.io + 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.15.2 Image Gallery - https://github.com/blueimp/Gallery diff --git a/js/app/map/map.js b/js/app/map/map.js index 1176a388..dab8a072 100644 --- a/js/app/map/map.js +++ b/js/app/map/map.js @@ -2011,7 +2011,7 @@ define([ case 'add_first_waypoint': case 'add_last_waypoint': systemData = system.getSystemData(); - setDestination(systemData, action); + Util.setDestination(systemData, action); break; } } @@ -2063,68 +2063,6 @@ define([ system.singleDoubleClick(single, double); }; - - /** - * set new destination for a system - * -> CREST request - * @param systemData - * @param type - */ - var setDestination = function(systemData, type){ - - var description = ''; - switch(type){ - case 'set_destination': - description = 'Set destination'; - break; - case 'add_first_waypoint': - description = 'Set first waypoint'; - break; - case 'add_last_waypoint': - description = 'Set new waypoint'; - break; - } - - $.ajax({ - type: 'POST', - url: Init.path.setDestination, - data: { - clearOtherWaypoints: (type === 'set_destination') ? 1 : 0, - first: (type === 'add_last_waypoint') ? 0 : 1, - systemData: [{ - systemId: systemData.systemId, - name: systemData.name - }] - }, - context: { - description: description - }, - dataType: 'json' - }).done(function(responseData){ - if( - responseData.systemData && - responseData.systemData.length > 0 - ){ - for (var j = 0; j < responseData.systemData.length; j++) { - Util.showNotify({title: this.description, text: 'System: ' + responseData.systemData[j].name, type: 'success'}); - } - } - - if( - responseData.error && - responseData.error.length > 0 - ){ - for(var i = 0; i < responseData.error.length; i++){ - Util.showNotify({title: this.description + ' error', text: 'System: ' + responseData.error[i].message, type: 'error'}); - } - } - - }).fail(function( jqXHR, status, error) { - var reason = status + ' ' + error; - Util.showNotify({title: jqXHR.status + ': ' + this.description, text: reason, type: 'warning'}); - }); - }; - /** * mark a dom element (map, system, connection) as changed */ @@ -2883,9 +2821,6 @@ define([ var content = Mustache.render(template, data); - // disable modal focus event -> otherwise select2 is not working! -> quick fix - $.fn.modal.Constructor.prototype.enforceFocus = function() {}; - var systemDialog = bootbox.dialog({ title: 'Add new system', message: content, diff --git a/js/app/page.js b/js/app/page.js index 93503bdd..75c4f1df 100644 --- a/js/app/page.js +++ b/js/app/page.js @@ -367,6 +367,7 @@ define([ return Mustache.render(TplLogo, {}); }, brandLogo: config.menuHeadMenuLogoClass, + popoverTriggerClass: Util.config.popoverTriggerClass, userCharacterClass: config.headUserCharacterClass, userCharacterImageClass: config.userCharacterImageClass, userShipClass: config.headUserShipClass, diff --git a/js/app/ui/dialog/map_settings.js b/js/app/ui/dialog/map_settings.js index fcd6f865..11317f6a 100644 --- a/js/app/ui/dialog/map_settings.js +++ b/js/app/ui/dialog/map_settings.js @@ -184,9 +184,6 @@ define([ $('#' + config.dialogMapCreateContainerId, contentDialog).html(contentNewMap); $('#' + config.dialogMapEditContainerId, contentDialog).html(contentEditMap); - // disable modal focus event -> otherwise select2 is not working! -> quick fix - $.fn.modal.Constructor.prototype.enforceFocus = function() {}; - var mapInfoDialog = bootbox.dialog({ title: dialogTitle, message: contentDialog, diff --git a/js/app/ui/form_element.js b/js/app/ui/form_element.js index 65fc065a..8bab28e1 100644 --- a/js/app/ui/form_element.js +++ b/js/app/ui/form_element.js @@ -18,7 +18,7 @@ define([ $.when( selectElement.select2({ - dropdownParent: 'body', + dropdownParent: selectElement.parents('.modal-body'), theme: 'pathfinder', maximumSelectionLength: 5 }) @@ -78,8 +78,8 @@ define([ return { results: data.map( function(item){ - // "systemId" is the system name! - var systemId = item[options.key]; + // "systemId" or "name" + var id = item[options.key]; var disabled = false; var trueSec = parseFloat(item.trueSec); var secClass = Util.getSecurityClassForSystem(item.security); @@ -89,7 +89,7 @@ define([ // check if system is dialed if( options.disabledOptions && - options.disabledOptions.indexOf(parseInt(systemId, 10)) !== -1 + options.disabledOptions.indexOf(parseInt(id, 10)) !== -1 ){ disabled = true; } @@ -105,8 +105,9 @@ define([ } return { - id: systemId, + id: id, text: item.name, + systemId: parseInt(item.systemId), security: item.security, secClass: secClass, trueSec: trueSec.toFixed(1), @@ -127,7 +128,7 @@ define([ } }, - dropdownParent: 'body', + dropdownParent: selectElement.parents('.modal-body'), theme: 'pathfinder', minimumInputLength: 2, templateResult: formatResultData, @@ -248,7 +249,7 @@ define([ } }, - dropdownParent: 'body', + dropdownParent: selectElement.parents('.modal-body'), theme: 'pathfinder', minimumInputLength: 3, placeholder: '', diff --git a/js/app/ui/system_route.js b/js/app/ui/system_route.js index 2af414c8..0c4a5a3c 100644 --- a/js/app/ui/system_route.js +++ b/js/app/ui/system_route.js @@ -32,8 +32,7 @@ define([ systemInfoRoutesTableClass: 'pf-system-route-table', // class for route tables mapSelectId: 'pf-route-dialog-map-select', // id for "map" select - sigTableActionCellClass: 'pf-table-action-cell' // class for "action" cells - + dataTableActionCellClass: 'pf-table-action-cell' // class for "action" cells }; // cache for system routes @@ -56,7 +55,8 @@ define([ var rowData = formatRouteData(routeData); if(rowData.route){ - var cacheKey = routeData.systemFrom.toLowerCase() + '_' + routeData.systemTo.toLowerCase(); + var cacheKey = routeData.systemFromData.name.toLowerCase() + + '_' + routeData.systemToData.name.toLowerCase(); // update route cache cache.systemRoutes[cacheKey] = { @@ -90,9 +90,9 @@ define([ var animationStatus = 'changed'; // search for an existing row (e.g. on mass "table refresh" [all routes]) - // get rowIndex where column 0 (equals to "systemTo") matches rowData.systemTo + // 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() === rowData.systemTo); + return (dataTable.cell(rowIdx, 0 ).data().name === rowData.systemToData.name); }); if(indexes.length > 0){ @@ -129,21 +129,33 @@ define([ moduleElement: moduleElement, dataTable: dataTable }; - var routeData = []; - dataTable.rows().every( function() { - var data = this.data(); - routeData.push({ - mapIds: data.mapIds, - systemFrom: data.systemFrom, - systemTo: data.systemTo - }); - } ); + 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 : 1, + jumpbridges: (rowData.hasOwnProperty('jumpbridges')) ? rowData.jumpbridges : 1, + wormholes: (rowData.hasOwnProperty('wormholes')) ? rowData.wormholes : 1, + wormholesReduced: (rowData.hasOwnProperty('wormholesReduced')) ? rowData.wormholesReduced : 1, + wormholesCritical: (rowData.hasOwnProperty('wormholesCritical')) ? rowData.wormholesCritical : 1 + }; + }; + /** * show route dialog. User can search for systems and jump-info for each system is added to a data table * @param dialogData @@ -165,7 +177,7 @@ define([ id: config.routeDialogId, selectClass: config.systemDialogSelectClass, mapSelectId: config.mapSelectId, - systemFrom: dialogData.systemFrom, + systemFromData: dialogData.systemFromData, mapSelectOptions: mapSelectOptions }; @@ -173,9 +185,6 @@ define([ var content = Mustache.render(template, data); - // disable modal focus event -> otherwise select2 is not working! -> quick fix - $.fn.modal.Constructor.prototype.enforceFocus = function() {}; - var findRouteDialog = bootbox.dialog({ title: 'Route finder', message: content, @@ -210,25 +219,36 @@ define([ return false; } - var context = { - moduleElement: dialogData.moduleElement, - dataTable: dialogData.dataTable - }; + // get all system data from select2 + var systemSelectData = form.find('.' + config.systemDialogSelectClass).select2('data'); - var requestData = { - routeData: [{ - mapIds: routeDialogData.mapIds, - systemFrom: dialogData.systemFrom, - systemTo: routeDialogData.systemTo, - 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 - }] - }; + if( + systemSelectData && + systemSelectData.length === 1 + ){ + var context = { + moduleElement: dialogData.moduleElement, + dataTable: dialogData.dataTable + }; - getRouteData(requestData, context, callbackAddRouteRow); + 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 + }] + }; + + getRouteData(requestData, context, callbackAddRouteRow); + } } } } @@ -338,8 +358,8 @@ define([ // default row data (e.g. no route found) var tableRowData = { - systemFrom: routeData.systemFrom, - systemTo: routeData.systemTo, + systemFromData: routeData.systemFromData, + systemToData: routeData.systemToData, jumps: { value: 0, formatted: '---' @@ -481,7 +501,18 @@ define([ targets: 0, orderable: true, title: 'system ', - data: 'systemTo' + 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, @@ -508,25 +539,14 @@ define([ targets: 3, orderable: false, title: 'route', - data: 'route', - createdCell: function(cell, cellData, rowData, rowIndex, colIndex) { - - // init context menu - /* - console.log(cell); - console.log(cellData); - $(cell).find('i').on('click', function(){ - - }); - */ - } + data: 'route' },{ targets: 4, title: '', orderable: false, searchable: false, width: '10px', - class: ['text-center', config.sigTableActionCellClass].join(' '), + class: ['text-center', config.dataTableActionCellClass].join(' '), data: 'reload', render: { _: 'button' @@ -547,8 +567,8 @@ define([ var requestData = { routeData: [{ mapIds: rowData.mapIds, - systemFrom: rowData.systemFrom, - systemTo: rowData.systemTo, + systemFromData: rowData.systemFromData, + systemToData: rowData.systemToData, stargates: rowData.stargates ? 1 : 0, jumpbridges: rowData.jumpbridges ? 1 : 0, wormholes: rowData.wormholes ? 1 : 0, @@ -566,7 +586,7 @@ define([ orderable: false, searchable: false, width: '10px', - class: ['text-center', config.sigTableActionCellClass].join(' '), + class: ['text-center', config.dataTableActionCellClass].join(' '), data: 'clear', render: { _: 'button' @@ -622,6 +642,69 @@ define([ 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 @@ -631,8 +714,26 @@ define([ */ var initModule = function(moduleElement, mapId, systemData){ - var systemFrom = systemData.name; - var systemsTo = ['Jita', 'Amarr', 'Rens', 'Dodixie']; + var systemFromData = { + name: systemData.name, + systemId: systemData.systemId + }; + + var systemsTo = [ + { + name: 'Jita', + systemId: 30000142 + },{ + name: 'Amarr', + systemId: 30002187 + },{ + name: 'Rens', + systemId: 30002510 + },{ + name: 'Dodixie', + systemId: 30002659 + } + ]; var routesTableElement = moduleElement.find('.' + config.systemInfoRoutesTableClass); @@ -648,7 +749,7 @@ define([ var dialogData = { moduleElement: moduleElement, mapId: mapId, - systemFrom: systemFrom, + systemFromData: systemFromData, dataTable: routesTable }; @@ -660,10 +761,10 @@ define([ var currentTimestamp = Util.getServerTime().getTime(); for(var i = 0; i < systemsTo.length; i++){ - var systemTo = systemsTo[i]; + var systemToData = systemsTo[i]; - if(systemFrom !== systemTo){ - var cacheKey = 'route_' + mapId + '_' + systemFrom.toUpperCase() + '_' + systemTo.toUpperCase(); + if(systemFromData.name !== systemToData.name){ + var cacheKey = 'route_' + mapId + '_' + systemFromData.name.toUpperCase() + '_' + systemToData.name.toUpperCase(); if( cache.systemRoutes.hasOwnProperty(cacheKey) && @@ -679,17 +780,13 @@ define([ addRow(context, cache.systemRoutes[cacheKey].data); }else{ // get route data - - requestRouteData.push({ + var searchData = { mapIds: [mapId], - systemFrom: systemFrom, - systemTo: systemTo, - stargates: 1, - jumpbridges: 1, - wormholes: 1, - wormholesReduced: 1, - wormholesCritical: 1 - }); + systemFromData: systemFromData, + systemToData: systemToData + }; + + requestRouteData.push( getRouteRequestDataFromRowData( searchData )); } } } diff --git a/js/app/util.js b/js/app/util.js index 92aa6dfc..ff826340 100644 --- a/js/app/util.js +++ b/js/app/util.js @@ -48,7 +48,10 @@ define([ // animation animationPulseSuccessClass: 'pf-animation-pulse-success', // animation class - animationPulseWarningClass: 'pf-animation-pulse-warning' // animation class + animationPulseWarningClass: 'pf-animation-pulse-warning', // animation class + + // popover + popoverTriggerClass: 'pf-popover-trigger' // class for "popover" trigger elements }; @@ -590,9 +593,10 @@ define([ title: 'select character', trigger: 'click', placement: 'bottom', + container: 'body', content: content, animation: false - }).data('bs.popover').tip().addClass('pf-character-info-popover'); + }).data('bs.popover').tip().addClass('pf-popover'); element.on('click', function(e) { e.preventDefault(); @@ -617,20 +621,33 @@ define([ } }); - // hide popup on clicking "somewhere" outside - $('body').off('click.' + eventNamespace).on('click.' + eventNamespace, function (e) { + // set popup "close" observer + elements.initPopoverClose(eventNamespace); + }); + }); + }; + /** + * set "popover" close action on clicking "somewhere" on the
+ * @param eventNamespace + * @returns {*} + */ + $.fn.initPopoverClose = function(eventNamespace){ + return this.each(function() { + $('body').off('click.' + eventNamespace).on('click.' + eventNamespace + ' contextmenu', function (e) { + + $('.' + config.popoverTriggerClass).each(function () { + var popoverElement = $(this); //the 'is' for buttons that trigger popups //the 'has' for icons within a button that triggers a popup - if ( - !$(element).is(e.target) && - $(element).has(e.target).length === 0 && + if( + !popoverElement.is(e.target) && + popoverElement.has(e.target).length === 0 && $('.popover').has(e.target).length === 0 ){ - $(element).popover('hide'); + popoverElement.popover('hide'); } }); - }); }); }; @@ -1677,6 +1694,67 @@ define([ return userInfo; }; + /** + * set new destination for a system + * -> CREST request + * @param systemData + * @param type + */ + var setDestination = function(systemData, type){ + + var description = ''; + switch(type){ + case 'set_destination': + description = 'Set destination'; + break; + case 'add_first_waypoint': + description = 'Set first waypoint'; + break; + case 'add_last_waypoint': + description = 'Set new waypoint'; + break; + } + + $.ajax({ + type: 'POST', + url: Init.path.setDestination, + data: { + clearOtherWaypoints: (type === 'set_destination') ? 1 : 0, + first: (type === 'add_last_waypoint') ? 0 : 1, + systemData: [{ + systemId: systemData.systemId, + name: systemData.name + }] + }, + context: { + description: description + }, + dataType: 'json' + }).done(function(responseData){ + if( + responseData.systemData && + responseData.systemData.length > 0 + ){ + for (var j = 0; j < responseData.systemData.length; j++) { + showNotify({title: this.description, text: 'System: ' + responseData.systemData[j].name, type: 'success'}); + } + } + + if( + responseData.error && + responseData.error.length > 0 + ){ + for(var i = 0; i < responseData.error.length; i++){ + showNotify({title: this.description + ' error', text: 'System: ' + responseData.error[i].message, type: 'error'}); + } + } + + }).fail(function( jqXHR, status, error) { + var reason = status + ' ' + error; + showNotify({title: jqXHR.status + ': ' + this.description, text: reason, type: 'warning'}); + }); + }; + /** * set currentSystemData as "global" variable * @param systemData @@ -1835,6 +1913,7 @@ define([ getCurrentSystemData: getCurrentSystemData, getCurrentUserInfo: getCurrentUserInfo, getCurrentCharacterLog: getCurrentCharacterLog, + setDestination: setDestination, convertDateToString: convertDateToString, getOpenDialogs: getOpenDialogs, formatPrice: formatPrice, diff --git a/js/lib/select2.min.js b/js/lib/select2.min.js index d1db56ac..61f48076 100644 --- a/js/lib/select2.min.js +++ b/js/lib/select2.min.js @@ -1,2 +1,3 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k