Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tailorbird
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Künstlerische Gestaltung
Tailorbird
Commits
1dce600f
Commit
1dce600f
authored
2 years ago
by
Jakob Yanagibashi
Browse files
Options
Downloads
Patches
Plain Diff
Add button for second preset
parent
bbedf241
No related branches found
No related tags found
No related merge requests found
Pipeline
#254319
passed
2 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.js
+20
-35
20 additions, 35 deletions
main.js
with
20 additions
and
35 deletions
main.js
+
20
−
35
View file @
1dce600f
...
...
@@ -118,7 +118,8 @@ document.querySelector("#app").innerHTML = `
</p>
<form method="dialog">
<menu>
<button value="example">Load example</button>
<button value="example1">Load example 1</button>
<button value="example2">Load example 2</button>
<button value="cancel">Close</button>
</menu>
</form>
...
...
@@ -148,16 +149,6 @@ document.querySelector("#app").innerHTML = `
</form>
</dialog>
<dialog id="loadPresetDialog">
<form method="dialog">
<input type="text" id="loadPresetInput" />
<menu>
<button value="load">Load</button>
<button value="cancel">Cancel</button>
</menu>
</form>
</dialog>
<dialog id="exportDialog">
<form method="dialog">
<menu>
...
...
@@ -215,7 +206,7 @@ document.querySelector("#app").innerHTML = `
<input
type="text"
id="addLineInputE"
value="
0
"
value="
1
"
/><br />
Speed (<strong>F</strong>eed):
<input
...
...
@@ -404,7 +395,7 @@ G28
import
{
Project
}
from
"
./js/project.js
"
;
import
{
Move
}
from
"
./js/command.js
"
;
function
getPresetModel
main
()
{
function
getPresetModel
Vase
()
{
var
presetProject
=
new
Project
();
var
precision
=
10
;
var
zoom
=
30
;
...
...
@@ -455,6 +446,12 @@ function getPresetModelmain() {
return
presetProject
;
}
function
getPresetModelVertical
()
{
var
presetProject
=
new
Project
();
return
presetProject
;
}
/* Model modification */
function
editSelectedCommand
()
{}
...
...
@@ -558,10 +555,6 @@ function loadProject(projectToLoad) {
//window.currentProject.load();
}
function
loadPreset
(
presetName
)
{
window
.
currentProject
=
eval
(
"
getPresetModel
"
+
presetName
+
"
()
"
);
}
/*function loadProject() {
const projectToLoad = document.getElementById("project-input").value;
if (!Number.isInteger(parseInt(projectToLoad))) return;
...
...
@@ -636,12 +629,6 @@ function initEventListeners() {
}
function
initMainEventListeners
()
{
/* document
.getElementById("loadPresetMenuButton")
.addEventListener("click", function onOpen() {
document.getElementById("loadPresetDialog").showModal();
}); */
document
.
getElementById
(
"
exportProjectMenuButton
"
)
.
addEventListener
(
"
click
"
,
function
onOpen
()
{
...
...
@@ -903,16 +890,6 @@ G28
window
.
currentProject
.
renderAll
();
});
document
.
getElementById
(
"
loadPresetDialog
"
)
.
addEventListener
(
"
close
"
,
function
onClose
()
{
// Check if Load button was pressed
if
(
event
.
target
.
returnValue
!=
"
load
"
)
return
;
const
inputEl
=
document
.
getElementById
(
"
loadPresetInput
"
);
loadPreset
(
inputEl
.
value
);
inputEl
.
value
=
""
;
});
document
.
getElementById
(
"
saveDialog
"
)
.
addEventListener
(
"
close
"
,
function
onClose
()
{
...
...
@@ -938,8 +915,16 @@ G28
.
getElementById
(
"
helpDialog
"
)
.
addEventListener
(
"
close
"
,
function
onClose
()
{
// Check if Load button was pressed
if
(
event
.
target
.
returnValue
!=
"
example
"
)
return
;
window
.
currentProject
=
getPresetModelmain
();
switch
(
event
.
target
.
returnValue
)
{
case
"
example1
"
:
window
.
currentProject
=
getPresetModelVase
();
break
;
case
"
example2
"
:
window
.
currentProject
=
getPresetModelVertical
();
break
;
default
:
return
;
}
});
document
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment