Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /naja/src/js/naja.js

naja
Discussion topic

Back to topic list

CVS update: /naja/src/js/naja.js

Reply

Author pablo_cabrera
Full name Pablo J. Cabrera Munoz
Date 2006-06-21 20:26:19 PDT
Message User: pablo_cabrera
Date: 2006-06-21 20:26:19-0700
Log:
 no message

File Changes:

Directory: /naja/src/js/
========================

File [changed]: naja.js
Url: http://naja.tigris.o​rg/source/browse/naj​a/src/js/naja.js?r1=​1.4&r2=1.5
Delta lines: +7 -9
-------------------
--- naja.js 2006-06-03 09:03:06-0700 1.4
+++ naja.js 2006-06-21 20:26:16-0700 1.5
@@ -66,9 +66,9 @@
  * @return String
  */
 $parsePath = function(pPath) {
- pPath = pPath.replace("\\", "/");
- pPath = pPath.replace("/./", "/");
- pPath = pPath.replace("//", "/");
+ pPath = pPath.replace(/\\/g, "/");
+ pPath = pPath.replace(/\/\.\//g, "/");
+ pPath = pPath.replace(/\/\//g, "/");
 
     var chunks = pPath.split("/");
     var returnPath = new Array();
@@ -167,13 +167,11 @@
     includeFile.file = includeFile.path+inc​ludeFile.name;
     includeFile.src = requester.responseText;
 
- /* Emulates an str_replace like function */
     var src = includeFile.src;
-
- src = (src.split("%SCRIPT_​PATH%")).join("('"+i​ncludeFile.path+"')"​);
- src = (src.split("%SCRIPT_​NAME%")).join("('"+i​ncludeFile.name+"')"​);
- src = (src.split("%SCRIPT_​FILE%")).join("('"+i​ncludeFile.file+"')"​);
- src = (src.split("%LOCAL_P​ATH%")).join("('"+$​nj.locationPath+"/')​");
+ src = src.replace(/\%SCRIPT_PATH\%/, "('"+includeFile.path+"')");
+ src = src.replace(/\%SCRIPT_NAME\%/, "('"+includeFile.file+"')");
+ src = src.replace(/\%SCRIPT_FILE\%/, "('"+includeFile.path+"')");
+ src = src.replace(/\%LOCAL_PATH\%/, "('"+locationPath+"')");
 
     try {
         if($getAgent() == $AGENT_IE) {

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /naja/src/js/naja.js pablo_cabrera Pablo J. Cabrera Munoz 2006-06-21 20:26:19 PDT
Messages per page: