Permalink
Browse files

ignore 'print' stylesheets

  • Loading branch information...
1 parent 3a29550 commit 25f8328f474131e38f213189b389f4b1e20928b5 @idflood idflood committed Sep 6, 2011
Showing with 21 additions and 17 deletions.
  1. +21 −17 src/client/vogue-client.js
View
38 src/client/vogue-client.js
@@ -119,30 +119,34 @@
// Go through all the links in the page, looking for stylesheets.
for (i = 0, m = links.length; i < m; i += 1) {
link = links[i];
- if (isLocalStylesheet(link)) {
- // Link is local, get the base URL.
- href = getBase(link.href);
- if (href !== false) {
- stylesheets[href] = link;
+ if (link.getAttribute("media") != "print") {
+ if (isLocalStylesheet(link)) {
+ // Link is local, get the base URL.
+ href = getBase(link.href);
+ if (href !== false) {
+ stylesheets[href] = link;
+ }
}
}
}
// Go through all the style tags, looking for @import tags.
links = document.getElementsByTagName("style");
for (i = 0, m = links.length; i < m; i += 1) {
- content = links[i].text || links[i].textContent;
- while ((matches = reImport.exec(content))) {
- link = {
- rel: "stylesheet",
- href: matches[1],
- getAttribute: getProperty
- };
- if (isLocalStylesheet(link)) {
- // Link is local, get the base URL.
- href = getBase(link.href);
- if (href !== false) {
- stylesheets[href] = link;
+ if (links[i].getAttribute("media") != "print") {
+ content = links[i].text || links[i].textContent;
+ while ((matches = reImport.exec(content))) {
+ link = {
+ rel: "stylesheet",
+ href: matches[1],
+ getAttribute: getProperty
+ };
+ if (isLocalStylesheet(link)) {
+ // Link is local, get the base URL.
+ href = getBase(link.href);
+ if (href !== false) {
+ stylesheets[href] = link;
+ }
}
}
}

0 comments on commit 25f8328

Please sign in to comment.