Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script Editor - ask for file name #1216

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading