@@ -88,16 +88,10 @@ var WormholeMap = {
8888 . linkDistance ( link_distance * SCALING_FACTOR )
8989 . on ( 'end' , function ( ) {
9090
91- var link_groups = link . data ( $ . grep ( WormholeMap . jumps , function ( l ) { return l . type ! = 'wormhole' } ) )
91+ var link_groups = link . data ( $ . grep ( WormholeMap . jumps , function ( l ) { return l . type = = 'wormhole' } ) )
9292 . enter ( ) . append ( 'g' )
9393 . attr ( 'class' , function ( j ) { return 'link ' + j . type ; } )
9494 . append ( 'line' ) ;
95-
96- var path_groups = link . data ( $ . grep ( WormholeMap . jumps , function ( l ) { return l . type == 'wormhole' } ) )
97- . enter ( ) . append ( 'g' )
98- . attr ( 'class' , function ( j ) { return 'link ' + j . type ; } )
99- . append ( 'path' )
100- . attr ( 'marker-mid' , 'url(#wormhole)' ) ;
10195
10296 var node_groups = node . data ( WormholeMap . systems )
10397 . enter ( ) . append ( 'g' )
@@ -158,27 +152,9 @@ var WormholeMap = {
158152 . attr ( 'x2' , function ( d ) { return d . target . x ; } )
159153 . attr ( 'y2' , function ( d ) { return d . target . y ; } ) ;
160154
161- path_groups . filter ( function ( l ) { return l . type == 'wormhole' ; } ) . on ( 'click' , function ( l ) {
155+ link_groups . filter ( function ( l ) { return l . type == 'wormhole' ; } ) . on ( 'click' , function ( l ) {
162156 WormholeMap . updateWormholeJump ( l ) ;
163157 } ) ;
164-
165- path_groups . attr ( 'd' , function ( d ) {
166- var dx = d . target . x - d . source . x ,
167- dy = d . target . y - d . source . y ,
168- dr = Math . sqrt ( dx * dx + dy * dy ) / 1.45 ,
169- mx = d . source . x + dx ,
170- my = d . source . y + dy ;
171-
172- return [
173- "M" , d . source . x , d . source . y ,
174- "A" , dr , dr , 0 , 0 , 1 , mx , my ,
175- "A" , dr , dr , 0 , 0 , 1 , d . target . x , d . target . y
176- ] . join ( " " ) ;
177- } ) ;
178-
179- path_groups . filter ( function ( l ) { return l . wormhole_data . signature ; } )
180- . append ( 'title' )
181- . text ( function ( d ) { return d . wormhole_data . signature ; } ) ;
182158
183159 node_groups . attr ( 'transform' , function ( d ) {
184160 return 'translate(' + ( d . x - rect_width / 2 ) + ',' + ( d . y - rect_height / 2 ) + ')' ;
@@ -287,6 +263,17 @@ var WormholeMap = {
287263 WormholeMap . zoom . translate ( [ ( Data . ui . map . width ( ) / 2 - nodes [ system . id ] . x * scale ) , ( Data . ui . map . height ( ) / 2 - nodes [ system . id ] . y * scale ) ] ) ;
288264 WormholeMap . zoom . event ( root ) ;
289265 } ,
266+
267+ updateWormholeJump : function ( link ) {
268+ link . permitted_ships = Handlebars . helpers . jump_permitted_ships ( link . wormhole_data . mass_total ) ;
269+ link . read_only = true ;
270+
271+ Data . ui . mapInfo . html ( $ ( Data . templates . wormhole_link_info ( link ) ) ) ;
272+ Data . ui . mapInfo . children ( 'div.wormhole-link-details' )
273+ . fadeIn ( Data . config . uiSpeed )
274+ . delay ( Data . config . alertStay * 3 )
275+ . fadeOut ( Data . config . uiSpeed ) ;
276+ } ,
290277
291278 init : function ( ) {
292279 log ( 'Initializing System Map...' ) ;
0 commit comments