Skip to content

Commit 4dd3331

Browse files
committed
fix: 修复bug
1 parent 6d83fe8 commit 4dd3331

6 files changed

Lines changed: 21 additions & 14 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2017 - present theajack <contact@theajack.com>
3+
Copyright (c) 2017 - present theajack <theajack@qq.com>
44

55
All rights reserved.
66

docs/v1.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
'汉字'.stroke();
8787
&lt;/script></pre>
8888
<!-- <div class="part-title small font-size-bigger">1.script 标签方式引入</div>
89-
<div class="part-title small">引用: &lt;script src="https://www.theajack.com/cnchar/cnchar.min.js"&gt;&lt;/script&gt;</div>
89+
<div class="part-title small">引用: &lt;script src="https://theajack.gitee.io/cnchar/cnchar.min.js"&gt;&lt;/script&gt;</div>
9090
<div class="part-title small font-size-bigger">2.npm 方式安装</div>
9191
<div class="part-title small">安装: npm install cnchar</div>
9292
<div class="part-title small">使用: import CnChar from 'cnchar' 或 const CnChar = require('cnchar')</div> -->
@@ -199,14 +199,14 @@
199199

200200
Email:theajack@qq.com
201201
<span class="split-icon d-hide">|</span>
202-
<span class="link d-hide" onclick="J.open('https://www.theajack.com')">theajack.com</span>
202+
<span class="link d-hide" onclick="J.open('https://theajack.gitee.io')">theajack</span>
203203
<div class=" d-show">
204204
<span class="wechat-public" onclick="this.child(0).fadeToggle()">
205205
WeChat Official Accounts
206206
<img class="wechat-img" src="./assets/v1/images/wechat_qrcode.jpg" />
207207
</span>
208208
<span class="split-icon">|</span>
209-
<span class="link" onclick="J.open('https://www.theajack.com')">theajack.com</span>
209+
<span class="link" onclick="J.open('https://theajack.gitee.io')">theajack</span>
210210
</div>
211211
</div>
212212
<div id="copyright">
@@ -216,15 +216,15 @@
216216
<script src="https://cdn.jsdelivr.net/gh/theajack/theajack.github.com/assets/js/jetter.min.js"></script>
217217
<script src="./assets/v1/js/index.js"></script>
218218
<script src="https://cdn.jsdelivr.net/npm/cnchar-all/cnchar.all.min.js" onload='loaded()'></script>
219-
<!-- <script src="https://www.theajack.com/cnchar/dist/cnchar.latest.min.js"></script>
220-
<script src="https://www.theajack.com/cnchar/dist/cnchar.order.latest.min.js"></script>
221-
<script src="https://www.theajack.com/cnchar/dist/cnchar.poly.latest.min.js"></script>
222-
<script src="https://www.theajack.com/cnchar/dist/cnchar.trad.latest.min.js" onload='loaded()'></script> -->
219+
<!-- <script src="https://theajack.gitee.io/cnchar/dist/cnchar.latest.min.js"></script>
220+
<script src="https://theajack.gitee.io/cnchar/dist/cnchar.order.latest.min.js"></script>
221+
<script src="https://theajack.gitee.io/cnchar/dist/cnchar.poly.latest.min.js"></script>
222+
<script src="https://theajack.gitee.io/cnchar/dist/cnchar.trad.latest.min.js" onload='loaded()'></script> -->
223223
<script src="./assets/v1/js/run.js"></script>
224224
<script src="https://cdn.jsdelivr.net/gh/theajack/theajack.github.com/assets/js/link.js"></script>
225225
<script src="https://cdn.jsdelivr.net/gh/theajack/theajack.github.com/assets/js/logo.js"></script>
226226
<script src="https://cdn.jsdelivr.net/gh/theajack/theajack.github.com/assets/js/log.js"></script>
227-
<!--<script type="text/javascript" name="cnchar.js" src="https://www.theajack.com/assets/js/stat.js"></script>-->
227+
<!--<script type="text/javascript" name="cnchar.js" src="https://theajack.gitee.io/assets/js/stat.js"></script>-->
228228
<script>
229229
var _mtac = {};
230230
(function () {

src/main/components/code.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,16 @@
8282
let autoRun = getUrlParam('run') !== 'false';
8383
theme.init(getUrlParam('theme') || getThemeFromCodeSrc());
8484
initConfig(code, () => {
85+
let _lang = getUrlParam('lang');
86+
if (_lang) language.init(_lang);
87+
const _code = getUrlParam('code');
88+
if (_code) { code.init(decompressUrl(_code)); }
8589
if (autoRun) {
8690
event.emit(EVENT.RUN_CODE);
8791
}
8892
}, () => {
8993
let _code = getCodeFromCodeSrc();
90-
if(!_code){
94+
if (!_code) {
9195
_code = getUrlParam('code');
9296
if (_code === null) {
9397
_code = '';

src/main/components/js/config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import {getUrlParam} from '../../js/util';
44
import {loadResources} from './lib';
5-
import {LANG} from './editor';
6-
import {language, code} from '../../js/status';
5+
import {LANG, THEME} from './editor';
6+
import {language, code, theme} from '../../js/status';
77
import {EVENT} from '../../js/constant';
88
import event from '../../js/event';
99
import {parseGithubParam} from '../../../import';
@@ -66,6 +66,7 @@ function initEnv (serachCode, success) {
6666
success();
6767
event.emit(EVENT.SET_ENV, env);
6868
}
69+
theme.init(THEME.DARK); // 默认使用黑色主题
6970
return true;
7071
}
7172

src/main/components/log.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<i :class='"ei-chevron-"+(htmlLog?"right":"left")'
66
@click='toggleLogShow'
77
:title='(htmlLog?"隐藏":"显示")+"log(ctrl + k)"'></i>
8-
<div class='log-content' v-html='html'></div>
8+
<div class='log-content' ref='logContent'></div>
99
</div>
1010
<div class='log-log' ref='logWrapper' :class='{"hide-log": !htmlLog}'>
1111
<div class='console-mask' @click='focuConsole'></div>
@@ -54,6 +54,7 @@
5454
},
5555
[EVENT.HTML_CONTENT_CHANGE]: (html) => {
5656
this.html = html;
57+
this.$refs.logContent.innerHTML = html;
5758
}
5859
});
5960
initDrag(this.$refs.drag);

src/main/js/compress.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export function compressUrl (str) {
1010
}
1111

1212
export function decompressUrl (str) {
13-
return decompressFromEncodedURIComponent(str);
13+
const result = decompressFromEncodedURIComponent(str);
14+
return result || decodeURIComponent(str);
1415
}
1516

1617
export function compress (str) {

0 commit comments

Comments
 (0)