Skip to content

Commit

Permalink
Add new template
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitea committed Mar 10, 2019
1 parent debca23 commit 9c71320
Show file tree
Hide file tree
Showing 9 changed files with 393 additions and 12 deletions.
11 changes: 6 additions & 5 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ function unzipUpdateFiles($fileName, $unzipPath) {
<h2><?php echo $pigeonConfig['sitename']; ?></h2>
<p><?php echo $pigeonConfig['description']; ?></p>
<hr>
<div class="alert alert-success alert-dismissable" id="alert_success"></div>
<div class="alert alert-danger alert-dismissable" id="alert_danger"></div>
<div id="alert_success"></div>
<div id="alert_danger"></div>
</div>
<div class="col-sm-3">
<p><blockquote><b>提示:</b>选择一个用户进行设置</blockquote></p>
Expand Down Expand Up @@ -331,7 +331,8 @@ function unzipUpdateFiles($fileName, $unzipPath) {
<script type="text/javascript">
var selectid;
var version = '<?php echo $pigeon->version; ?>';
var dismiss = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
var dismiss_success = '<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
var dismiss_danger = '<div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
function getUser(id) {
var htmlobj = $.ajax({
type: 'GET',
Expand Down Expand Up @@ -468,11 +469,11 @@ function updateExecute() {
}
}
function SuccessMsg(text) {
$("#alert_success").html(dismiss + text);
$("#alert_success").html(dismiss_success + text + "</div>");
$("#alert_success").fadeIn(500);
}
function ErrorMsg(text) {
$("#alert_danger").html(dismiss + text);
$("#alert_danger").html(dismiss_danger + text + "</div>");
$("#alert_danger").fadeIn(500);
}
window.onload = function() {
Expand Down
2 changes: 1 addition & 1 deletion pigeon/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Pigeon {
public $cacheData;
public $writeToCache;
public $publicMode = true;
public $version = "1.0.160";
public $version = "1.0.162";

/**
*
Expand Down
7 changes: 4 additions & 3 deletions pigeon/template/pigeon/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
var psearch = '';
var puser = "<?php $user = isset($_GET['user']) ? $_GET['user'] : ""; echo str_replace('"', "", $user); ?>";
var storage = '<?php echo $_SESSION['ids']; ?>';
var dismiss = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
var dismiss_success = '<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
var dismiss_danger = '<div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
var isblur = false;
var pagetitle = document.title;
hljs.initHighlightingOnLoad();
Expand Down Expand Up @@ -196,11 +197,11 @@ function changepublic(id, newstatus) {
});
}
function SuccessMsg(text) {
$("#alert_success").html(dismiss + text);
$("#alert_success").html(dismiss_success + text + "</div>");
$("#alert_success").fadeIn(500);
}
function ErrorMsg(text) {
$("#alert_danger").html(dismiss + text);
$("#alert_danger").html(dismiss_danger + text + "</div>");
$("#alert_danger").fadeIn(500);
}
window.onload = function() {
Expand Down
6 changes: 3 additions & 3 deletions pigeon/template/pigeon/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
echo '<script src="https://recaptcha.net/recaptcha/api.js" async defer></script>';
}
?>
<style type="text/css">@import url(https://fonts.googleapis.com/css?family=Raleway:400,700,500);body{font-family:'Raleway',sans-serif;font-weight:400;}.hljs{background:unset;}.headimg{width:90px;text-align:center;padding-top:8px;padding-bottom:8px;vertical-align:top;}.headimg img{width:64px;height:64px;border-radius:50%;}.headimg img:hover{transform:rotate(360deg);transition-delay:0.2s;transition-duration:1s;box-shadow:0px 0px 16px rgba(0,0,0,0.5);}#pagecontent table{font-size:14px;}.right-btn{width:100%;}.loginhead{border-radius:50%;width:70%;margin-top:32px;margin-bottom:32px;}.message{padding:12px;background-color:#F5F5F5;border-radius:8px;margin-bottom:26px;padding-bottom:2px;display:inline-block;overflow:hidden;}.message:hover{background-color:#F0F0F0;box-shadow:0px 0px 16px rgba(0,0,0,0.2);}.hoverdisplay{opacity:0;}.hoverdisplay:hover{opacity:1;}#alert_success,#alert_danger{display:none;}.newpost{width:100%;height:80px;min-width:100%;max-width:100%;min-height:80px;max-height:256px;}*{transition-duration:0.5s;}.logo h2 a{color:#000;text-decoration:none;}#mdcontent{display:none;}.thread img{vertical-align:text-bottom ! important;max-width:100% ! important;margin-top:8px;margin-bottom:8px;}.thread table{display:block;width:100%;overflow:auto;margin-bottom:8px;}.thread table tr{background-color:#fff;border-top:1px solid #c6cbd1;}.thread table tr:nth-child(2n){background-color:#f6f8fa;}.thread table th,.thread table td{padding:6px 13px;border:1px solid #dfe2e5;font-size:14px;}.thread pre{margin-bottom:0px;margin-top:-10px;margin-left:-12px;margin-right:-12px;background:#e6e6e6;border-radius:0px;border-left:4px solid #9e9e9e ! important;}pre{border:none ! important;}blockquote{font-size:15px ! important;}.thread{word-break:break-all;white-space:pre-wrap;}.thread ul li{margin:-5px 0px -5px 0px;}.thread ol li{margin:-5px 0px -5px 0px;}ol,ul{margin-top:-15px;margin-bottom:0px;}#imgscan{display:none;width:100%;height:100%;background:rgba(0,0,0,0.7);position:fixed;top:0px;left:0px;text-align:center;z-index:999999999;}.imgcontent{width:100%;height:100%;display:table;}.imgrow{width:100%;height:100%;display:table-cell;vertical-align:middle;}.message img{cursor:pointer;}</style>
<style type="text/css">@import url(https://fonts.googleapis.com/css?family=Raleway:400,700,500);body{font-family:'Raleway',sans-serif;font-weight:400;}.hljs{background:unset;}.headimg{width:90px;text-align:center;padding-top:8px;padding-bottom:8px;vertical-align:top;}.headimg img{width:64px;height:64px;border-radius:50%;}.headimg img:hover{transform:rotate(360deg);transition-delay:0.2s;transition-duration:1s;box-shadow:0px 0px 16px rgba(0,0,0,0.5);}#pagecontent table{font-size:14px;}.right-btn{width:100%;}.loginhead{border-radius:50%;width:70%;margin-top:32px;margin-bottom:32px;}.message{padding:12px;background-color:#F5F5F5;border-radius:8px;margin-bottom:26px;padding-bottom:2px;display:inline-block;overflow:hidden;}.message:hover{background-color:#F0F0F0;box-shadow:0px 0px 16px rgba(0,0,0,0.2);}.hoverdisplay{opacity:0;}.hoverdisplay:hover{opacity:1;}#alert_success,#alert_danger{display:none;}.newpost{width:100%;height:80px;min-width:100%;max-width:100%;min-height:80px;max-height:256px;}*{transition-duration:0.5s;}.logo h2 a{color:#000;text-decoration:none;}#mdcontent{display:none;}.thread img{vertical-align:text-bottom ! important;max-width:100% ! important;margin-top:8px;margin-bottom:8px;}.thread table{display:block;width:100%;overflow:auto;margin-bottom:8px;}.thread table tr{background-color:#fff;border-top:1px solid #c6cbd1;}.thread table tr:nth-child(2n){background-color:#f6f8fa;}.thread table th,.thread table td{padding:6px 13px;border:1px solid #dfe2e5;font-size:14px;}.thread pre{margin-bottom:0px;margin-top:-10px;margin-left:-12px;margin-right:-12px;background:#e6e6e6;border-radius:0px;border-left:4px solid #9e9e9e ! important;}pre{border:none ! important;}blockquote{font-size:15px ! important;padding:0px 20px 0px;margin:0 0 10px;}.thread{word-break:break-all;white-space:pre-wrap;}.thread ul li{margin:-5px 0px -5px 0px;}.thread ol li{margin:-5px 0px -5px 0px;}ol,ul{margin-top:-15px;margin-bottom:0px;}#imgscan{display:none;width:100%;height:100%;background:rgba(0,0,0,0.7);position:fixed;top:0px;left:0px;text-align:center;z-index:999999999;}.imgcontent{width:100%;height:100%;display:table;}.imgrow{width:100%;height:100%;display:table-cell;vertical-align:middle;}.message img{cursor:pointer;}</style>
</head>
<body>
<div id="imgscan" onclick="$(this).fadeOut();">
Expand Down Expand Up @@ -60,8 +60,8 @@
<center>
<p><a href="?">公共时间线</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="?user=<?php echo $_SESSION['user']; ?>">我的时间线</a></p>
</center>
<div class="alert alert-success alert-dismissable" id="alert_success"></div>
<div class="alert alert-danger alert-dismissable" id="alert_danger"></div>
<div id="alert_success"></div>
<div id="alert_danger"></div>
<?php
}
?>
230 changes: 230 additions & 0 deletions pigeon/template/pigeon_dark/footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
<?php
global $pigeon;
?>
</div>
<div class="col-sm-3">
<p>
<div class="input-group">
<input type="text" id="search" class="form-control" placeholder="搜索">
<span class="input-group-btn">
<button class="btn btn-primary" onclick="search()" style="height: 34px;"><i class="fa fa-search"></i></button>
</span>
</div>
</p>
<?php
if(isset($_SESSION['user']) && isset($_SESSION['email'])) {
?>
<center>
<img src="https://secure.gravatar.com/avatar/<?php echo md5($_SESSION['email']); ?>?s=256" class="loginhead">
</center>
<h3><?php echo $_SESSION['user']; ?></h3>
<p>欢迎回来!<a href="?s=logout">[退出登录]</a></p>
<p>你的 Token(可用于 API 发布)</p>
<p><pre><?php echo $_SESSION['token']; ?></pre></p>
<?php
} else {
?>
<p>欢迎来到本站,请登陆。</p>
<div class="row">
<div class="col-sm-6">
<p><a href="?s=login"><button class="btn btn-primary right-btn">立即登录</button></a></p>
</div>
<div class="col-sm-6">
<p><a href="?s=register"><button class="btn btn-success right-btn">注册账号</button></a></p>
</div>
</div>
<?php
}
?>
<hr>
<p><b>输入一个时间来进行筛选</b></p>
<p>时间格式:<?php echo date("Y-m-d H:i:s"); ?></p>
<p>
<div class="input-group">
<input type="text" id="time" class="form-control">
<span class="input-group-btn">
<button class="btn btn-primary" placeholder="yyyy-mm-dd HH:ii:ss" onclick="setTime()">确定</button>
</span>
</div>
</p>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<hr>
<p>&copy; <?php echo date("Y"); ?> <?php echo $pigeon->config['sitename']; ?> | Powered by <a href="https://github.com/kasuganosoras/Pigeon" target="_blank">Pigeon</a></p>
</div>
</div>
<script type="text/javascript">
var auto_refresh = true;
var ptime = '';
var psearch = '';
var puser = "<?php $user = isset($_GET['user']) ? $_GET['user'] : ""; echo str_replace('"', "", $user); ?>";
var storage = '<?php echo $_SESSION['ids']; ?>';
var dismiss_success = '<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
var dismiss_danger = '<div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
var isblur = false;
var pagetitle = document.title;
hljs.initHighlightingOnLoad();
function setTime() {
ptime = $("#time").val();
RefreshHome();
}
function search() {
psearch = $("#search").val();
RefreshHome();
}
function newpost() {
var htmlobj = $.ajax({
type: 'POST',
url: "?s=newpost",
data: {
ispublic: $("#ispublic").val(),
content: $("#newpost").val()
},
async:true,
error: function() {
alert("错误:" + htmlobj.responseText);
return;
},
success: function() {
$("#newpost").val("");
RefreshHome();
return;
}
});
}
function RefreshHome() {
current_page = '1';
auto_refresh = true;
var htmlobj = $.ajax({
type: 'GET',
url: "?s=timeline",
data: {
page: '1',
time: ptime,
user: puser,
search: psearch
},
async:true,
error: function() {
alert("错误:" + htmlobj.responseText);
return;
},
success: function() {
var ids = htmlobj.getResponseHeader('ids');
if(storage != ids) {
$("#pagecontent").html(htmlobj.responseText);
if(isblur && storage != '') {
document.title = "[新消息] " + pagetitle;
}
storage = ids;
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
$('.message img').click(function() {
imgsrc.src = this.src;
$("#imgscan").fadeIn();
});
}
return;
}
});
}
function loadMore() {
auto_refresh = false;
var newPage = parseInt(current_page) + 1;
var htmlobj = $.ajax({
type: 'GET',
url: "?s=timeline",
data: {
ajax: 1,
page: newPage,
time: ptime,
user: puser,
search: psearch
},
async:true,
error: function() {
return;
},
success: function() {
$(".loadMore").css({display:'none'});
$("#pagecontent").append(htmlobj.responseText);
current_page = newPage;
$('.message img').click(function() {
imgsrc.src = this.src;
$("#imgscan").fadeIn();
});
return;
}
});
}
function deletepost(id) {
auto_refresh = false;
var htmlobj = $.ajax({
type: 'GET',
url: "?s=deletepost&id=" + id,
async:true,
error: function() {
ErrorMsg("错误:" + htmlobj.responseText);
return;
},
success: function() {
storage = '';
SuccessMsg("消息删除成功!");
RefreshHome();
return;
}
});
}
function changepublic(id, newstatus) {
auto_refresh = false;
var htmlobj = $.ajax({
type: 'GET',
url: "?s=changepublic&id=" + id + "&newstatus=" + newstatus,
async:true,
error: function() {
ErrorMsg("错误:" + htmlobj.responseText);
return;
},
success: function() {
storage = '';
SuccessMsg("消息状态修改成功!");
RefreshHome();
return;
}
});
}
function SuccessMsg(text) {
$("#alert_success").html(dismiss_success + text + "</div>");
$("#alert_success").fadeIn(500);
}
function ErrorMsg(text) {
$("#alert_danger").html(dismiss_danger + text + "</div>");
$("#alert_danger").fadeIn(500);
}
window.onload = function() {
setInterval(function() {
if(auto_refresh) {
RefreshHome();
}
}, 10000);
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
$('.message img').click(function() {
imgsrc.src = this.src;
$("#imgscan").fadeIn();
});
}
window.onblur = function() {
isblur = true;
}
window.onfocus = function() {
isblur = false;
document.title = pagetitle;
}
</script>
</body>
</html>
Loading

0 comments on commit 9c71320

Please sign in to comment.