Changeset 20939
- Timestamp:
- 10/08/08 02:39:11 (2 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/plugin_loader.js
r20938 r20939 21 21 function toArray (obj) { 22 22 return obj instanceof Array ? obj 23 : obj.toString().split(/[,| \s]/);23 : obj.toString().split(/[,| \t\r\n]+/); 24 24 } 25 25 26 26 let roots = toArray(globalVariables.plugin_loader_roots); 27 27 let plugins = toArray(globalVariables.plugin_loader_plugins); 28 let filter = new RegExp('[\\\\/](' + plugins.join('|') + ')\\.(js|vimp)$'); 28 let filter = new RegExp('[\\\\/](?:' + 29 plugins.map(function (plugin) plugin.replace(/(?=[\\^$.+*?|(){}\[\]])/g, '\\')) 30 .join('|') + 31 ')\\.(?:js|vimp)$'); 29 32 30 33 log('plugin_loader: loading'); 31 34 32 for each (let root in roots) {35 roots.forEach(function (root) { 33 36 let files = io.readDirectory(io.getFile(root), true); 34 for each (let file in files) { 35 if (!filter.test(file.path)) 36 continue; 37 liberator.io.source(file.path, false); 38 } 39 } 37 files.forEach(function (file) { 38 if (filter.test(file.path)) 39 liberator.io.source(file.path, false); 40 }); 41 }); 40 42 41 43 log('plugin_loader: loaded');
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)