[open-ils-commits] r18105 - trunk/Open-ILS/web/js/dojo/openils (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Sep 29 16:16:46 EDT 2010


Author: miker
Date: 2010-09-29 16:16:41 -0400 (Wed, 29 Sep 2010)
New Revision: 18105

Modified:
   trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js
Log:
Give BibTemplate the ability to inspect and optionally parse XML, instead of requiring a DOM node

Modified: trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js	2010-09-29 18:08:16 UTC (rev 18104)
+++ trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js	2010-09-29 20:16:41 UTC (rev 18105)
@@ -36,6 +36,9 @@
             this.locale = kwargs.locale || OpenSRF.locale || 'en-US';
             this.nodelay = kwargs.delay == false;
 
+            if (this.xml && this.xml instanceof String)
+                this.xml = dojox.xml.parser.parse(this.xml);
+
             this.mode = 'biblio-record_entry';
             this.default_datatype = 'marcxml-uris';
             if (kwargs.metarecord) {
@@ -56,12 +59,11 @@
         },
 
         textContent : function (node) {
-            var content = '';
             if (node) {
-                if(window.ActiveXObject) content = node.text;
-                else content = node.textContent;
+                if (node instanceof HTMLElement) return node.innerText || node.textContent;
+                return dojox.xml.parser.textContent(node);
             }
-            return content;
+            return '';
         },
 
         render : function() {



More information about the open-ils-commits mailing list