Index: trunk/extensions/OWALiteTracker/OWALiteTracker.php |
— | — | @@ -25,9 +25,15 @@ |
26 | 26 | if( !count( $wgOWAGeoTrackSites ) ) { |
27 | 27 | return; |
28 | 28 | } |
29 | | - $text .= "<script> var includeOWA = false; if(Geo){"; |
| 29 | + $text = "<script> var includeOWA = false; if( Geo ){\n"; |
30 | 30 | foreach( $condition as $wgOWAGeoTrackSites ){ |
31 | | - $text .= "if (Geo.{$condition[0]} && Geo.{$condition[0]} == \"{$condition[1]}\"){ if(!includeOWA){includeOWA=true; importScriptURI( document.location.protocol +'//owa.wikimedia.org/owa/modules/base/js/owa.tracker-combined-min.js');} importScriptURI( document.location.protocol + '//owa.wikimedia.org/resources/{$condition[2]}');}"; |
| 31 | + $text .= "if (Geo.{$condition[0]} && Geo.{$condition[0]} == \"{$condition[1]}\"){ |
| 32 | + if( !includeOWA ) { |
| 33 | + includeOWA = true; |
| 34 | + importScriptURI( document.location.protocol + '//owa.wikimedia.org/owa/modules/base/js/owa.tracker-combined-min.js' ); |
32 | 35 | } |
| 36 | + importScriptURI( document.location.protocol + '//owa.wikimedia.org/resources/{$condition[2]}'); |
| 37 | +}"; |
| 38 | + } |
33 | 39 | $text .= "}</script>"; |
34 | 40 | } |
\ No newline at end of file |