Fix scrolling functionality
[WebThing.git] / plugins / DefaultPage.cs
index e1a0010..b534fe1 100644 (file)
@@ -1,8 +1,16 @@
 using System;
+using System.Text.RegularExpressions;
 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) {
+            foreach (string arg in Config.Arguments)
+                wt.OpenTab(arg);
+        } else if (Config.Options.ContainsKey("DefaultPage")) {
+            string[] pages = Regex.Split(Config.Options["DefaultPage"], @"\s+");
+            foreach (string page in pages)
+                wt.OpenTab(page);
+        }
+    }
 }