Skip to content

Commit d5dc251

Browse files
committed
fixed html snapshot
1 parent f1104b8 commit d5dc251

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "conet",
3-
"version": "3.0.5",
3+
"version": "3.0.6",
44
"license": "MIT",
55
"description": "CoNET",
66
"repository": {

app/public/scripts/appsManager.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,18 @@ const _appScript = {
342342
const regex = new RegExp(`${filename}`, 'g');
343343
const index = html.indexOf(`${filename}`);
344344
if (index > -1) {
345+
if (/\.js$/.test(filename)) {
346+
_data = _data.replace(/^data:text\/plain;/, 'data:application/javascript;');
347+
}
348+
else if (/\.css$/.test(filename)) {
349+
_data = _data.replace(/^data:text\/plain;/, 'data:text/css;');
350+
}
351+
else if (/\.html$|\.htm$/.test(filename)) {
352+
_data = _data.replace(/^data:text\/plain;/, 'data:text/html;');
353+
}
354+
else if (/\.pdf$/.test(filename)) {
355+
_data = _data.replace(/^data:text\/plain;/, 'data:text/html;');
356+
}
345357
html = html.replace(regex, _data);
346358
}
347359
};

app/public/scripts/appsManager.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,15 @@ const _appScript = {
395395
const index = html.indexOf ( `${ filename }` )
396396

397397
if ( index > -1 ) {
398+
if ( /\.js$/.test ( filename )) {
399+
_data = _data.replace ( /^data:text\/plain;/, 'data:application/javascript;')
400+
} else if ( /\.css$/.test ( filename )) {
401+
_data = _data.replace ( /^data:text\/plain;/, 'data:text/css;')
402+
} else if ( /\.html$|\.htm$/.test ( filename )) {
403+
_data = _data.replace ( /^data:text\/plain;/, 'data:text/html;')
404+
} else if ( /\.pdf$/.test ( filename )) {
405+
_data = _data.replace ( /^data:text\/plain;/, 'data:text/html;')
406+
}
398407

399408
html = html.replace ( regex, _data )
400409

app/tools/imap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ class ImapServerSwitchStream extends Stream.Transform {
497497
};
498498
this.Tag = `A${this.imapServer.TagCount1()}`;
499499
this.cmd = `${this.Tag} LOGOUT`;
500-
this.debug ? debugOut(this.cmd, false, this.imapServer.imapSerialID) : null;
500+
this.debug ? debugOut(this.cmd, false, this.imapServer.listenFolder || this.imapServer.imapSerialID) : null;
501501
if (this.writable) {
502502
this.appendWaitResponsrTimeOut = timers_1.setTimeout(() => {
503503
return CallBack();

app/tools/imap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ class ImapServerSwitchStream extends Stream.Transform {
613613
this.Tag = `A${ this.imapServer.TagCount1() }`
614614
this.cmd = `${ this.Tag } LOGOUT`
615615

616-
this.debug ? debugOut ( this.cmd, false, this.imapServer.imapSerialID ) : null
616+
this.debug ? debugOut ( this.cmd, false, this.imapServer.listenFolder || this.imapServer.imapSerialID ) : null
617617
if ( this.writable ) {
618618
this.appendWaitResponsrTimeOut = setTimeout (() => {
619619

0 commit comments

Comments
 (0)