diff --git a/web/democode/perleditor.html b/web/democode/perleditor.html index 5e52f8d..3bf24d8 100644 --- a/web/democode/perleditor.html +++ b/web/democode/perleditor.html @@ -164,7 +164,7 @@ function fetchUrl(url,cm) { // fetch the contents of a URL into a CodeMirror ins }); } -function makeCodeWithFn (fn,targ,ro,nodel) { +function makeCodeWithFn (fn,targ,ro,isscript) { var div = $('
',{class:"codewithfn"}); var fnfuncs = $('
',{class:"fnfuncs"}).appendTo(div); @@ -191,30 +191,31 @@ function makeCodeWithFn (fn,targ,ro,nodel) { var filefuncs = $('
',{class:"filefuncs"}).appendTo(fnfuncs); - if (!nodel) { - var conf = $('', {class:"text small"}) - .append( - " ", - "Are you sure?", - " ", - $('',{class:"fakelink",text:"Yes"}) - .click(function () { div.remove(); }), - " ", - $('',{class:"fakelink",text:"Cancel"}) - .click(function () { conf.hide(); }), - ); - $('',{class:"fakelink",text:"delete"}) - .appendTo(filefuncs).click(function () { - conf.show(); - }); - conf.hide(); - conf.appendTo(filefuncs); - } + var conf = $('', {class:"text small"}) + .append( + " ", + "Are you sure?", + " ", + $('',{class:"fakelink",text:"Yes"}) + .click(function () { + div.remove(); + if (isscript) $('#addscript').show(); + }), + " ", + $('',{class:"fakelink",text:"Cancel"}) + .click(function () { conf.hide(); }), + ); + $('',{class:"fakelink",text:"delete"}) + .appendTo(filefuncs).click(function () { + conf.show(); + }); + conf.hide(); + conf.appendTo(filefuncs); var ta = $('