webui-aria2/js/filters/path.js
2013-01-29 17:47:40 +05:00

9 lines
237 B
JavaScript

// returns the relative path from base
angular.module('webui.filters.path', [])
.filter('prelative', function() {
return function(path, base) {
return path.replace(/\\/g, '/')
.replace(base.replace(/\\/, '/'), '.');
};
});