Merge remote-tracking branch 'gravitystorm/history'
[potlatch2.git] / potlatch2.mxml
index 87c1e5c1f3c95e941833598ed395539555c98d56..3fcc6f063da868fa0835ace42eb7e5f2c9377830 100644 (file)
@@ -99,9 +99,8 @@
                import net.systemeD.potlatch2.collections.*;
                import net.systemeD.potlatch2.controller.*;
                import net.systemeD.potlatch2.help.*;
-               import net.systemeD.potlatch2.options.*;
+               import net.systemeD.potlatch2.dialogs.*;
                import net.systemeD.potlatch2.utils.*;
-        import net.systemeD.potlatch2.mygpx.*;
                import net.systemeD.controls.FloatingAlert;
                import net.systemeD.controls.Spinner;
                import mx.managers.PopUpManager;
 
         public var theMap:Map;
         public var theController:EditController;
-               public var yahoo:Yahoo;
                public var trackLoader:TrackLoader;
                public var toolbox:Toolbox;
         public var bugLoader:BugLoader;
                private function startInit():void {
                        var loader:Loader = new Loader();
                        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, startApp);
-                       loader.load(new URLRequest("FontLibrary.swf"));
+            if (loaderInfo.parameters['font_library']) {
+                           loader.load(new URLRequest(loaderInfo.parameters['font_library']));
+            } else {
+                           loader.load(new URLRequest("FontLibrary.swf"));
+            }
 
             if (loaderInfo.parameters['locale'] && loaderInfo.parameters['locale']!='en_US') {
                 // we don't bother with localisation if the user is en_US, as P2 is in English by default
                 Globals.vars.locale = loaderInfo.parameters['locale'];
+                Globals.vars.locale_paths = loaderInfo.parameters['locale_paths'];
                 dispatchEvent(new LocaleEvent(LocaleEvent.LOAD_LOCALE, loaderInfo.parameters['locale']));
                 dispatchEvent(new LocaleEvent(LocaleEvent.LOAD_LOCALE, 'en_US')); // think en_US is default
                 resourceManager.localeChain = [loaderInfo.parameters['locale'], 'en_US'];
                        theMap.backdrop=b;
             theMap.updateSize(w,h);
                        theMap.addEventListener(MapEvent.SCALE, scaleHandler);
-
-                       yahoo=new Yahoo(theMap);
-                       yahoo.hide();
-                       _root.addChild(yahoo);
                        _root.addChild(theMap);
 
                        // Initialise stylesheets
                        theMap.tileset.blocks=[/google\./i];    // hard-coded block on Google tiles
                        theMap.tileset.setDimming(params['background_dim']    ==null ? true  : params['background_dim']);
                        theMap.tileset.setSharpen(params['background_sharpen']==null ? false : params['background_sharpen']);
-                       Imagery.instance().init(theMap, overlay, yahoo);
+                       Imagery.instance().init(theMap, overlay);
                        Imagery.instance().addEventListener(MapEvent.BUMP, bumpHandler);
                        Imagery.instance().addEventListener(CollectionEvent.SELECT,
                                function(e:CollectionEvent):void { theMap.tileset.init(e.data, e.data!=''); }
                 var gpx_url:String = loaderInfo.parameters['gpx_url'];
 
                 var connection:Connection = new Connection(name, gpx_url, null, null);
-                var gpx:GpxImporter=new GpxImporter(connection, theMap, [gpx_url],
+                var gpx:GpxImporter=new GpxImporter(connection, theMap,
                                                 function(success:Boolean,message:String=null):void {
                                                     if (!success) return;
                                                     var paint:MapPaint = theMap.addLayer(connection, "stylesheets/gpx.css");
                                                     paint.updateEntityUIs(false, false);
                                                     dispatchEvent(new Event("layers_changed"));
                                                 }, false);
+                               gpx.importFromRemoteFiles([gpx_url]);
                        }
 
                        // create GPS trackloader