@jx3box/jx3box-editor 0.8.7 → 0.9.1
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.
- package/assets/css/module/buff.less +14 -7
- package/assets/css/module/table.less +1 -1
- package/package.json +5 -5
- package/public/tinymce.html +2 -1
- package/readme.md +1 -1
- package/service/item.js +4 -8
- package/src/Buff.vue +16 -3
- package/src/Item.vue +47 -34
- package/src/Resource.vue +1 -1
- package/src/Skill.vue +6 -4
- package/src/Tinymce.vue +2 -2
|
@@ -29,10 +29,17 @@
|
|
|
29
29
|
.fz(13px);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
.w-buff-type{
|
|
33
|
+
.db;
|
|
34
|
+
color: #77ecff;
|
|
35
|
+
letter-spacing: 0.5px;
|
|
36
|
+
.mb(5px);
|
|
37
|
+
.fz(12px, 20px);
|
|
38
|
+
}
|
|
39
|
+
|
|
32
40
|
.w-buff-desc {
|
|
33
41
|
color: #ffffff;
|
|
34
42
|
letter-spacing: 0.5px;
|
|
35
|
-
.mb(10px);
|
|
36
43
|
.fz(12px, 20px);
|
|
37
44
|
}
|
|
38
45
|
|
|
@@ -55,12 +62,12 @@
|
|
|
55
62
|
// line-height: 36px;
|
|
56
63
|
// }
|
|
57
64
|
|
|
58
|
-
&.isBuff {
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
&.isDebuff {
|
|
62
|
-
|
|
63
|
-
}
|
|
65
|
+
// &.isBuff {
|
|
66
|
+
// color: #37a900;
|
|
67
|
+
// }
|
|
68
|
+
// &.isDebuff {
|
|
69
|
+
// color: #900;
|
|
70
|
+
// }
|
|
64
71
|
text-decoration: underline;
|
|
65
72
|
&:hover {
|
|
66
73
|
box-shadow: none !important;
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
margin: 10px 0;
|
|
8
8
|
overflow-x: auto;
|
|
9
9
|
max-width: 100%;
|
|
10
|
-
display: block;
|
|
11
10
|
border: none;
|
|
12
11
|
|
|
13
12
|
line-height:2.2;
|
|
@@ -42,6 +41,7 @@
|
|
|
42
41
|
@media screen and (max-width: @phone) {
|
|
43
42
|
.c-article{
|
|
44
43
|
table {
|
|
44
|
+
display: block;
|
|
45
45
|
width: 100% !important;
|
|
46
46
|
height: auto !important;
|
|
47
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "JX3BOX Article & Editor",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"last 2 versions"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@jx3box/jx3box-common": "^6.
|
|
34
|
-
"@jx3box/jx3box-data": "^1.
|
|
35
|
-
"@jx3box/jx3box-emotion": "^1.0.
|
|
33
|
+
"@jx3box/jx3box-common": "^6.7.2",
|
|
34
|
+
"@jx3box/jx3box-data": "^1.8.3",
|
|
35
|
+
"@jx3box/jx3box-emotion": "^1.0.10",
|
|
36
36
|
"@jx3box/jx3box-macro": "^1.0.1",
|
|
37
|
-
"@jx3box/jx3box-talent": "^1.1.
|
|
37
|
+
"@jx3box/jx3box-talent": "^1.1.2",
|
|
38
38
|
"@tinymce/tinymce-vue": "^3.2.2",
|
|
39
39
|
"axios": "^0.19.2",
|
|
40
40
|
"core-js": "^3.6.5",
|
package/public/tinymce.html
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
<meta name="renderer" content="webkit" />
|
|
8
8
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
9
9
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
|
|
10
|
-
<script src="https://oss.jx3box.com/static/tinymce/tinymce.min.js?v=0.0
|
|
10
|
+
<script src="https://oss.jx3box.com/static/tinymce/tinymce.min.js?v=0.1.0"></script>
|
|
11
|
+
<!-- TODO: -->
|
|
11
12
|
<!-- <script src="http://localhost:5000/tinymce.min.js"></script> -->
|
|
12
13
|
</head>
|
|
13
14
|
<body>
|
package/readme.md
CHANGED
|
@@ -88,7 +88,7 @@ import Tinymce from "@jx3box/jx3box-editor/src/Tinymce.vue";
|
|
|
88
88
|
headers.set("Authorization", "Basic " + btoa(username + ":" + password));
|
|
89
89
|
|
|
90
90
|
// 1.异步加载设置数据,将420改成正确的文章ID
|
|
91
|
-
fetch("https://
|
|
91
|
+
fetch("https://cms.jx3box.com/api/cms/post/420", {
|
|
92
92
|
method: "GET",
|
|
93
93
|
headers: headers,
|
|
94
94
|
credentials: "include",
|
package/service/item.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import {$helper} from "@jx3box/jx3box-common/js/https";
|
|
1
|
+
import { $helper } from "@jx3box/jx3box-common/js/https";
|
|
2
2
|
|
|
3
3
|
// 获取物品
|
|
4
|
-
function get_item(item_id,
|
|
4
|
+
function get_item(item_id, client_id) {
|
|
5
5
|
if (!item_id) return;
|
|
6
6
|
|
|
7
7
|
let options = {
|
|
8
8
|
url: `api/item/${item_id}`,
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
_.set(options, 'headers.JX3-Client-Type', jx3_client_type);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return $helper()(options);
|
|
11
|
+
return $helper({ mute: true,client_id : client_id })(options);
|
|
16
12
|
}
|
|
17
13
|
|
|
18
14
|
// 获取清单
|
|
@@ -22,4 +18,4 @@ function get_plan(plan_id) {
|
|
|
22
18
|
});
|
|
23
19
|
}
|
|
24
20
|
|
|
25
|
-
export {get_item, get_plan};
|
|
21
|
+
export { get_item, get_plan };
|
package/src/Buff.vue
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="w-buff" v-if="data">
|
|
3
3
|
<div class="w-buff-wrapper">
|
|
4
|
-
<img class="w-buff-icon" :src="data.IconID
|
|
4
|
+
<img class="w-buff-icon" :src="iconLink(data.IconID)" :alt="data.Name" />
|
|
5
5
|
<div class="w-buff-content">
|
|
6
6
|
<span class="w-buff-name">{{data.Name}}</span>
|
|
7
7
|
<span class="w-buff-desc">{{data.Desc}}</span>
|
|
8
|
+
<span class="w-buff-type" v-if="data.DetachType">※ {{data.DetachType | showDetachType}}</span>
|
|
8
9
|
<span class="w-buff-meta">ID : {{data.BuffID}}</span>
|
|
9
10
|
<span class="w-buff-meta">Level : {{data.Level}}</span>
|
|
10
11
|
</div>
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
<script>
|
|
16
17
|
import { getBuff } from "../service/database.js";
|
|
17
18
|
import { iconLink } from "@jx3box/jx3box-common/js/utils";
|
|
19
|
+
import detach_types from "../assets/data/detach_type.json";
|
|
18
20
|
export default {
|
|
19
21
|
name: "Buff",
|
|
20
22
|
props: ["client", "id", "level"],
|
|
@@ -57,9 +59,20 @@ export default {
|
|
|
57
59
|
},
|
|
58
60
|
},
|
|
59
61
|
},
|
|
60
|
-
|
|
61
|
-
iconLink
|
|
62
|
+
methods: {
|
|
63
|
+
iconLink: function (id) {
|
|
64
|
+
return iconLink(id, this.client);
|
|
65
|
+
},
|
|
62
66
|
},
|
|
67
|
+
filters : {
|
|
68
|
+
showDetachType: function (val) {
|
|
69
|
+
if (val && detach_types[val]) {
|
|
70
|
+
return detach_types[val];
|
|
71
|
+
} else {
|
|
72
|
+
return "";
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
}
|
|
63
76
|
};
|
|
64
77
|
</script>
|
|
65
78
|
|
package/src/Item.vue
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
<img
|
|
59
59
|
v-if="attribute.icon_id > 0"
|
|
60
60
|
class="u-horse-icon"
|
|
61
|
-
:src="
|
|
61
|
+
:src="iconLink(attribute.icon_id)"
|
|
62
62
|
/>
|
|
63
63
|
<div class="u-horse-desc" v-html="attribute.label"></div>
|
|
64
64
|
</span>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
attribute.value
|
|
73
73
|
)
|
|
74
74
|
"
|
|
75
|
-
></span
|
|
75
|
+
></span>-->
|
|
76
76
|
</span>
|
|
77
77
|
</div>
|
|
78
78
|
</div>
|
|
@@ -242,29 +242,42 @@
|
|
|
242
242
|
|
|
243
243
|
<script>
|
|
244
244
|
import { get_item } from "../service/item.js";
|
|
245
|
-
import icon_url from "../assets/js/item/icon_url.js";
|
|
246
245
|
import second_format from "../assets/js/item/second_format.js";
|
|
247
246
|
import attribute_percent from "../assets/js/item/attribute_percent.js";
|
|
248
247
|
import bind from "../assets/js/item/bind.js";
|
|
249
248
|
import color from "../assets/js/item/color.js";
|
|
249
|
+
import { iconLink } from "@jx3box/jx3box-common/js/utils";
|
|
250
250
|
|
|
251
251
|
export default {
|
|
252
252
|
name: "Item",
|
|
253
|
-
props: ["item", "item_id","jx3ClientType"],
|
|
253
|
+
props: ["item", "item_id", "jx3ClientType"],
|
|
254
254
|
data() {
|
|
255
255
|
return {
|
|
256
256
|
source: null,
|
|
257
257
|
};
|
|
258
258
|
},
|
|
259
|
+
computed : {
|
|
260
|
+
client_id : function (){
|
|
261
|
+
return this.jx3ClientType || 1
|
|
262
|
+
},
|
|
263
|
+
client : function (){
|
|
264
|
+
return this.client_id == 1 ? 'std' : 'origin'
|
|
265
|
+
},
|
|
266
|
+
cache_key : function (){
|
|
267
|
+
return `item-${this.client}-${this.item_id}`
|
|
268
|
+
},
|
|
269
|
+
},
|
|
259
270
|
methods: {
|
|
260
|
-
|
|
271
|
+
iconLink : function (id){
|
|
272
|
+
return iconLink(id,this.client)
|
|
273
|
+
},
|
|
261
274
|
second_format,
|
|
262
275
|
attribute_percent,
|
|
263
276
|
bind,
|
|
264
277
|
color,
|
|
265
|
-
formatDescHtml
|
|
266
|
-
return str.replace(/font=\d+\s>/g,
|
|
267
|
-
}
|
|
278
|
+
formatDescHtml: function (str) {
|
|
279
|
+
return str.replace(/font=\d+\s>/g, "");
|
|
280
|
+
},
|
|
268
281
|
},
|
|
269
282
|
watch: {
|
|
270
283
|
item: {
|
|
@@ -275,35 +288,35 @@ export default {
|
|
|
275
288
|
},
|
|
276
289
|
item_id: {
|
|
277
290
|
immediate: true,
|
|
278
|
-
handler() {
|
|
279
|
-
if (
|
|
291
|
+
handler(val) {
|
|
292
|
+
if (val) {
|
|
280
293
|
// 提取本地数据
|
|
281
|
-
let
|
|
282
|
-
let cache = sessionStorage.getItem(cacheName);
|
|
283
|
-
let createdCacheName = `${cacheName}-created`;
|
|
284
|
-
let createdCache = sessionStorage.getItem(createdCacheName);
|
|
285
|
-
// 查看是否存在缓存
|
|
286
|
-
if (
|
|
287
|
-
(cache === false || cache) &&
|
|
288
|
-
Math.round(new Date() / 1000) - createdCache <= 3600
|
|
289
|
-
) {
|
|
290
|
-
this.source = cache === false ? null : JSON.parse(cache);
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
294
|
+
let _cache = sessionStorage.getItem(this.cache_key);
|
|
293
295
|
|
|
294
|
-
//
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
// 记录本地数据
|
|
301
|
-
sessionStorage.setItem(cacheName, this.source ? JSON.stringify(this.source) : false);
|
|
302
|
-
sessionStorage.setItem(createdCacheName, Math.round(new Date() / 1000));
|
|
296
|
+
// 本地读取缓存
|
|
297
|
+
if(_cache){
|
|
298
|
+
try{
|
|
299
|
+
this.source = JSON.parse(_cache)
|
|
300
|
+
}catch(e){
|
|
301
|
+
console.log(e,'[Item]无法解析本地缓存')
|
|
303
302
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
303
|
+
|
|
304
|
+
// 服务端拉取
|
|
305
|
+
}else{
|
|
306
|
+
get_item(this.item_id, this.client_id).then((res) => {
|
|
307
|
+
let data = res.data;
|
|
308
|
+
if (data.code === 200) {
|
|
309
|
+
let item = data.data.item;
|
|
310
|
+
let isValidItem = JSON.stringify(item) !== "{}"
|
|
311
|
+
if(isValidItem){
|
|
312
|
+
this.source = item
|
|
313
|
+
sessionStorage.setItem(this.cache_key,JSON.stringify(this.source));
|
|
314
|
+
}else{
|
|
315
|
+
this.source = null
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
}
|
|
307
320
|
}
|
|
308
321
|
},
|
|
309
322
|
},
|
package/src/Resource.vue
CHANGED
|
@@ -488,7 +488,7 @@ export default {
|
|
|
488
488
|
this.isPC = window.innerWidth > 720;
|
|
489
489
|
},
|
|
490
490
|
iconURL: function (id) {
|
|
491
|
-
return iconLink(id);
|
|
491
|
+
return iconLink(id,this.client);
|
|
492
492
|
},
|
|
493
493
|
getLink: function (type, client, id, level) {
|
|
494
494
|
let domain = client == "origin" ? __OriginRoot : __Root;
|
package/src/Skill.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="w-skill" v-if="data">
|
|
3
3
|
<div class="w-skill-wrapper">
|
|
4
|
-
<img class="w-skill-icon" :src="(data.IconID || 13)
|
|
4
|
+
<img class="w-skill-icon" :src="iconLink(data.IconID || 13)" :alt="data.Name" />
|
|
5
5
|
<div class="w-skill-content">
|
|
6
6
|
<span class="w-skill-name">{{data.Name}}</span>
|
|
7
7
|
<span class="w-skill-desc">{{data.Desc}}</span>
|
|
@@ -57,9 +57,11 @@ export default {
|
|
|
57
57
|
},
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
|
-
|
|
61
|
-
iconLink
|
|
62
|
-
|
|
60
|
+
methods : {
|
|
61
|
+
iconLink : function (id){
|
|
62
|
+
return iconLink(id,this.client)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
63
65
|
};
|
|
64
66
|
</script>
|
|
65
67
|
|
package/src/Tinymce.vue
CHANGED
|
@@ -66,11 +66,11 @@ export default {
|
|
|
66
66
|
"link autolink",
|
|
67
67
|
"hr lists advlist table codeinline codesample checklist foldtext latex",
|
|
68
68
|
"image emoticons media videox macro qixue talent2",
|
|
69
|
-
"autosave code fullscreen wordcount powerpaste pagebreak printpage", // template anchor jx3icon
|
|
69
|
+
"autosave code fullscreen wordcount powerpaste pagebreak printpage pz", // template anchor jx3icon
|
|
70
70
|
],
|
|
71
71
|
toolbar: [
|
|
72
72
|
"undo | formatselect | fontsizeselect | forecolor backcolor | bold italic underline strikethrough superscript subscript | link unlink | restoredraft fullscreen code",
|
|
73
|
-
"removeformat | hr alignleft aligncenter alignright alignjustify indent outdent | bullist numlist checklist table blockquote foldtext codeinline codesample latex | emoticons image media videox | macro qixue talent2 pagebreak printpage", // template anchor jx3icon
|
|
73
|
+
"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
|
|
74
74
|
],
|
|
75
75
|
mobile: {
|
|
76
76
|
toolbar_drawer: true,
|