From 77c7bb1d487fda73f319fd73ee384b7dacdb61ec Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 15 Aug 2011 13:16:26 +0800 Subject: [PATCH] Pman.Tab.FtpFiles.js --- Pman.Tab.FtpFiles.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Pman.Tab.FtpFiles.js b/Pman.Tab.FtpFiles.js index 3f787e1..b00f612 100644 --- a/Pman.Tab.FtpFiles.js +++ b/Pman.Tab.FtpFiles.js @@ -182,7 +182,21 @@ Pman.Tab.FtpFiles = { } // if it's not a text file.. download it.. - _this.viewLayout.load(baseURL+ '/Ftp/View' + s[0].data.id + '?html=1'); + var mt = s[0].data.mimetype; + if (mt.match(/^text\//)) { + _this.viewLayout.load(baseURL+ '/Ftp/View' + s[0].data.id + '?html=1'); + return; + } + if (mt.match(/\/xml$/)) { + _this.viewLayout.load(baseURL+ '/Ftp/View' + s[0].data.id + '?html=1'); + return; + } + // download + new Pman.Download({ + url: baseURL+ '/Ftp/View' + s[0].data.id; + }) + + } } } -- 2.39.2