remove domain name and root slash from extracted id

This commit is contained in:
cloudhead 2010-07-04 21:20:29 +02:00
parent 67dc0498d7
commit 789c829d26

View File

@ -146,10 +146,11 @@ function loadStyleSheet(sheet, callback, reload, remaining) {
} }
function extractId(href) { function extractId(href) {
return href.replace(/^[a-z]+:\/\/?/, '') // Remove protocol return href.replace(/^[a-z]+:\/\/?[^\/]+/, '') // Remove protocol & domain
.replace(/\?.*$/, '') // Remove query .replace(/^\//, '') // Remove root /
.replace(/\.[^\/]+$/, '') // Remove file extension .replace(/\?.*$/, '') // Remove query
.replace(/[^\w-]+/g, '-'); // Replace illegal characters .replace(/\.[^\/]+$/, '') // Remove file extension
.replace(/[^\w-]+/g, '-'); // Replace illegal characters
} }
function createCSS(styles, sheet, lastModified) { function createCSS(styles, sheet, lastModified) {