bruno 2003/08/04 04:37:08
Modified: src/blocks/petstore/samples/flow petstore.js
Log:
remove initial / in uri supplied to sendPage calls
Revision Changes Path
1.2 +17 -17 cocoon-2.1/src/blocks/petstore/samples/flow/petstore.js
Index: petstore.js
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/petstore/samples/flow/petstore.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- petstore.js 10 Jul 2003 23:48:53 -0000 1.1
+++ petstore.js 4 Aug 2003 11:37:08 -0000 1.2
@@ -117,7 +117,7 @@
function index() {
setView();
getPetStore();
- cocoon.sendPage("/view/index" + EXT, {
+ cocoon.sendPage("view/index" + EXT, {
view: VIEW,
accountForm: accountForm,
categoryList: categoryList,
@@ -132,7 +132,7 @@
var cartItem = cartForm.cart.cartItems[i];
cartItems.push(cartItem);
}
- cocoon.sendPage("/view/Cart" + EXT, {
+ cocoon.sendPage("view/Cart" + EXT, {
view: VIEW,
accountForm: accountForm,
cartForm: cartForm,
@@ -151,7 +151,7 @@
var cartItem = cartForm.cart.cartItems[i];
cartItems.push(cartItem);
}
- cocoon.sendPage("/view/Cart" + EXT, {
+ cocoon.sendPage("view/Cart" + EXT, {
view: VIEW,
fmt: fmt,
accountForm: accountForm,
@@ -168,7 +168,7 @@
cartItem.updateQuantity(quantity);
cartItems.push(cartItem);
}
- cocoon.sendPage("/view/Cart" + EXT, {
+ cocoon.sendPage("view/Cart" + EXT, {
view: VIEW,
fmt: fmt,
accountForm: accountForm,
@@ -186,7 +186,7 @@
var cartItem = cartForm.cart.cartItems[i];
cartItems.push(cartItem);
}
- cocoon.sendPage("/view/Cart" + EXT, {
+ cocoon.sendPage("view/Cart" + EXT, {
view: VIEW,
fmt: fmt,
accountForm: accountForm,
@@ -210,7 +210,7 @@
maxResults);
var lastPage = !productList.isLimitedByMaxRows;
var rowCount = productList.rowCount;
- cocoon.sendPageAndWait("/view/Category" + EXT, {
+ cocoon.sendPageAndWait("view/Category" + EXT, {
accountForm: accountForm,
productList: productList.rows,
category: category,
@@ -254,7 +254,7 @@
getPetStore().getItemListByProduct(productId,
skipResults,
maxResults);
- cocoon.sendPageAndWait("/view/Product" + EXT, {
+ cocoon.sendPageAndWait("view/Product" + EXT, {
view: VIEW,
accountForm: accountForm,
fmt: fmt,
@@ -281,7 +281,7 @@
function viewItem() {
var itemId = cocoon.request.getParameter("itemId");
var item = getPetStore().getItem(itemId);
- cocoon.sendPage("/view/Item" + EXT, {
+ cocoon.sendPage("view/Item" + EXT, {
view: VIEW,
accountForm: accountForm,
cartForm: cartForm,
@@ -307,7 +307,7 @@
} else {
var message = "";
while (true) {
- cocoon.sendPageAndWait("/view/SignonForm" + EXT, {
+ cocoon.sendPageAndWait("view/SignonForm" + EXT, {
view: VIEW,
accountForm: accountForm,
message: message
@@ -334,7 +334,7 @@
print("new account");
var accountForm = new AccountForm();
var account = new Account();
- cocoon.sendPageAndWait("/view/NewAccountForm" + EXT, {
+ cocoon.sendPageAndWait("view/NewAccountForm" + EXT, {
view: VIEW,
accountForm: accountForm,
account: account,
@@ -425,7 +425,7 @@
function searchProducts() {
var keyword = cocoon.request.get("keyword");
if (empty(keyword)) {
- cocoon.sendPage("/view/Error" + EXT, {
+ cocoon.sendPage("view/Error" + EXT, {
view: VIEW,
message: "Please enter a keyword to search for, then press the
search button"
});
@@ -437,7 +437,7 @@
var result =
getPetStore().searchProductList(keyword, skipResults,
maxResults);
- cocoon.sendPageAndWait("/view/SearchProducts" + EXT, {
+ cocoon.sendPageAndWait("view/SearchProducts" + EXT, {
view: VIEW,
searchResultsProductList: result.rows,
firstPage: skipResults == 0,
@@ -464,7 +464,7 @@
var cartItem = cartForm.cart.cartItems[i];
cartItems.push(cartItem);
}
- cocoon.sendPageAndWait("/view/Checkout" + EXT, {
+ cocoon.sendPageAndWait("view/Checkout" + EXT, {
view: VIEW,
accountForm: accountForm,
cartForm: cartForm,
@@ -479,7 +479,7 @@
var order = orderForm.order;
var valid = false;
while (!valid) {
- cocoon.sendPageAndWait("/view/NewOrderForm" + EXT, {
+ cocoon.sendPageAndWait("view/NewOrderForm" + EXT, {
accountForm: accountForm,
view: VIEW,
fmt: fmt,
@@ -487,19 +487,19 @@
order: order});
var shippingAddressRequired =
cocoon.request.get("shippingAddressRequired");
if (shippingAddressRequired) {
- cocoon.sendPageAndWait("/view/ShippingForm" + EXT,
+ cocoon.sendPageAndWait("view/ShippingForm" + EXT,
{order: order, fmt: fmt, accountForm:
accountForm});
}
// fix me !! do real validation
valid = true;
}
- cocoon.sendPageAndWait("/view/ConfirmOrder" + EXT,
+ cocoon.sendPageAndWait("view/ConfirmOrder" + EXT,
{accountForm: accountForm,
view: VIEW, order: order, fmt: fmt});
var oldCartForm = cartForm;
cartForm = new CartForm();
- cocoon.sendPage("/view/ViewOrder" + EXT,
+ cocoon.sendPage("view/ViewOrder" + EXT,
{view: VIEW, order: order,
accountForm: accountForm,
itemList: order.lineItems,