@jx3box/jx3box-editor 1.7.5 → 1.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -118,3 +118,13 @@
118
118
  .c-article .isScrollFocus {
119
119
  animation: focusFade 0.5s ease-in-out;
120
120
  }
121
+
122
+ .w-directory-anchor{
123
+ .fz(16px);
124
+ .pointer;
125
+ color:@color !important;
126
+ &:hover{
127
+ box-shadow:none !important;
128
+ color:#c00 !important;
129
+ }
130
+ }
@@ -9,6 +9,7 @@ const count = {
9
9
  };
10
10
  const MAX_DEPTH = 3;
11
11
  const PREFIX_CLS = "lv"; //class前缀
12
+ const HEADER_HEIGHT = 112; //头部高度
12
13
 
13
14
  function directory(from, to = '#directory') {
14
15
  // 装载容器设置
@@ -50,7 +51,7 @@ function directory(from, to = '#directory') {
50
51
  // 进行克隆
51
52
  let _item = $(item).clone();
52
53
  // 解决懒加载跳转位置问题
53
- $(item).append(`<a id="directory-${i}"></a>`);
54
+ $(item).prepend(`<a id="directory-${i}" class="el-icon-s-flag w-directory-anchor"></a>`);
54
55
 
55
56
  // 过滤行内样式
56
57
  _item.removeAttr("style");
@@ -80,7 +81,7 @@ function directory(from, to = '#directory') {
80
81
  let target = $(this)
81
82
  .data("raw")
82
83
  .offset().top;
83
- $(document).scrollTop(target - 112);
84
+ $(document).scrollTop(target - HEADER_HEIGHT);
84
85
  $(this)
85
86
  .data("raw")
86
87
  .addClass("isScrollFocus");
package/assets/js/img.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // 图片地址&懒加载
2
2
  import { resolveImagePath } from "@jx3box/jx3box-common/js/utils";
3
- import { __cdn } from "@jx3box/jx3box-common/data/jx3box.json";
3
+ import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
4
4
  function lazyLoad(str) {
5
5
  if (!str) return;
6
6
 
@@ -11,7 +11,7 @@ function lazyLoad(str) {
11
11
  let prefix = item[1];
12
12
  let src = resolveImagePath(item[2]);
13
13
  if (src.includes('https://console.cnyixun.com/')) {
14
- src = src.replace('https://console.cnyixun.com/', __cdn)
14
+ src = src.replace('https://console.cnyixun.com/', JX3BOX.__cdn)
15
15
  }
16
16
  let suffix = item[3];
17
17
  let output = `<img ${prefix} loading="lazy" src="${src}" ${suffix}>`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Article.vue CHANGED
@@ -62,6 +62,9 @@
62
62
  </template>
63
63
 
64
64
  <script>
65
+ import $ from "jquery";
66
+ const HEADER_HEIGHT = 112; //头部高度
67
+
65
68
  import { Pagination, Button, Popover } from "element-ui";
66
69
  import "@jx3box/jx3box-common/css/element.css";
67
70
 
@@ -224,6 +227,12 @@ export default {
224
227
  }
225
228
  let dir = renderDirectory(target, this.directorybox);
226
229
  this.$emit("directoryRendered",dir);
230
+
231
+ $('.w-directory-anchor').on('click', function(){
232
+ let id = $(this).attr('id')
233
+ let target = $(`#${id}`).offset().top;
234
+ $(document).scrollTop(target - HEADER_HEIGHT);
235
+ })
227
236
  },
228
237
  changePage: function (i) {
229
238
  this.page = i;
package/src/Tinymce.vue CHANGED
@@ -76,12 +76,12 @@ export default {
76
76
  contextmenu: "",
77
77
  plugins: [
78
78
  "link autolink",
79
- "hr lists advlist table codeinline codesample checklist foldtext latex",
79
+ "hr lists advlist table codeinline codesample checklist foldtext latex anchor",
80
80
  "image emoticons media videox macro qixue talent2",
81
81
  "code fullscreen wordcount powerpaste pagebreak printpage pz", // template anchor jx3icon autosave
82
82
  ],
83
83
  toolbar: [
84
- "undo | formatselect | fontsizeselect | forecolor backcolor | bold italic underline strikethrough superscript subscript | link unlink | fullscreen code", //restoredraft
84
+ "undo | formatselect | fontsizeselect | forecolor backcolor | bold italic underline strikethrough superscript subscript | link unlink anchor | fullscreen code", //restoredraft
85
85
  "removeformat | hr alignleft aligncenter alignright alignjustify indent outdent | bullist numlist checklist table blockquote foldtext codeinline codesample latex | emoticons image media videox | macro pz qixue talent2 pagebreak printpage", // template anchor jx3icon
86
86
  ],
87
87
  mobile: {
package/src/Upload.vue CHANGED
@@ -4,7 +4,7 @@
4
4
  <el-button type="primary" @click="dialogVisible = true" icon="el-icon-upload" :disabled="!enable">{{ btn_txt }}</el-button>
5
5
 
6
6
  <!-- 弹出界面 -->
7
- <el-dialog class="c-large-dialog" title="上传" :visible.sync="dialogVisible">
7
+ <el-dialog class="c-large-dialog" title="上传" :visible.sync="dialogVisible" append-to-body>
8
8
  <!-- 清空按钮 -->
9
9
  <el-button class="u-upload-clear" plain icon="el-icon-delete" size="mini" @click="clear">清空</el-button>
10
10