Merge branch 'master' into history
[potlatch2.git] / net / systemeD / halcyon / connection / Entity.as
index 2a47935..c5c6178 100644 (file)
@@ -33,6 +33,7 @@ package net.systemeD.halcyon.connection {
             this._uid = uid;
             this._timestamp = timestamp;
             this._user = user
+            if (connection.cssTransform) tags=connection.cssTransform.run(this,tags);
             this.tags = tags;
                        this._loaded = loaded;
             modified = id < 0;
@@ -135,6 +136,14 @@ package net.systemeD.halcyon.connection {
             return tags[key];
         }
 
+               /** Retrieve a key matching a regex. */
+               public function getTagByRegex(regex:RegExp):String {
+                       for (var k:String in tags) {
+                               if (k.match(regex)) return tags[k];
+                       }
+                       return null;
+               }
+
         /** @return true if there exists key=value */
         public function tagIs(key:String,value:String):Boolean {
             if (!tags[key]) { return false; }
@@ -153,7 +162,7 @@ package net.systemeD.halcyon.connection {
 
         /** Change oldKey=[value] to newKey=[value], with optional undoability.
          * @param oldKey Name of key to rename
-         * @parame newKey New name of key
+         * @param newKey New name of key
          * @param performAction Single-argument function to pass a SetTagKeyAction to.
          * @example renameTag("building", "amenity", MainUndoStack.getGlobalStack().addAction);
          */