Skip to content

Commit

Permalink
Merge pull request #1216 from keeshii/script-editor
Browse files Browse the repository at this point in the history
Script Editor - ask for file name
  • Loading branch information
ksuprynowicz authored Nov 1, 2024
2 parents d16de1c + c36bfd5 commit 583b5ab
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 583b5ab

Please sign in to comment.