[Koha-cvs] koha/koha-tmpl/opac-tmpl/css/en/includes basket.js [dev_week]

Robert Lyon bob at katipo.co.nz
Tue Oct 24 01:16:59 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Robert Lyon <bob_lyon>	06/10/23 23:16:59

Modified files:
	koha-tmpl/opac-tmpl/css/en/includes: basket.js 

Log message:
	Updating the basket read cookie to make sure it reads the part relating to 'name'

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/css/en/includes/basket.js?cvsroot=koha&only_with_tag=dev_week&r1=1.3.2.4&r2=1.3.2.4.2.1

Patches:
Index: basket.js
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/opac-tmpl/css/en/includes/basket.js,v
retrieving revision 1.3.2.4
retrieving revision 1.3.2.4.2.1
diff -u -b -r1.3.2.4 -r1.3.2.4.2.1
--- basket.js	23 Sep 2005 09:56:54 -0000	1.3.2.4
+++ basket.js	23 Oct 2006 23:16:59 -0000	1.3.2.4.2.1
@@ -47,17 +47,15 @@
 	}
 	var coo_len = str_cookie.length;
 	var i = 0;
-
-	while (i < coo_len) {
-		var j = i + str_len;
-		if (str_cookie.substring(i, j) == str_name)
-			return readCookieValue(str_cookie, j);
-		i = str_cookie.indexOf(" ", i) + 1;
-		if (i == 0)
-			break;
+        // fixed - getting the part of the basket that is bib_list
+        var cookie_parts = str_cookie.split(";");
+        for(var i=0;i < cookie_parts.length;i++) {
+            var c = cookie_parts[i];
+            while (c.charAt(0)==' ') c = c.substring(1,c.length);
+            if(c.indexOf(str_name) == 0) return c.substring(str_name.length,c.length);
 	}
-
 	return null;
+		    
 }
 
 function delCookie(name) {





More information about the Koha-cvs mailing list