diff --git a/app/admin/view/index/console1.html b/app/admin/view/index/console1.html index 116d423..592608e 100644 --- a/app/admin/view/index/console1.html +++ b/app/admin/view/index/console1.html @@ -1,631 +1,634 @@ - - - 控制后台 - - - - - - - -
-
-
-
-
今日访问
-
-
-
- 0 -
-
- - - - - - - - - -
-
+ + + 控制后台 + + + + + + + +
+
+
+
+
今日访问
+
+
+
+ 0
-
-
-
-
-
提交次数
-
-
-
- 0 -
-
- - - - - - - - - - - - - -
-
-
-
-
-
-
-
下载数量
-
-
-
- 0 -
-
- - - - - - - - - - -
-
-
-
-
-
-
-
流量统计
-
-
-
- 0 -
-
- - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
    -
  • 官方动态
  • -
  • 发送反馈
  • -
  • 今周发帖
  • -
  • 今周评论
  • -
-
- -
-
-
-
-
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- -
-
-
- -
-
- -
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
版本信息
-
-
-
- -
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
系统 - -
版本 - TaoLer_{:config('taoler.version')} -
日志 - 更新日志 -
框架 - Thinkphp_{:think\\App::VERSION} -
PHP - PHP_{$Think.PHP_VERSION} -
UI Layui -
运行 - {$runTime} -
授权 - {$syscy} - -
-
-
-
-
- 链接 -
-
- 官 网 -
- 下 载 -
- 交 流 -
-
-
-
- 寄语 -
-
- 不是最好,只会越来越好!高效迅速、专注其道,简洁简单,功能专一,又具有更多的应用功能。 -
不管是自用、商用,还是学习,都可让您轻松愉快的使用。 -
作者尽最大热情,持续迭代更新维护,做到项目长期可用,不放弃不遗忘。 +
+ + + + + + + + +
- - - - +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
版本信息
+
+
+
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
系统 + +
版本 + TaoLer_{:config('taoler.version')} +
日志 + 更新日志 +
框架 + Thinkphp_{:think\\App::VERSION} +
PHP + PHP_{$Think.PHP_VERSION} +
UI Layui +
运行 + {$runTime} +
授权 + {$syscy} + +
+
+
+
+
+ 链接 +
+
+ 官 网 +
+ 下 载 +
+ 交 流 +
+
+
+
+ 寄语 +
+
+ 不是最好,只会越来越好!高效迅速、专注其道,简洁简单,功能专一,又具有更多的应用功能。 +
不管是自用、商用,还是学习,都可让您轻松愉快的使用。 +
作者尽最大热情,持续迭代更新维护,做到项目长期可用,不放弃不遗忘。 +
+
+
+
+
+ + + + - + }); + + }); + + diff --git a/app/admin/view/index/console2.html b/app/admin/view/index/console2.html index a7dd020..52b5220 100644 --- a/app/admin/view/index/console2.html +++ b/app/admin/view/index/console2.html @@ -108,7 +108,7 @@
待审文章
-
14
+
0
diff --git a/app/common/lib/Arts.php b/app/common/lib/Arts.php index a67bd31..d727b87 100644 --- a/app/common/lib/Arts.php +++ b/app/common/lib/Arts.php @@ -68,6 +68,9 @@ class Arts */ public function setKeywords(string $flag,string $title,string $content) :array { + // 获取seo插件配置 + $conf = get_addons_config('seo'); + $keywords = []; // seo插件配置 @@ -148,12 +151,11 @@ class Arts } $post_data = substr($o,0,-1); $res = $this->request_post($url, $post_data); - // 写入token - SetArr::name('taoler')->edit([ - 'baidu'=> [ - 'access_token' => json_decode($res)->access_token, - ] - ]); + + // 保存token + $conf['baidufenci']['value']['access_token'] = json_decode($res)->access_token; + set_addons_config('seo', $conf); + echo 'api接口数据错误 - '; echo $dataItem->error_msg; } diff --git a/app/common/model/Comment.php b/app/common/model/Comment.php index c392dcd..e599af6 100644 --- a/app/common/model/Comment.php +++ b/app/common/model/Comment.php @@ -45,6 +45,14 @@ class Comment extends Model ->select() ->toArray(); + foreach ($comment as $k => $v) + { + if(empty($v['content'])){ + unset($comment[$k]); + } + } + + if(count($comment)) { $data['data'] = getTree($comment); $data['total'] = count($data['data']); @@ -181,20 +189,26 @@ class Comment extends Model return ''; } + /** - * 评论下有评论且自身已删除,会显示为 评论已删除,评论下无评论且已删除则不显示 + * 评论没有被删除正常显示 + * 评论被删除,但它下面有跟评时自身会显示为“评论已删除”,跟评会显示,无跟评且已删除则不显示 * @param $value * @param $data * @return string */ public function getContentAttr($value,$data) { - if($data['delete_time'] !== 0) { + if($data['delete_time'] == 0) { + return $value; + } else { if($this::getByPid($data['id'])) { return '评论已删除'; + } else { + return ''; } + } - return $value; } - + } \ No newline at end of file diff --git a/app/index/controller/Comment.php b/app/index/controller/Comment.php index 1a4c7c8..2f777d5 100644 --- a/app/index/controller/Comment.php +++ b/app/index/controller/Comment.php @@ -35,9 +35,8 @@ class Comment extends BaseController //删除评论 public function jiedaDelete() { + if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']); $id = input('id'); - //$arid = intval($id); - $comms = CommentModel::find($id); $result = $comms->delete(); if($result){ @@ -52,7 +51,7 @@ class Comment extends BaseController public function getDa() { //获取原评论 - $this->isLogin(); + if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']); $id = input('id'); $comms = CommentModel::find($id); $res['rows'] = []; @@ -66,7 +65,7 @@ class Comment extends BaseController //更新评论 public function updateDa() { - $this->isLogin(); + if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']); $id = input('id'); $content = input('content'); $comms = CommentModel::find($id); @@ -83,6 +82,7 @@ class Comment extends BaseController //更新评论 public function edit() { + if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']); if(Request::isAjax()) { $param = Request::param(); // halt($param); @@ -101,7 +101,7 @@ class Comment extends BaseController //评论点赞 public function jiedaZan() { - $this->isLogin(); + if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']); $data['comment_id'] = input('post.id'); $data['user_id'] = session('user_id'); //查询是否已存在点赞 diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index d6809f4..5a03027 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -11,6 +11,7 @@ namespace app\index\controller; use app\common\controller\BaseController; +use app\common\lib\facade\HttpHelper; use think\facade\View; use think\facade\Request; use think\facade\Db; @@ -32,7 +33,7 @@ class Index extends BaseController //置顶文章 $artTop = Article::getArtTop(5); //首页文章列表,显示10个 - $artList = Article::getArtList(10); + $artList = Article::getArtList(15); //热议文章 $artHot = Article::getArtHot(10); diff --git a/composer.json b/composer.json index 71d70da..9ca524c 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "taoser/taoler", - "description": "the new thinkphp taoler bbs system", + "description": "the new thinkphp taolerCMS system", "type": "project", "keywords": [ "taoler", diff --git a/composer.lock b/composer.lock index 514e11f..78e0d86 100644 --- a/composer.lock +++ b/composer.lock @@ -18,13 +18,7 @@ "type": "zip", "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22", "reference": "8674e51bb65af933a5ffaf1c308a660387c35c22", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "dasprid/enum": "^1.0.3", @@ -78,13 +72,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-cache/adapter-common/zipball/8788309be72aa7be69b88cdc0687549c74a7d479", "reference": "8788309be72aa7be69b88cdc0687549c74a7d479", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "cache/tag-interop": "^1.0", @@ -148,13 +136,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-cache/filesystem-adapter/zipball/f1faaae40aaa696ef899cef6f6888aedb90b419b", "reference": "f1faaae40aaa696ef899cef6f6888aedb90b419b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "cache/adapter-common": "^1.0", @@ -226,13 +208,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-cache/tag-interop/zipball/b062b1d735357da50edf8387f7a8696f3027d328", "reference": "b062b1d735357da50edf8387f7a8696f3027d328", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^5.5 || ^7.0 || ^8.0", @@ -291,13 +267,7 @@ "type": "zip", "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8e6b6ea76eabbf19ea2bf5b67b98e1860474012f", "reference": "8e6b6ea76eabbf19ea2bf5b67b98e1860474012f", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1 <9.0" @@ -347,13 +317,7 @@ "type": "zip", "url": "https://api.github.com/repos/endroid/qr-code/zipball/a75c913b0e4d6ad275e49a2c1de1cacffc6c2184", "reference": "a75c913b0e4d6ad275e49a2c1de1cacffc6c2184", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "bacon/bacon-qr-code": "^2.0.5", @@ -425,13 +389,7 @@ "type": "zip", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/414c24961042f6616fb43e23fa69a785f9fc053e", "reference": "414c24961042f6616fb43e23fa69a785f9fc053e", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-json": "*", @@ -516,13 +474,7 @@ "type": "zip", "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.5" @@ -601,13 +553,7 @@ "type": "zip", "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.4.0", @@ -712,13 +658,7 @@ "type": "zip", "url": "https://api.github.com/repos/jae-jae/GHttp/zipball/82585ddd5e2c6651e37ab1d8166efcdbb6b293d4", "reference": "82585ddd5e2c6651e37ab1d8166efcdbb6b293d4", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "cache/filesystem-adapter": "^1", @@ -759,13 +699,7 @@ "type": "zip", "url": "https://api.github.com/repos/jae-jae/phpQuery-single/zipball/39a650ade692a6b480c22220dce0c198d6a946fb", "reference": "39a650ade692a6b480c22220dce0c198d6a946fb", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.3.0" @@ -812,13 +746,7 @@ "type": "zip", "url": "https://api.github.com/repos/jae-jae/QueryList/zipball/39dc0ca9c668bec7a793e20472ccd7d26ef89ea4", "reference": "39dc0ca9c668bec7a793e20472ccd7d26ef89ea4", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-dom": "*", @@ -868,23 +796,17 @@ }, { "name": "laravel/serializable-closure", - "version": "v1.2.2", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae" + "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae", - "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", + "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", + "shasum": "" }, "require": { "php": "^7.3|^8.0" @@ -930,7 +852,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2022-09-08T13:45:54+00:00" + "time": "2023-01-30T18:31:20+00:00" }, { "name": "league/flysystem", @@ -944,13 +866,7 @@ "type": "zip", "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-fileinfo": "*", @@ -1044,13 +960,7 @@ "type": "zip", "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-fileinfo": "*", @@ -1106,13 +1016,7 @@ "type": "zip", "url": "https://api.github.com/repos/liliuwei/thinkphp-social/zipball/2067fc2c2cc3b3d109602bc19c3e5a99c5f4c970", "reference": "2067fc2c2cc3b3d109602bc19c3e5a99c5f4c970", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.6.0", @@ -1187,13 +1091,7 @@ "type": "zip", "url": "https://api.github.com/repos/lotofbadcode/phpspirit_databackup/zipball/77c2421f8461392c044cf8c29918f495c22a5612", "reference": "77c2421f8461392c044cf8c29918f495c22a5612", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.0" @@ -1237,13 +1135,7 @@ "type": "zip", "url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/cd6d9f267d1a3474bdddf1be1da079f01b942786", "reference": "cd6d9f267d1a3474bdddf1be1da079f01b942786", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3", @@ -1298,13 +1190,7 @@ "type": "zip", "url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/ae0f1b3b03d8b29dff81747063cbfd6276246cc4", "reference": "ae0f1b3b03d8b29dff81747063cbfd6276246cc4", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "laravel/serializable-closure": "^1.0", @@ -1380,13 +1266,7 @@ "type": "zip", "url": "https://api.github.com/repos/PHP-DI/PhpDocReader/zipball/66daff34cbd2627740ffec9469ffbac9f8c8185c", "reference": "66daff34cbd2627740ffec9469ffbac9f8c8185c", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.2.0" @@ -1418,23 +1298,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.7.1", + "version": "v6.8.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55" + "reference": "df16b615e371d81fb79e506277faea67a1be18f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55", - "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1", + "reference": "df16b615e371d81fb79e506277faea67a1be18f1", + "shasum": "" }, "require": { "ext-ctype": "*", @@ -1492,7 +1366,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0" }, "funding": [ { @@ -1500,7 +1374,7 @@ "type": "github" } ], - "time": "2022-12-08T13:30:06+00:00" + "time": "2023-03-06T14:43:22+00:00" }, { "name": "psr/cache", @@ -1514,13 +1388,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.3.0" @@ -1569,13 +1437,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.4.0" @@ -1623,13 +1485,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.2.0" @@ -1669,27 +1525,21 @@ }, { "name": "psr/http-client", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "shasum": "" }, "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -1709,7 +1559,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -1721,9 +1571,9 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/master" + "source": "https://github.com/php-fig/http-client/tree/1.0.2" }, - "time": "2020-06-29T06:28:15+00:00" + "time": "2023-04-10T20:12:12+00:00" }, { "name": "psr/http-message", @@ -1737,13 +1587,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.2 || ^8.0" @@ -1796,13 +1640,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.3.0" @@ -1852,13 +1690,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.3.0" @@ -1909,13 +1741,7 @@ "type": "zip", "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.6" @@ -1959,13 +1785,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -2048,13 +1868,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -2130,13 +1944,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -2219,13 +2027,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63", "reference": "1069c7a3fca74578022fab6f81643248d02f8e63", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1.3", @@ -2314,13 +2116,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/var-exporter/zipball/be74908a6942fdd331554b3cec27ff41b45ccad4", "reference": "be74908a6942fdd331554b3cec27ff41b45ccad4", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.2.5", @@ -2383,23 +2179,17 @@ }, { "name": "taoser/think-addons", - "version": "v1.0.6", + "version": "v1.0.9", "source": { "type": "git", "url": "https://github.com/taoser/think-addons.git", - "reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541" + "reference": "00112adf200b897deecbd1bbabc33ad22377b008" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/taoser/think-addons/zipball/e6e35bfd8b93dc469ebb5c5530ba350131bd7541", - "reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/taoser/think-addons/zipball/00112adf200b897deecbd1bbabc33ad22377b008", + "reference": "00112adf200b897deecbd1bbabc33ad22377b008", + "shasum": "" }, "require": { "php": ">=7.1.0", @@ -2440,9 +2230,9 @@ "description": "The ThinkPHP6 Addons Package", "support": { "issues": "https://github.com/taoser/think-addons/issues", - "source": "https://github.com/taoser/think-addons/tree/v1.0.6" + "source": "https://github.com/taoser/think-addons/tree/v1.0.9" }, - "time": "2022-10-06T13:11:38+00:00" + "time": "2023-06-10T05:08:45+00:00" }, { "name": "taoser/think-auth", @@ -2456,13 +2246,7 @@ "type": "zip", "url": "https://api.github.com/repos/taoser/think-auth/zipball/d3aa853b7d2a34624bcc566150105f2815e68ad0", "reference": "d3aa853b7d2a34624bcc566150105f2815e68ad0", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1.0", @@ -2515,13 +2299,7 @@ "type": "zip", "url": "https://api.github.com/repos/taoser/think-setarr/zipball/6651c31ef42417a6294ef08e6fb970917b7e7f86", "reference": "6651c31ef42417a6294ef08e6fb970917b7e7f86", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.2.0" @@ -2561,13 +2339,7 @@ "type": "zip", "url": "https://api.github.com/repos/tighten/collect/zipball/07eed6cf7441c7a69c379fdcb118eec1a1fdd0e6", "reference": "07eed6cf7441c7a69c379fdcb118eec1a1fdd0e6", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.3|^8.0", @@ -2621,13 +2393,7 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/framework/zipball/7c324e7011246f0064b055b62ab9c3921cf0a041", "reference": "7c324e7011246f0064b055b62ab9c3921cf0a041", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-json": "*", @@ -2692,13 +2458,7 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-captcha/zipball/b1ef360670578214edeebcf824aaf6ab7ee0528b", "reference": "b1ef360670578214edeebcf824aaf6ab7ee0528b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "topthink/framework": "^6.0|^8.0" @@ -2751,13 +2511,7 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-helper/zipball/769acbe50a4274327162f9c68ec2e89a38eb2aff", "reference": "769acbe50a4274327162f9c68ec2e89a38eb2aff", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1.0" @@ -2803,13 +2557,7 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-installer/zipball/38ba647706e35d6704b5d370c06f8a160b635f88", "reference": "38ba647706e35d6704b5d370c06f8a160b635f88", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "composer-plugin-api": "^1.0||^2.0" @@ -2844,23 +2592,17 @@ }, { "name": "topthink/think-migration", - "version": "v3.0.4", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/top-think/think-migration.git", - "reference": "c5880669b277762d5ff935e551bc0d5c71de6811" + "reference": "7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-migration/zipball/c5880669b277762d5ff935e551bc0d5c71de6811", - "reference": "c5880669b277762d5ff935e551bc0d5c71de6811", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/top-think/think-migration/zipball/7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca", + "reference": "7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca", + "shasum": "" }, "require": { "topthink/framework": "^6.0", @@ -2898,9 +2640,9 @@ ], "support": { "issues": "https://github.com/top-think/think-migration/issues", - "source": "https://github.com/top-think/think-migration/tree/v3.0.4" + "source": "https://github.com/top-think/think-migration/tree/v3.0.5" }, - "time": "2022-10-26T07:57:54+00:00" + "time": "2023-02-26T13:16:22+00:00" }, { "name": "topthink/think-multi-app", @@ -2914,13 +2656,7 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-multi-app/zipball/4055a6187296ac16c0bc7bbab4ed5d92f82f791c", "reference": "4055a6187296ac16c0bc7bbab4ed5d92f82f791c", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1.0", @@ -2968,13 +2704,7 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-orm/zipball/10528ebf4a5106b19c3bac9c6deae7a67ff49de6", "reference": "10528ebf4a5106b19c3bac9c6deae7a67ff49de6", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-json": "*", @@ -3029,13 +2759,7 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-template/zipball/6d25642ae0e306166742fd7073dc7a159e18073c", "reference": "6d25642ae0e306166742fd7073dc7a159e18073c", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1.0", @@ -3076,13 +2800,7 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-view/zipball/edce0ae2c9551ab65f9e94a222604b0dead3576d", "reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1.0", @@ -3123,13 +2841,7 @@ "type": "zip", "url": "https://api.github.com/repos/wamkj/thinkphp6.0-databackup/zipball/28a0e406d827132942723a3c9f69bb20c98e652f", "reference": "28a0e406d827132942723a3c9f69bb20c98e652f", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1.0", @@ -3174,13 +2886,7 @@ "type": "zip", "url": "https://api.github.com/repos/walkor/channel/zipball/fbfb81c7ebc5858c4053f226cbb5d15fe670ff6e", "reference": "fbfb81c7ebc5858c4053f226cbb5d15fe670ff6e", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "workerman/workerman": ">=4.0.12" @@ -3204,23 +2910,17 @@ }, { "name": "workerman/phpsocket.io", - "version": "v1.1.16", + "version": "v1.1.17", "source": { "type": "git", "url": "https://github.com/walkor/phpsocket.io.git", - "reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304" + "reference": "fb51151fd86414548e7cd9321c066c7b60983f8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/f4dc14e69e9d0d8ce69c6180f93b76b7743f2304", - "reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/fb51151fd86414548e7cd9321c066c7b60983f8c", + "reference": "fb51151fd86414548e7cd9321c066c7b60983f8c", + "shasum": "" }, "require": { "workerman/channel": ">=1.0.0", @@ -3242,7 +2942,7 @@ ], "support": { "issues": "https://github.com/walkor/phpsocket.io/issues", - "source": "https://github.com/walkor/phpsocket.io/tree/v1.1.16" + "source": "https://github.com/walkor/phpsocket.io/tree/v1.1.17" }, "funding": [ { @@ -3254,7 +2954,7 @@ "type": "patreon" } ], - "time": "2022-11-25T13:00:18+00:00" + "time": "2023-06-08T06:07:20+00:00" }, { "name": "workerman/workerman", @@ -3268,13 +2968,7 @@ "type": "zip", "url": "https://api.github.com/repos/walkor/workerman/zipball/e967b79f95b9251a72acb971be05623ec1a51e83", "reference": "e967b79f95b9251a72acb971be05623ec1a51e83", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.0" @@ -3337,13 +3031,7 @@ "type": "zip", "url": "https://api.github.com/repos/yansongda/pay/zipball/7ff004f05f9d6e288ff9b4deef585d30395f37f2", "reference": "7ff004f05f9d6e288ff9b4deef585d30395f37f2", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-bcmath": "*", @@ -3420,13 +3108,7 @@ "type": "zip", "url": "https://api.github.com/repos/yansongda/supports/zipball/c3f736efe169696cef94730976e604a61c345b5c", "reference": "c3f736efe169696cef94730976e604a61c345b5c", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.4" @@ -3487,13 +3169,7 @@ "type": "zip", "url": "https://api.github.com/repos/yzh52521/easyhttp/zipball/52cb9aba60a725bef77acd9c4c48ecc78931af9e", "reference": "52cb9aba60a725bef77acd9c4c48ecc78931af9e", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "guzzlehttp/guzzle": "^6.0|^7.0", @@ -3547,13 +3223,7 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-trace/zipball/136cd5d97e8bdb780e4b5c1637c588ed7ca3e142", "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1.0", diff --git a/config/taoler.php b/config/taoler.php index 3edfa78..6df864f 100644 --- a/config/taoler.php +++ b/config/taoler.php @@ -16,7 +16,7 @@ return [ // 应用名,此项不可更改 'appname' => 'TaoLer', // 版本配置 - 'version' => '2.3.7', + 'version' => '2.3.8', // 加盐 'salt' => 'taoler', // 数据库备份目录 diff --git a/public/static/res/css/global.css b/public/static/res/css/global.css index 823cb4d..159df97 100644 --- a/public/static/res/css/global.css +++ b/public/static/res/css/global.css @@ -525,7 +525,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co */ .layui-form-pane{position:relative; width:100%;} -.que-comments{position:absolute;right:20px;bottom:5px;} +.que-comments{position:absolute; right:15px; bottom:15px;} .wenda-user{height:200px; margin: 0,auto; text-align: center; pardding-top:20px;} .wenda-user .user-img{posation:relative; width:100%;} @@ -538,7 +538,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co .detail-zan span{padding-right:5px; color:#999; cursor:pointer;} .detail-zan span:hover{color:#666;} .detail-zan span .icon-zan{font-size: 22px;} -.detail-zan span img{height: 25px; border-radius: 100%;} +.detail-zan span img{height: 25px; width:25px; border-radius: 100%; object-fit: cover;} /* 详情页的底部操作条 */ @@ -600,6 +600,10 @@ body .fly-user-main{position: relative; min-height: 600px;} .fly-user-main .fly-none{min-height: 0;} .fly-panel-user[pad20]{padding-top: 5px;} +@media screen and (min-width: 768px) { + .fly-panel-user{height: calc(100vh - 280px)} +} + .fly-form-app{margin-top:30px;} .fly-form-app .iconfont{font-size:26px; padding: 0 5px;} .fly-form-app .icon-qq{color:#7CA9C9} diff --git a/public/static/res/mods/jie.js b/public/static/res/mods/jie.js index 7c6d2b0..6e49d55 100644 --- a/public/static/res/mods/jie.js +++ b/public/static/res/mods/jie.js @@ -234,27 +234,29 @@ layui.define('fly', function(exports){ }); }); } - } - ,del: function(li){ //删除评论 - layer.confirm('确认删除该回答么?', function(index){ - layer.close(index); - fly.json(commentJiedaDelete, { - id: li.data('id') - }, function(res){ - if(res.status === 0){ - var count = dom.jiedaCount.text()|0; - dom.jiedaCount.html(--count); - li.remove(); - //如果删除了最佳答案 - if(li.hasClass('jieda-daan')){ - $('.jie-status').removeClass('jie-status-ok').text('求解中'); + ,del: function(span){ //删除评论 + if(taonystatus == 0) { + layer.confirm('确认删除该回答么?', function(index){ + layer.close(index); + fly.json(commentJiedaDelete, { + id: li.data('id') + }, function(res){ + if(res.status === 0){ + var count = dom.jiedaCount.text()|0; + dom.jiedaCount.html(--count); + li.remove(); + //如果删除了最佳答案 + if(li.hasClass('jieda-daan')){ + $('.jie-status').removeClass('jie-status-ok').text('求解中'); + } + } else { + layer.msg(res.msg); } - } else { - layer.msg(res.msg); - } + }); }); - }); + } + } }; diff --git a/public/static/res/mods/toast.js b/public/static/res/mods/toast.js new file mode 100644 index 0000000..57c8ca5 --- /dev/null +++ b/public/static/res/mods/toast.js @@ -0,0 +1,1225 @@ +(function (root, factory) { + if(typeof define === 'function' && define.amd) { + define([], factory(root)); + } else if(typeof exports === 'object') { + module.exports = factory(root); + } else if (window.layui && layui.define) { + layui.define(function(exports){ + exports('toast',factory(root)) + }) + }else { + root.iziToast = factory(root); + } +})(typeof global !== 'undefined' ? global : window || this.window || this.global, function (root) { + + 'use strict'; + + var $iziToast = {}, + PLUGIN_NAME = 'iziToast', + BODY = document.querySelector('body'), + ISMOBILE = (/Mobi/.test(navigator.userAgent)) ? true : false, + ISCHROME = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor), + ISFIREFOX = typeof InstallTrigger !== 'undefined', + ACCEPTSTOUCH = 'ontouchstart' in document.documentElement, + POSITIONS = ['bottomRight','bottomLeft','bottomCenter','topRight','topLeft','topCenter','center'], + THEMES = { + info: { + color: 'blue', + icon: 'ico-info' + }, + success: { + color: 'green', + icon: 'ico-success' + }, + warning: { + color: 'orange', + icon: 'ico-warning' + }, + error: { + color: 'red', + icon: 'ico-error' + }, + question: { + color: 'yellow', + icon: 'ico-question' + } + }, + MOBILEWIDTH = 568, + CONFIG = {}; + + $iziToast.children = {}; + + // Default settings + var defaults = { + id: null, + class: '', + title: '', + titleColor: '', + titleSize: '', + titleLineHeight: '', + message: '', + messageColor: '', + messageSize: '', + messageLineHeight: '', + backgroundColor: '', + theme: 'light', // dark + color: '', // blue, red, green, yellow + icon: '', + iconText: '', + iconColor: '', + iconUrl: null, + image: '', + imageWidth: 50, + maxWidth: null, + zindex: null, + layout: 2, + balloon: false, + close: true, + closeOnEscape: false, + closeOnClick: false, + displayMode: 0, + position: 'topCenter', // bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, center + target: '', + targetFirst: true, + timeout: 3000, // 默认3秒 + rtl: false, + animateInside: false, // 动画效果 + drag: true, + pauseOnHover: true, + resetOnHover: false, + progressBar: false, + progressBarColor: '', + progressBarEasing: 'linear', + overlay: false, + overlayClose: false, + overlayColor: 'rgba(0, 0, 0, 0.6)', + transitionIn: 'fadeInDown', // bounceInLeft, bounceInRight, bounceInUp, bounceInDown, fadeIn, fadeInDown, fadeInUp, fadeInLeft, fadeInRight, flipInX + transitionOut: 'fadeOut', // fadeOut, fadeOutUp, fadeOutDown, fadeOutLeft, fadeOutRight, flipOutX + transitionInMobile: 'bounceInDown', + transitionOutMobile: 'fadeOutUp', + buttons: {}, + inputs: {}, + onOpening: function () {}, + onOpened: function () {}, + onClosing: function () {}, + onClosed: function () {} + }; + + if(!('remove' in Element.prototype)) { + Element.prototype.remove = function() { + if(this.parentNode) { + this.parentNode.removeChild(this); + } + }; + } + + if(typeof window.CustomEvent !== 'function') { + var CustomEventPolyfill = function (event, params) { + params = params || { bubbles: false, cancelable: false, detail: undefined }; + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); + return evt; + }; + + CustomEventPolyfill.prototype = window.Event.prototype; + + window.CustomEvent = CustomEventPolyfill; + } + + var forEach = function (collection, callback, scope) { + if(Object.prototype.toString.call(collection) === '[object Object]') { + for (var prop in collection) { + if(Object.prototype.hasOwnProperty.call(collection, prop)) { + callback.call(scope, collection[prop], prop, collection); + } + } + } else { + if(collection){ + for (var i = 0, len = collection.length; i < len; i++) { + callback.call(scope, collection[i], i, collection); + } + } + } + }; + + var extend = function (defaults, options) { + var extended = {}; + forEach(defaults, function (value, prop) { + extended[prop] = defaults[prop]; + }); + forEach(options, function (value, prop) { + extended[prop] = options[prop]; + }); + return extended; + }; + + var createFragElem = function(htmlStr) { + var frag = document.createDocumentFragment(), + temp = document.createElement('div'); + temp.innerHTML = htmlStr; + while (temp.firstChild) { + frag.appendChild(temp.firstChild); + } + return frag; + }; + + var generateId = function(params) { + var newId = btoa(encodeURIComponent(params)); + return newId.replace(/=/g, ""); + }; + + var isColor = function(color){ + if( color.substring(0,1) == '#' || color.substring(0,3) == 'rgb' || color.substring(0,3) == 'hsl' ){ + return true; + } else { + return false; + } + }; + + var isBase64 = function(str) { + try { + return btoa(atob(str)) == str; + } catch (err) { + return false; + } + }; + + var drag = function() { + + return { + move: function(toast, instance, settings, xpos) { + + var opacity, + opacityRange = 0.3, + distance = 180; + + if(xpos !== 0){ + + toast.classList.add(PLUGIN_NAME+'-dragged'); + + toast.style.transform = 'translateX('+xpos + 'px)'; + + if(xpos > 0){ + opacity = (distance-xpos) / distance; + if(opacity < opacityRange){ + instance.hide(extend(settings, { transitionOut: 'fadeOutRight', transitionOutMobile: 'fadeOutRight' }), toast, 'drag'); + } + } else { + opacity = (distance+xpos) / distance; + if(opacity < opacityRange){ + instance.hide(extend(settings, { transitionOut: 'fadeOutLeft', transitionOutMobile: 'fadeOutLeft' }), toast, 'drag'); + } + } + toast.style.opacity = opacity; + + if(opacity < opacityRange){ + + if(ISCHROME || ISFIREFOX) + toast.style.left = xpos+'px'; + + toast.parentNode.style.opacity = opacityRange; + + this.stopMoving(toast, null); + } + } + + + }, + startMoving: function(toast, instance, settings, e) { + + e = e || window.event; + var posX = ((ACCEPTSTOUCH) ? e.touches[0].clientX : e.clientX), + toastLeft = toast.style.transform.replace('px)', ''); + toastLeft = toastLeft.replace('translateX(', ''); + var offsetX = posX - toastLeft; + + if(settings.transitionIn){ + toast.classList.remove(settings.transitionIn); + } + if(settings.transitionInMobile){ + toast.classList.remove(settings.transitionInMobile); + } + toast.style.transition = ''; + + if(ACCEPTSTOUCH) { + document.ontouchmove = function(e) { + e.preventDefault(); + e = e || window.event; + var posX = e.touches[0].clientX, + finalX = posX - offsetX; + drag.move(toast, instance, settings, finalX); + }; + } else { + document.onmousemove = function(e) { + e.preventDefault(); + e = e || window.event; + var posX = e.clientX, + finalX = posX - offsetX; + drag.move(toast, instance, settings, finalX); + }; + } + + }, + stopMoving: function(toast, e) { + + if(ACCEPTSTOUCH) { + document.ontouchmove = function() {}; + } else { + document.onmousemove = function() {}; + } + + toast.style.opacity = ''; + toast.style.transform = ''; + + if(toast.classList.contains(PLUGIN_NAME+'-dragged')){ + + toast.classList.remove(PLUGIN_NAME+'-dragged'); + + toast.style.transition = 'transform 0.4s ease, opacity 0.4s ease'; + setTimeout(function() { + toast.style.transition = ''; + }, 400); + } + + } + }; + + }(); + + $iziToast.setSetting = function (ref, option, value) { + + $iziToast.children[ref][option] = value; + + }; + + $iziToast.getSetting = function (ref, option) { + + return $iziToast.children[ref][option]; + + }; + + $iziToast.destroy = function () { + + forEach(document.querySelectorAll('.'+PLUGIN_NAME+'-overlay'), function(element, index) { + element.remove(); + }); + + forEach(document.querySelectorAll('.'+PLUGIN_NAME+'-wrapper'), function(element, index) { + element.remove(); + }); + + forEach(document.querySelectorAll('.'+PLUGIN_NAME), function(element, index) { + element.remove(); + }); + + this.children = {}; + + // Remove event listeners + document.removeEventListener(PLUGIN_NAME+'-opened', {}, false); + document.removeEventListener(PLUGIN_NAME+'-opening', {}, false); + document.removeEventListener(PLUGIN_NAME+'-closing', {}, false); + document.removeEventListener(PLUGIN_NAME+'-closed', {}, false); + document.removeEventListener('keyup', {}, false); + + // Reset variables + CONFIG = {}; + }; + + /** + * Initialize Plugin + * @public + * @param {Object} options User settings + */ + $iziToast.settings = function (options) { + + // Destroy any existing initializations + $iziToast.destroy(); + + CONFIG = options; + defaults = extend(defaults, options || {}); + }; + + + /** + * Building themes functions. + * @public + * @param {Object} options User settings + */ + forEach(THEMES, function (theme, name) { + + $iziToast[name] = function (options) { + + var settings = extend(CONFIG, options || {}); + settings = extend(theme, settings || {}); + + this.show(settings); + }; + + }); + + + /** + * Do the calculation to move the progress bar + * @private + */ + $iziToast.progress = function (options, $toast, callback) { + + + var that = this, + ref = $toast.getAttribute('data-iziToast-ref'), + settings = extend(this.children[ref], options || {}), + $elem = $toast.querySelector('.'+PLUGIN_NAME+'-progressbar div'); + + return { + start: function() { + + if(typeof settings.time.REMAINING == 'undefined'){ + + $toast.classList.remove(PLUGIN_NAME+'-reseted'); + + if($elem !== null){ + $elem.style.transition = 'width '+ settings.timeout +'ms '+settings.progressBarEasing; + $elem.style.width = '0%'; + } + + settings.time.START = new Date().getTime(); + settings.time.END = settings.time.START + settings.timeout; + settings.time.TIMER = setTimeout(function() { + + clearTimeout(settings.time.TIMER); + + if(!$toast.classList.contains(PLUGIN_NAME+'-closing')){ + + that.hide(settings, $toast, 'timeout'); + + if(typeof callback === 'function'){ + callback.apply(that); + } + } + + }, settings.timeout); + that.setSetting(ref, 'time', settings.time); + } + }, + pause: function() { + + if(typeof settings.time.START !== 'undefined' && !$toast.classList.contains(PLUGIN_NAME+'-paused') && !$toast.classList.contains(PLUGIN_NAME+'-reseted')){ + + $toast.classList.add(PLUGIN_NAME+'-paused'); + + settings.time.REMAINING = settings.time.END - new Date().getTime(); + + clearTimeout(settings.time.TIMER); + + that.setSetting(ref, 'time', settings.time); + + if($elem !== null){ + var computedStyle = window.getComputedStyle($elem), + propertyWidth = computedStyle.getPropertyValue('width'); + + $elem.style.transition = 'none'; + $elem.style.width = propertyWidth; + } + + if(typeof callback === 'function'){ + setTimeout(function() { + callback.apply(that); + }, 10); + } + } + }, + resume: function() { + + if(typeof settings.time.REMAINING !== 'undefined'){ + + $toast.classList.remove(PLUGIN_NAME+'-paused'); + + if($elem !== null){ + $elem.style.transition = 'width '+ settings.time.REMAINING +'ms '+settings.progressBarEasing; + $elem.style.width = '0%'; + } + + settings.time.END = new Date().getTime() + settings.time.REMAINING; + settings.time.TIMER = setTimeout(function() { + + clearTimeout(settings.time.TIMER); + + if(!$toast.classList.contains(PLUGIN_NAME+'-closing')){ + + that.hide(settings, $toast, 'timeout'); + + if(typeof callback === 'function'){ + callback.apply(that); + } + } + + + }, settings.time.REMAINING); + + that.setSetting(ref, 'time', settings.time); + } else { + this.start(); + } + }, + reset: function(){ + + clearTimeout(settings.time.TIMER); + + delete settings.time.REMAINING; + + that.setSetting(ref, 'time', settings.time); + + $toast.classList.add(PLUGIN_NAME+'-reseted'); + + $toast.classList.remove(PLUGIN_NAME+'-paused'); + + if($elem !== null){ + $elem.style.transition = 'none'; + $elem.style.width = '100%'; + } + + if(typeof callback === 'function'){ + setTimeout(function() { + callback.apply(that); + }, 10); + } + } + }; + + }; + + + /** + * Close the specific Toast + * @public + * @param {Object} options User settings + */ + $iziToast.hide = function (options, $toast, closedBy) { + + if(typeof $toast != 'object'){ + $toast = document.querySelector($toast); + } + + var that = this, + settings = extend(this.children[$toast.getAttribute('data-iziToast-ref')], options || {}); + settings.closedBy = closedBy || null; + + delete settings.time.REMAINING; + + $toast.classList.add(PLUGIN_NAME+'-closing'); + + // Overlay + (function(){ + + var $overlay = document.querySelector('.'+PLUGIN_NAME+'-overlay'); + if($overlay !== null){ + var refs = $overlay.getAttribute('data-iziToast-ref'); + refs = refs.split(','); + var index = refs.indexOf(String(settings.ref)); + + if(index !== -1){ + refs.splice(index, 1); + } + $overlay.setAttribute('data-iziToast-ref', refs.join()); + + if(refs.length === 0){ + $overlay.classList.remove('fadeIn'); + $overlay.classList.add('fadeOut'); + setTimeout(function() { + $overlay.remove(); + }, 700); + } + } + + })(); + + if(settings.transitionIn){ + $toast.classList.remove(settings.transitionIn); + } + + if(settings.transitionInMobile){ + $toast.classList.remove(settings.transitionInMobile); + } + + if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ + if(settings.transitionOutMobile) + $toast.classList.add(settings.transitionOutMobile); + } else { + if(settings.transitionOut) + $toast.classList.add(settings.transitionOut); + } + var H = $toast.parentNode.offsetHeight; + $toast.parentNode.style.height = H+'px'; + $toast.style.pointerEvents = 'none'; + + if(!ISMOBILE || window.innerWidth > MOBILEWIDTH){ + $toast.parentNode.style.transitionDelay = '0.2s'; + } + + try { + var event = new CustomEvent(PLUGIN_NAME+'-closing', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + setTimeout(function() { + + $toast.parentNode.style.height = '0px'; + $toast.parentNode.style.overflow = ''; + + setTimeout(function(){ + + delete that.children[settings.ref]; + + $toast.parentNode.remove(); + + try { + var event = new CustomEvent(PLUGIN_NAME+'-closed', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + if(typeof settings.onClosed !== 'undefined'){ + settings.onClosed.apply(null, [settings, $toast, closedBy]); + } + + }, 1000); + }, 200); + + + if(typeof settings.onClosing !== 'undefined'){ + settings.onClosing.apply(null, [settings, $toast, closedBy]); + } + }; + + /** + * Create and show the Toast + * @public + * @param {Object} options User settings + */ + $iziToast.show = function (options) { + + var that = this; + + // Merge user options with defaults + var settings = extend(CONFIG, options || {}); + settings = extend(defaults, settings); + settings.time = {}; + + if(settings.id === null){ + settings.id = generateId(settings.title+settings.message+settings.color); + } + + if(settings.displayMode === 1 || settings.displayMode == 'once'){ + try { + if(document.querySelectorAll('.'+PLUGIN_NAME+'#'+settings.id).length > 0){ + return false; + } + } catch (exc) { + console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+settings.id+'. Try to set an valid id.'); + } + } + + if(settings.displayMode === 2 || settings.displayMode == 'replace'){ + try { + forEach(document.querySelectorAll('.'+PLUGIN_NAME+'#'+settings.id), function(element, index) { + that.hide(settings, element, 'replaced'); + }); + } catch (exc) { + console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+settings.id+'. Try to set an valid id.'); + } + } + + settings.ref = new Date().getTime() + Math.floor((Math.random() * 10000000) + 1); + + $iziToast.children[settings.ref] = settings; + + var $DOM = { + body: document.querySelector('body'), + overlay: document.createElement('div'), + toast: document.createElement('div'), + toastBody: document.createElement('div'), + toastTexts: document.createElement('div'), + toastCapsule: document.createElement('div'), + cover: document.createElement('div'), + buttons: document.createElement('div'), + inputs: document.createElement('div'), + icon: !settings.iconUrl ? document.createElement('i') : document.createElement('img'), + wrapper: null + }; + + $DOM.toast.setAttribute('data-iziToast-ref', settings.ref); + $DOM.toast.appendChild($DOM.toastBody); + $DOM.toastCapsule.appendChild($DOM.toast); + + // CSS Settings + (function(){ + + $DOM.toast.classList.add(PLUGIN_NAME); + $DOM.toast.classList.add(PLUGIN_NAME+'-opening'); + $DOM.toastCapsule.classList.add(PLUGIN_NAME+'-capsule'); + $DOM.toastBody.classList.add(PLUGIN_NAME + '-body'); + $DOM.toastTexts.classList.add(PLUGIN_NAME + '-texts'); + + if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ + if(settings.transitionInMobile) + $DOM.toast.classList.add(settings.transitionInMobile); + } else { + if(settings.transitionIn) + $DOM.toast.classList.add(settings.transitionIn); + } + + if(settings.class){ + var classes = settings.class.split(' '); + forEach(classes, function (value, index) { + $DOM.toast.classList.add(value); + }); + } + + if(settings.id){ $DOM.toast.id = settings.id; } + + if(settings.rtl){ + $DOM.toast.classList.add(PLUGIN_NAME + '-rtl'); + $DOM.toast.setAttribute('dir', 'rtl'); + } + + if(settings.layout > 1){ $DOM.toast.classList.add(PLUGIN_NAME+'-layout'+settings.layout); } + + if(settings.balloon){ $DOM.toast.classList.add(PLUGIN_NAME+'-balloon'); } + + if(settings.maxWidth){ + if( !isNaN(settings.maxWidth) ){ + $DOM.toast.style.maxWidth = settings.maxWidth+'px'; + } else { + $DOM.toast.style.maxWidth = settings.maxWidth; + } + } + + if(settings.theme !== '' || settings.theme !== 'light') { + + $DOM.toast.classList.add(PLUGIN_NAME+'-theme-'+settings.theme); + } + + if(settings.color) { //#, rgb, rgba, hsl + + if( isColor(settings.color) ){ + $DOM.toast.style.background = settings.color; + } else { + $DOM.toast.classList.add(PLUGIN_NAME+'-color-'+settings.color); + } + } + + if(settings.backgroundColor) { + $DOM.toast.style.background = settings.backgroundColor; + if(settings.balloon){ + $DOM.toast.style.borderColor = settings.backgroundColor; + } + } + })(); + + // Cover image + (function(){ + if(settings.image) { + $DOM.cover.classList.add(PLUGIN_NAME + '-cover'); + $DOM.cover.style.width = settings.imageWidth + 'px'; + + if(isBase64(settings.image.replace(/ /g,''))){ + $DOM.cover.style.backgroundImage = 'url(data:image/png;base64,' + settings.image.replace(/ /g,'') + ')'; + } else { + $DOM.cover.style.backgroundImage = 'url(' + settings.image + ')'; + } + + if(settings.rtl){ + $DOM.toastBody.style.marginRight = (settings.imageWidth + 10) + 'px'; + } else { + $DOM.toastBody.style.marginLeft = (settings.imageWidth + 10) + 'px'; + } + $DOM.toast.appendChild($DOM.cover); + } + })(); + + // Button close + (function(){ + if(settings.close){ + + $DOM.buttonClose = document.createElement('button'); + $DOM.buttonClose.type = 'button'; + $DOM.buttonClose.classList.add(PLUGIN_NAME + '-close'); + $DOM.buttonClose.addEventListener('click', function (e) { + var button = e.target; + that.hide(settings, $DOM.toast, 'button'); + }); + $DOM.toast.appendChild($DOM.buttonClose); + } else { + if(settings.rtl){ + $DOM.toast.style.paddingLeft = '18px'; + } else { + $DOM.toast.style.paddingRight = '18px'; + } + } + })(); + + // Progress Bar & Timeout + (function(){ + + if(settings.progressBar){ + $DOM.progressBar = document.createElement('div'); + $DOM.progressBarDiv = document.createElement('div'); + $DOM.progressBar.classList.add(PLUGIN_NAME + '-progressbar'); + $DOM.progressBarDiv.style.background = settings.progressBarColor; + $DOM.progressBar.appendChild($DOM.progressBarDiv); + $DOM.toast.appendChild($DOM.progressBar); + } + + if(settings.timeout) { + + if(settings.pauseOnHover && !settings.resetOnHover){ + + $DOM.toast.addEventListener('mouseenter', function (e) { + that.progress(settings, $DOM.toast).pause(); + }); + $DOM.toast.addEventListener('mouseleave', function (e) { + that.progress(settings, $DOM.toast).resume(); + }); + } + + if(settings.resetOnHover){ + + $DOM.toast.addEventListener('mouseenter', function (e) { + that.progress(settings, $DOM.toast).reset(); + }); + $DOM.toast.addEventListener('mouseleave', function (e) { + that.progress(settings, $DOM.toast).start(); + }); + } + } + })(); + + // Icon + (function(){ + + if(settings.iconUrl) { + + $DOM.icon.setAttribute('class', PLUGIN_NAME + '-icon'); + $DOM.icon.setAttribute('src', settings.iconUrl); + + } else if(settings.icon) { + $DOM.icon.setAttribute('class', PLUGIN_NAME + '-icon ' + settings.icon); + + if(settings.iconText){ + $DOM.icon.appendChild(document.createTextNode(settings.iconText)); + } + + if(settings.iconColor){ + $DOM.icon.style.color = settings.iconColor; + } + } + + if(settings.icon || settings.iconUrl) { + + if(settings.rtl){ + $DOM.toastBody.style.paddingRight = '33px'; + } else { + $DOM.toastBody.style.paddingLeft = '33px'; + } + + $DOM.toastBody.appendChild($DOM.icon); + } + + })(); + + // Title & Message + (function(){ + if(settings.title.length > 0) { + + $DOM.strong = document.createElement('strong'); + $DOM.strong.classList.add(PLUGIN_NAME + '-title'); + $DOM.strong.appendChild(createFragElem(settings.title)); + $DOM.toastTexts.appendChild($DOM.strong); + + if(settings.titleColor) { + $DOM.strong.style.color = settings.titleColor; + } + if(settings.titleSize) { + if( !isNaN(settings.titleSize) ){ + $DOM.strong.style.fontSize = settings.titleSize+'px'; + } else { + $DOM.strong.style.fontSize = settings.titleSize; + } + } + if(settings.titleLineHeight) { + if( !isNaN(settings.titleSize) ){ + $DOM.strong.style.lineHeight = settings.titleLineHeight+'px'; + } else { + $DOM.strong.style.lineHeight = settings.titleLineHeight; + } + } + } + + if(settings.message.length > 0) { + + $DOM.p = document.createElement('p'); + $DOM.p.classList.add(PLUGIN_NAME + '-message'); + $DOM.p.appendChild(createFragElem(settings.message)); + $DOM.toastTexts.appendChild($DOM.p); + + if(settings.messageColor) { + $DOM.p.style.color = settings.messageColor; + } + if(settings.messageSize) { + if( !isNaN(settings.titleSize) ){ + $DOM.p.style.fontSize = settings.messageSize+'px'; + } else { + $DOM.p.style.fontSize = settings.messageSize; + } + } + if(settings.messageLineHeight) { + + if( !isNaN(settings.titleSize) ){ + $DOM.p.style.lineHeight = settings.messageLineHeight+'px'; + } else { + $DOM.p.style.lineHeight = settings.messageLineHeight; + } + } + } + + if(settings.title.length > 0 && settings.message.length > 0) { + if(settings.rtl){ + $DOM.strong.style.marginLeft = '10px'; + } else if(settings.layout !== 2 && !settings.rtl) { + $DOM.strong.style.marginRight = '10px'; + } + } + })(); + + $DOM.toastBody.appendChild($DOM.toastTexts); + + // Inputs + var $inputs; + (function(){ + if(settings.inputs.length > 0) { + + $DOM.inputs.classList.add(PLUGIN_NAME + '-inputs'); + + forEach(settings.inputs, function (value, index) { + $DOM.inputs.appendChild(createFragElem(value[0])); + + $inputs = $DOM.inputs.childNodes; + + $inputs[index].classList.add(PLUGIN_NAME + '-inputs-child'); + + if(value[3]){ + setTimeout(function() { + $inputs[index].focus(); + }, 300); + } + + $inputs[index].addEventListener(value[1], function (e) { + var ts = value[2]; + return ts(that, $DOM.toast, this, e); + }); + }); + $DOM.toastBody.appendChild($DOM.inputs); + } + })(); + + // Buttons + (function(){ + if(settings.buttons.length > 0) { + + $DOM.buttons.classList.add(PLUGIN_NAME + '-buttons'); + + forEach(settings.buttons, function (value, index) { + $DOM.buttons.appendChild(createFragElem(value[0])); + + var $btns = $DOM.buttons.childNodes; + + $btns[index].classList.add(PLUGIN_NAME + '-buttons-child'); + + if(value[2]){ + setTimeout(function() { + $btns[index].focus(); + }, 300); + } + + $btns[index].addEventListener('click', function (e) { + e.preventDefault(); + var ts = value[1]; + return ts(that, $DOM.toast, this, e, $inputs); + }); + }); + } + $DOM.toastBody.appendChild($DOM.buttons); + })(); + + if(settings.message.length > 0 && (settings.inputs.length > 0 || settings.buttons.length > 0)) { + $DOM.p.style.marginBottom = '0'; + } + + if(settings.inputs.length > 0 || settings.buttons.length > 0){ + if(settings.rtl){ + $DOM.toastTexts.style.marginLeft = '10px'; + } else { + $DOM.toastTexts.style.marginRight = '10px'; + } + if(settings.inputs.length > 0 && settings.buttons.length > 0){ + if(settings.rtl){ + $DOM.inputs.style.marginLeft = '8px'; + } else { + $DOM.inputs.style.marginRight = '8px'; + } + } + } + + // Wrap + (function(){ + $DOM.toastCapsule.style.visibility = 'hidden'; + setTimeout(function() { + var H = $DOM.toast.offsetHeight; + var style = $DOM.toast.currentStyle || window.getComputedStyle($DOM.toast); + var marginTop = style.marginTop; + marginTop = marginTop.split('px'); + marginTop = parseInt(marginTop[0]); + var marginBottom = style.marginBottom; + marginBottom = marginBottom.split('px'); + marginBottom = parseInt(marginBottom[0]); + + $DOM.toastCapsule.style.visibility = ''; + $DOM.toastCapsule.style.height = (H+marginBottom+marginTop)+'px'; + + setTimeout(function() { + $DOM.toastCapsule.style.height = 'auto'; + if(settings.target){ + $DOM.toastCapsule.style.overflow = 'visible'; + } + }, 500); + + if(settings.timeout) { + that.progress(settings, $DOM.toast).start(); + } + }, 100); + })(); + + // Target + (function(){ + var position = settings.position; + + if(settings.target){ + + $DOM.wrapper = document.querySelector(settings.target); + $DOM.wrapper.classList.add(PLUGIN_NAME + '-target'); + + if(settings.targetFirst) { + $DOM.wrapper.insertBefore($DOM.toastCapsule, $DOM.wrapper.firstChild); + } else { + $DOM.wrapper.appendChild($DOM.toastCapsule); + } + + } else { + + if( POSITIONS.indexOf(settings.position) == -1 ){ + console.warn('['+PLUGIN_NAME+'] Incorrect position.\nIt can be › ' + POSITIONS); + return; + } + + if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ + if(settings.position == 'bottomLeft' || settings.position == 'bottomRight' || settings.position == 'bottomCenter'){ + position = PLUGIN_NAME+'-wrapper-bottomCenter'; + } + else if(settings.position == 'topLeft' || settings.position == 'topRight' || settings.position == 'topCenter'){ + position = PLUGIN_NAME+'-wrapper-topCenter'; + } + else { + position = PLUGIN_NAME+'-wrapper-center'; + } + } else { + position = PLUGIN_NAME+'-wrapper-'+position; + } + $DOM.wrapper = document.querySelector('.' + PLUGIN_NAME + '-wrapper.'+position); + + if(!$DOM.wrapper) { + $DOM.wrapper = document.createElement('div'); + $DOM.wrapper.classList.add(PLUGIN_NAME + '-wrapper'); + $DOM.wrapper.classList.add(position); + document.body.appendChild($DOM.wrapper); + } + if(settings.position == 'topLeft' || settings.position == 'topCenter' || settings.position == 'topRight'){ + $DOM.wrapper.insertBefore($DOM.toastCapsule, $DOM.wrapper.firstChild); + } else { + $DOM.wrapper.appendChild($DOM.toastCapsule); + } + } + + if(!isNaN(settings.zindex)) { + $DOM.wrapper.style.zIndex = settings.zindex; + } else { + console.warn('['+PLUGIN_NAME+'] Invalid zIndex.'); + } + })(); + + // Overlay + (function(){ + + if(settings.overlay) { + + if( document.querySelector('.'+PLUGIN_NAME+'-overlay.fadeIn') !== null ){ + + $DOM.overlay = document.querySelector('.'+PLUGIN_NAME+'-overlay'); + $DOM.overlay.setAttribute('data-iziToast-ref', $DOM.overlay.getAttribute('data-iziToast-ref') + ',' + settings.ref); + + if(!isNaN(settings.zindex) && settings.zindex !== null) { + $DOM.overlay.style.zIndex = settings.zindex-1; + } + + } else { + + $DOM.overlay.classList.add(PLUGIN_NAME+'-overlay'); + $DOM.overlay.classList.add('fadeIn'); + $DOM.overlay.style.background = settings.overlayColor; + $DOM.overlay.setAttribute('data-iziToast-ref', settings.ref); + if(!isNaN(settings.zindex) && settings.zindex !== null) { + $DOM.overlay.style.zIndex = settings.zindex-1; + } + document.querySelector('body').appendChild($DOM.overlay); + } + + if(settings.overlayClose) { + + $DOM.overlay.removeEventListener('click', {}); + $DOM.overlay.addEventListener('click', function (e) { + that.hide(settings, $DOM.toast, 'overlay'); + }); + } else { + $DOM.overlay.removeEventListener('click', {}); + } + } + })(); + + // Inside animations + (function(){ + if(settings.animateInside){ + $DOM.toast.classList.add(PLUGIN_NAME+'-animateInside'); + + var animationTimes = [200, 100, 300]; + if(settings.transitionIn == 'bounceInLeft' || settings.transitionIn == 'bounceInRight'){ + animationTimes = [400, 200, 400]; + } + + if(settings.title.length > 0) { + setTimeout(function(){ + $DOM.strong.classList.add('slideIn'); + }, animationTimes[0]); + } + + if(settings.message.length > 0) { + setTimeout(function(){ + $DOM.p.classList.add('slideIn'); + }, animationTimes[1]); + } + + if(settings.icon || settings.iconUrl) { + setTimeout(function(){ + $DOM.icon.classList.add('revealIn'); + }, animationTimes[2]); + } + + var counter = 150; + if(settings.buttons.length > 0 && $DOM.buttons) { + + setTimeout(function(){ + + forEach($DOM.buttons.childNodes, function(element, index) { + + setTimeout(function(){ + element.classList.add('revealIn'); + }, counter); + counter = counter + 150; + }); + + }, settings.inputs.length > 0 ? 150 : 0); + } + + if(settings.inputs.length > 0 && $DOM.inputs) { + counter = 150; + forEach($DOM.inputs.childNodes, function(element, index) { + + setTimeout(function(){ + element.classList.add('revealIn'); + }, counter); + counter = counter + 150; + }); + } + } + })(); + + settings.onOpening.apply(null, [settings, $DOM.toast]); + + try { + var event = new CustomEvent(PLUGIN_NAME + '-opening', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + setTimeout(function() { + + $DOM.toast.classList.remove(PLUGIN_NAME+'-opening'); + $DOM.toast.classList.add(PLUGIN_NAME+'-opened'); + + try { + var event = new CustomEvent(PLUGIN_NAME + '-opened', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + settings.onOpened.apply(null, [settings, $DOM.toast]); + }, 1000); + + if(settings.drag){ + + if(ACCEPTSTOUCH) { + + $DOM.toast.addEventListener('touchstart', function(e) { + drag.startMoving(this, that, settings, e); + }, false); + + $DOM.toast.addEventListener('touchend', function(e) { + drag.stopMoving(this, e); + }, false); + } else { + + $DOM.toast.addEventListener('mousedown', function(e) { + e.preventDefault(); + drag.startMoving(this, that, settings, e); + }, false); + + $DOM.toast.addEventListener('mouseup', function(e) { + e.preventDefault(); + drag.stopMoving(this, e); + }, false); + } + } + + if(settings.closeOnEscape) { + + document.addEventListener('keyup', function (evt) { + evt = evt || window.event; + if(evt.keyCode == 27) { + that.hide(settings, $DOM.toast, 'esc'); + } + }); + } + + if(settings.closeOnClick) { + $DOM.toast.addEventListener('click', function (evt) { + that.hide(settings, $DOM.toast, 'toast'); + }); + } + + that.toast = $DOM.toast; + }; + return $iziToast; +}); \ No newline at end of file diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index afef3fa..7824d8f 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -42,35 +42,37 @@ namespace Composer\Autoload; */ class ClassLoader { - /** @var ?string */ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr0 = array(); @@ -78,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array + * @var array */ private $classMap = array(); @@ -87,29 +88,29 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array + * @var array */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } /** - * @return string[] + * @return array> */ public function getPrefixes() { @@ -121,8 +122,7 @@ class ClassLoader } /** - * @return array[] - * @psalm-return array> + * @return array> */ public function getPrefixesPsr4() { @@ -130,8 +130,7 @@ class ClassLoader } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirs() { @@ -139,8 +138,7 @@ class ClassLoader } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirsPsr4() { @@ -148,8 +146,7 @@ class ClassLoader } /** - * @return string[] Array of classname => path - * @psalm-return array + * @return array Array of classname => path */ public function getClassMap() { @@ -157,8 +154,7 @@ class ClassLoader } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap + * @param array $classMap Class to filename map * * @return void */ @@ -175,24 +171,25 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -201,19 +198,19 @@ class ClassLoader $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -222,9 +219,9 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -232,17 +229,18 @@ class ClassLoader */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -252,18 +250,18 @@ class ClassLoader throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -272,8 +270,8 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories * * @return void */ @@ -290,8 +288,8 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -425,7 +423,8 @@ class ClassLoader public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } @@ -476,9 +475,9 @@ class ClassLoader } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { @@ -555,18 +554,26 @@ class ClassLoader return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index c6b54af..51e734a 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -98,7 +98,7 @@ class InstalledVersions { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -119,7 +119,7 @@ class InstalledVersions */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -328,7 +328,9 @@ class InstalledVersions if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -340,12 +342,17 @@ class InstalledVersions // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 5f5f0c7..bec7df4 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -33,25 +33,18 @@ class ComposerAutoloaderInit1b32198725235c8d6500c87262ef30c2 $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$files; - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire1b32198725235c8d6500c87262ef30c2($fileIdentifier, $file); + $filesToLoad = \Composer\Autoload\ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequire1b32198725235c8d6500c87262ef30c2($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index e4324f9..6d0f251 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -850,17 +850,17 @@ }, { "name": "laravel/serializable-closure", - "version": "v1.2.2", - "version_normalized": "1.2.2.0", + "version": "v1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae" + "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae", - "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", + "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", "shasum": "" }, "require": { @@ -872,7 +872,7 @@ "phpstan/phpstan": "^1.8.2", "symfony/var-dumper": "^5.4.11" }, - "time": "2022-09-08T13:45:54+00:00", + "time": "2023-01-30T18:31:20+00:00", "type": "library", "extra": { "branch-alias": { @@ -1394,24 +1394,18 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.7.1", - "version_normalized": "6.7.1.0", + "version": "v6.8.0", + "version_normalized": "6.8.0.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55" + "reference": "df16b615e371d81fb79e506277faea67a1be18f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55", - "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1", + "reference": "df16b615e371d81fb79e506277faea67a1be18f1", + "shasum": "" }, "require": { "ext-ctype": "*", @@ -1439,7 +1433,7 @@ "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, - "time": "2022-12-08T13:30:06+00:00", + "time": "2023-03-06T14:43:22+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1471,7 +1465,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0" }, "funding": [ { @@ -1648,24 +1642,24 @@ }, { "name": "psr/http-client", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", "shasum": "" }, "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2020-06-29T06:28:15+00:00", + "time": "2023-04-10T20:12:12+00:00", "type": "library", "extra": { "branch-alias": { @@ -1685,7 +1679,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -1697,7 +1691,7 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/master" + "source": "https://github.com/php-fig/http-client/tree/1.0.2" }, "install-path": "../psr/http-client" }, @@ -2377,24 +2371,18 @@ }, { "name": "taoser/think-addons", - "version": "v1.0.6", - "version_normalized": "1.0.6.0", + "version": "v1.0.9", + "version_normalized": "1.0.9.0", "source": { "type": "git", "url": "https://github.com/taoser/think-addons.git", - "reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541" + "reference": "00112adf200b897deecbd1bbabc33ad22377b008" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/taoser/think-addons/zipball/e6e35bfd8b93dc469ebb5c5530ba350131bd7541", - "reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/taoser/think-addons/zipball/00112adf200b897deecbd1bbabc33ad22377b008", + "reference": "00112adf200b897deecbd1bbabc33ad22377b008", + "shasum": "" }, "require": { "php": ">=7.1.0", @@ -2403,7 +2391,7 @@ "topthink/think-helper": "^3.0.0", "topthink/think-view": "^1.0" }, - "time": "2022-10-06T13:11:38+00:00", + "time": "2023-06-10T05:08:45+00:00", "type": "library", "extra": { "think": { @@ -2437,7 +2425,7 @@ "description": "The ThinkPHP6 Addons Package", "support": { "issues": "https://github.com/taoser/think-addons/issues", - "source": "https://github.com/taoser/think-addons/tree/v1.0.6" + "source": "https://github.com/taoser/think-addons/tree/v1.0.9" }, "install-path": "../taoser/think-addons" }, @@ -2856,24 +2844,18 @@ }, { "name": "topthink/think-migration", - "version": "v3.0.4", - "version_normalized": "3.0.4.0", + "version": "v3.0.5", + "version_normalized": "3.0.5.0", "source": { "type": "git", "url": "https://github.com/top-think/think-migration.git", - "reference": "c5880669b277762d5ff935e551bc0d5c71de6811" + "reference": "7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-migration/zipball/c5880669b277762d5ff935e551bc0d5c71de6811", - "reference": "c5880669b277762d5ff935e551bc0d5c71de6811", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/top-think/think-migration/zipball/7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca", + "reference": "7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca", + "shasum": "" }, "require": { "topthink/framework": "^6.0", @@ -2885,7 +2867,7 @@ "suggest": { "fzaninotto/faker": "Required to use the factory builder (^1.8)." }, - "time": "2022-10-26T07:57:54+00:00", + "time": "2023-02-26T13:16:22+00:00", "type": "library", "extra": { "think": { @@ -2913,7 +2895,7 @@ ], "support": { "issues": "https://github.com/top-think/think-migration/issues", - "source": "https://github.com/top-think/think-migration/tree/v3.0.4" + "source": "https://github.com/top-think/think-migration/tree/v3.0.5" }, "install-path": "../topthink/think-migration" }, @@ -3293,30 +3275,24 @@ }, { "name": "workerman/phpsocket.io", - "version": "v1.1.16", - "version_normalized": "1.1.16.0", + "version": "v1.1.17", + "version_normalized": "1.1.17.0", "source": { "type": "git", "url": "https://github.com/walkor/phpsocket.io.git", - "reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304" + "reference": "fb51151fd86414548e7cd9321c066c7b60983f8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/f4dc14e69e9d0d8ce69c6180f93b76b7743f2304", - "reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/fb51151fd86414548e7cd9321c066c7b60983f8c", + "reference": "fb51151fd86414548e7cd9321c066c7b60983f8c", + "shasum": "" }, "require": { "workerman/channel": ">=1.0.0", "workerman/workerman": ">=4.0.0" }, - "time": "2022-11-25T13:00:18+00:00", + "time": "2023-06-08T06:07:20+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3334,7 +3310,7 @@ ], "support": { "issues": "https://github.com/walkor/phpsocket.io/issues", - "source": "https://github.com/walkor/phpsocket.io/tree/v1.1.16" + "source": "https://github.com/walkor/phpsocket.io/tree/v1.1.17" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index cbca903..9b00b4a 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'taoser/taoler', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'c74d8b8052c4f2da4466d3ed181a1636e5c52c39', + 'reference' => 'f6d525db0665b6aa400834582aba220223d8244b', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -119,9 +119,9 @@ 'dev_requirement' => false, ), 'laravel/serializable-closure' => array( - 'pretty_version' => 'v1.2.2', - 'version' => '1.2.2.0', - 'reference' => '47afb7fae28ed29057fdca37e16a84f90cc62fae', + 'pretty_version' => 'v1.3.0', + 'version' => '1.3.0.0', + 'reference' => 'f23fe9d4e95255dacee1bf3525e0810d1a1b0f37', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/serializable-closure', 'aliases' => array(), @@ -191,9 +191,9 @@ 'dev_requirement' => false, ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.7.1', - 'version' => '6.7.1.0', - 'reference' => '49cd7ea3d2563f028d7811f06864a53b1f15ff55', + 'pretty_version' => 'v6.8.0', + 'version' => '6.8.0.0', + 'reference' => 'df16b615e371d81fb79e506277faea67a1be18f1', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), @@ -239,9 +239,9 @@ 'dev_requirement' => false, ), 'psr/http-client' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), @@ -349,16 +349,16 @@ 'taoser/taoler' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'c74d8b8052c4f2da4466d3ed181a1636e5c52c39', + 'reference' => 'f6d525db0665b6aa400834582aba220223d8244b', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'taoser/think-addons' => array( - 'pretty_version' => 'v1.0.6', - 'version' => '1.0.6.0', - 'reference' => 'e6e35bfd8b93dc469ebb5c5530ba350131bd7541', + 'pretty_version' => 'v1.0.9', + 'version' => '1.0.9.0', + 'reference' => '00112adf200b897deecbd1bbabc33ad22377b008', 'type' => 'library', 'install_path' => __DIR__ . '/../taoser/think-addons', 'aliases' => array(), @@ -428,9 +428,9 @@ 'dev_requirement' => false, ), 'topthink/think-migration' => array( - 'pretty_version' => 'v3.0.4', - 'version' => '3.0.4.0', - 'reference' => 'c5880669b277762d5ff935e551bc0d5c71de6811', + 'pretty_version' => 'v3.0.5', + 'version' => '3.0.5.0', + 'reference' => '7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-migration', 'aliases' => array(), @@ -500,9 +500,9 @@ 'dev_requirement' => false, ), 'workerman/phpsocket.io' => array( - 'pretty_version' => 'v1.1.16', - 'version' => '1.1.16.0', - 'reference' => 'f4dc14e69e9d0d8ce69c6180f93b76b7743f2304', + 'pretty_version' => 'v1.1.17', + 'version' => '1.1.17.0', + 'reference' => 'fb51151fd86414548e7cd9321c066c7b60983f8c', 'type' => 'library', 'install_path' => __DIR__ . '/../workerman/phpsocket.io', 'aliases' => array(), diff --git a/vendor/laravel/serializable-closure/README.md b/vendor/laravel/serializable-closure/README.md index a9c2513..b1efef3 100644 --- a/vendor/laravel/serializable-closure/README.md +++ b/vendor/laravel/serializable-closure/README.md @@ -53,6 +53,7 @@ echo $closure(); // james; 1. Creating **anonymous classes** within closures is not supported. 2. Using attributes within closures is not supported. +3. Serializing closures on REPL environments such as Laravel Tinker is not supported. ## Contributing diff --git a/vendor/laravel/serializable-closure/src/SerializableClosure.php b/vendor/laravel/serializable-closure/src/SerializableClosure.php index e7f9f0c..86422f9 100644 --- a/vendor/laravel/serializable-closure/src/SerializableClosure.php +++ b/vendor/laravel/serializable-closure/src/SerializableClosure.php @@ -62,6 +62,17 @@ class SerializableClosure return $this->serializable->getClosure(); } + /** + * Create a new unsigned serializable closure instance. + * + * @param Closure $closure + * @return \Laravel\SerializableClosure\UnsignedSerializableClosure + */ + public static function unsigned(Closure $closure) + { + return new UnsignedSerializableClosure($closure); + } + /** * Sets the serializable closure secret key. * diff --git a/vendor/laravel/serializable-closure/src/Serializers/Native.php b/vendor/laravel/serializable-closure/src/Serializers/Native.php index 0ff8410..4a04b98 100644 --- a/vendor/laravel/serializable-closure/src/Serializers/Native.php +++ b/vendor/laravel/serializable-closure/src/Serializers/Native.php @@ -10,6 +10,7 @@ use Laravel\SerializableClosure\Support\ClosureScope; use Laravel\SerializableClosure\Support\ClosureStream; use Laravel\SerializableClosure\Support\ReflectionClosure; use Laravel\SerializableClosure\Support\SelfReference; +use Laravel\SerializableClosure\UnsignedSerializableClosure; use ReflectionObject; use UnitEnum; @@ -379,7 +380,7 @@ class Native implements Serializable $item = $property->getValue($data); - if ($item instanceof SerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) { + if ($item instanceof SerializableClosure || $item instanceof UnsignedSerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) { $this->code['objects'][] = [ 'instance' => $data, 'property' => $property, @@ -452,7 +453,7 @@ class Native implements Serializable } unset($value); - } elseif (is_object($data) && ! $data instanceof SerializableClosure) { + } elseif (is_object($data) && ! $data instanceof SerializableClosure && ! $data instanceof UnsignedSerializableClosure) { if (isset($this->scope[$data])) { $data = $this->scope[$data]; diff --git a/vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php b/vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php new file mode 100644 index 0000000..1588e7c --- /dev/null +++ b/vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php @@ -0,0 +1,82 @@ +serializable = new Serializers\Native($closure); + } + + /** + * Resolve the closure with the given arguments. + * + * @return mixed + */ + public function __invoke() + { + if (\PHP_VERSION_ID < 70400) { + throw new PhpVersionNotSupportedException(); + } + + return call_user_func_array($this->serializable, func_get_args()); + } + + /** + * Gets the closure. + * + * @return \Closure + */ + public function getClosure() + { + if (\PHP_VERSION_ID < 70400) { + throw new PhpVersionNotSupportedException(); + } + + return $this->serializable->getClosure(); + } + + /** + * Get the serializable representation of the closure. + * + * @return array + */ + public function __serialize() + { + return [ + 'serializable' => $this->serializable, + ]; + } + + /** + * Restore the closure after serialization. + * + * @param array $data + * @return void + */ + public function __unserialize($data) + { + $this->serializable = $data['serializable']; + } +} diff --git a/vendor/phpmailer/phpmailer/README.md b/vendor/phpmailer/phpmailer/README.md index 3bba826..53e66f1 100644 --- a/vendor/phpmailer/phpmailer/README.md +++ b/vendor/phpmailer/phpmailer/README.md @@ -47,7 +47,7 @@ This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lg PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: ```json -"phpmailer/phpmailer": "^6.7.1" +"phpmailer/phpmailer": "^6.8.0" ``` or run diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION index 1d42024..8a1c5c7 100644 --- a/vendor/phpmailer/phpmailer/VERSION +++ b/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.7.1 \ No newline at end of file +6.8.0 \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php index d973a35..d2856e0 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php @@ -4,24 +4,32 @@ * Hindi PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Yash Karanke + * Rewrite and extension of the work by Jayanti Suthar */ $PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; +$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.'; $PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; $PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; $PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। '; $PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। '; +$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; $PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। '; $PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। '; $PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। '; $PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।'; $PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; +$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान'; +$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: '; $PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। '; $PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। '; -$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। '; +$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। '; +$PHPMAILER_LANG['smtp_detail'] = 'विवरण: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। '; $PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; -$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; diff --git a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php new file mode 100644 index 0000000..ab707d2 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php @@ -0,0 +1,247 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2023 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Configure PHPMailer with DSN string. + * + * @see https://en.wikipedia.org/wiki/Data_source_name + * + * @author Oleg Voronkovich + */ +class DSNConfigurator +{ + /** + * Create new PHPMailer instance configured by DSN. + * + * @param string $dsn DSN + * @param bool $exceptions Should we throw external exceptions? + * + * @return PHPMailer + */ + public static function mailer($dsn, $exceptions = null) + { + static $configurator = null; + + if (null === $configurator) { + $configurator = new DSNConfigurator(); + } + + return $configurator->configure(new PHPMailer($exceptions), $dsn); + } + + /** + * Configure PHPMailer instance with DSN string. + * + * @param PHPMailer $mailer PHPMailer instance + * @param string $dsn DSN + * + * @return PHPMailer + */ + public function configure(PHPMailer $mailer, $dsn) + { + $config = $this->parseDSN($dsn); + + $this->applyConfig($mailer, $config); + + return $mailer; + } + + /** + * Parse DSN string. + * + * @param string $dsn DSN + * + * @throws Exception If DSN is malformed + * + * @return array Configuration + */ + private function parseDSN($dsn) + { + $config = $this->parseUrl($dsn); + + if (false === $config || !isset($config['scheme']) || !isset($config['host'])) { + throw new Exception( + sprintf('Malformed DSN: "%s".', $dsn) + ); + } + + if (isset($config['query'])) { + parse_str($config['query'], $config['query']); + } + + return $config; + } + + /** + * Apply configuration to mailer. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + * + * @throws Exception If scheme is invalid + */ + private function applyConfig(PHPMailer $mailer, $config) + { + switch ($config['scheme']) { + case 'mail': + $mailer->isMail(); + break; + case 'sendmail': + $mailer->isSendmail(); + break; + case 'qmail': + $mailer->isQmail(); + break; + case 'smtp': + case 'smtps': + $mailer->isSMTP(); + $this->configureSMTP($mailer, $config); + break; + default: + throw new Exception( + sprintf( + 'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".', + $config['scheme'] + ) + ); + } + + if (isset($config['query'])) { + $this->configureOptions($mailer, $config['query']); + } + } + + /** + * Configure SMTP. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + */ + private function configureSMTP($mailer, $config) + { + $isSMTPS = 'smtps' === $config['scheme']; + + if ($isSMTPS) { + $mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; + } + + $mailer->Host = $config['host']; + + if (isset($config['port'])) { + $mailer->Port = $config['port']; + } elseif ($isSMTPS) { + $mailer->Port = SMTP::DEFAULT_SECURE_PORT; + } + + $mailer->SMTPAuth = isset($config['user']) || isset($config['pass']); + + if (isset($config['user'])) { + $mailer->Username = $config['user']; + } + + if (isset($config['pass'])) { + $mailer->Password = $config['pass']; + } + } + + /** + * Configure options. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $options Options + * + * @throws Exception If option is unknown + */ + private function configureOptions(PHPMailer $mailer, $options) + { + $allowedOptions = get_object_vars($mailer); + + unset($allowedOptions['Mailer']); + unset($allowedOptions['SMTPAuth']); + unset($allowedOptions['Username']); + unset($allowedOptions['Password']); + unset($allowedOptions['Hostname']); + unset($allowedOptions['Port']); + unset($allowedOptions['ErrorInfo']); + + $allowedOptions = \array_keys($allowedOptions); + + foreach ($options as $key => $value) { + if (!in_array($key, $allowedOptions)) { + throw new Exception( + sprintf( + 'Unknown option: "%s". Allowed values: "%s"', + $key, + implode('", "', $allowedOptions) + ) + ); + } + + switch ($key) { + case 'AllowEmpty': + case 'SMTPAutoTLS': + case 'SMTPKeepAlive': + case 'SingleTo': + case 'UseSendmailOptions': + case 'do_verp': + case 'DKIM_copyHeaderFields': + $mailer->$key = (bool) $value; + break; + case 'Priority': + case 'SMTPDebug': + case 'WordWrap': + $mailer->$key = (int) $value; + break; + default: + $mailer->$key = $value; + break; + } + } + } + + /** + * Parse a URL. + * Wrapper for the built-in parse_url function to work around a bug in PHP 5.5. + * + * @param string $url URL + * + * @return array|false + */ + protected function parseUrl($url) + { + if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) { + return parse_url($url); + } + + $chunks = explode('?', $url); + if (is_array($chunks)) { + $result = parse_url($chunks[0]); + if (is_array($result)) { + $result['query'] = $chunks[1]; + } + return $result; + } + + return false; + } +} diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php index e14cdbf..a644d2c 100644 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.7.1'; + const VERSION = '6.8.0'; /** * Error severity: message only, continue processing. @@ -2423,7 +2423,7 @@ class PHPMailer */ public function addrFormat($addr) { - if (empty($addr[1])) { //No name provided + if (!isset($addr[1]) || ($addr[1] === '')) { //No name provided return $this->secureHeader($addr[0]); } diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php index 4ae52fb..d025689 100644 --- a/vendor/phpmailer/phpmailer/src/POP3.php +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.7.1'; + const VERSION = '6.8.0'; /** * Default POP3 port number. diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php index 95b0d0b..fc4b781 100644 --- a/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.7.1'; + const VERSION = '6.8.0'; /** * SMTP line break constant. @@ -51,6 +51,13 @@ class SMTP */ const DEFAULT_PORT = 25; + /** + * The SMTPs port to use if one is not specified. + * + * @var int + */ + const DEFAULT_SECURE_PORT = 465; + /** * The maximum line length allowed by RFC 5321 section 4.5.3.1.6, * *excluding* a trailing CRLF break. @@ -187,6 +194,7 @@ class SMTP 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', + 'ZoneMTA' => '/[\d]{3} Message queued as (.*)/', 'Mailjet' => '/[\d]{3} OK queued as (.*)/', ]; diff --git a/vendor/psr/http-client/README.md b/vendor/psr/http-client/README.md index 6876b84..84af5c5 100644 --- a/vendor/psr/http-client/README.md +++ b/vendor/psr/http-client/README.md @@ -7,6 +7,6 @@ Note that this is not a HTTP Client implementation of its own. It is merely abst The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. -[psr-url]: http://www.php-fig.org/psr/psr-18 +[psr-url]: https://www.php-fig.org/psr/psr-18 [package-url]: https://packagist.org/packages/psr/http-client [implementation-url]: https://packagist.org/providers/psr/http-client-implementation diff --git a/vendor/psr/http-client/composer.json b/vendor/psr/http-client/composer.json index c195f8f..e4cab2f 100644 --- a/vendor/psr/http-client/composer.json +++ b/vendor/psr/http-client/composer.json @@ -7,12 +7,12 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "autoload": { "psr-4": { diff --git a/vendor/services.php b/vendor/services.php index 7c6ba8a..a1cbf9d 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'taoser\\addons\\Service', diff --git a/vendor/taoser/think-addons/src/addons/Controller.php b/vendor/taoser/think-addons/src/addons/Controller.php index 4985fff..15c232a 100644 --- a/vendor/taoser/think-addons/src/addons/Controller.php +++ b/vendor/taoser/think-addons/src/addons/Controller.php @@ -23,6 +23,10 @@ class Controller extends BaseController protected $addon_path; // 视图模型 protected $view; + // 插件配置 + protected $addon_config = ''; + // 插件信息 + protected $addon_info = ''; /** diff --git a/vendor/taoser/think-addons/src/helper.php b/vendor/taoser/think-addons/src/helper.php index 3864f4d..6646946 100644 --- a/vendor/taoser/think-addons/src/helper.php +++ b/vendor/taoser/think-addons/src/helper.php @@ -2,9 +2,9 @@ declare(strict_types=1); use think\facade\Event; -use think\facade\App; use think\facade\Route; use taoser\addons\Service; +use think\facade\App; use think\facade\Config; use think\facade\Cache; use think\helper\{ @@ -24,11 +24,8 @@ define('DS', DIRECTORY_SEPARATOR); spl_autoload_register(function ($class) { $class = ltrim($class, '\\'); -// $app = new think\App(); -// $dir = $app->getRootPath(); -// $dir = App::getRootPath(); - $dir = app()->getRootPath(); -// halt($dir); + + $dir = App::getRootPath(); $namespace = 'addons'; if (strpos($class, $namespace) === 0) { @@ -287,3 +284,37 @@ if (!function_exists('get_addons_menu')) { } } +if (!function_exists('get_addons_list')) { + /** + * 获得插件列表 + * @return array + */ + function get_addons_list() + { + $list = Cache::get('addonslist'); + if (empty($list)) { + $addonsPath = app()->getRootPath().'addons'.DS; // 插件列表 + $results = scandir($addonsPath); + $list = []; + foreach ($results as $name) { + if ($name === '.' or $name === '..') + continue; + if (is_file($addonsPath . $name)) + continue; + $addonDir = $addonsPath . $name . DS; + if (!is_dir($addonDir)) + continue; + if (!is_file($addonDir . 'Plugin' . '.php')) + continue; + $info = get_addons_info($name); + if (!isset($info['name'])) + continue; + $info['url'] =isset($info['url']) && $info['url'] ?(string)addons_url($info['url']):''; + $list[$name] = $info; + } + Cache::set('addonslist', $list); + } + return $list; + } + +} \ No newline at end of file diff --git a/vendor/topthink/think-migration/src/Command.php b/vendor/topthink/think-migration/src/Command.php index b4db21f..6551897 100644 --- a/vendor/topthink/think-migration/src/Command.php +++ b/vendor/topthink/think-migration/src/Command.php @@ -15,7 +15,8 @@ use Phinx\Db\Adapter\AdapterFactory; abstract class Command extends \think\console\Command { - + protected $adapter; + public function getAdapter() { if (isset($this->adapter)) { diff --git a/vendor/workerman/phpsocket.io/src/Engine/Protocols/WebSocket/RFC6455.php b/vendor/workerman/phpsocket.io/src/Engine/Protocols/WebSocket/RFC6455.php index a7c61e3..ed652d2 100644 --- a/vendor/workerman/phpsocket.io/src/Engine/Protocols/WebSocket/RFC6455.php +++ b/vendor/workerman/phpsocket.io/src/Engine/Protocols/WebSocket/RFC6455.php @@ -1,4 +1,5 @@ -websocketCurrentFrameLength有值说明当前fin为0,则缓冲websocket帧数据 - if($connection->websocketCurrentFrameLength) - { + if ($connection->websocketCurrentFrameLength) { // 如果当前帧数据未收全,则继续收 - if($connection->websocketCurrentFrameLength > $recv_len) - { + if ($connection->websocketCurrentFrameLength > $recv_len) { // 返回0,因为不清楚完整的数据包长度,需要等待fin=1的帧 return 0; } - } - else - { + } else { $data_len = ord($buffer[1]) & 127; $firstbyte = ord($buffer[0]); - $is_fin_frame = $firstbyte>>7; + $is_fin_frame = $firstbyte >> 7; $opcode = $firstbyte & 0xf; - switch($opcode) - { - // 附加数据帧 @todo 实现附加数据帧 + switch ($opcode) { + // 附加数据帧 @todo 实现附加数据帧 case 0x0: break; - // 文本数据帧 + // 文本数据帧 case 0x1: break; - // 二进制数据帧 + // 二进制数据帧 case 0x2: break; - // 关闭的包 + // 关闭的包 case 0x8: // 如果有设置onWebSocketClose回调,尝试执行 - if(isset($connection->onWebSocketClose)) - { + if (isset($connection->onWebSocketClose)) { call_user_func($connection->onWebSocketClose, $connection); } // 默认行为是关闭连接 - else - { + else { $connection->close(); } return 0; - // ping的包 + // ping的包 case 0x9: // 如果有设置onWebSocketPing回调,尝试执行 - if(isset($connection->onWebSocketPing)) - { + if (isset($connection->onWebSocketPing)) { call_user_func($connection->onWebSocketPing, $connection); } // 默认发送pong - else - { + else { $connection->send(pack('H*', '8a00'), true); } // 从接受缓冲区中消费掉该数据包 - if(!$data_len) - { + if (!$data_len) { $connection->consumeRecvBuffer(self::MIN_HEAD_LEN); return 0; } break; - // pong的包 + // pong的包 case 0xa: // 如果有设置onWebSocketPong回调,尝试执行 - if(isset($connection->onWebSocketPong)) - { + if (isset($connection->onWebSocketPong)) { call_user_func($connection->onWebSocketPong, $connection); } // 从接受缓冲区中消费掉该数据包 - if(!$data_len) - { + if (!$data_len) { $connection->consumeRecvBuffer(self::MIN_HEAD_LEN); return 0; } break; - // 错误的opcode - default : + // 错误的opcode + default: echo "error opcode $opcode and close websocket connection\n"; $connection->close(); return 0; } - + // websocket二进制数据 $head_len = self::MIN_HEAD_LEN; if ($data_len === 126) { $head_len = 8; - if($head_len > $recv_len) - { + if ($head_len > $recv_len) { return 0; } $pack = unpack('ntotal_len', substr($buffer, 2, 2)); $data_len = $pack['total_len']; } else if ($data_len === 127) { $head_len = 14; - if($head_len > $recv_len) - { + if ($head_len > $recv_len) { return 0; } $arr = unpack('N2', substr($buffer, 2, 8)); - $data_len = $arr[1]*4294967296 + $arr[2]; + $data_len = $arr[1] * 4294967296 + $arr[2]; } $current_frame_length = $head_len + $data_len; - if($is_fin_frame) - { + if ($is_fin_frame) { return $current_frame_length; - } - else - { + } else { $connection->websocketCurrentFrameLength = $current_frame_length; } } - + // 收到的数据刚好是一个frame - if($connection->websocketCurrentFrameLength == $recv_len) - { + if ($connection->websocketCurrentFrameLength == $recv_len) { self::decode($buffer, $connection); $connection->consumeRecvBuffer($connection->websocketCurrentFrameLength); $connection->websocketCurrentFrameLength = 0; return 0; } // 收到的数据大于一个frame - elseif($connection->websocketCurrentFrameLength < $recv_len) - { + elseif ($connection->websocketCurrentFrameLength < $recv_len) { self::decode(substr($buffer, 0, $connection->websocketCurrentFrameLength), $connection); $connection->consumeRecvBuffer($connection->websocketCurrentFrameLength); $current_frame_length = $connection->websocketCurrentFrameLength; @@ -181,46 +163,37 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface return self::input(substr($buffer, $current_frame_length), $connection); } // 收到的数据不足一个frame - else - { + else { return 0; } } - + /** * 打包 * @param string $buffer * @return string */ - public static function encode($buffer, ConnectionInterface $connection) + public static function encode(mixed $buffer, ConnectionInterface $connection): string { $len = strlen($buffer); - if(empty($connection->websocketHandshake)) - { + if (empty($connection->websocketHandshake)) { // 默认是utf8文本格式 $connection->websocketType = self::BINARY_TYPE_BLOB; } - + $first_byte = $connection->websocketType; - - if($len<=125) - { - $encode_buffer = $first_byte.chr($len).$buffer; + + if ($len <= 125) { + $encode_buffer = $first_byte . chr($len) . $buffer; + } else if ($len <= 65535) { + $encode_buffer = $first_byte . chr(126) . pack("n", $len) . $buffer; + } else { + $encode_buffer = $first_byte . chr(127) . pack("xxxxN", $len) . $buffer; } - else if($len<=65535) - { - $encode_buffer = $first_byte.chr(126).pack("n", $len).$buffer; - } - else - { - $encode_buffer = $first_byte.chr(127).pack("xxxxN", $len).$buffer; - } - + // 还没握手不能发数据,先将数据缓冲起来,等握手完毕后发送 - if(empty($connection->websocketHandshake)) - { - if(empty($connection->websocketTmpData)) - { + if (empty($connection->websocketHandshake)) { + if (empty($connection->websocketTmpData)) { // 临时数据缓冲 $connection->websocketTmpData = ''; } @@ -228,16 +201,16 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface // 返回空,阻止发送 return ''; } - + return $encode_buffer; } - + /** * 解包 * @param string $buffer * @return string */ - public static function decode($buffer, ConnectionInterface $connection) + public static function decode(string $buffer, ConnectionInterface $connection): mixed { $len = $masks = $data = $decoded = null; $len = ord($buffer[1]) & 127; @@ -254,19 +227,16 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface for ($index = 0; $index < strlen($data); $index++) { $decoded .= $data[$index] ^ $masks[$index % 4]; } - if($connection->websocketCurrentFrameLength) - { + if ($connection->websocketCurrentFrameLength) { $connection->websocketDataBuffer .= $decoded; return $connection->websocketDataBuffer; - } - else - { + } else { $decoded = $connection->websocketDataBuffer . $decoded; $connection->websocketDataBuffer = ''; return $decoded; } } - + /** * 处理websocket握手 * @param string $buffer @@ -276,33 +246,25 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface public static function dealHandshake($connection, $req, $res) { $headers = array(); - if(isset($connection->onWebSocketConnect)) - { - try - { + if (isset($connection->onWebSocketConnect)) { + try { call_user_func_array($connection->onWebSocketConnect, array($connection, $req, $res)); - } - catch (\Exception $e) - { + } catch (\Exception $e) { echo $e; } - if(!$res->writable) - { + if (!$res->writable) { return false; } } - - if(isset($req->headers['sec-websocket-key'])) - { + + if (isset($req->headers['sec-websocket-key'])) { $sec_websocket_key = $req->headers['sec-websocket-key']; - } - else - { + } else { $res->writeHead(400); $res->end('400 Bad Request
Upgrade to websocket but Sec-WebSocket-Key not found.'); return 0; } - + // 标记已经握手 $connection->websocketHandshake = true; // 缓冲fin为0的包,直到fin为1 @@ -313,8 +275,8 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface $connection->websocketCurrentFrameBuffer = ''; // blob or arraybuffer $connection->websocketType = self::BINARY_TYPE_BLOB; - - $sec_websocket_accept = base64_encode(sha1($sec_websocket_key.'258EAFA5-E914-47DA-95CA-C5AB0DC85B11',true)); + + $sec_websocket_accept = base64_encode(sha1($sec_websocket_key . '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', true)); $headers['Content-Length'] = 0; $headers['Upgrade'] = 'websocket'; $headers['Sec-WebSocket-Version'] = 13; @@ -322,14 +284,13 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface $headers['Sec-WebSocket-Accept'] = $sec_websocket_accept; $res->writeHead(101, '', $headers); $res->end(); - + // 握手后有数据要发送 - if(!empty($connection->websocketTmpData)) - { + if (!empty($connection->websocketTmpData)) { $connection->send($connection->websocketTmpData, true); $connection->websocketTmpData = ''; } - + return 0; } } diff --git a/vendor/workerman/phpsocket.io/src/Engine/Socket.php b/vendor/workerman/phpsocket.io/src/Engine/Socket.php index b7563df..683617f 100644 --- a/vendor/workerman/phpsocket.io/src/Engine/Socket.php +++ b/vendor/workerman/phpsocket.io/src/Engine/Socket.php @@ -1,8 +1,11 @@ id = $id; $this->server = $server; $this->request = $req; - $this->remoteAddress = $req->connection->getRemoteIp().':'.$req->connection->getRemotePort(); + $this->remoteAddress = $req->connection->getRemoteIp() . ':' . $req->connection->getRemotePort(); $this->setTransport($transport); $this->onOpen(); Debug::debug('Engine/Socket __construct'); @@ -39,9 +42,10 @@ class Socket extends Emitter { $this->upgrading = true; $this->upgradeTimeoutTimer = Timer::add( - $this->server->upgradeTimeout, + $this->server->upgradeTimeout, array($this, 'upgradeTimeoutCallback'), - array($transport), false + array($transport), + false ); $this->upgradeTransport = $transport; $transport->on('packet', array($this, 'onUpgradePacket')); @@ -52,22 +56,18 @@ class Socket extends Emitter public function onUpgradePacket($packet) { - if(empty($this->upgradeTransport)) - { - $this->onError('upgradeTransport empty'); - return; + if (empty($this->upgradeTransport)) { + $this->onError('upgradeTransport empty'); + return; } - if('ping' === $packet['type'] && (isset($packet['data']) && 'probe' === $packet['data'])) - { - $this->upgradeTransport->send(array(array('type'=> 'pong', 'data'=> 'probe'))); + if ('ping' === $packet['type'] && (isset($packet['data']) && 'probe' === $packet['data'])) { + $this->upgradeTransport->send(array(array('type' => 'pong', 'data' => 'probe'))); //$this->transport->shouldClose = function(){}; if ($this->checkIntervalTimer) { - Timer::del($this->checkIntervalTimer); - } + Timer::del($this->checkIntervalTimer); + } $this->checkIntervalTimer = Timer::add(0.5, array($this, 'check')); - } - else if('upgrade' === $packet['type'] && $this->readyState !== 'closed') - { + } else if ('upgrade' === $packet['type'] && $this->readyState !== 'closed') { $this->upgradeCleanup(); $this->upgraded = true; $this->clearTransport(); @@ -77,21 +77,16 @@ class Socket extends Emitter $this->upgradeTransport = null; $this->setPingTimeout(); $this->flush(); - if($this->readyState === 'closing') - { + if ($this->readyState === 'closing') { $this->transport->close(array($this, 'onClose')); } - } - else - { - if(!empty($this->upgradeTransport)) - { + } else { + if (!empty($this->upgradeTransport)) { $this->upgradeCleanup(); $this->upgradeTransport->close(); $this->upgradeTransport = null; } } - } @@ -100,8 +95,7 @@ class Socket extends Emitter $this->upgrading = false; Timer::del($this->checkIntervalTimer); Timer::del($this->upgradeTimeoutTimer); - if(!empty($this->upgradeTransport)) - { + if (!empty($this->upgradeTransport)) { $this->upgradeTransport->removeListener('packet', array($this, 'onUpgradePacket')); $this->upgradeTransport->removeListener('close', array($this, 'onUpgradeTransportClose')); $this->upgradeTransport->removeListener('error', array($this, 'onUpgradeTransportError')); @@ -118,8 +112,7 @@ class Socket extends Emitter { //echo $err; $this->upgradeCleanup(); - if($this->upgradeTransport) - { + if ($this->upgradeTransport) { $this->upgradeTransport->close(); $this->upgradeTransport = null; } @@ -129,12 +122,11 @@ class Socket extends Emitter { //echo("client did not complete upgrade - closing transport\n"); $this->upgradeCleanup(); - if('open' === $transport->readyState) - { - $transport->close(); + if ('open' === $transport->readyState) { + $transport->close(); } } - + public function setTransport($transport) { $this->transport = $transport; @@ -145,77 +137,74 @@ class Socket extends Emitter //this function will manage packet events (also message callbacks) $this->setupSendCallback(); } - + public function onOpen() { $this->readyState = 'open'; - + // sends an `open` packet $this->transport->sid = $this->id; $this->sendPacket('open', json_encode(array( - 'sid'=> $this->id - , 'upgrades' => $this->getAvailableUpgrades() - , 'pingInterval'=> $this->server->pingInterval*1000 - , 'pingTimeout'=> $this->server->pingTimeout*1000 + 'sid' => $this->id, 'upgrades' => $this->getAvailableUpgrades(), 'pingInterval' => $this->server->pingInterval * 1000, 'pingTimeout' => $this->server->pingTimeout * 1000 ))); - + $this->emit('open'); $this->setPingTimeout(); } - + public function onPacket($packet) { if ('open' === $this->readyState) { // export packet event $this->emit('packet', $packet); - + // Reset ping timeout on any packet, incoming data is a good sign of // other side's liveness $this->setPingTimeout(); switch ($packet['type']) { - + case 'ping': $this->sendPacket('pong'); $this->emit('heartbeat'); break; - + case 'error': $this->onClose('parse error'); break; - + case 'message': $this->emit('data', $packet['data']); $this->emit('message', $packet['data']); break; } - } - else - { - echo('packet received with closed socket'); + } else { + echo ('packet received with closed socket'); } - } - + } + public function check() { - if('polling' == $this->transport->name && $this->transport->writable) - { + if ('polling' == $this->transport->name && $this->transport->writable) { $this->transport->send(array(array('type' => 'noop'))); } } - - public function onError($err) + + public function onError($err) { $this->onClose('transport error', $err); } - + public function setPingTimeout() { if ($this->pingTimeoutTimer) { Timer::del($this->pingTimeoutTimer); } $this->pingTimeoutTimer = Timer::add( - $this->server->pingInterval + $this->server->pingTimeout , - array($this, 'pingTimeoutCallback'), null, false); + $this->server->pingInterval + $this->server->pingTimeout, + array($this, 'pingTimeoutCallback'), + null, + false + ); } public function pingTimeoutCallback() @@ -224,21 +213,26 @@ class Socket extends Emitter $this->onClose('ping timeout'); } - + public function clearTransport() { $this->transport->close(); Timer::del($this->pingTimeoutTimer); } - + public function onClose($reason = '', $description = null) { - if ('closed' !== $this->readyState) - { + if ('closed' !== $this->readyState) { Timer::del($this->pingTimeoutTimer); - Timer::del($this->checkIntervalTimer); + + if (!empty($this->checkIntervalTimer)) + Timer::del($this->checkIntervalTimer); + $this->checkIntervalTimer = null; - Timer::del($this->upgradeTimeoutTimer); + + if (!empty($this->checkIntervalTimer)) + Timer::del($this->upgradeTimeoutTimer); + // clean writeBuffer in next tick, so developers can still // grab the writeBuffer on 'close' event $this->writeBuffer = array(); @@ -251,74 +245,66 @@ class Socket extends Emitter $this->request = null; $this->upgradeTransport = null; $this->removeAllListeners(); - if(!empty($this->transport)) - { + if (!empty($this->transport)) { $this->transport->removeAllListeners(); $this->transport = null; } } } - + public function send($data, $options, $callback) { $this->sendPacket('message', $data, $callback); return $this; } - + public function write($data, $options = array(), $callback = null) { return $this->send($data, $options, $callback); } - + public function sendPacket($type, $data = null, $callback = null) { - if('closing' !== $this->readyState) - { + if ('closing' !== $this->readyState) { $packet = array( - 'type'=> $type + 'type' => $type ); - if($data !== null) - { + if ($data !== null) { $packet['data'] = $data; } // exports packetCreate event $this->emit('packetCreate', $packet); $this->writeBuffer[] = $packet; //add send callback to object - if($callback) - { + if ($callback) { $this->packetsFn[] = $callback; } $this->flush(); } } - - public function flush() + + public function flush() { - if ('closed' !== $this->readyState && $this->transport->writable - && $this->writeBuffer) - { + if ( + 'closed' !== $this->readyState && $this->transport->writable + && $this->writeBuffer + ) { $this->emit('flush', $this->writeBuffer); $this->server->emit('flush', $this, $this->writeBuffer); $wbuf = $this->writeBuffer; $this->writeBuffer = array(); - if($this->packetsFn) - { - if(!empty($this->transport->supportsFraming)) - { + if ($this->packetsFn) { + if (!empty($this->transport->supportsFraming)) { + $this->sentCallbackFn[] = $this->packetsFn; + } else { + // @todo check $this->sentCallbackFn[] = $this->packetsFn; - } - else - { - // @todo check - $this->sentCallbackFn[]=$this->packetsFn; } } $this->packetsFn = array(); $this->transport->send($wbuf); $this->emit('drain'); - if($this->server) - { + if ($this->server) { $this->server->emit('drain', $this); } } @@ -331,11 +317,10 @@ class Socket extends Emitter public function close() { - if ('open' !== $this->readyState) - { + if ('open' !== $this->readyState) { return; } - + $this->readyState = 'closing'; if ($this->writeBuffer) { @@ -356,24 +341,21 @@ class Socket extends Emitter { $self = $this; //the message was sent successfully, execute the callback - $this->transport->on('drain', array($this, 'onDrainCallback')); + $this->transport->on('drain', array($this, 'onDrainCallback')); } public function onDrainCallback() { - if ($this->sentCallbackFn) - { - $seqFn = array_shift($this->sentCallbackFn); - if(is_callable($seqFn)) - { - echo('executing send callback'); - call_user_func($seqFn, $this->transport); - }else if (is_array($seqFn)) { - echo('executing batch send callback'); - foreach($seqFn as $fn) - { - call_user_func($fn, $this->transport); - } + if ($this->sentCallbackFn) { + $seqFn = array_shift($this->sentCallbackFn); + if (is_callable($seqFn)) { + echo ('executing send callback'); + call_user_func($seqFn, $this->transport); + } else if (is_array($seqFn)) { + echo ('executing batch send callback'); + foreach ($seqFn as $fn) { + call_user_func($fn, $this->transport); + } } } } diff --git a/view/taoler/index/article/add.html b/view/taoler/index/article/add.html index 6745bec..7e2a149 100644 --- a/view/taoler/index/article/add.html +++ b/view/taoler/index/article/add.html @@ -192,30 +192,6 @@ }); }); - // 发布文章 - form.on("submit(article-add)", function (data) { - var field = data.field; - var index = layer.load(1); - $.ajax({ - type: "post", - url: "{:url('article/add')}", - data: field, - dataType: "json", - success: function (data) { - if (data.code === 0) { - notify.success(data.msg, function () { - location.href = data.url; - }); - } else { - notify.error(data.msg); - $("#captcha").attr("src", "{:captcha_src()}?" + Math.random()); - } - layer.close(index); - }, - }); - return false; - }); - // 改变标题颜色 colorpicker.render({ elem: "#color", @@ -235,7 +211,7 @@ data: { type: "zip" }, accept: "file", before: function(obj){ - layer.load(); + layer.load(0); }, done: function (res) { layer.closeAll('loading'); @@ -248,6 +224,30 @@ }, }); + // 发布文章 + form.on("submit(article-add)", function (data) { + var field = data.field; + var loadIndex = layer.load(2); + $.ajax({ + type: "post", + url: "{:url('article/add')}", + data: field, + dataType: "json", + success: function (res) { + layer.close(loadIndex); + if (res.code === 0) { + toast.success({title:"成功消息",message: res.msg}); + location.href = res.url; + } else { + toast.error({title:"失败消息",message:res.msg}); + $("#captcha").attr("src", "{:captcha_src()}?" + Math.random()); + } + layer.close(index); + }, + }); + return false; + }); + }); {// 编辑器} diff --git a/view/taoler/index/article/ask/detail.html b/view/taoler/index/article/ask/detail.html index 3a43ff2..f37baf5 100644 --- a/view/taoler/index/article/ask/detail.html +++ b/view/taoler/index/article/ask/detail.html @@ -75,46 +75,111 @@ {//评论内容}
- 评论 {article:comment_num} + 评论 {$article.comments_count} +
    {article:comment}
  • -
    -  {if($comment.user.vip > 0)}{/if} + {comment:uname}
    {comment:uname /} {if condition="$article.user_id eq $comment.user_id"}({:lang('poster')}){/if} + {comment:usign /} +
    +
    + {:hook('ipShow',$comment.user.city)}
    -
    {:hook('ipShow', $comment.user.city)}
    - {if $comment.cai == 1}{/if} -
    - {//加密未解密评论不可查看} - {if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))} -
    {comment:content /}
    -
    - {comment:zan /} - {:lang('reply')} - {//评论 编辑/删除/采纳/权限} -
    - {if ((session('user_id') == $comment.user_id) && (getLimtTime($comment.create_time) < 2)) OR ($user.auth ?? '')} - {:lang('edit')} - {:lang('delete')} - {/if} {if ($comment.cai == 0) && ((session('user_id') == $article.user_id) OR ($user.auth ?? '')) && ($article.jie == 0)/} - {:lang('accept')} - {/if} + {//加密未解密评论不可查看} + {if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))} + +
    {comment:content /}
    +
    + {eq name="comment.delete_time" value="0"} + + {comment:zan /} + + {:lang('reply')} + {//评论编辑删除采纳权限} +
    + {if ((session('user_id') == $comment.user_id) && (getLimtTime($comment.create_time) < 2)) OR ($user.auth ?? '')} + {:lang('edit')} + {:lang('delete')} + {/if} +
    + {/eq} + + {// 第二层回复} + {notempty name="$comment.children"} + {volist name="$comment.children" id="vo"} + +
    + +
    +
    {$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}
    +
    {$vo.content|raw}
    +
    + {eq name="vo.delete_time" value="0"} + + {$vo.zan} + + {:lang('reply')} + {//评论编辑删除采纳权限} +
    + {if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')} + {:lang('edit')} + {:lang('delete')} + {/if} +
    + {/eq} + +
    +
    +
    + + {// 第三层回复} + {notempty name="$vo.children"} + {volist name="$vo.children" id="voo"} +
    + +
    +
    {$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}
    +
    {$voo.content|raw}
    +
    + {eq name="voo.delete_time" value="0"} + + {$voo.zan} + + {:lang('reply')} + {//评论编辑删除采纳权限} +
    + {if ((session('user_id') == $voo.user.id) && (getLimtTime($voo.create_time) < 2)) OR ($user.auth ?? '')} + {:lang('edit')} + {:lang('delete')} + {/if} +
    + {/eq} +
    +
    +
    + {/volist} + {/notempty} + + {/volist} + {/notempty}
    + {else /} +
    + + 评论解密后查看 +
    + {/if}
    - {else /} -
    评论解密后查看
    - {/if} -
    -
    {comment:usign /}
  • {/article:comment}
@@ -127,7 +192,7 @@
- +
@@ -183,10 +248,6 @@ {block name="script"} -{:hook('taonyeditor')} - -{:hook('taoplayer')} - +{:hook('taonyeditor')} + +{:hook('taoplayer')} + {:hook('taoplyr')} {//图片点击放大} {include file="/public/images-click" /} -{include file="/public/qr-read" /} - {/block} diff --git a/view/taoler/index/article/blog/detail.html b/view/taoler/index/article/blog/detail.html index 712bbf0..20ad888 100644 --- a/view/taoler/index/article/blog/detail.html +++ b/view/taoler/index/article/blog/detail.html @@ -26,180 +26,247 @@ {/block} {block name="column"}
{include file="/public/column" /}
{/block} {block name="content"} -
+
-
-
-
-
-
-

{article:title /}

-
-
- -
-
- - 已阅读 {article:pv /} 次 - -
-
-
-
- {:hook('taoplayerdiv')} -
- {article:content} -
- {//文章末尾} - {if (($article.upzip !== '') || session('?user_name'))} -
- {notempty name="$article.upzip"} - - {/notempty} -
- {/if} - - {//解密文件} - {empty name="passJieMi"} - {if($article.read_type == 1)} -
- -
- {/if} - {/empty} - - {notempty name="tags"} -
标签 - {volist name="tags" id="vo" } - {$vo.name} - {/volist} -
- {/notempty} -
-

{$sysInfo.state|raw}

-
- -
- - 点赞 {:count($userZanList)} - - {volist name="userZanList" id="vo" } - - {/volist} -
-
- - -
-
- # 上一篇: {$previous|raw} - # 下一篇: {$next|raw} -
- {notempty name="relationArticle"} - - {/notempty} - -
-
-
- {//评论内容} -
- 文章评论 ({article:comment_num}) -
    - {article:comment} -
  • - -
    - -  {if($comment.user.vip > 0)}{/if} - -
    - - {comment:uname /} - - {if condition="$article.user.id eq $comment.user_id"}({:lang('poster')}){/if} -
    -
    {:hook('ipShow',$comment.user.city)}
    -
    - {//加密未解密评论不可查看} - {if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))} -
    {comment:content}
    -
    - {comment:zan /} - {:lang('reply')} - {//评论 编辑/删除/采纳/权限} -
    - {if ((session('user_id') == $comment.user_id) && (getLimtTime($comment.create_time) < 2)) OR ($user.auth ?? '')} - {:lang('edit')} - {:lang('delete')} - {/if} +
    + # 上一篇: {$previous|raw} + # 下一篇: {$next|raw} +
    + {notempty name="relationArticle"} +
  • - {/article:comment} -
-
-
- {//评论区} - {if (config('taoler.config.is_reply') == 1 ) AND ( $article.is_reply == 0 )} -
-
评论已关闭!
-
- {/if} - {if session('?user_id') AND (config('taoler.config.is_reply') == 1 ) AND ( $article.is_reply == 1 )} -
-
- -
-
- -
-
-
- - - -
-
-
-
- {/if} +
+ {/notempty} -
+
+
+
+ {//评论内容} +
+ 文章评论 ({article:comment_num}) +
    + {article:comment} +
  • +
    + + {comment:uname} + +
    + + {comment:uname /} + + {if condition="$article.user_id eq $comment.user_id"}({:lang('poster')}){/if} + {comment:usign /} +
    +
    + {:hook('ipShow',$comment.user.city)} +
    + + {//加密未解密评论不可查看} + {if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))} + +
    {comment:content /}
    +
    + {eq name="comment.delete_time" value="0"} + + {comment:zan /} + + {:lang('reply')} + {//评论编辑删除采纳权限} +
    + {if ((session('user_id') == $comment.user_id) && (getLimtTime($comment.create_time) < 2)) OR ($user.auth ?? '')} + {:lang('edit')} + {:lang('delete')} + {/if} +
    + {/eq} + + {// 第二层回复} + {notempty name="$comment.children"} + {volist name="$comment.children" id="vo"} +
    + +
    +
    {$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}
    +
    {$vo.content|raw}
    +
    + {eq name="vo.delete_time" value="0"} + + {$vo.zan} + + {:lang('reply')} + {//评论编辑删除采纳权限} +
    + {if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')} + {:lang('edit')} + {:lang('delete')} + {/if} +
    + {/eq} +
    +
    +
    + + {// 第三层回复} + {notempty name="$vo.children"} + {volist name="$vo.children" id="voo"} +
    + +
    +
    {$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}
    +
    {$voo.content|raw}
    +
    + {eq name="voo.delete_time" value="0"} + + {$voo.zan} + + {:lang('reply')} + {//评论编辑删除采纳权限} +
    + {if ((session('user_id') == $voo.user.id) && (getLimtTime($voo.create_time) < 2)) OR ($user.auth ?? '')} + {:lang('edit')} + {:lang('delete')} + {/if} +
    + {/eq} +
    +
    +
    + {/volist} + {/notempty} + + {/volist} + {/notempty} +
    + {else /} +
    + + 解密后查看内容 +
    + {/if} +
    +
  • + {/article:comment} +
+
+
+ + {//评论区} + {if (config('taoler.config.is_reply') == 1 ) AND ( $article.is_reply == 0 )} +
+
评论已关闭!
+
+ {/if} + + {if session('?user_id') AND (config('taoler.config.is_reply') == 1 ) AND ( $article.is_reply == 1 )} +
+
+
+
+ +
+ +
+
+
+ + + +
+
+
+
+ {/if} + +
+
+
- -
- -
+
+ {//crud管理模块} {include file="/public/crud" /} - + + {include file="public/menu" /} + {/block} {block name="script"} -{:hook('taonyeditor')} - -{:hook('taoplayer')} - +{:hook('taonyeditor')} + +{:hook('taoplayer')} + {:hook('taoplyr')} {/block} \ No newline at end of file diff --git a/view/taoler/index/article/edit.html b/view/taoler/index/article/edit.html index 3e3e5fd..6e16846 100644 --- a/view/taoler/index/article/edit.html +++ b/view/taoler/index/article/edit.html @@ -202,19 +202,20 @@ //编辑文章 form.on('submit(article-edit)', function(data){ - var field = data.field; + var field = data.field; + var loadIndex = layer.load(2); $.ajax({ type:"post", url:"{:url('article/edit')}", data: field, daType:"json", - success:function (data){ - if (data.code == 0) { - notify.success(data.msg, function(){ - location.href = data.url; - }); + success:function (res){ + layer.close(loadIndex); + if (res.code === 0) { + toast.success({title:"成功消息",message: res.msg}); + location.href = res.url; } else { - notify.error(data.msg); + toast.error({title:"失败消息",message:res.msg}); layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random()); } } diff --git a/view/taoler/index/article/posts/detail.html b/view/taoler/index/article/posts/detail.html index daefaed..a8f04df 100644 --- a/view/taoler/index/article/posts/detail.html +++ b/view/taoler/index/article/posts/detail.html @@ -52,7 +52,6 @@ 关注
- {:hook('ipShow',$article.user.city)}
@@ -107,7 +106,7 @@
- +
@@ -145,6 +144,7 @@
{comment:content /}
+ {eq name="comment.delete_time" value="0"} {comment:zan /} @@ -153,9 +153,10 @@
{if ((session('user_id') == $comment.user_id) && (getLimtTime($comment.create_time) < 2)) OR ($user.auth ?? '')} {:lang('edit')} - {:lang('delete')} + {:lang('delete')} {/if}
+ {/eq} {// 第二层回复} {notempty name="$comment.children"} @@ -167,17 +168,19 @@
{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}
{$vo.content|raw}
+ {eq name="vo.delete_time" value="0"} {$vo.zan} - {:lang('reply')} - {//评论编辑删除采纳权限} -
- {if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')} - {:lang('edit')} - {:lang('delete')} - {/if} -
+ {:lang('reply')} + {//评论编辑删除采纳权限} +
+ {if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')} + {:lang('edit')} + {:lang('delete')} + {/if} +
+ {/eq}
@@ -192,17 +195,19 @@
{$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}
{$voo.content|raw}
- - {$voo.zan} - - {:lang('reply')} - {//评论编辑删除采纳权限} -
- {if ((session('user_id') == $voo.user.id) && (getLimtTime($voo.create_time) < 2)) OR ($user.auth ?? '')} - {:lang('edit')} - {:lang('delete')} - {/if} -
+ {eq name="voo.delete_time" value="0"} + + {$voo.zan} + + {:lang('reply')} + {//评论编辑删除采纳权限} +
+ {if ((session('user_id') == $voo.user.id) && (getLimtTime($voo.create_time) < 2)) OR ($user.auth ?? '')} + {:lang('edit')} + {:lang('delete')} + {/if} +
+ {/eq}
@@ -213,17 +218,19 @@ {/notempty} {else /} -
- - 评论解密后查看 -
+
+ + 评论解密后查看 +
{/if} {/article:comment} +
+ {//右栏} @@ -294,36 +301,14 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){ var id = "{$article.id}"; let LOGIN_URL = "{:url('login/index')}"; - //如果你是采用模版自带的编辑器,你需要开启以下语句来解析。 - // 编辑器插件启用状态 - if(taonystatus == 0) { - $('.detail-body').each(function(){ - var othis = $(this), html = othis.html(); - othis.html(fly.content(html)); - }); - } else { - $(".comment-edit").on('click',function (){ - var id = $(this).data('id'); - layer.open({ - type: 2, - title: '修改', - shade: 0.1, - area: ['600px', '500px'], - content: "{:url('comment/edit')}" + '?id=' + id - }); - }); - } - //tpl模板给发布时间赋值 $('div.detail-hits').children('span.post-time').each(function(){ var othis = $(this), html = othis.html(); var string = laytpl('{{ d.time }}').render({ - //time: html time: othis.attr('data') }); var posttime = layui.util.timeAgo(string, 1); othis.text(posttime); - //console.log(othis.attr('data')); }); //文章点赞 @@ -334,7 +319,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){ return false; } $.post("{:url('article/userZanArticle')}",{article_id:id,type:1},function(data){ - if(data.code == 0){ + if(data.code === 0){ layer.msg(data.msg,{icon:6,time:2000},function () { location.reload(true); }); @@ -359,7 +344,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){ data:{id: id,title_color: color}, dataType:'json', success:function(data){ - if(data.code == 0){ + if(data.code === 0){ layer.msg(data.msg,{icon:6,time:2000 }); } else { @@ -392,11 +377,6 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){ } }); } - - // 评论 - form.on('submit(user-comment)',function (data){ - comment(data.field); - }); // 回复用户 $("span[type='reply']").on('click',function (){ @@ -420,12 +400,52 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){ $(this).next().after(html); } }) + + // 评论 + form.on('submit(user-comment)',function (data){ + comment(data.field); + }); //提交回复 form.on('submit(submit-user-comment)', function(data){ comment(data.field); return false; }) + // 编辑器插件启用状态 + if(taonystatus == 0) { + //如果你是采用模版自带的编辑器,你需要开启以下语句来解析。 + $('.detail-body').each(function(){ + var othis = $(this), html = othis.html(); + othis.html(fly.content(html)); + }); + } else { + // 编辑评论 + $(".comment-edit").on('click', function () { + var id = $(this).data('id'); + layer.open({ + type: 2, + title: '修改', + shade: 0.1, + area: ['600px', '500px'], + content: "{:url('comment/edit')}" + '?id=' + id + }); + }); + // 删除评论 + $(".comment-del").on('click', function () { + var id = $(this).data('id'); + layer.confirm('需要删除吗?', {icon: 3}, function (){ + $.post("{:url('comment/jiedaDelete')}", {id: id}, function (res) { + if (res.status === 0) { + toast.success({title: "成功消息", message: res.msg}); + location.reload(true); + } else { + toast.error({title: "失败消息", message: res.msg}); + } + }) + }) + }); + } + // 评论分页 laypage.render({ elem: "pages", //注意,这里的 test1 是 ID,不用加 # 号 diff --git a/view/taoler/index/comment/edit.html b/view/taoler/index/comment/edit.html index ffe9aac..1f2cded 100644 --- a/view/taoler/index/comment/edit.html +++ b/view/taoler/index/comment/edit.html @@ -7,7 +7,7 @@
- +
diff --git a/view/taoler/index/login/login.html b/view/taoler/index/login/login.html index 3167bd4..be4d3a4 100644 --- a/view/taoler/index/login/login.html +++ b/view/taoler/index/login/login.html @@ -74,18 +74,19 @@ {/block} diff --git a/view/taoler/index/public/base.html b/view/taoler/index/public/base.html index 487f72e..d92dbae 100644 --- a/view/taoler/index/public/base.html +++ b/view/taoler/index/public/base.html @@ -30,12 +30,14 @@ {block name="meta"}{/block} + + {block name="link"}{/block} {$sysInfo.showlist|raw} @@ -48,6 +50,7 @@ {include file="public/js" /}