前台展示增加收缩功能,防止页面过长
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: 日志归档
|
||||
Version: 1.5
|
||||
Version: 1.5.1
|
||||
Plugin URL: http://xiaosong.org/share/emlog-log-archiving-plug-in-released
|
||||
Description: 将所有日志按照日期或分类归档显示
|
||||
ForEmlog:5.0.0
|
||||
@@ -16,7 +16,7 @@ function displayRecord(){
|
||||
$record_cache = $CACHE->readCache('record');
|
||||
$output = '';
|
||||
foreach($record_cache as $value){
|
||||
$output .= '<li>'.$value['record'].'('.$value['lognum'].')'.displayRecordItem($value['date']).'</li>';
|
||||
$output .= '<li><h4>'.$value['record'].'('.$value['lognum'].')</h4>'.displayRecordItem($value['date']).'</li>';
|
||||
}
|
||||
$output = '<ul class="archiver">'.$output.'</ul>';
|
||||
return $output;
|
||||
@@ -39,7 +39,7 @@ function displaySort(){
|
||||
$sort_cache = $CACHE->readCache('sort');
|
||||
$output = '';
|
||||
foreach($sort_cache as $value){
|
||||
$output .= '<li>'.$value['sortname'].'('.$value['lognum'].')'.displaySortItem($value['sid']).'</li>';
|
||||
$output .= '<li><h4>'.$value['sortname'].'('.$value['lognum'].')</h4>'.displaySortItem($value['sid']).'</li>';
|
||||
}
|
||||
$output = '<ul class="archiver">'.$output.'</ul>';
|
||||
return $output;
|
||||
|
||||
@@ -16,6 +16,7 @@ $ckname = $ckmail = $ckurl = $verifyCode = false;
|
||||
$icp = Option::get('icp');
|
||||
$footer_info = Option::get('footer_info');
|
||||
if($res['hide'] == 'y' || !function_exists('displaySort') || !function_exists('displayRecord')) emMsg('不存在的页面!');
|
||||
emLoadJQuery();
|
||||
include View::getView('header');
|
||||
|
||||
$log_content = '<h3><input type="radio" name="show_type" onclick="switchtype(this.value)" value="record" ';
|
||||
@@ -39,6 +40,14 @@ ol.archiver_item li {margin-left:1em;}
|
||||
function switchtype(type){
|
||||
window.location = '<?php echo BLOG_URL; ?>?plugin=archiver&show_type=' + type;
|
||||
}
|
||||
jQuery(function($){
|
||||
if ($('ul.archiver').length) {
|
||||
$('ul.archiver').find('.archiver_item:gt(3)').hide();
|
||||
$('ul.archiver').find('h4').on('click', function(){
|
||||
$(this).next('.archiver_item').slideToggle();
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<?php
|
||||
include View::getView('page');
|
||||
|
||||
Reference in New Issue
Block a user