fix metadata view page files list bug

This commit is contained in:
Li Jianxuan 2013-04-13 08:58:58 +00:00
parent 905622102d
commit 77ec3f7306
4 changed files with 1818 additions and 1751 deletions

View File

@ -18,9 +18,9 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
<hr />
<div class="row">
<div class="span8">
<div>
<div class="span8">
<a class="colorbox pull-right" title="<?php echo $md->title; ?>" href="/service/bigthumb/uuid/<?php echo $md->uuid; ?>"><img src="/service/thumb/uuid/<?php echo $md->uuid;?>"/></a>
<p>
<p style="word-break:break-all;word-wrap:break-word;overflow:hidden;">
<?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?>
</p>
</div>
@ -423,6 +423,39 @@ $('#recommend_t').click(function(){recommend(0);});
function recommend(page){$.ajax({type:"GET",url:"/service/recommend/uuid/<?= $md->uuid; ?>",data:'page='+page,success:function(html){$('#recommend').html('<ul>'+html+'</ul>');},
beforeSend:function(){$('#recommend').html('<img src="/images/loading.gif" />加载中');}});}
function getFileList(){
html ='<div id="window-outter">'
+ '<div id="window-inner">'
+ '<div id="window-content-container">'
+ '<div id="window-loading">加载中...</div>'
+ '<ol id="file-list">'
+ '</ol>'
+ '</div>'
+ '</div>'
+'</div>';
$.colorbox({width:"80%",height:"80%",html:html});
$.getJSON("/service/filelist/uuid/<?php echo $md->uuid;?>", function(data) {
var items = [];
if(data.length>0)
{
$.each(data, function(key, val) {
if(val['filename'].match(/\/$/))
{
items.push('<li id="li_' + val['id'] + '"><span id="span_'+val['id']+'">+</span> <a href="javascript:;" id="taget_'+val['id']+'" onclick="getSubFileList(\'' +val['uuid']+ '\',\''+val['id']+'\',\''+val['depth']+'\')">' + val['filename'] + '</a></li>');
}else{
items.push('<li id="li_' + val['id'] + '">' + val['filename'] + '</li>');
}
});
}else{
items.push('<li>暂无数据</li>');
}
$('#file-list').html(items.join(''));
})
.complete(function() {
$('#window-loading').hide();
});
}
function ajaxpage(page){
var url = "/data/comment/uuid/<?= $md->uuid; ?>";
data='page='+page;

View File

@ -427,6 +427,39 @@ $('#recommend_t').click(function(){recommend(0);});
function recommend(page){$.ajax({type:"GET",url:"/service/recommend/uuid/<?= $md->uuid; ?>",data:'page='+page,success:function(html){$('#recommend').html('<ul>'+html+'</ul>');},
beforeSend:function(){$('#recommend').html('<img src="/images/loading.gif" />加载中');}});}
function getFileList(){
html ='<div id="window-outter">'
+ '<div id="window-inner">'
+ '<div id="window-content-container">'
+ '<div id="window-loading">加载中...</div>'
+ '<ol id="file-list">'
+ '</ol>'
+ '</div>'
+ '</div>'
+'</div>';
$.colorbox({width:"80%",height:"80%",html:html});
$.getJSON("/service/filelist/uuid/<?php echo $md->uuid;?>", function(data) {
var items = [];
if(data.length>0)
{
$.each(data, function(key, val) {
if(val['filename'].match(/\/$/))
{
items.push('<li id="li_' + val['id'] + '"><span id="span_'+val['id']+'">+</span> <a href="javascript:;" id="taget_'+val['id']+'" onclick="getSubFileList(\'' +val['uuid']+ '\',\''+val['id']+'\',\''+val['depth']+'\')">' + val['filename'] + '</a></li>');
}else{
items.push('<li id="li_' + val['id'] + '">' + val['filename'] + '</li>');
}
});
}else{
items.push('<li>暂无数据</li>');
}
$('#file-list').html(items.join(''));
})
.complete(function() {
$('#window-loading').hide();
});
}
function ajaxpage(page){
var url = "/data/comment/uuid/<?= $md->uuid; ?>";
data='page='+page;

View File

@ -20,7 +20,7 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
<div class="span8">
<div>
<a class="colorbox pull-right" title="<?php echo $md->title; ?>" href="/service/bigthumb/uuid/<?php echo $md->uuid; ?>"><img src="/service/thumb/uuid/<?php echo $md->uuid;?>"/></a>
<p>
<p style="word-break:break-all;word-wrap:break-word;overflow:hidden;">
<?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?>
</p>
</div>
@ -426,6 +426,39 @@ $('#recommend_t').click(function(){recommend(0);});
function recommend(page){$.ajax({type:"GET",url:"/service/recommend/uuid/<?= $md->uuid; ?>",data:'page='+page,success:function(html){$('#recommend').html('<ul>'+html+'</ul>');},
beforeSend:function(){$('#recommend').html('<img src="/images/loading.gif" />加载中');}});}
function getFileList(){
html ='<div id="window-outter">'
+ '<div id="window-inner">'
+ '<div id="window-content-container">'
+ '<div id="window-loading">加载中...</div>'
+ '<ol id="file-list">'
+ '</ol>'
+ '</div>'
+ '</div>'
+'</div>';
$.colorbox({width:"80%",height:"80%",html:html});
$.getJSON("/service/filelist/uuid/<?php echo $md->uuid;?>", function(data) {
var items = [];
if(data.length>0)
{
$.each(data, function(key, val) {
if(val['filename'].match(/\/$/))
{
items.push('<li id="li_' + val['id'] + '"><span id="span_'+val['id']+'">+</span> <a href="javascript:;" id="taget_'+val['id']+'" onclick="getSubFileList(\'' +val['uuid']+ '\',\''+val['id']+'\',\''+val['depth']+'\')">' + val['filename'] + '</a></li>');
}else{
items.push('<li id="li_' + val['id'] + '">' + val['filename'] + '</li>');
}
});
}else{
items.push('<li>暂无数据</li>');
}
$('#file-list').html(items.join(''));
})
.complete(function() {
$('#window-loading').hide();
});
}
function ajaxpage(page){
var url = "/data/comment/uuid/<?= $md->uuid; ?>";
data='page='+page;

View File

@ -18,38 +18,6 @@ function postcomment(){
});
}
function getFileList(){
html ='<div id="window-outter">'
+ '<div id="window-inner">'
+ '<div id="window-content-container">'
+ '<div id="window-loading">加载中...</div>'
+ '<ol id="file-list">'
+ '</ol>'
+ '</div>'
+ '</div>'
+'</div>';
$.colorbox({width:"80%",height:"80%",html:html});
$.getJSON("/service/filelist/uuid/<?php echo $md->uuid;?>", function(data) {
var items = [];
if(data.length>0)
{
$.each(data, function(key, val) {
if(val['filename'].match(/\/$/))
{
items.push('<li id="li_' + val['id'] + '"><span id="span_'+val['id']+'">+</span> <a href="javascript:;" id="taget_'+val['id']+'" onclick="getSubFileList(\'' +val['uuid']+ '\',\''+val['id']+'\',\''+val['depth']+'\')">' + val['filename'] + '</a></li>');
}else{
items.push('<li id="li_' + val['id'] + '">' + val['filename'] + '</li>');
}
});
}else{
items.push('<li>暂无数据</li>');
}
$('#file-list').html(items.join(''));
})
.complete(function() {
$('#window-loading').hide();
});
}
function getSubFileList(uuid,id,depth){
if($("#div_"+id).length>0)
{