Skip to content

Commit

Permalink
fixed example RunDemo
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-Symbroson committed Dec 31, 2023
1 parent c33c0b2 commit 83ccecc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docs/docs/js/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function demo(id) {
var div = document.querySelector('#' + id + codeClass);
var code = (div.innerText || div.textContent).replace(/\xa0/g, ' ');
if (isMobileIDE) {
var file = "/sdcard/.DroidScript/Example." + curMode;
const dir = "/sdcard/.DroidScript/Example/";
app.DeleteFolder(dir);
app.MakeFolder(dir);
var file = dir + "Example." + curMode;
app.WriteFile(file, code);
app.Execute("RunDemo( '" + file + "' );");
// app.Execute( "try { StartApp('" + file + "') } catch(e) { ShowPopup('Whoops! Something went wrong.'); }" );
Expand Down
5 changes: 4 additions & 1 deletion docs/docs/v265/js/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function demo(id) {
var div = document.querySelector('#' + id + codeClass);
var code = (div.innerText || div.textContent).replace(/\xa0/g, ' ');
if (isMobileIDE) {
var file = "/sdcard/.DroidScript/Example." + curMode;
const dir = "/sdcard/.DroidScript/Example/";
app.DeleteFolder(dir);
app.MakeFolder(dir);
var file = dir + "Example." + curMode;
app.WriteFile(file, code);
app.Execute("RunDemo( '" + file + "' );");
// app.Execute( "try { StartApp('" + file + "') } catch(e) { ShowPopup('Whoops! Something went wrong.'); }" );
Expand Down
5 changes: 4 additions & 1 deletion files/docs-base/js/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function demo(id) {
var div = document.querySelector('#' + id + codeClass);
var code = (div.innerText || div.textContent).replace(/\xa0/g, ' ');
if (isMobileIDE) {
var file = "/sdcard/.DroidScript/Example." + curMode;
const dir = "/sdcard/.DroidScript/Example/";
app.DeleteFolder(dir);
app.MakeFolder(dir);
var file = dir + "Example." + curMode;
app.WriteFile(file, code);
app.Execute("RunDemo( '" + file + "' );");
// app.Execute( "try { StartApp('" + file + "') } catch(e) { ShowPopup('Whoops! Something went wrong.'); }" );
Expand Down

0 comments on commit 83ccecc

Please sign in to comment.