-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.html
216 lines (215 loc) · 4.74 KB
/
view.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta name="viewport" content="width=740px"/>
<style type="text/css">
html{
height: 100%;
margin: 0 auto;
}
body{
font-family: "Regular", "微软雅黑","Microsoft Yahei",Arial,Helvetica,sans-serif;
margin: 0 auto;
padding: 0px;
height: 100%;
background-color: white;
}
h1{
margin: 0px;
}
.middle{
width: 700px;
margin: 0 auto;
border-right: #cccccc 1px solid;
border-left: #cccccc 1px solid;
padding-left: 20px;
padding-right: 20px;
height: 100%;
}
.title{
text-align: left;
font-size: 30px;
width: 700px;
font-weight: 500;
opacity: 0.8;
}
.lineWrap{
border-width:thin;
border-top: #cccccc 1px dotted;
border-bottom: #cccccc 0px dotted;
height: 1px;
margin-bottom: 23px;
width: 100%;
float: left;
}
.author{
float: left;
}
.time{
float:right;
margin-right: 20px;
}
.author,.time{
font-size: 18px;
margin-bottom: 7px;
margin-top: 10px;
color: #000000;
opacity: 0.5;
}
.clear{
overflow: hidden;
clear: both;
heigth: 1px;
}
img{
margin-top: 7px;
margin-bottom: 7px;
width: 700px;
}
p{
color: #000000;
margin-top: 0px;
text-align:justify;
line-height: 32px;
margin-bottom: 16px;
}
.logo{
margin-left: -20px;
margin-top: 30px;
margin-bottom: 30px;
width: 120px;
height:40px;
}
.blank{
height:60px;
}
.content{
word-wrap: break-word;
font-size: 18px;
font-weight: 100;
opacity: 0.8;
}
@media screen and (max-width:1536px){
。logo{width:150px; height:50px;}
.title{
font-weight: bold;
}
.middle{
padding-left: 46px;
padding-right: 46px;
}
.author,.time{font-size: 30px;}
.author{margin-bottom: 20px;}
.content{
font-size: 34px;
font-weight: normal;
opacity: 1.0;
}
img{
margin-top: 0px;
margin-bottom: 0px;
width: 700px;
}
.lineWrap{margin-bottom: 40px;}
p{
color: #000000;
margin-top: 0px;
margin-bottom: 30px;
text-align:justify;
line-height: 50px;
}
.title{
font-size: 46px;
line-height: 68px;
}
.blank{
height:80px;
}
}
</style>
</head>
<body>
<div class='middle copyr'>
<div>
<img id='logo' class='logo' name='logo' src="public/img/logo.png"/>
</div>
<h1 id='title' class='title'></h1>
<span id='author' class='author'></span>
<span id='timeHour' class='time'></span>
<span id='time' class='time'></span>
<div class='lineWrap'></div>
<div class='clear'></div>
<div id='content' class='content'></div>
<div class='blank'>
</div>
</div>
<script charset="utf-8" type="text/javascript" src="//cdn.bootcss.com/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
function getUrlParam(name)
{
var reg= new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r!=null) return unescape(r[2]); return null;
}
var format = function(date, format) {
var o = {
"M+" : date.getMonth() + 1,
"d+" : date.getDate(),
"h+" : date.getHours(),
"m+" : date.getMinutes(),
"s+" : date.getSeconds()
};
for (var k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1? o[k]: ("00" + o[k]).substr(("" + o[k]).length));
}
}
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
}
return format;
};
var doPost = function(){
var id = getUrlParam('id');
var date = getUrlParam('date');
var url = 'json.php?date=' + date + '&id=' + id;
var opt = {
type : "GET",
url : url,
cache : false,
success : function(r) {
$('#title').html(r.title || '暂无标题');
document.title = $('#title').text();
$('#author').html("来源:" + r.author || '暂无作者');
$('#time').html(format(new Date(r.date || 0), 'yyyy年MM月dd日'));
$('#timeHour').html(format(new Date(r.date || 0), 'hh:mm'));
var content = r.content || '';
$('#content').html(content.replace("/gif1", "/original"));
var m = r.articleMediaMap;
$(document).find('img').not("#logo").each(function(){
$(this).hide();
$(this).load(function(){
$(this).show();
$('.middle').height($(document).height());
});
$(this).error(function(){
$('.middle').height($(document).height());
});
});
$('.middle').height($(document).height());
for(var p in m){
if(m.hasOwnProperty(p)){
$('#' + p).attr('src', m[p]['url'].replace("/gif1", "/original"));
}
}
},
dataType : 'json'
};
$.ajax(opt);
};
doPost();
</script>
</body>
</html>