Provide an option for showing yahoo by default - great for US, less so for elsewhere
authorAndy Allan <gravitystorm@gmail.com>
Thu, 28 Oct 2010 11:42:55 +0000 (11:42 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Thu, 28 Oct 2010 11:42:55 +0000 (11:42 +0000)
potlatch2.mxml

index 5bcd83f..c146015 100755 (executable)
                        var saved_url:String = SharedObject.getLocal("user_state").data['background_url'];
                        var saved_name:String= SharedObject.getLocal("user_state").data['background_name'];
                        var xml_url:String, xml_name:String, isSet:Boolean=false;
+            var backgroundSet:Boolean = false;
+
             theController.imagery=new Array(
                                { label: "None", data: "" },
                                { label: "Yahoo", data: "yahoo" } );
                        for each (var bg:Object in theController.imagery) {
                                if (bg['label']==saved_nameĀ || bg['data']==saved_url) {
                                        setBackground(bg['label'], bg['data']);
+                    backgroundSet = true;
                                }
                        }
+
+            // For most contributors it's useful to set the background to yahoo by default, I reckon, but lets make it a config
+            if (!backgroundSet && loaderInfo.parameters['yahoo_default'] == 'true') {
+                setBackground("Yahoo", "yahoo");
+            }
                }
                
                public function setBackground(name:String,url:String):void {