From c177159192649fa3581f1f292a85426c4a01dc7e Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 1 Oct 2008 12:19:01 +0000 Subject: getCSSFiles の返り血が入れ子になってしまっているのを修正 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@20388 d0d07461-0603-4401-acd4-de1884942a52 --- stylechanger.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'stylechanger.js') diff --git a/stylechanger.js b/stylechanger.js index b2d06b4..f075ea4 100644 --- a/stylechanger.js +++ b/stylechanger.js @@ -43,12 +43,15 @@ liberator.plugins.styleSheetsManger = (function(){ function init() { if (globalVariables.styles) globalVariables.styles.split(/\s*,\s*/).forEach(manager.load); } - function getCSSFiles() + function getCSSFiles() { + let files = []; io.getRuntimeDirectories('colors') .filter(function(colorDir) colorDir) - .map(function(colorDir) - io.readDirectory(colorDir).filter(function(file) - /\.css$/.test(file.leafName.toLowerCase()) && !file.isDirectory())); + .forEach(function(colorDir) + io.readDirectory(colorDir).forEach(function(file) + /\.css$/.test(file.leafName.toLowerCase()) && !file.isDirectory() && files.push(file))); + return files; + } function getURIFromName(aName){ var ret = null; io.getRuntimeDirectories('colors').some(function(file){ -- cgit v1.2.3