Skip to content

Commit

Permalink
require users to acknowledge interpreter dialogs fixes #160
Browse files Browse the repository at this point in the history
  • Loading branch information
flouc001 committed May 18, 2017
1 parent f398d22 commit 39d3880
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/ide.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ D.IDE=function(){'use strict'
I.gd_close.onclick=function(){ret(-1)}
I.gd_btns.onclick=function(e){if(e.target.nodeName==='BUTTON'){
var i=-1,t=e.target;while(t){t=t.previousSibling;i++}ret(i)}}
D.util.dlg(I.gd,{w:400});setTimeout(function(){b.focus()},1)
D.util.dlg(I.gd,{w:400,closable:false});setTimeout(function(){b.focus()},1)
}
},
StringDialog:function(x){
Expand All @@ -144,7 +144,7 @@ D.IDE=function(){'use strict'
I.gd_close.onclick=function(){ret(x.defaultValue||null)}
I.gd_btns.onclick=function(e){if(e.target.nodeName==='BUTTON'){
ret(e.target.previousSibling?x.defaultValue||null:inp.value)}}
D.util.dlg(I.gd,{w:400,h:250});setTimeout(function(){inp.focus()},1)
D.util.dlg(I.gd,{w:400,h:250,closable:false});setTimeout(function(){inp.focus()},1)
},
TaskDialog:function(x){
var esc=D.util.esc
Expand All @@ -160,7 +160,7 @@ D.IDE=function(){'use strict'
I.gd_close.onclick=function(){ret(-1)}
I.gd_btns.onclick=function(e){if(e.target.nodeName==='BUTTON'){
var t=e.target,i=99;while(t){t=t.previousSibling;i++}ret(i)}}
D.util.dlg(I.gd,{w:400,h:300});setTimeout(function(){b.focus()},1)
D.util.dlg(I.gd,{w:400,h:300,closable:false});setTimeout(function(){b.focus()},1)
},
ReplyGetSIStack:function(x){ide.dbg&&ide.dbg.sistack.render(x.stack)},
ReplyGetThreads:function(x){ide.dbg&&ide.dbg.threads.render(x.threads)},
Expand Down
4 changes: 3 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ D.util={
d.style.zIndex=zCtr++;d.hidden=0
d.style.left=(0|(innerWidth -(o.w||d.clientWidth ))/2)+'px';if(o.w)d.style.width =o.w+'px'
d.style.top =(0|(innerHeight-(o.h||d.clientHeight))/2)+'px';if(o.h)d.style.height=o.h+'px'
if (o.closable!==undefined&&!o.closable){d.querySelector('.dlg_close').style.display="none"}
else{d.querySelector('.dlg_close').style.display="";
CM.on(d,'keydown',function(e){if(e.which===27&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){d.hidden=1;return!1}})}
o=null
if(d.__dlg)return;d.__dlg=1
d.onmousedown=function(){d.style.zIndex=zCtr++}
d.onclick=function(e){if(e.target.className==='dlg_close'){d.hidden=1;return!1}}
CM.on(d,'keydown',function(e){if(e.which===27&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){d.hidden=1;return!1}})
var t=d.querySelector('.dlg_title')
if(t){
var dx,dy //dx,dy:dialog position corrected for mouse
Expand Down

0 comments on commit 39d3880

Please sign in to comment.