Skip to content

Tinymce #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Jul 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e96ddff
Merge branch 'feature/menutab' into develop
Apr 6, 2019
d79b814
fix:删除iconfont.js
Apr 6, 2019
c4fd9a4
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Apr 11, 2019
9878226
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Apr 13, 2019
6434b13
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Apr 16, 2019
15f7717
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Apr 21, 2019
c1a0dc5
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Apr 24, 2019
4de6469
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Apr 24, 2019
dc3580c
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Apr 30, 2019
a794036
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
May 2, 2019
383d81e
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
May 3, 2019
b450669
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
May 5, 2019
93974e2
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
May 5, 2019
946f926
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
May 12, 2019
fc620ea
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
May 12, 2019
9e6c6de
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
May 12, 2019
ccd5a57
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
May 13, 2019
3b15688
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
May 19, 2019
3819f68
Merge pull request #174 from TaleLin/develop
vanoneang Jun 2, 2019
9312730
Update README.md
vanoneang Jun 2, 2019
26c745c
Update axios.js
vanoneang Jun 10, 2019
d06f1ff
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Jun 30, 2019
b48ba1e
feat:富文本 Tinymce
Jul 10, 2019
9ad3352
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Jul 14, 2019
0782146
fix:conflict
Jul 14, 2019
402f607
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Jul 14, 2019
4dda521
Merge branch 'develop' into tinymce
Jul 14, 2019
4f7db4f
fix:去掉tinymce标识
Jul 17, 2019
0b890cd
Merge branch 'master' into tinymce
Jul 17, 2019
360502c
update:新增富文本部分内置插件
Jul 21, 2019
a1ece32
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
Jul 21, 2019
054f44a
Merge branch 'develop' into tinymce
Jul 21, 2019
6896149
fix:conflict
Jul 21, 2019
db105c4
fix:富文本上传图片加入token验证
Jul 23, 2019
2c0bb7d
fix:自动化导入富文本插件
Jul 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,16 @@ QQ群搜索:林间有风 或 643205479

## 版本日志

<<<<<<< HEAD
最新版本 `0.2.0`

### 0.2.0

1. `A` 新增图像上传、图像预览、富文本等自定义组件
2. `A` 新增 lin-cms-ui 多个基础组件
=======
最新版本 `0.1.0-beta.3`
>>>>>>> 0b890cda57f1aaa11af9315d031ae15fae4def51

### 0.1.0-beta.3

Expand Down
63 changes: 45 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"moment": "^2.24.0",
"photoswipe": "^4.1.2",
"screenfull": "^4.2.0",
"tinymce": "^5.0.9",
"tinymce": "^5.0.12",
"vue": "^2.6.8",
"vue-awesome-swiper": "^3.1.3",
"vue-croppa": "^1.3.8",
Expand Down
8 changes: 8 additions & 0 deletions src/components/base/tinymce/importAll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// eslint-disable-next-line
const importAll = (requireContext) => requireContext.keys().forEach(requireContext)
try {
// 导入所有插件
importAll(require.context('../../../../node_modules/tinymce/plugins', true))
} catch (err) {
console.log(err)
}
54 changes: 21 additions & 33 deletions src/components/base/tinymce/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,12 @@
<editor id="tinymceEditor" :init="tinymceInit" v-model="content" :key="tinymceFlag"></editor>
</div>
</template>

<script>
// eslint-disable-next-line
import tinymce from 'tinymce/tinymce'
import Editor from '@tinymce/tinymce-vue'
import 'tinymce/themes/silver/theme'
import 'tinymce/plugins/textcolor'
import 'tinymce/plugins/advlist'
import 'tinymce/plugins/table'
import 'tinymce/plugins/lists'
import 'tinymce/plugins/paste'
import 'tinymce/plugins/preview'
import 'tinymce/plugins/fullscreen'
import 'tinymce/plugins/image'
import 'tinymce/plugins/code'
import 'tinymce/plugins/link'
import './importAll'

export default {
name: 'TinymceEditor',
Expand All @@ -39,6 +29,11 @@ export default {
type: Boolean,
default: true,
},
toolbar: {
type: String,
// eslint-disable-next-line
default: ' undo redo |formatselect | bold italic strikethrough forecolor backcolor formatpainter | link image | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | preview fullscreen code',
},
},
components: {
Editor,
Expand All @@ -64,32 +59,25 @@ export default {
statusbar: false, // 隐藏编辑器底部的状态栏
paste_data_images: true, // 允许粘贴图像
menubar: this.showMenubar, // 隐藏最上方menu
plugins: 'advlist table lists paste preview fullscreen image code link',
// eslint-disable-next-line
toolbar:' undo redo |fontselect fontsizeselect forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | link image | h1 h2 h3 blockquote table numlist bullist | preview fullscreen code',
plugins: 'print fullpage searchreplace autolink directionality visualblocks visualchars template codesample charmap hr pagebreak nonbreaking anchor toc insertdatetime wordcount textpattern help advlist table lists paste preview fullscreen image imagetools code link',
toolbar: this.toolbar,
// eslint-disable-next-line
images_upload_handler: async function(blobInfo, success, failure) {
// eslint-disable-next-line
let json
const xhr = new XMLHttpRequest()
xhr.withCredentials = false
xhr.open('POST', `${_this.upload_url}`)
// eslint-disable-next-line
xhr.onload = function() {
if (xhr.status !== 200) {
failure(`HTTP Error: ${xhr.status}`)
return
}
json = JSON.parse(xhr.responseText)
if (json[0] && json[0].url) {
success(json[0].url)
} else {
failure(`Invalid JSON: ${xhr.responseText}`)
const file = new File([blobInfo.blob()], blobInfo.filename(), {
type: 'image/*',
})
_this.$axios({
method: 'post',
url: '/cms/file/',
data: {
file,
},
}).then((res) => {
if (res[0] && res[0].url) {
success(res[0].url)
}
}
const formData = new FormData()
formData.append('file', blobInfo.blob(), blobInfo.filename())
xhr.send(formData)
}).catch(err => failure(err))
},
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/config/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Config = {
baseUrl: process.env.VUE_APP_BASE_URL,
baseUrl: 'http://dev.lin.colorful3.com/',
stagnateTime: 1 * 60 * 60 * 1000, // 无操作停滞时间 默认1小时
openAutoJumpOut: true, // 是否开启无操作跳出
notLoginRoute: ['login'], // 无需登录即可访问的路由 name,
Expand Down
1 change: 1 addition & 0 deletions src/plugins/custom/views/Tinymce.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</template>

<script>

import Tinymce from '@/components/base/tinymce'

export default {
Expand Down