Fix scrolling functionality
[WebThing.git] / plugins / DefaultPage.cs
index e0f65d6..b534fe1 100644 (file)
@@ -1,12 +1,16 @@
 using System;
+using System.Text.RegularExpressions;
 using bytex64.WebThing;
 
 public class DefaultPage : WebThingPlugin {
     public override void Init(WebThing wt) {
-        if (wt.Arguments.Length > 0) {
-            wt.OpenUri(wt.Arguments[0]);
-        } else {
-            wt.OpenUri("http://dominionofawesome.com/");
+        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);
         }
     }
 }