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

Robert Lyon bob at katipo.co.nz
Tue Oct 24 01:14:05 CEST 2006


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

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

Log message:
	Altered the read cookie js to be able to handle finding the bib_list whereever it appears in the cookie info

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

Patches:
Index: basket.js
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/opac-tmpl/npl/en/includes/basket.js,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.2.2.1
diff -u -b -r1.1.2.2 -r1.1.2.2.2.1
--- basket.js	28 Sep 2005 20:38:43 -0000	1.1.2.2
+++ basket.js	23 Oct 2006 23:14:04 -0000	1.1.2.2.2.1
@@ -45,18 +45,13 @@
 	else {
 		str_cookie = parent.document.cookie;
 	}
-	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;
 }
 





More information about the Koha-cvs mailing list