From c1735267fbfdef5bf0392816253c5e7873429ad0 Mon Sep 17 00:00:00 2001 From: hamza zia Date: Thu, 17 Jan 2013 22:13:58 +0500 Subject: [PATCH] relative file paths added --- js/script.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/script.js b/js/script.js index 86aafdb..48f5786 100755 --- a/js/script.js +++ b/js/script.js @@ -374,6 +374,8 @@ function getTemplateCtx(data) { var type = data.status; if (type == "paused") type = "waiting"; if (type == "error" || type == "removed" || type == "complete") type = "stopped"; + + data.dir = data.dir.replace(/\\/g, '/'); return { name: name, sett_name: name.substr(0,name.lastIndexOf('.')) || name, @@ -402,7 +404,11 @@ function getTemplateCtx(data) { can_restart: type == "stopped" }, chunks: chunks, - files: data.files.map(function(e) { e.size = changeLength(e.length, "B"); return e }), + files: data.files.map(function(e) { + e.size = changeLength(e.length, "B"); + e.path = e.path.replace(/\\/g, '/').replace(data.dir, './'); + return e + }), bittorrent: !!data.bittorrent }; }