ravenlp 16 лет назад
Родитель
Сommit
260b14882f
5 измененных файлов с 236 добавлено и 102 удалено
  1. 67 29
      admin/css/archive.css
  2. 11 11
      admin/scripts/jquery.js
  3. 11 0
      admin/scripts/jquery.scrollTo-min.js
  4. 1 1
      admin/scripts/tools.js
  5. 146 61
      archive.php

+ 67 - 29
admin/css/archive.css Просмотреть файл

@@ -1,26 +1,40 @@
1
+*{ outline:none;}
1 2
 body {
2 3
 	background: white;
3 4
 	font-family: "Lucida Sans";
4 5
 	font-size: 15px;
5 6
 	letter-spacing: 2px;
6 7
 	line-height: 30px;
8
+	background: transparent url('../../images/bg.jpg') top center no-repeat;
9
+	padding:0;
10
+	margin:0;
7 11
 }
8 12
 
9 13
 #dash {
10
-	margin: 35px auto 0px auto;
11
-	padding: 10px;
12
-	width: 85%;
14
+	margin: 0 auto;
15
+	padding: 0;
16
+	position:relative;
13 17
 }
14 18
 
19
+
15 20
 #options {
21
+	position:fixed;
22
+	height:37px;
16 23
 	width:100%;
17 24
 	text-align: center;
18
-	border-bottom: thin solid white;
25
+	border-bottom: thin solid #000;
26
+	background: transparent url('../../images/top_ribbon.png') top left repeat-x;
27
+	z-index:999;
28
+	padding-top:8px;
29
+	margin:0;
30
+	left:0;
19 31
 }
20 32
 
33
+#context_help{ display:block; margin:0; padding:3px 5px; position: absolute; border: 1px solid #222; background-color: #444; color:#fff; font-size: 11px;}
34
+
35
+
21 36
 li {
22 37
 	list-style: none;
23
-	margin-bottom: 5px;
24 38
 }
25 39
 
26 40
 ul {
@@ -38,7 +52,6 @@ h4 {
38 52
 
39 53
 #options li {
40 54
 	display: inline;
41
-	padding: 10px;
42 55
 	color: #999;	
43 56
 	font-variant: small-caps;
44 57
 }
@@ -46,45 +59,45 @@ h4 {
46 59
 #options li a {
47 60
 	text-decoration: none;
48 61
 	padding:10px 20px;
49
-	color: #999;
62
+	color: #666;
50 63
 }
51 64
 
52
-#options li a:hover {
53
-	background-color: #382513;
54
-	color: #FFF;
65
+#options li a:hover, #options li a.selected  {
66
+	color: #000;
67
+	text-decoration: underline;
55 68
 }
56 69
 
57
-#options li a.selected {
58
-	background-color: #382513;
59
-	color: #FFF;
60
-}
61 70
 
62 71
 #content {
63
-	padding: 25px;
64
-	width:auto;
72
+	text-align: left;
73
+	padding:20px 0 0 130px;
74
+	width:600px;
75
+	margin: 0 auto;
65 76
 }
77
+html > body div#content{ padding:60px 25px 0 25px;}
78
+
66 79
 
67 80
 .item {
68 81
 	height: 110px;
69 82
 	width: 110px;
70 83
 	padding: 5px;
71 84
 	overflow: hidden;
72
-	border: thin solid #CCC;
73
-	border-top: 2px solid #444;
74
-	float:left;
85
+	border: 1px solid #CCC;
75 86
 	margin: 10px;
76 87
 	color: #222;
77 88
 	text-align: left;
78 89
 	background-color: #FEFEFE;
79 90
 	font-size: 11px;
80 91
 	line-height: normal;
92
+	
81 93
 }
82 94
 
83 95
 .link {
84
-	font-size: 16px;
96
+	font-size: 12px;
85 97
 }
