Skip to content

Commit

Permalink
script editor - ask for file name, wizard step number validation
Browse files Browse the repository at this point in the history
  • Loading branch information
keeshii committed Oct 31, 2024
1 parent d16de1c commit c36bfd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions interface/resources/serverless/Scripts/Wizard.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Rectangle {
property bool keyboardRaised: false

function setStep(stepNum) {
stepList.completed = stepNum
switch (stepNum) {
case 0:
loader.sourceComponent = step1;
Expand All @@ -49,8 +48,9 @@ Rectangle {
loader.sourceComponent = step5;
break;
default:
loader.setSource(undefined);
return;
}
stepList.completed = stepNum;
}

function completeWizard() {
Expand Down
13 changes: 9 additions & 4 deletions scripts/system/create/scriptEditor/scriptEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,16 +430,21 @@
return;
}

if (url.match(/(file|https?):\/\//)) {
fileName = this.getFileNameFromUrl(url);
}

// Script will be copied to the Asset Server
var proceed = Window.confirm("The script will be copied to the Asset Server and may overwrite some other files. Say YES if you want to proceed.");
if (!proceed) {
var answer = Window.prompt(
"The script will be copied to the Asset Server "
+ "and may overwrite some other files. Enter file name.", fileName);
if (!answer) {
return;
}
fileName = answer;

var content = url || ' ';
if (url.match(/(file|https?):\/\//)) {
fileName = this.getFileNameFromUrl(url);

content = this.downloadFileFromUrl(url);
if (content === undefined) {
Window.alert("Unable to download the file.");
Expand Down

0 comments on commit c36bfd5

Please sign in to comment.