ovidiu      02/04/15 17:36:07

  Modified:    src/scratchpad/schecoon/webapp/examples/calc calc.js
  Log:
  Use a prefix when generating the output pages.
  
  Revision  Changes    Path
  1.7       +7 -4      xml-cocoon2/src/scratchpad/schecoon/webapp/examples/calc/calc.js
  
  Index: calc.js
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/scratchpad/schecoon/webapp/examples/calc/calc.js,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- calc.js   15 Apr 2002 05:23:57 -0000      1.6
  +++ calc.js   16 Apr 2002 00:36:07 -0000      1.7
  @@ -1,5 +1,8 @@
  -function calculator()
  +var prefix;
  +
  +function calculator(uriPrefix)
   {
  +  prefix = uriPrefix;
     var a = getNumber("a");
     var b = getNumber("b", a);
     var op = getOperator(a, b);
  @@ -18,20 +21,20 @@
   
   function getNumber(name, a, b)
   {
  -  var uri = "getNumber" + name.toUpperCase() + ".html";
  +  var uri = prefix + "getNumber" + name.toUpperCase() + ".html";
     sendPage(uri, { "a" : a, "b" : b });
     return parseFloat(cocoon.request.getParameter(name));
   }
   
   function getOperator(a, b)
   {
  -  var uri = "getOperator.html";
  +  var uri = prefix + "getOperator.html";
     sendPage(uri, { "a" : a, "b" : b });
     return cocoon.request.getParameter("operator");
   }
   
   function sendResult(a, b, op, result)
   {
  -  sendPage("displayResult.html",
  +  sendPage(prefix + "displayResult.html",
              { "a" : a, "b" : b, "operator" : op, "result" : result });
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to