diff options
author | trapezoid | 2008-09-25 07:57:07 +0000 |
---|---|---|
committer | trapezoid | 2008-09-25 07:57:07 +0000 |
commit | 583a0c61bebda9478a25bd954a01ce542a66a4ef (patch) | |
tree | d3369a1260c084ccb22b269c0b689d20caf81c97 | |
parent | a18322953e0ec8add22faf24b816fa387c4254c3 (diff) | |
download | vimperator-plugins-583a0c61bebda9478a25bd954a01ce542a66a4ef.tar.bz2 |
CVS HEADに対応(set runtimepathでの読み込み先ディレクトリの複数指定に対応)
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@19900 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | stylechanger.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/stylechanger.js b/stylechanger.js index 85eb42b..a3fc2b7 100644 --- a/stylechanger.js +++ b/stylechanger.js @@ -6,7 +6,7 @@ * @author teramako teramako@gmail.com * @url http://coderepos.org/share/wiki/VimperatorPlugin/stylechanger.js * @license MPL 1.1/GPL 2.0/LGPL 2.1 - * @version 0.3b + * @version 0.3c * ==/VimperatorPlugin== * * Usage: @@ -48,19 +48,24 @@ liberator.plugins.styleSheetsManger = (function(){ } } function getCSSFiles(){ - var colorDir = io.getSpecialDirectory('colors'); var cssFiles = []; - if (colorDir){ - cssFiles = io.readDirectory(colorDir).filter(function(file){ - return /\.css$/.test(file.leafName.toLowerCase()) && !file.isDirectory() ; - }); + var colorDirs = io.getRuntimeDirectories('colors'); + for each(var colorDir in colorDirs){ + if (colorDir){ + cssFiles.concat(io.readDirectory(colorDir).filter(function(file){ + return /\.css$/.test(file.leafName.toLowerCase()) && !file.isDirectory() ; + })); + } } + return cssFiles; } function getURIFromName(aName){ - var file = io.getSpecialDirectory('colors'); - file.append(aName + '.css'); - if (file.exists()) return ios.newFileURI(file); + var colorDirs = io.getRuntimeDirectories('colors'); + for each(var file in colorDirs){ + file.append(aName + '.css'); + if (file.exists()) return ios.newFileURI(file); + } return null; } |