Add team method parseFragment()
authorMike Taylor <mike@indexdata.com>
Fri, 1 May 2015 19:54:36 +0000 (20:54 +0100)
committerMike Taylor <mike@indexdata.com>
Fri, 1 May 2015 19:54:36 +0000 (20:54 +0100)
src/mkws-team.js

index 890f582..c688f76 100644 (file)
@@ -101,6 +101,18 @@ mkws.makeTeam = function($, teamName) {
     return s;
   }
 
+  // ### what quoting do we need to undo? Complement of previous function
+  that.parseFragment = function(s) {
+    var x = {};
+
+    var list = s.split('@');
+    for (var i in list) {
+      var a = list[i].split('=');
+      x[a[0]] = a[1];
+    }
+
+    return x;
+  }
 
   // The following PubSub code is modified from the jQuery manual:
   // http://api.jquery.com/jQuery.Callbacks/