Rearrange initialization to be clearer and shorter
[WebThing.git] / plugins / DefaultPage.cs
index f7076e5..5ec5bdd 100644 (file)
@@ -1,14 +1,18 @@
 using System;
+using System.Text.RegularExpressions;
 using bytex64.WebThing;
 
 public class DefaultPage : WebThingPlugin {
     public override void Init(WebThing wt) {
         if (Config.Arguments.Length > 0) {
-            wt.OpenUri(Config.Arguments[0]);
+            foreach (string arg in Config.Arguments)
+                wt.OpenUriTab(arg);
         } else if (Config.Options.ContainsKey("DefaultPage")) {
-            wt.OpenUri(Config.Options["DefaultPage"]);
+            string[] pages = Regex.Split(Config.Options["DefaultPage"], @"\s+");
+            foreach (string page in pages)
+                wt.OpenUriTab(page);
         } else {
-            wt.OpenUri("http://dominionofawesome.com/");
+            wt.OpenUriTab("http://dominionofawesome.com/");
         }
     }
 }