From 2a87abfc15d8f9569ca64562c8e5bc8308c78b80 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Wed, 30 Apr 2014 14:45:52 +0800 Subject: Add artDialog in FQTerm script engine - Modify filedialog so that it'll work without config. - Use artDialog to show the result of the downloadart.js --- res/script/README | 3 ++- res/script/downloadart.js | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'res') diff --git a/res/script/README b/res/script/README index 8e273fc..5e11eb9 100644 --- a/res/script/README +++ b/res/script/README @@ -116,4 +116,5 @@ toUTF8(str, codec) decode from string in specified codec to utf8 return string - +artDialog(content) +open a dialog with content denoted in the argument diff --git a/res/script/downloadart.js b/res/script/downloadart.js index f0fd212..8438a52 100644 --- a/res/script/downloadart.js +++ b/res/script/downloadart.js @@ -1,6 +1,6 @@ fqterm.importFile("utils.js"); -var saveFile = "/tmp/save.txt"; +// var saveFile = "/tmp/save.txt"; var LastLine = 23; var timeout = 300; var retries = 5; @@ -8,6 +8,7 @@ var retries = 5; // there'll be a 'XX%' at the last line var r = new RegExp("%"); var esc = new RegExp('\x1b\x1b','g'); +var content = ""; getAnsiLine = function(i){ var line = fqterm.getAttrText(i).replace(esc, "\x1b["); @@ -16,7 +17,8 @@ getAnsiLine = function(i){ // first copy the previous lines for (var i=0; i