98
+.link a, .link a:visited, .link a:active, .link a:link{ color:#000; text-decoration:none;}
86 99
 
87
-div.user_hover {
100
+#user_hover {
88 101
 	background-color:#000000;
89 102
 	color:#FFFFFF;
90 103
 	display:none;
@@ -103,17 +116,42 @@ div.user_hover {
103 116
 	z-index:10;
104 117
 	height:113px;
105 118
 	width: 112px;
106
-	margin:10px;
107 119
 	cursor: pointer;
108 120
 }
109 121
 
110
-li:hover div.user_hover {
122
+ul.item_list {
123
+	 margin:10px;
124
+}
125
+
126
+ul.item_list li{
111 127
 	display:block;
128
+	float:left;
129
+	margin-top:1px;
130
+	cursor:pointer;
112 131
 }
113 132
 
114
-ul.item_list {
115
-	 width:112px; 
116
-	 float:left; 
117
-	 position:relative; 
118
-	 margin:10px;
119
-}
133
+ul.item_list li.selected{
134
+	background-color: #8db1de; position: relative; border:none;
135
+}
136
+
137
+li.selected div.crnr{ display:block; position: absolute; width:5px; height:5px;}
138
+li.selected div.wn{background:none; display:none;}
139
+html > body li.selected div.wn{background: #FFF url('../../images/round-wn.png') no-repeat top left; top:0; left:0; display:block;}
140
+li.selected div.en{background:none; display:none;}
141
+html > body li.selected div.en{background: #FFF url('../../images/round-en.png') no-repeat top left; top:0; right:0;display:block;}
142
+li.selected div.es{background:none; display:none;}
143
+html > body li.selected div.es{background: #FFF url('../../images/round-es.png') no-repeat top left; bottom:0; right:0;display:block;}
144
+li.selected div.ws{background:none; display:none;}
145
+html > body li.selected div.ws{background: #FFF url('../../images/round-ws.png') no-repeat top left; bottom:0; left:0;display:block;}
146
+
147
+
148
+#timeline {position:fixed; top: 60px; right: 40px; line-height:auto; margin: 10px; float:right; width:90px;}
149
+
150
+#timewrap { position:relative;}
151
+#timewrap h4{ float:right;}
152
+#bubble{ line-height:10px; position:absolute; left: -90px; width:80px; display:none; font-size:10px; color:#444; font-family: Arial, "MS Trebuchet", sans-serif; text-align:right; }
153
+#timeline li{ background-color: #222;height:7px; margin:1px; display:block; float:right; clear:right;}
154
+#timeline li span{display:none;}
155
+li.year{ width:60px;}
156
+li.month{ width:40px;}
157
+li.day{ width:20px;}

Разница между файлами не показана из-за своего большого размера
+ 11 - 11
admin/scripts/jquery.js


Разница между файлами не показана из-за своего большого размера
+ 11 - 0
admin/scripts/jquery.scrollTo-min.js


+ 1 - 1
admin/scripts/tools.js Просмотреть файл

@@ -67,7 +67,7 @@ $(function(){
67 67
 			if($("#context_help").get().length < 1){
68 68
 				$('.box:last').append('<div id="context_help"></div>');
69 69
 			}
70
-			$('#context_help').hide().html(t).css({left:e.pageX, top:e.pageY + 20}).fadeIn('slow');
70
+			$('#context_help').hide().html(t).css({left:e.pageX, top:e.pageY + 20}).fadeIn(300);
71 71
 		});
72 72
 	},function(){
73 73
 		$(this).stop().attr('title',t);

+ 146 - 61
archive.php Просмотреть файл

@@ -22,9 +22,15 @@ $photo = array();
22 22
 $regular = array();
23 23
 $video = array();
24 24
 
25
+$dates = array();
25 26
 $rs = $tumble->getPosts($tumble->getPostsNumber());
26 27
 if ($db->contarRegistros()>0) {
27 28
     while($register = mysql_fetch_assoc($rs)) {
29
+		$date = strtotime($register['date']);
30
+		$year = date('Y',$date);
31
+		$month = date('M',$date);
32
+		$day = date('d',$date);
33
+		$dates[$year][$month][$day] = true;
28 34
     	$output = handleNode($register);
29 35
     	
30 36
 		$theType = util::type2Text($register["type"]);
@@ -57,26 +63,32 @@ function handleNode($node) {
57 63
 		$dateTmp = null;
58 64
 		$formatedDate = gmdate("M d", strtotime($node["date"]) + util::transform_offset($conf->offsetTime));
59 65
         
60
-		$output = array();		
66
+		$output = array();
61 67
 		$output['url'] = $tumble->getPermalink($node["id_post"]);
62 68
  		$output['date'] = $formatedDate;
63
- 		
69
+
70
+		$date = strtotime($node['date']);
71
+		$year = date('Y',$date);
72
+		$month = date('M',$date);
73
+		$day = date('d',$date);
74
+		
75
+ 		$output['full_date'] = $day.' '.$month.' '.$year;
64 76
  		$theType = util::type2Text($node["type"]);
65 77
  		
66 78
 		switch($theType) {
67 79
 			case 'quote':
68 80
 				$output['quote'] = $node["description"];
69
-				$output['source'] = $node["title"];                                        		
81
+				$output['source'] = $node["title"];
70 82
 				break;
71
-			case 'conversation':				
83
+			case 'conversation':
72 84
 				$output['lines'] = $tumble->formatConversation($node["description"]);
73 85
 				break;
74
-			case 'url':								
75
-				$node["title"] = (empty($node["title"]))? $node["url"] : $node["title"];				
86
+			case 'url':
87
+				$node["title"] = (empty($node["title"]))? $node["url"] : $node["title"];
76 88
 				$output['text'] = $node["title"];
77 89
 				$output['link'] = $node["url"];
78 90
 				break;
79
-			case 'photo':				
91
+			case 'photo':
80 92
 				$fileName = "uploads/".util::getFileName($node["url"]);
81 93
 				$x = @getimagesize($fileName);
82 94
                 if ($x[0] > 500) {
@@ -110,28 +122,85 @@ function handleNode($node) {
110 122
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
111 123
 
112 124
 	<head>
113
-    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
114
-        <meta name="generator" content="gelato <?php echo util::codeName()." (".util::version().")"; ?>" />
115
-        <link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
116
-        <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $conf->urlGelato.($conf->urlFriendly ? "/rss/" : "/rss.php"); ?>"/>
125
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
126
+		<meta name="generator" content="gelato <?php echo util::codeName()." (".util::version().")"; ?>" />
127
+		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
128
+		<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $conf->urlGelato.($conf->urlFriendly ? "/rss/" : "/rss.php"); ?>"/>
117 129
 		<title><?php echo $conf->title." &raquo; ".__(" archive"); ?></title>
118 130
 		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
119
-		<link href="<?php echo $conf->urlGelato;?>/admin/css/archive.css" type="text/css" rel="stylesheet">
131
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.scrollTo-min.js"></script>
132
+		<link href="<?php echo $conf->urlGelato;?>/admin/css/archive.css" type="text/css" rel="stylesheet">		
120 133
 		<script type='text/javascript'>
121 134
 			function select(object) {
122 135
 				var sel_id = object.id;
123 136
 				$("a.option").removeClass('selected');
124 137
 				$(object).addClass('selected');
125
-				$("#conversation_content, #quote_content, #link_content, #regular_content, #photo_content, #video_content").hide("slow");
126
-				$("#"+sel_id+"_content").show("slow");
138
+				$("#conversation_content, #quote_content, #link_content, #regular_content, #photo_content, #video_content").slideUp("fast");
139
+				$(".en, .es, .wn, .ws").remove();
140
+			 	$("li.selected").removeClass('selected');
141
+				$("#"+sel_id+"_content").show();
142
+				$('#user_hover').hide();
143
+				
127 144
 			};
145
+			
146
+			$(function(){
147
+				$("#timeline li").hover(function(){
148
+					$(this).css('cursor','pointer');
149
+					$("#bubble").hide();
150
+					$(this).queue('fx',[]);
151
+					$(this).animate({width:80},300, function(){
152
+						$("#bubble").text($(this).find('span').text()).fadeIn('fast').css({top:this.offsetTop - 2});
153
+						});
154
+				},function(){
155
+					$(this).css('cursor','auto');
156
+					$(this).animate({width:$(this).attr("rel")},300,'linear');
157
+				}).click(function(){
158
+					$(".en, .es, .wn, .ws").remove();
159
+					var date = $(this).text();
160
+					$("#content > div:visible ul").find('li').removeClass('selected');
161
+					$("#content > div:visible ul").find('li div[rel$='+date+']').parent().addClass('selected');
162
+					wrap();
163
+					if($('li.selected').length > 0){
164
+						var elem = $("li.selected").get();
165
+						$(window).scrollTo($("li.selected").eq(0).offset().top-50,900);
166
+					}else{
167
+						$("#bubble").text('Not found');
168
+					}
169
+				});
170
+				
171
+				$('#user_hover').hover(function(){},function(){ $(this).hide(); });
172
+				
173
+				$('.item').hover(function(e){
174
+					var item = $(this);
175
+					$('#user_hover').css({top:$(this).offset().top,left:$(this).offset().left}).show().unbind('click').click(function(){
176
+						$(item).click();
177
+					});
178
+					$('#user_hover h3').text($(this).attr('rel'));
179
+				},function(e){});
180
+			});
181
+			
182
+			function wrap () {
183
+					var elems = $("li.selected");
184
+					var list = $("#content > div:visible ul.item_list > li");
185
+					var cols = 4;
186
+					var l = $(elems).length;
187
+					$(elems).each(function(){
188
+						index = $(list).index(this);
189
+						if( (index+1) % cols == 0){
190
+							$(this).append("<div class='crnr en'>&nbsp;</div>").append("<div class='crnr es'>&nbsp;</div>");
191
+						}else if( (index) % cols == 0){
192
+							$(this).append("<div class='crnr wn'>&nbsp;</div>").append("<div class='crnr ws'>&nbsp;</div>");
193
+						}
194
+					});
195
+					$(elems).eq(0).append("<div class='crnr wn'>&nbsp;</div>").append("<div class='crnr ws'>&nbsp;</div>");
196
+					$(elems).eq(l-1).append("<div class='crnr en'>&nbsp;</div>").append("<div class='crnr es'>&nbsp;</div>");
197
+			 }
198
+			
128 199
 		</script>
129 200
 	</head>
130 201
 	
131 202
 	<body>
132
-		
133 203
 		<div id='dash'>
134
-					
135 204
 			<div id='options'>
136 205
 				<ul id='option-list'>
137 206
 					<li><a href='#' id='conversation' class='option selected' onclick="select(this);">Conversations</a></li>
@@ -141,111 +210,127 @@ function handleNode($node) {
141 210
 					<li><a href='#' id='quote' class='option' onclick="select(this);">Quotes</a></li>
142 211
 					<li><a href='#' id='video' class='option' onclick="select(this);">Videos</a></li>
143 212
 				</ul>
144
-			</div>
213
+			</div>		
214
+		<div id="timeline">
215
+			<div id="timewrap">
216
+				<div id="bubble"></div>
217
+				<h4>TIMELINE</h4>
218
+				<ul>
219
+					<?php
220
+					
221
+					foreach ($dates as $year => $monthday) {
222
+						echo '<li class="year" rel="60"><span>'.$year.'</span></li>';
223
+						if(is_array($monthday) && count($monthday) > 0){
224
+							
225
+							foreach ($monthday as $month => $days) {
226
+								echo '<li class="month" rel="40"><span>'.$month.' '.$year.'</span></li>';
227
+								if(is_array($days) && count($days) > 0){
228
+									foreach ($days as $day => $val) {
229
+										echo '<li class="day" rel="20"><span>'.$day.' '.$month.' '.$year.'</span></li>';
230
+									}
231
+								}
232
+							}
233
+						}
234
+					}
235
+					?>
236
+				</ul>
237
+			</div>		
238
+		</div>
239
+					
240
+
241
+			
145 242
 			
146 243
 			<div id='content'>
244
+				<div id='msg' style="display:none;">&nbsp;</div>
245
+				
147 246
 				<div id='conversation_content'>
148
-					<?php foreach($conversation as $item) { ?>
149 247
 					<ul class='item_list'>
248
+					<?php foreach($conversation as $item) { ?>
150 249
 						<li>
151
-							<div class='item'>
152
-								<ul>									
153
-                                    <li><?php echo $item['lines']; ?></li>
250
+							<div class='item' rel='<?php echo $item['full_date'] ?>' title="<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>" onclick="location.href='<?php echo $item['url'] ?>';">
251
+								<ul>
252
+									<li><?php echo $item['lines']; ?></li>
154 253
 								</ul>
155 254
 							</div>
156
-							<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
157
-								<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
158
-							</div>
159 255
 						</li>
160
-					</ul>
161 256
 					<?php } ?>
257
+					</ul>
162 258
 				</div>
163 259
 				
164 260
 				<div id='quote_content' style='display:none;'>
165
-					<?php foreach($quote as $item) { ?>
166 261
 					<ul class='item_list'>
262
+					<?php foreach($quote as $item) { ?>
167 263
 						<li>
168
-							<div class='item'>
264
+							<div class='item' rel='<?php echo $item['full_date'] ?>' title="<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>" onclick="location.href='<?php echo $item['url'] ?>';">
169 265
 								<ul>
170 266
 									<li><em>"<?php echo substr($item['quote'], 0, 50), "..."; ?>"</em></li>
171 267
 									<li>--<?php echo $item['source']; ?></li>
172 268
 								</ul>
173 269
 							</div>
174
-							<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
175
-								<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
176
-							</div>
177 270
 						</li>
178
-					</ul>
179 271
 					<?php } ?>
272
+					</ul>
180 273
 				</div>
181 274
 				
182 275
 				<div id='link_content' style='display:none;'>
183
-					<?php foreach($link as $item) { ?>
184 276
 					<ul class='item_list'>
277
+					<?php foreach($link as $item) { ?>
185 278
 						<li>
186
-							<div class='item link'>
279
+							<div class='item link' rel='<?php echo $item['full_date'] ?>' title='<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>' onclick="location.href='<?php echo $item['url'] ?>';">
187 280
 								<ul>
188
-									<li><a href="<?php echo $item['link']; ?>"><?php echo $item['text']; ?></a></li>
281
+									<li><a href="<?php echo $item['link']; ?>" ><?php echo str_replace('.','.<br/>',$item['text']); ?></a></li>
189 282
 								</ul>
190 283
 							</div>
191
-							<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
192
-								<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
193
-							</div>
194 284
 						</li>
195
-					</ul>
196 285
 					<?php } ?>
286
+					</ul>
197 287
 				</div>
198 288
 				
199 289
 				<div id='photo_content' style='display:none;'>
200
-					<?php foreach($photo as $item) { ?>
201 290
 					<ul class='item_list'>
291
+						<?php foreach($photo as $item) { ?>
292
+								<?php echo "<pre>";
293
+								print_r($item);
294
+								echo "</pre>"; ?>
202 295
 						<li>
203
-							<div class='item' style="background-image:url('<?php echo $item['photo']; ?>')"></div>
204
-							<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
205
-								<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
206
-							</div>
296
+							<div class='item' style="background-image:url('<?php echo $item['photo']; ?>')"  rel='<?php echo $item['full_date'] ?>' title="<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>" onclick="location.href='<?php echo $item['url'] ?>';"></div>
207 297
 						</li>
208
-					</ul>
209 298
 					<?php } ?>
299
+					</ul>
210 300
 				</div>
211 301
 				
212 302
 				<div id='regular_content' style='display:none;'>	
213
-					<?php foreach($regular as $item) { ?>
214
-					<ul class='item_list'>
303
+					<ul class='item_list' rel='<?php echo $item['full_date'] ?>'>
304
+						<?php foreach($regular as $item) { ?>
215 305
 						<li>
216
-							<div class='item'>
306
+							<div class="item" title="<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>" onclick="location.href='<?php echo $item['url'] ?>';">
217 307
 								<h4><?php echo $item['title']; ?></h4>
218 308
 								<p><?php echo $item['body']; ?></p>
219 309
 							</div>
220
-							<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
221
-								<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
222
-							</div>
223 310
 						</li>
224
-					</ul>
225 311
 					<?php } ?>
312
+					</ul>
226 313
 				</div>
227 314
 				
228 315
 				<div id='video_content' style='display:none;'>
316
+					<ul class='item_list' rel='<?php echo $item['full_date'] ?>'>
229 317
 					<?php foreach($video as $item) { ?>
230
-					<ul class='item_list'>
231 318
 						<li>
232
-							<div class='item' style='text-align:center;'>
233
-								<?php echo  $item['embed']; //$item['caption'] ?>								
234
-							</div>
235
-							<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
236
-								<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
319
+							<div class='item' style='text-align:center;' title="<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>" onclick="location.href='<?php echo $item['url'] ?>';">
320
+								<?php echo  $item['embed']; //$item['caption'] ?>
237 321
 							</div>
238 322
 						</li>
239
-					</ul>
240 323
 					<?php } ?>
324
+					</ul>
241 325
 				</div>
242
-
326
+			<p style="clear:both">&nbsp;</p>
243 327
 			</div>
244 328
 			
245 329
 			<br clear='both' />
246
-			
330
+			<div id='user_hover'><h3>&nbsp;</h3></div>
331
+
247 332
 		</div>
248 333
 		
249 334
 	</body>
250 335
 
251
-</html>
336
+</html>