Kaynağa Gözat

Merge branch 'mergePrintCSS' into print

Marien Fressinaud 12 yıl önce
ebeveyn
işleme
6a9ce0cbad

+ 0 - 1
app/App_FrontController.php

@@ -65,7 +65,6 @@ class App_FrontController extends FrontController {
 				View::appendStyle (Url::display ('/themes/' . $theme['path'] . '/' . $file . '?' . @filemtime(PUBLIC_PATH . '/themes/' . $theme['path'] . '/' . $file)));
 			}
 		}
-		View::appendStyle (Url::display ('/themes/printer/style.css?' . @filemtime(PUBLIC_PATH . '/themes/printer/style.css')), 'print');
 
 		if (login_is_conf ($this->conf)) {
 			View::appendScript ('https://login.persona.org/include.js');

+ 3 - 2
lib/minz/View.php

@@ -150,8 +150,9 @@ class View {
 				$styles .= '<!--[if ' . $cond . ']>';
 			}
 
-			$styles .= '<link rel="stylesheet" media="' . $style['media']
-				. '" href="' . $style['url'] . '" />';
+			$styles .= '<link rel="stylesheet" ' .
+				($style['media'] === 'all' ? '' : 'media="' . $style['media'] . '" ') .
+				'href="' . $style['url'] . '" />';
 
 			if ($cond) {
 				$styles .= '<![endif]-->';

+ 39 - 0
public/themes/default/freshrss.css

@@ -1,3 +1,5 @@
+@charset "UTF-8";
+
 /* STRUCTURE */
 .header {
 	display: table;
@@ -826,3 +828,40 @@
 		-ms-transition: width 200ms linear;
 	}
 }
+
+@media print {
+	.header,
+	.aside,
+	.nav_menu,
+	.day,
+	.flux_header,
+	.flux_content .bottom,
+	.pagination {
+		display: none;
+	}
+
+	html, body {
+		background: #fff;
+		color: #000;
+		font-family: Serif;
+		font-size: 12pt;
+	}
+
+	#global,
+	.flux_content {
+		display: block !important;
+	}
+
+	.flux_content .content {
+		width: 100% !important;
+		text-align: justify;
+	}
+
+	.flux_content .content a {
+		color: #000;
+	}
+	.flux_content .content a:after {
+		content: " (" attr(href) ") ";
+		text-decoration: underline;
+	}
+}

+ 2 - 0
public/themes/default/global.css

@@ -1,3 +1,5 @@
+@charset "UTF-8";
+
 /* FONTS */
 @font-face {
 	font-family: "OpenSans";

+ 39 - 0
public/themes/flat-design/freshrss.css

@@ -1,3 +1,5 @@
+@charset "UTF-8";
+
 /* STRUCTURE */
 body {
 	background: #fafafa;
@@ -756,3 +758,40 @@ body {
 	-webkit-transform: rotate(45deg);
 	-ms-transform: rotate(45deg);
 }
+
+@media print {
+	.header,
+	.aside,
+	.nav_menu,
+	.day,
+	.flux_header,
+	.flux_content .bottom,
+	.pagination {
+		display: none;
+	}
+
+	html, body {
+		background: #fff;
+		color: #000;
+		font-family: Serif;
+		font-size: 12pt;
+	}
+
+	#global,
+	.flux_content {
+		display: block !important;
+	}
+
+	.flux_content .content {
+		width: 100% !important;
+		text-align: justify;
+	}
+
+	.flux_content .content a {
+		color: #000;
+	}
+	.flux_content .content a:after {
+		content: " (" attr(href) ") ";
+		text-decoration: underline;
+	}
+}

+ 2 - 0
public/themes/flat-design/global.css

@@ -1,3 +1,5 @@
+@charset "UTF-8";
+
 /* FONTS */
 @font-face {
 	font-family: "OpenSans";

+ 0 - 34
public/themes/printer/style.css

@@ -1,34 +0,0 @@
-.header,
-.aside,
-.nav_menu,
-.day,
-.flux_header,
-.flux_content .bottom,
-.pagination {
-	display: none;
-}
-
-html, body {
-	background: #fff;
-	color: #000;
-	font-family: Serif;
-	font-size: 12pt;
-}
-
-#global,
-.flux_content {
-	display: block !important;
-}
-
-.flux_content .content {
-	width: 100% !important;
-	text-align: justify;
-}
-
-.flux_content .content a {
-	color: #000;
-}
-.flux_content .content a:after {
-	content: " (" attr(href) ") ";
-	text-decoration: underline;
-}