Skip to content

Commit

Permalink
#1 优化微博显示
Browse files Browse the repository at this point in the history
  • Loading branch information
pob986 committed Aug 29, 2013
1 parent d02b7cc commit 0baf972
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
12 changes: 11 additions & 1 deletion assets/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,26 @@
state = 1;
i = 0;
str.text = str.user + ' : ' + str.text;
if (str.origin != '') {
if (str.origin.type == 1) {
str.text += ' (转)@' + str.origin.user + ':' + str.origin.text;
}else{
str.text += ' (评)//@' + str.origin.user + ':' + str.origin.text;
}
};
}
break;
case 1:
// print
el.html('<span class="head">' + settings.prefix + '</span>' + str.text.substring(0, i)).append(sp);
document.body.scrollTop = document.body.scrollHeight;
if (i >= str.text.length) {
if (str.thumb != '') {
el.append('<br><img src="'+ str.thumb +'">');
}
state = 2;
j = 0;
}
};
i ++;
break;
case 2:
Expand Down
8 changes: 7 additions & 1 deletion assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body {
.str {
color: #000;
width: 100%;
padding: 0 5px;
padding: 5px 5px;
line-height: 35px;
font-size: 25px;
box-sizing: border-box;
Expand All @@ -26,6 +26,12 @@ body {
.head {
color: #000;
}
.str img{
max-width: 60%;
max-height: 216px;
margin-left: 20%;
padding-bottom: 10px;
}

.hide {
background: transparent;
Expand Down
5 changes: 3 additions & 2 deletions manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
if (len > 0) {
$.each(data.lists, function (i, list) {
if (list.if_use == 1) {
html += '<tr><td>'+ list.weibo_nick +'</td><td><a class="cancel" href="javascript:;" id="'+ list.id +'">取消</a></td></tr>';
html += '<tr><td>'+ list.weibo_nick +'</td><td><a class="cancel" href="javascript:;" id="'+ list.id +'">取消</a><a class="update" style="margin-left:10px;" href="javascript:;" id="'+ list.weibo_uid +'">删除缓存</a></td></tr>';
}else{
html += '<tr><td>'+ list.weibo_nick +'</td><td><a class="select" href="javascript:;" id="'+ list.id +'">选择</a></td></tr>';
};
Expand Down Expand Up @@ -57,11 +57,12 @@
});

// 选择微博用户
$('a.cancel, a.select').live('click', function(){
$('a.cancel, a.select, a.update').live('click', function(){
var obj = $(this);
var type = 'select';
var item_id = obj.attr('id');
if (obj.hasClass('cancel')) { type = 'cancel'; }
if (obj.hasClass('update')) { type = 'update'; }
$.ajax({
type : 'GET',
url : base_url + 'list.php?method=' + type + '&item_id=' + item_id,
Expand Down

0 comments on commit 0baf972

Please sign in to comment.