v2.5.2
parent
4ffba77452
commit
d1fb93ca2e
10
README.md
10
README.md
|
@ -103,10 +103,14 @@ $HTTP["url"] =~ "^/(i|public)/" {
|
|||
|
||||
<details><summary><mark>点击查看2.0版更新日志</mark></summary>
|
||||
|
||||
* 2022-2-13 v2.5.1
|
||||
- 异步执行鉴黄
|
||||
- 取消检测imagick扩展
|
||||
* 2022-2-19 v2.5.2 Developing
|
||||
- 增加简繁体转换
|
||||
- 增加管理页面记录当前操作页
|
||||
- 修复一处暴露路径bug
|
||||
|
||||
* 2022-2-13 v2.5.1
|
||||
- 增加异步执行鉴黄
|
||||
- 取消检测imagick扩展
|
||||
- 修复可能导致检测弹窗弹出失败
|
||||
|
||||
* 2022-2-7 v2.5.0
|
||||
|
|
|
@ -138,20 +138,20 @@ if (isset($_GET['reimg'])) {
|
|||
</div>
|
||||
<div class="col-md-2 col-xs-4">
|
||||
<ul class="nav nav-tabs nav-stacked">
|
||||
<li class="active"><a data-tab href="#Content1">网站设置</a></li>
|
||||
<li><a data-tab href="#Content1">网站设置</a></li>
|
||||
<li><a data-tab href="#Content9">界面设置</a></li>
|
||||
<li><a data-tab href="#Content2">上传设置</a></li>
|
||||
<li><a data-tab href="#Content3">广告设置</a></li>
|
||||
<li><a data-tab href="#Content5">API 设置</a></li>
|
||||
<li><a data-tab href="#Content7">可疑图片<span class="label label-badge label-success"><?php echo get_file_by_glob(APP_ROOT . $config['path'] . 'suspic', 'number'); ?></span></a></li>
|
||||
<li><a data-tab href="#Content4">文件操作</a></li>
|
||||
<li><a data-tab href="#Content4">文件操作</a></li>
|
||||
<li><a data-tab href="#Content6">图片安全</a></li>
|
||||
<li><a data-tab href="#Content10">账号密码</a></li>
|
||||
<li><a data-tab href="#Content8">系统信息</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content col-md-10 col-xs-8">
|
||||
<div class="tab-pane fade active in" id="Content1">
|
||||
<div class="tab-pane fade" id="Content1">
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
|
||||
<div class="form-group">
|
||||
<label>网站域名 | 末尾不加'/'</label>
|
||||
|
@ -572,27 +572,26 @@ if (isset($_GET['reimg'])) {
|
|||
$cache_dir = APP_ROOT . $config['path'] . 'suspic/'; // cache目录
|
||||
$cache_file = get_file_by_glob($cache_dir . '*.*'); // 获取所有文件
|
||||
@$cache_num = count($cache_file); // 统计目录文件个数
|
||||
for ($i = 0; $i < $cache_num and $i < 21; $i++) { // 循环输出文件
|
||||
for ($i = 0; $i < $cache_num and $i < 21; $i++) : // 循环输出文件
|
||||
$file_cache_path = APP_ROOT . $config['path'] . 'suspic/' . $cache_file[$i]; // 图片绝对路径
|
||||
$file_path = $config['path'] . 'suspic/' . $cache_file[$i]; // 图片相对路径
|
||||
@$file_size = getDistUsed(filesize($file_cache_path)); // 图片大小
|
||||
@$filen_name = $cache_file[$i]; // 图片名称
|
||||
$url = $config['imgurl'] . $config['path'] . 'suspic/' . $cache_file[$i]; // 图片网络连接
|
||||
$unlink_img = $config['domain'] . '/application/del.php?url=' . $url; // 图片删除连接
|
||||
echo '
|
||||
?>
|
||||
<tr>
|
||||
<td>' . $i . '</td>
|
||||
<td><img data-toggle="lightbox" src="' . get_online_thumbnail($file_path) . '" data-image="' . $url . '" class="img-thumbnail" ></td>
|
||||
<td>' . $filen_name . '</td>
|
||||
<td>' . $file_size . '</td>
|
||||
<td><?php echo $i; ?></td>
|
||||
<td><img data-toggle="lightbox" src="<?php echo get_online_thumbnail($file_path); ?>" data-image="<?php echo $url; ?>" class="img-thumbnail"></td>
|
||||
<td><?php echo $filen_name; ?></td>
|
||||
<td><?php echo $file_size; ?></td>
|
||||
<td>
|
||||
<a class="btn btn-mini" href="' . $url . '" target="_blank">新窗口</a>
|
||||
<a class="btn btn-mini btn-success" href="?reimg=' . $filen_name . '">恢复</a>
|
||||
<a class="btn btn-mini btn-danger" href="' . $unlink_img . '" target="_blank">删除</a>
|
||||
<a class="btn btn-mini" href="<?php echo $url; ?>" target="_blank">新窗口</a>
|
||||
<a class="btn btn-mini btn-success" href="?reimg=<?php echo $filen_name; ?>">恢复</a>
|
||||
<a class="btn btn-mini btn-danger" href="<?php echo $unlink_img; ?>" target="_blank">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
} ?>
|
||||
<?php endfor; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -661,6 +660,13 @@ if (isset($_GET['reimg'])) {
|
|||
<option value="black" <?php if ($config['theme'] == 'black') echo 'selected'; ?>>黑色</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label data-toggle="tooltip" title="界面语言切换 | 暂支持中文简繁体转换">界面语言</label>
|
||||
<select class="chosen-select form-control" name="language">
|
||||
<option value="0" <?php if ($config['language'] == '0') echo 'selected'; ?>>简体中文</option>
|
||||
<option value="1" <?php if ($config['language'] == '1') echo 'selected'; ?>>繁體中文</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<h5>上传后首选显示链接</h5>
|
||||
<label class="radio-inline">
|
||||
|
@ -685,26 +691,12 @@ if (isset($_GET['reimg'])) {
|
|||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch switch-inline">
|
||||
<div class="switch switch-inline" data-toggle="tooltip" title="链接经过加密 | 请妥善保存密码">
|
||||
<input type="hidden" name="show_user_hash_del" value="0">
|
||||
<input type="checkbox" name="show_user_hash_del" value="1" <?php if ($config['show_user_hash_del']) echo 'checked="checked"'; ?>>
|
||||
<label style="font-weight: bold">上传后显示删除链接</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch switch-inline">
|
||||
<input type="hidden" name="show_exif_info" value="0">
|
||||
<input type="checkbox" name="show_exif_info" value="1" <?php if ($config['show_exif_info']) echo 'checked="checked"'; ?>>
|
||||
<label style="font-weight: bold">图片Exif信息</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch switch-inline" data-toggle="tooltip" title="图片过多时可能会影响统计时间">
|
||||
<input type="hidden" name="chart_on" value="0">
|
||||
<input type="checkbox" name="chart_on" value="1" <?php if ($config['chart_on']) echo 'checked="checked"'; ?>>
|
||||
<label style="font-weight: bold">统计信息</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch switch-inline" data-toggle="tooltip" title=" 关闭广场非登录状态不显示广场导航">
|
||||
<input type="hidden" name="showSwitch" value="0">
|
||||
|
@ -713,12 +705,27 @@ if (isset($_GET['reimg'])) {
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch switch-inline" data-toggle="tooltip" title="以上传时间正序 | 开启倒序">
|
||||
<div class="switch switch-inline" data-toggle="tooltip" title="广场图片以上传时间正序 | 开启倒序">
|
||||
<input type="hidden" name="showSort" value="0">
|
||||
<input type="checkbox" name="showSort" value="1" <?php if ($config['showSort']) echo 'checked="checked"'; ?>>
|
||||
<label style="font-weight: bold">按上传时间排序</label>
|
||||
<label style="font-weight: bold">排序</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch switch-inline" data-toggle="tooltip" title="广场图片信息按钮">
|
||||
<input type="hidden" name="show_exif_info" value="0">
|
||||
<input type="checkbox" name="show_exif_info" value="1" <?php if ($config['show_exif_info']) echo 'checked="checked"'; ?>>
|
||||
<label style="font-weight: bold">Exif</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="switch switch-inline" data-toggle="tooltip" title="图片过多时可能会影响统计时间">
|
||||
<input type="hidden" name="chart_on" value="0">
|
||||
<input type="checkbox" name="chart_on" value="1" <?php if ($config['chart_on']) echo 'checked="checked"'; ?>>
|
||||
<label style="font-weight: bold">统计</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>默认游客浏览数量 | 当前: </label>
|
||||
<label id="listNumber"><?php echo $config['listNumber']; ?>张</label>
|
||||
|
@ -799,15 +806,13 @@ if (isset($_GET['reimg'])) {
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($guestConfig as $key => $value) {
|
||||
echo "
|
||||
<tr>
|
||||
<td>$key</td>
|
||||
<td>$value</td>
|
||||
<td><a class='btn btn-mini btn-danger' href='admin.inc.php?delete_guest=$key'>删除</a></td>
|
||||
</tr>";
|
||||
} ?>
|
||||
<?php foreach ($guestConfig as $key => $value) : ?>
|
||||
<tr>
|
||||
<td><?php echo $key; ?></td>
|
||||
<td><?php echo $value; ?></td>
|
||||
<td><a class='btn btn-mini btn-danger' href='admin.inc.php?delete_guest=$key'>删除</a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -819,8 +824,30 @@ if (isset($_GET['reimg'])) {
|
|||
<link href="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet">
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.js"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/md5/md5.min.js"></script>
|
||||
<?php /** 引入空间检测文件 */ if ($config['checkEnv']) require_once APP_ROOT . '/application/check_admin.inc.php'; ?>
|
||||
<script src="<?php static_cdn(); ?>/public/static/jquery/jquery.cookie.js"></script>
|
||||
<?php /** 引入设置页面检测文件 */ if ($config['checkEnv']) require_once APP_ROOT . '/application/check_admin.inc.php'; ?>
|
||||
<script>
|
||||
// cookie 记录当前tab页面
|
||||
$('[data-tab]').on('shown.zui.tab', function(e) {
|
||||
var cookie_value = e.delegateTarget.attributes[1].value;
|
||||
$.cookie('data-tab-now', cookie_value, {
|
||||
expires: 1,
|
||||
}); // 存储一个带1天期限的 cookie
|
||||
console.log('当前被激活的标签页', e.target);
|
||||
console.log('上一个标签页', e.relatedTarget);
|
||||
});
|
||||
// cookie有
|
||||
if ($.cookie('data-tab-now') != null) {
|
||||
$ac = $.cookie('data-tab-now');
|
||||
$("a[href = '" + $ac + "']").parent().addClass("active in")
|
||||
$($ac).addClass("active in")
|
||||
}
|
||||
// cookie无
|
||||
if ($.cookie('data-tab-now') == null) {
|
||||
$("a[href = '#Content1']").parent().addClass("active in")
|
||||
$('#Content1').addClass("active in")
|
||||
}
|
||||
|
||||
// tips提示
|
||||
$('[data-toggle="tooltip"]').tooltip({
|
||||
placement: 'top',
|
||||
|
@ -870,12 +897,6 @@ if (isset($_GET['reimg'])) {
|
|||
|
||||
// 更改网页标题
|
||||
document.title = "图床设置 - <?php echo $config['title']; ?>"
|
||||
|
||||
$('[data-tab]').on('shown.zui.tab', function(e) {
|
||||
console.clear()
|
||||
console.log('当前被激活的标签页', e.target);
|
||||
console.log('上一个标签页', e.relatedTarget);
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
require_once APP_ROOT . '/application/footer.php';
|
||||
|
|
|
@ -113,7 +113,7 @@ if (isset($_GET['login'])) {
|
|||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label title="选不选都记得你,想退出就点击退出才可以哦!">
|
||||
<label title="选不选都记得你,想退出就点击退出才可以哦!">
|
||||
<input type="checkbox" checked="checked"> 记住我
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
@ -40,6 +40,9 @@ if ($config['ad_bot']) echo $config['ad_bot_info']; // 底部广告
|
|||
</p>
|
||||
</footer>
|
||||
<script>
|
||||
// NProgress
|
||||
NProgress.start();
|
||||
NProgress.done();
|
||||
// 导航状态
|
||||
$('.nav-pills').find('a').each(function() {
|
||||
if (this.href == document.location.href) {
|
||||
|
@ -57,15 +60,16 @@ if ($config['ad_bot']) echo $config['ad_bot_info']; // 底部广告
|
|||
correctLevel: QRCode.CorrectLevel.H
|
||||
});
|
||||
|
||||
// NProgress
|
||||
NProgress.start();
|
||||
NProgress.done();
|
||||
<?php /** 简繁转换 */ if ($config['language'] == 1) : ?>
|
||||
$.getScript("<?php static_cdn(); ?>/public/static/i18n/jquery.s2t.js", function() { //加载成功后,并执行回调函数
|
||||
$('*').s2t();
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
// console
|
||||
console.log("%cEasyImage2.0", "background: rgba(252,234,187,1);background: -moz-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%,rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -webkit-gradient(left top, right top, color-stop(0%, rgba(252,234,187,1)), color-stop(12%, rgba(175,250,77,1)), color-stop(28%, rgba(0,247,49,1)), color-stop(39%, rgba(0,210,247,1)), color-stop(51%, rgba(0,189,247,1)), color-stop(64%, rgba(133,108,217,1)), color-stop(78%, rgba(177,0,247,1)), color-stop(87%, rgba(247,0,189,1)), color-stop(100%, rgba(245,22,52,1)));background: -webkit-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -o-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -ms-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: linear-gradient(to right, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fceabb', endColorstr='#f51634', GradientType=1 );font-size:2.34em;font-weight:bold")
|
||||
console.log('%c图床演示网站: https://png.cm \n请为本人博客 https://blog.png.cm/ 加上链接, 谢谢尊重!\n作为开发者你可以对相应的后台功能进行扩展(增删改相应代码), 但请保留代码中相关来源信息(例如: 本人博客, 邮箱等);\n本程序由 Icret 独自开发并完全开源, 碰到收费发布的请不要轻易付款; 本人仅为程序开源创作, 如非法网站使用与本人无关, 请勿用于非法用途.%c ', 'color: #eaad1a; padding:5px 0; border:1px solid #448ef6; font-size:12px;', '');
|
||||
</script>
|
||||
<?php /** 环境检测 */ if ($config['checkEnv']) require_once APP_ROOT . '/application/check.php'; ?>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -30,7 +30,7 @@
|
|||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/ieonly/excanvas.js"></script>
|
||||
<![endif]-->
|
||||
<?php /** 自定义代码 */ if ($config['customize']) echo $config['customize']; ?>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="container">
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
<?php
|
||||
$config=Array
|
||||
(
|
||||
'title'=>'简单图床 - EasyImage',
|
||||
'keywords'=>'简单图床,easyimage,无数据库图床,PHP多图长传程序,自适应页面,HTML5,markdown,bbscode,一键复制',
|
||||
'description'=>'简单图床EasyImage是一款支持多文件上传的无数据库图床,可以完美替代PHP多图上传程序,最新html5自适应页面兼容手机电脑,上传后返回图片直链,markdown图片,论坛贴图bbscode链接,简单方便支持一键复制,支持多域名,api上传。',
|
||||
'tips'=>'<a><li class="icon icon-bullhorn text-muted"> 单文件≤10M,单次上传≤30张</li></a>
|
||||
<a href="https://github.com/icret/EasyImages2.0" target="_black"><i class="icon icon-heart"> 简单图床是一款开源图床, 支持多文件上传无数据库</i></a>
|
||||
'tips'=>'<a><li class="icon icon-bullhorn text-muted"> 单文件≤10M,单次上传≤30张</li></a>
|
||||
<a href="https://github.com/icret/EasyImages2.0" target="_black"><i class="icon icon-heart"> 简单图床是一款开源图床, 支持多文件上传无数据库</i></a>
|
||||
<a href="https://github.com/icret/EasyImages2.0" target="_black"><i class="icon icon-github"> 如果你喜欢这种图床风格就下载喔 (๑•̀ㅂ•́)و✧</i></a>',
|
||||
'domain'=>'http://127.0.0.1',
|
||||
'imgurl'=>'http://127.0.0.1',
|
||||
|
@ -47,25 +47,25 @@ $config=Array
|
|||
'checkImg_value'=>50,
|
||||
'moderatecontent_key'=>'',
|
||||
'nsfwjs_url'=>'',
|
||||
'footer'=>'<a href="/admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a>
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?c790ac2bdc2f385757ecd0183206108d";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
'footer'=>'<a href="/admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a>
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?c790ac2bdc2f385757ecd0183206108d";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>',
|
||||
'ad_top'=>0,
|
||||
'ad_top_info'=>' <!--广告 按照这个范例替换相应链接,如果想多几个广告,就多复制几个-->
|
||||
<div class="col-md-12" style="text-align: center;margin:2px;">
|
||||
<a href="https://app.cloudcone.com.cn/?ref=3521" target="_blank"><img src="/public/images/EasyImage2.0.png" /></a>
|
||||
'ad_top_info'=>' <!--广告 按照这个范例替换相应链接,如果想多几个广告,就多复制几个-->
|
||||
<div class="col-md-12" style="text-align: center;margin:2px;">
|
||||
<a href="https://app.cloudcone.com.cn/?ref=3521" target="_blank"><img src="/public/images/EasyImage2.0.png" /></a>
|
||||
</div>',
|
||||
'ad_bot'=>0,
|
||||
'ad_bot_info'=>'<div class="col-md-12" style="text-align: center;margin:12px;">
|
||||
<a href="../public/images/wechat.jpg" title="您的赞美是我开发的动力!" data-toggle="lightbox" class="btn btn-mini" style="color:#329d38;" data-lightbox-group="group1644998953432"><i class="icon icon-wechat"></i> 打赏作者</a>
|
||||
<a href="../public/images/alipay.jpg" title="您的赞美是我开发的动力!" data-toggle="lightbox" class="btn btn-mini" style="color:#1970fc;" data-lightbox-group="group1644998953432"><i class="icon icon-zhifubao"></i> 打赏作者</a>
|
||||
'ad_bot_info'=>'<div class="col-md-12" style="text-align: center;margin:12px;">
|
||||
<a href="../public/images/wechat.jpg" title="您的赞美是我开发的动力!" data-toggle="lightbox" class="btn btn-mini" style="color:#329d38;" data-lightbox-group="group1644998953432"><i class="icon icon-wechat"></i> 打赏作者</a>
|
||||
<a href="../public/images/alipay.jpg" title="您的赞美是我开发的动力!" data-toggle="lightbox" class="btn btn-mini" style="color:#1970fc;" data-lightbox-group="group1644998953432"><i class="icon icon-zhifubao"></i> 打赏作者</a>
|
||||
</div>',
|
||||
'showSwitch'=>1,
|
||||
'showSort'=>1,
|
||||
|
@ -81,6 +81,7 @@ var _hmt = _hmt || [];
|
|||
'check_ip'=>0,
|
||||
'check_ip_model'=>0,
|
||||
'check_ip_list'=>'',
|
||||
'version'=>'2.5.1',
|
||||
'update'=>'2022-02-18 00:23:07'
|
||||
'language'=>0,
|
||||
'version'=>'2.5.2 dev',
|
||||
'update'=>'2022-02-19 13:59:41'
|
||||
);
|
|
@ -153,4 +153,5 @@ mustLogin();
|
|||
})();
|
||||
</script>
|
||||
<?php
|
||||
/** 环境检测 */ if ($config['checkEnv']) require_once APP_ROOT . '/application/check.php';
|
||||
require_once APP_ROOT . '/application/footer.php';
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,117 @@
|
|||
/*!
|
||||
* jQuery Cookie Plugin v1.4.1
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2013 Klaus Hartl
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// CommonJS
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var pluses = /\+/g;
|
||||
|
||||
function encode(s) {
|
||||
return config.raw ? s : encodeURIComponent(s);
|
||||
}
|
||||
|
||||
function decode(s) {
|
||||
return config.raw ? s : decodeURIComponent(s);
|
||||
}
|
||||
|
||||
function stringifyCookieValue(value) {
|
||||
return encode(config.json ? JSON.stringify(value) : String(value));
|
||||
}
|
||||
|
||||
function parseCookieValue(s) {
|
||||
if (s.indexOf('"') === 0) {
|
||||
// This is a quoted cookie as according to RFC2068, unescape...
|
||||
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
||||
}
|
||||
|
||||
try {
|
||||
// Replace server-side written pluses with spaces.
|
||||
// If we can't decode the cookie, ignore it, it's unusable.
|
||||
// If we can't parse the cookie, ignore it, it's unusable.
|
||||
s = decodeURIComponent(s.replace(pluses, ' '));
|
||||
return config.json ? JSON.parse(s) : s;
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
function read(s, converter) {
|
||||
var value = config.raw ? s : parseCookieValue(s);
|
||||
return $.isFunction(converter) ? converter(value) : value;
|
||||
}
|
||||
|
||||
var config = $.cookie = function (key, value, options) {
|
||||
|
||||
// Write
|
||||
|
||||
if (value !== undefined && !$.isFunction(value)) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setTime(+t + days * 864e+5);
|
||||
}
|
||||
|
||||
return (document.cookie = [
|
||||
encode(key), '=', stringifyCookieValue(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
|
||||
// Read
|
||||
|
||||
var result = key ? undefined : {};
|
||||
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all. Also prevents odd result when
|
||||
// calling $.cookie().
|
||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||
|
||||
for (var i = 0, l = cookies.length; i < l; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
var name = decode(parts.shift());
|
||||
var cookie = parts.join('=');
|
||||
|
||||
if (key && key === name) {
|
||||
// If second argument (value) is a function it's a converter...
|
||||
result = read(cookie, value);
|
||||
break;
|
||||
}
|
||||
|
||||
// Prevent storing a cookie that we couldn't decode.
|
||||
if (!key && (cookie = read(cookie)) !== undefined) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
if ($.cookie(key) === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Must not alter options, thus extending a fresh object...
|
||||
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
||||
return !$.cookie(key);
|
||||
};
|
||||
|
||||
}));
|
Loading…
Reference in New Issue