repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 510e1d5a7989ffece27b21274291bd795a850a6d:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 510e1d5a7989ffece27b21274291bd795a850a6d
Author: James Baicoianu 
Date:   Tue Mar 27 14:08:51 2018 -0700

    object.getElementsByTagName()

diff --git a/scripts/janusbase.js b/scripts/janusbase.js
index 894809a458b774d1715b868ec3b06c3c82bfdb2b..
index ..b16dd819ef38cac7472e32c6ff65379bd78de627 100644
--- a/scripts/janusbase.js
+++ b/scripts/janusbase.js
@@ -296,6 +296,7 @@ elation.require(['engine.things.generic', 'utils.template'], function() {
           removeClass:         ['function', 'removeClass'],
           hasClass:            ['function', 'hasClass'],
           raycast:             ['function', 'raycast'],
+          getElementsByTagName:['function', 'getElementsByTagName'],
         });

         if (classdef) {
@@ -716,5 +717,18 @@ console.error('dunno what this is', other);
         return this.room.raycast(_dir, _pos, classname);
       };
     })();
+    this.getElementsByTagName = function(tagname, elements) {
+      var tag = tagname.toUpperCase();
+      if (!elements) elements = [];
+      var children = this.getChildProxies();
+      for (var i = 0; i < children.length; i++) {
+        var el = children[i];
+        if (el.tag == tag) {
+          elements.push(el);
+        }
+        el.getElementsByTagName(tagname, elements);
+      };
+      return elements;
+    }
   }, elation.engine.things.generic);
 });

-----END OF PAGE-----