Skip to content

Commit a4e1ab0

Browse files
committed
feat: blog share
1 parent 233941a commit a4e1ab0

File tree

34 files changed

+1276
-393
lines changed

34 files changed

+1276
-393
lines changed

app/Constant/AppConstant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ class AppConstant
66
{
77
const APP = 'blog';
88
const APP_NAME = 'ModStartBlog';
9-
const VERSION = '6.9.0';
9+
const VERSION = '7.0.0';
1010
}

config/module.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
'Banner' => [
3232
'enable' => true,
3333
],
34+
'ShareJS' => [
35+
'enable' => true,
36+
],
3437
'VisitStatistic' => [
3538
'enable' => true,
3639
],

module/Blog/View/pc/blog/show.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="row">
1313
<div class="col-md-8 margin-top">
1414

15-
<div class="tw-p-6 tw-rounded tw-bg-white tw-py-4">
15+
<div class="tw-p-6 tw-rounded tw-bg-white tw-py-4 margin-bottom">
1616
<h1 class="tw-mb-4">
1717
{{$record['title']}}
1818
</h1>
@@ -44,8 +44,12 @@
4444
{!! $record['content'] !!}
4545
</div>
4646
</div>
47+
<div class="tw-text-center">
48+
@include('module::ShareJS.View.buttons')
49+
</div>
4750
</div>
4851

52+
4953
<div class="tw-p-6 margin-bottom tw-bg-white tw-rounded">
5054
<div class="row">
5155
<div class="col-6">
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## 模块介绍
2+
3+
「一键分享」是一个提供网页生成一键分享功能
4+
5+
6+
## 支持网站
7+
8+
- QQ( `qq`
9+
- 微博( `weibo`
10+
- 微信( `wechat`
11+
- QQ空间( `qzone`
12+
- Facebook( `facebook`
13+
- Google( `google`
14+
- Twitter( `twitter`
15+
16+
## 使用方式
17+
18+
在 Blade 模板中通过如下方式调用
19+
20+
```
21+
@include('module::ShareJS.View.buttons')
22+
```
23+
24+
> 默认分享到 weibo,qq,qzone,wechat
25+
26+
或指定分享网站
27+
28+
```
29+
@include('module::ShareJS.View.buttons',['sites'=>'weibo,qq'])
30+
```
31+
32+
## 更多参考
33+
34+
- [https://github.com/overtrue/share.js](https://github.com/overtrue/share.js)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://ms-assets.modstart.com/data/image/2021/12/11/6124_ihfq_9500.jpeg
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://ms-assets.modstart.com/data/image/2021/12/11/6125_szxs_8453.jpeg

module/ShareJS/Docs/release.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 1.1.0
2+
3+
- 新增:支持Laravel9
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{!! \ModStart\ModStart::js('asset/common/share.js') !!}
2+
<div data-share-buttons data-sites="{{empty($sites)?'weibo,qq,qzone,wechat':$sites}}"></div>

module/ShareJS/config.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "ShareJS",
3+
"title": "一键分享",
4+
"require": [
5+
"Vendor"
6+
],
7+
"env": [
8+
"laravel5",
9+
"laravel9"
10+
],
11+
"version": "1.1.0",
12+
"modstartVersion": ">=2.0.0",
13+
"author": "ModStart",
14+
"description": "提供网页生成一键分享功能",
15+
"providers": [
16+
],
17+
"config": {
18+
}
19+
}

module/Vendor/Tecmz/Tecmz.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,4 +523,29 @@ public function docToHtmlQuery($jobId)
523523
return $this->callFileConvertQuery('doc_to_html', $jobId);
524524
}
525525

526+
527+
public function pdfToTextQueue($url, $name = null, $param = [])
528+
{
529+
return $this->callFileConvertQueue('pdf_to_text', $url, $name, $param);
530+
}
531+
532+
533+
public function pdfToTextQuery($jobId)
534+
{
535+
return $this->callFileConvertQuery('pdf_to_text', $jobId);
536+
}
537+
538+
539+
public function docSmartPreviewQueue($url, $name = null, $param = [])
540+
{
541+
return $this->callFileConvertQueue('doc_smart_preview', $url, $name, $param);
542+
}
543+
544+
545+
public function docSmartPreviewQuery($jobId)
546+
{
547+
return $this->callFileConvertQuery('doc_smart_preview', $jobId);
548+
}
549+
550+
526551
}

0 commit comments

Comments
 (0)