[open-ils-commits] r16546 - in trunk: . Open-ILS/src/perlmods/OpenILS/WWW/SuperCat Open-ILS/web/js/dojo/openils (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jun 1 15:02:24 EDT 2010


Author: miker
Date: 2010-06-01 15:02:19 -0400 (Tue, 01 Jun 2010)
New Revision: 16546

Modified:
   trunk/
   trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm
   trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js
Log:
rid ourself of some namespace prefixes because IE is too braindead to understand them


Property changes on: trunk
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2010-05-06 15:49:25.437000036 -0400
committer: Mike Rylander <miker at esilibrary.com>
properties: 
	branch-nick: trunk

   + timestamp: 2010-06-01 15:02:18.358000040 -0400
committer: Mike Rylander <miker at esilibrary.com>
properties: 
	branch-nick: trunk

Name: bzr:file-ids
   - Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm	15833 at dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk%2FOpen-ILS%2Fsrc%2Fperlmods%2FOpenILS%2FApplication%2FStorage%2FDriver%2FPg%2FQueryParser.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/QueryParser.pm	15833 at dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk%2FOpen-ILS%2Fsrc%2Fperlmods%2FOpenILS%2FApplication%2FStorage%2FQueryParser.pm

   + Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm	3271 at dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk:Open-ILS%2Fsrc%2Fperlmods%2FOpenILS%2FWWW%2FSuperCat%2FFeed.pm
Open-ILS/web/js/dojo/openils/BibTemplate.js	13010 at dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk%2FOpen-ILS%2Fweb%2Fjs%2Fdojo%2Fopenils%2FBibTemplate.js

Name: bzr:revision-id:v4
   - 11741 phasefx at batrepo-20091014063041-ama3i5s87ziqohxo
11742 phasefx at batrepo-20091014063644-pn3a6urkw3uxgr6n
12108 phasefx at batrepo-20091120084700-lavt73oserscgalf
12166 jason at esilibrary.com-20091202233906-g8kh2kh3qmmz66r1
12184 jason at esilibrary.com-20091204161020-0dqezh01c05btffh
12198 jason at esilibrary.com-20091208140008-eofwdbn2u8dxk2kk
12199 jason at esilibrary.com-20091208155412-4qdzy8sgs51vm0yq
12215 jason at esilibrary.com-20091209133642-bp8mb3tc5vpoc1ij
12220 jason at esilibrary.com-20091209143447-i1st1to8ln4hhwyb
12231 jason at esilibrary.com-20091209221438-vv4crqppm8ajj3dr
12804 jason at esilibrary.com-20100324194046-jza2ic2dlpq8txhc
12946 miker at esilibrary.com-20100402183612-8xznj35wfohk7zyu
12955 miker at esilibrary.com-20100403141037-h8d57ryrmkkg9yhb
12971 miker at whirly-20100405202254-aztbsf3p3eey9e8e
12997 miker at esilibrary.com-20100408154146-zodwuxxizwf0y449
13010 miker at miker-msi-20100409021618-5f0ohbg5cgi5pai0
13014 miker at esilibrary.com-20100409135406-mitf09aw1srnps3g
13022 miker at esilibrary.com-20100412144909-fc4bx1n80ac0z8ox
13023 miker at esilibrary.com-20100412145629-92g9jts2k8yqsm38
13152 miker at esilibrary.com-20100503010126-67i6kclipxip27du
13153 miker at esilibrary.com-20100503010322-3ri56680p7bf4o26
13161 miker at esilibrary.com-20100504150623-34h9t5p64cd52swu
13163 miker at esilibrary.com-20100504180646-77rxefvetqkiyo3s
13164 miker at esilibrary.com-20100504182041-0s81n6j3dxb14hrk
13175 miker at esilibrary.com-20100506194925-xg5folqttvehr2np

   + 11741 phasefx at batrepo-20091014063041-ama3i5s87ziqohxo
11742 phasefx at batrepo-20091014063644-pn3a6urkw3uxgr6n
12108 phasefx at batrepo-20091120084700-lavt73oserscgalf
12166 jason at esilibrary.com-20091202233906-g8kh2kh3qmmz66r1
12184 jason at esilibrary.com-20091204161020-0dqezh01c05btffh
12198 jason at esilibrary.com-20091208140008-eofwdbn2u8dxk2kk
12199 jason at esilibrary.com-20091208155412-4qdzy8sgs51vm0yq
12215 jason at esilibrary.com-20091209133642-bp8mb3tc5vpoc1ij
12220 jason at esilibrary.com-20091209143447-i1st1to8ln4hhwyb
12231 jason at esilibrary.com-20091209221438-vv4crqppm8ajj3dr
12804 jason at esilibrary.com-20100324194046-jza2ic2dlpq8txhc
12946 miker at esilibrary.com-20100402183612-8xznj35wfohk7zyu
12955 miker at esilibrary.com-20100403141037-h8d57ryrmkkg9yhb
12971 miker at whirly-20100405202254-aztbsf3p3eey9e8e
12997 miker at esilibrary.com-20100408154146-zodwuxxizwf0y449
13010 miker at miker-msi-20100409021618-5f0ohbg5cgi5pai0
13014 miker at esilibrary.com-20100409135406-mitf09aw1srnps3g
13022 miker at esilibrary.com-20100412144909-fc4bx1n80ac0z8ox
13023 miker at esilibrary.com-20100412145629-92g9jts2k8yqsm38
13152 miker at esilibrary.com-20100503010126-67i6kclipxip27du
13153 miker at esilibrary.com-20100503010322-3ri56680p7bf4o26
13161 miker at esilibrary.com-20100504150623-34h9t5p64cd52swu
13163 miker at esilibrary.com-20100504180646-77rxefvetqkiyo3s
13164 miker at esilibrary.com-20100504182041-0s81n6j3dxb14hrk
13175 miker at esilibrary.com-20100506194925-xg5folqttvehr2np
13306 miker at esilibrary.com-20100601190218-nf7sqyxzgsylm94f

Name: bzr:text-parents
   - Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm	miker at esilibrary.com-20100504150623-34h9t5p64cd52swu
Open-ILS/src/perlmods/OpenILS/Application/Storage/QueryParser.pm	miker at miker-msi-20100409021618-5f0ohbg5cgi5pai0

   + Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm	svn-v4:dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk:14178
Open-ILS/web/js/dojo/openils/BibTemplate.js	miker at esilibrary.com-20100504182041-0s81n6j3dxb14hrk


Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm	2010-06-01 17:38:21 UTC (rev 16545)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm	2010-06-01 19:02:19 UTC (rev 16546)
@@ -426,7 +426,7 @@
 
 sub new {
 	my $class = shift;
-	my $self = $class->SUPER::build('<mods:modsCollection version="3.0" xmlns:mods="http://www.loc.gov/mods/"/>');
+	my $self = $class->SUPER::build('<modsCollection version="3.0" xmlns="http://www.loc.gov/mods/" xmlns:mods="http://www.loc.gov/mods/"/>');
 	$self->{type} = 'application/xml';
 	$self->{item_xpath} = '/mods:modsCollection';
 	return $self;
@@ -456,15 +456,15 @@
 	if ($type eq 'unapi' || $type eq 'opac') {
 		$self->_create_node(
 			'mods:mods',
-			'http://www.loc.gov/mods/',
-			'mods:relatedItem',
+            undef,
+			'relatedItem',
 			undef,
 			{ type => 'otherFormat', id => 'link-'.$linkid }
 		);
 		$self->_create_node(
-			"mods:mods/mods:relatedItem[\@id='link-$linkid']",
-			'http://www.loc.gov/mods/',
-			'mods:recordIdentifier',
+			"mods:mods/relatedItem[\@id='link-$linkid']",
+            undef,
+			'recordIdentifier',
 			$id
 		);
 		$linkid++;
@@ -478,7 +478,7 @@
 
 sub new {
 	my $class = shift;
-	my $self = $class->SUPER::build('<mods:modsCollection version="3.0" xmlns:mods="http://www.loc.gov/mods/v3"/>');
+	my $self = $class->SUPER::build('<modsCollection version="3.0" xmlns="http://www.loc.gov/mods/v3" xmlns:mods="http://www.loc.gov/mods/v3"/>');
 	$self->{type} = 'application/xml';
 	$self->{item_xpath} = '/mods:modsCollection';
 	return $self;
@@ -506,15 +506,15 @@
 	if ($type eq 'unapi' || $type eq 'opac') {
 		$self->_create_node(
 			'mods:mods',
-			'http://www.loc.gov/mods/v3',
-			'mods:relatedItem',
 			undef,
+			'relatedItem',
+			undef,
 			{ type => 'otherFormat', id => 'link-'.$linkid }
 		);
 		$self->_create_node(
-			"mods:mods/mods:relatedItem[\@id='link-$linkid']",
-			'http://www.loc.gov/mods/v3',
-			'mods:recordIdentifier',
+			"mods:mods/relatedItem[\@id='link-$linkid']",
+			undef,
+			'recordIdentifier',
 			$id
 		);
 		$linkid++;
@@ -529,7 +529,7 @@
 
 sub new {
 	my $class = shift;
-	my $self = $class->SUPER::build('<mods:modsCollection version="3.2" xmlns:mods="http://www.loc.gov/mods/v3"/>');
+	my $self = $class->SUPER::build('<modsCollection version="3.2" xmlns="http://www.loc.gov/mods/v3" xmlns:mods="http://www.loc.gov/mods/v3"/>');
 	$self->{type} = 'application/xml';
 	$self->{item_xpath} = '/mods:modsCollection';
 	return $self;
@@ -545,7 +545,7 @@
 
 sub new {
 	my $class = shift;
-	my $self = $class->SUPER::build('<mods:modsCollection version="3.3" xmlns:mods="http://www.loc.gov/mods/v3"/>');
+	my $self = $class->SUPER::build('<modsCollection version="3.3" xmlns="http://www.loc.gov/mods/v3" xmlns:mods="http://www.loc.gov/mods/v3"/>');
 	$self->{type} = 'application/xml';
 	$self->{item_xpath} = '/mods:modsCollection';
 	return $self;
@@ -562,7 +562,7 @@
 
 sub new {
 	my $class = shift;
-	my $self = $class->SUPER::build('<marc:collection xmlns:marc="http://www.loc.gov/MARC21/slim"/>');
+	my $self = $class->SUPER::build('<collection xmlns="http://www.loc.gov/MARC21/slim" xmlns:marc="http://www.loc.gov/MARC21/slim"/>');
 	$self->{type} = 'application/xml';
 	$self->{item_xpath} = '/marc:collection';
 	return $self;

Modified: trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js	2010-06-01 17:38:21 UTC (rev 16545)
+++ trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js	2010-06-01 19:02:19 UTC (rev 16546)
@@ -17,7 +17,7 @@
 if(!dojo._hasResource["openils.BibTemplate"]) {
 
     dojo.require('DojoSRF');
-    dojo.require('dojox.data.dom');
+    dojo.require('dojox.xml.parser');
     dojo.require('dojo.string');
     dojo._hasResource["openils.BibTemplate"] = true;
     dojo.provide("openils.BibTemplate");
@@ -51,6 +51,15 @@
             return new_nl;
         },
 
+        textContent : function (node) {
+            var content = '';
+            if (node) {
+                if(window.ActiveXObject) content = node.text;
+                else content = node.textContent;
+            }
+            return content;
+        },
+
         render : function() {
 
             var all_slots = dojo.query('*[type^=opac/slot-data]', this.root);
@@ -122,25 +131,25 @@
                                     var templated = slot.getAttribute('templated') == 'true';
                                     if (debug) alert('BibTemplate debug -- slot ' + (templated ? 'is' : 'is not') + ' templated');
                                     if (templated) {
+                                        if (debug) alert('BibTemplate debug -- slot template innerHTML:\n' + slot.innerHTML);
                                         var template_values = {};
 
                                         dojo.query(
                                             '*[type=opac/template-value]',
                                             slot
                                         ).orphan().forEach(function(x) {
-                                            dojo.setObject(
-                                                x.getAttribute('name'),
-                                                (new Function( 'item_list', 'BT', 'slotXML', 'slot', unescape(x.innerHTML) ))(item_list,BT,bib,slot),
-                                                template_values
-                                            );
+                                            var name = x.getAttribute('name');
+                                            var value = (new Function( 'item_list', 'BT', 'slotXML', 'slot', unescape(x.innerHTML) ))(item_list,BT,bib,slot);
+                                            if (name && (value || value == '')) template_values[name] = value;
                                         });
-    
+
+                                        if (debug) alert('BibTemplate debug -- template values:\n' + dojo.toJson( template_values ));
                                         slot.innerHTML = dojo.string.substitute( unescape(slot.innerHTML), template_values );
                                     }
 
                                     var handler_node = dojo.query( '*[type=opac/slot-format]', slot )[0];
-                                    if (handler_node) slot_handler = new Function('item_list', 'BT', 'slotXML', 'slot', 'item', dojox.data.dom.textContent(handler_node) || handler_node.innerHTML);
-                                    else slot_handler = new Function('item_list', 'BT', 'slotXML', 'slot', 'item','return dojox.data.dom.textContent(item) || item.innerHTML;');
+                                    if (handler_node) slot_handler = new Function('item_list', 'BT', 'slotXML', 'slot', 'item', dojox.xml.parser.textContent(handler_node) || handler_node.innerHTML);
+                                    else slot_handler = new Function('item_list', 'BT', 'slotXML', 'slot', 'item','return dojox.xml.parser.textContent(item) || item.innerHTML;');
 
                                     if (item_list.length) {
                                         var content = dojo.map(item_list, dojo.partial(slot_handler,item_list,BT,bib,slot)).join(joiner);



More information about the open-ils-commits mailing list