Convert Vimish to use global config
[WebThing.git] / plugins / DefaultPage.cs
index e1a0010..f7076e5 100644 (file)
@@ -1,8 +1,14 @@
 using System;
 using bytex64.WebThing;
 
-public class Plugin {
-       public Plugin(WebThing wt) {
-               wt.WebView.Open("http://dominionofawesome.com/");
-       }
+public class DefaultPage : WebThingPlugin {
+    public override void Init(WebThing wt) {
+        if (Config.Arguments.Length > 0) {
+            wt.OpenUri(Config.Arguments[0]);
+        } else if (Config.Options.ContainsKey("DefaultPage")) {
+            wt.OpenUri(Config.Options["DefaultPage"]);
+        } else {
+            wt.OpenUri("http://dominionofawesome.com/");
+        }
+    }
 }