Procházet zdrojové kódy

Fix issue #131 : pied d'article

Ajout de la date et du lien vers site externe au pied des articles

Modification comportement raccourci "up" : si la fenêtre est sous
l'article actif, on remonte en haut de cet article. Si la fenêtre est au
début de l'article actif ou au-dessus, on remonte en haut de l'écran
Marien Fressinaud před 12 roky
rodič
revize
9ae0652d9f

+ 1 - 1
app/layout/nav_entries.phtml

@@ -1,5 +1,5 @@
 <ul class="nav_entries">
 	<li class="item"><a class="previous_entry" href="#"><i class="icon i_prev"></i></a></li>
-	<li class="item"><a href="#"><i class="icon i_up"></i></a></li>
+	<li class="item"><a class="up" href="#"><i class="icon i_up"></i></a></li>
 	<li class="item"><a class="next_entry" href="#"><i class="icon i_next"></i></a></li>
 </ul>

+ 2 - 0
app/views/helpers/view/normal_view.phtml

@@ -114,6 +114,8 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) {
 					</div>
 				</li>
 				<?php } ?>
+				<li class="item date"><?php echo $item->date (); ?></li>
+				<li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>">&nbsp;</a></li>
 			</ul>
 		</div>
 	</div>

+ 12 - 0
app/views/javascript/main.phtml

@@ -313,6 +313,18 @@ function init_nav_entries() {
 		next_entry();
 		return false;
 	});
+	$('.nav_entries a.up').click(function() {
+		var active_item = $(".flux.active");
+		var windowTop = $(window).scrollTop();
+		var item_top = active_item.position ().top;
+
+		if(windowTop > item_top) {
+			$("html,body").scrollTop (item_top);
+		} else {
+			$("html,body").scrollTop (0);
+		}
+		return false;
+	});
 }
 
 $(document).ready (function () {

+ 5 - 5
public/themes/default/freshrss.css

@@ -262,7 +262,7 @@
 			.flux.not_read .flux_header .item.title {
 				font-weight: bold;
 			}
-		.flux_header .item.date {
+		.item.date {
 			width: 200px;
 			overflow: hidden;
 			white-space: nowrap;
@@ -272,11 +272,11 @@
 			color: #666;
 			cursor: pointer;
 		}
-		.flux_header .item.link {
+		.item.link {
 			width: 40px;
 			text-align: center;
 		}
-			.flux_header .item.link a {
+			.item.link a {
 				display: inline-block;
 				width: 40px;
 				height: 40px;
@@ -284,7 +284,7 @@
 				background: url("icons/link.svg") center center no-repeat;
 				vertical-align: middle;
 			}
-				.flux_header .item.link a:hover {
+				.item.link a:hover {
 					text-decoration: none;
 				}
 
@@ -553,7 +553,7 @@
 	.aside .btn-important,
 	.aside .feeds .dropdown,
 	.flux_header .item.website span,
-	.flux_header .item.date {
+	.item.date {
 		display: none;
 	}
 	.flux_header .item.website {

+ 5 - 5
public/themes/flat-design/freshrss.css

@@ -256,7 +256,7 @@ body {
 			.flux.not_read .flux_header .item.title {
 				font-weight: bold;
 			}
-		.flux_header .item.date {
+		.item.date {
 			width: 200px;
 			overflow: hidden;
 			white-space: nowrap;
@@ -266,11 +266,11 @@ body {
 			color: #666;
 			cursor: pointer;
 		}
-		.flux_header .item.link {
+		.item.link {
 			width: 40px;
 			text-align: center;
 		}
-			.flux_header .item.link a {
+			.item.link a {
 				display: inline-block;
 				width: 40px;
 				height: 40px;
@@ -278,7 +278,7 @@ body {
 				background: url("icons/link.svg") center center no-repeat;
 				vertical-align: middle;
 			}
-				.flux_header .item.link a:hover {
+				.item.link a:hover {
 					text-decoration: none;
 				}
 
@@ -559,7 +559,7 @@ body {
 	.aside .btn-important,
 	.aside .feeds .dropdown,
 	.flux_header .item.website span,
-	.flux_header .item.date {
+	.item.date {
 		display: none;
 	}
 	.flux_header .item.website {