Skip to content

Commit f4882b2

Browse files
save file
1 parent f4d4171 commit f4882b2

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

utils/editors/js-console/html/output-console/v2.0/output-console-v2.0.html

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@
5454
<script>
5555

5656
(function output_console({mod,dom,host}){
57-
//console.log('output');
57+
5858
var obj = {
5959
version : 'v2.0',
6060
};
6161

62-
62+
var df=false,did='output-console'
63+
;
64+
65+
66+
6367
var ext,$
6468
;
6569

@@ -100,7 +104,7 @@
100104

101105

102106
obj.init = async function(){
103-
107+
debug('init',obj.version);
104108
await libs();
105109

106110
}//init
@@ -118,7 +122,7 @@
118122

119123

120124
obj.initdom = function(rootnode){
121-
125+
debug('initdom');
122126
shadow = host.shadowRoot;
123127

124128
chk.persist = $.chkbox(shadow,'#console-persist',false);
@@ -140,14 +144,14 @@
140144

141145

142146
btn.kill = function(){
143-
147+
debug('btn.kill');
144148
kill();
145149

146150
}//kill
147151

148152

149153
btn.clear = function(){
150-
154+
debug('btn.clear');
151155
clear();
152156

153157
}//clear
@@ -165,7 +169,7 @@
165169

166170

167171
obj.run = async function(js,params={}){
168-
console.log('run');
172+
debug('run');
169173
var sandbox = (()=>{
170174

171175
var console = {};
@@ -221,7 +225,7 @@
221225

222226

223227
obj.run.iframe = async function(js,params={}){
224-
console.log('run.iframe');
228+
debug('run.iframe');
225229
var resolve,promise=new Promise(res=>resolve=res);
226230

227231
if(iframe){
@@ -271,7 +275,7 @@
271275

272276

273277
obj.run.iframe2 = async function(js,params={}){
274-
console.log('run.iframe2');
278+
debug('run.iframe2');
275279
var resolve,promise=new Promise(res=>resolve=res);
276280

277281
if(iframe){
@@ -881,11 +885,32 @@
881885

882886

883887

888+
function debug(...args){
889+
890+
if(!df && !obj.df)return;
891+
args.unshift(`[ ${did} ]`);
892+
var fmt = Array.from({length:args.length}).fill('%O').join(' ');
893+
var args2 = [fmt].concat(args);
894+
console.groupCollapsed.apply(console,args2);
895+
console.trace();
896+
console.groupEnd();
897+
898+
}//debug
899+
900+
901+
902+
903+
884904
return obj;
885905

886-
})//output_console
906+
//output_console
907+
})
908+
887909

888910
</script>
889911

912+
890913
</output-console>
891914

915+
916+

0 commit comments

Comments
 (0)