Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
macaronideath
fc-pregmod
Commits
202cadaf
Commit
202cadaf
authored
4 years ago
by
lowercasedonkey
Browse files
Options
Downloads
Patches
Plain Diff
condense design to one panel
parent
fc4db0e3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/facilities/toyShop/toyShop.js
+49
-37
49 additions, 37 deletions
src/facilities/toyShop/toyShop.js
with
49 additions
and
37 deletions
src/facilities/toyShop/toyShop.js
+
49
−
37
View file @
202cadaf
...
...
@@ -39,31 +39,72 @@ App.UI.toyShop = function() {
const
el
=
new
DocumentFragment
();
let
linkArray
;
App
.
UI
.
DOM
.
appendNewElement
(
"
h2
"
,
el
,
"
Buttplugs
"
);
const
select
=
App
.
UI
.
DOM
.
appendNewElement
(
"
div
"
,
el
,
App
.
UI
.
DOM
.
link
(
"
Start a new design
"
,
()
=>
{
init
();
refresh
();
}));
if
(
V
.
customItem
.
buttPlugs
.
size
>
0
)
{
select
.
append
(
selectDesign
());
}
el
.
append
(
create
());
return
el
;
function
create
()
{
const
el
=
new
DocumentFragment
();
const
existingDesign
=
V
.
customItem
.
buttPlugs
.
get
(
buttPlugName
);
if
(
existingDesign
)
{
el
.
append
(
descLocked
());
}
else
{
el
.
append
(
desc
());
}
el
.
append
(
desc
(),
title
(),
width
(),
length
(),
apply
(),
);
if
(
V
.
customItem
.
buttPlugs
.
size
>
0
)
{
el
.
append
(
reviewDesigns
());
if
(
existingDesign
)
{
const
build
=
App
.
UI
.
DOM
.
appendNewElement
(
"
div
"
,
el
,
`Send updated design to production and make sure all appropriate slaves are updated `
);
const
linkArray
=
[];
linkArray
.
push
(
App
.
UI
.
DOM
.
link
(
"
Update the mold
"
,
()
=>
{
buildPlug
();
}
)
);
linkArray
.
push
(
App
.
UI
.
DOM
.
link
(
`Recall "
${
buttPlugName
}
"`
,
()
=>
{
deletePlug
();
}
)
);
build
.
append
(
App
.
UI
.
DOM
.
generateLinksStrip
(
linkArray
));
}
else
{
el
.
append
(
apply
());
}
return
el
;
function
descLocked
()
{
return
App
.
UI
.
DOM
.
makeElement
(
"
div
"
,
`Description has already been selected for this model: "
${
buttPlugName
}
"`
);
}
}
function
reviewDesigns
()
{
const
el
=
document
.
createElement
(
"
p
"
);
App
.
UI
.
DOM
.
appendNewElement
(
"
h3
"
,
el
,
"
Tweak existing design
"
);
const
choice
=
App
.
UI
.
DOM
.
appendNewElement
(
"
div
"
,
el
,
` Choose an existing design to edit `
);
function
selectDesign
()
{
const
el
=
new
DocumentFragment
();
const
choice
=
App
.
UI
.
DOM
.
appendNewElement
(
"
span
"
,
el
,
` or choose an existing design to edit `
);
const
select
=
App
.
UI
.
DOM
.
appendNewElement
(
"
select
"
,
choice
);
let
matchFound
=
false
;
for
(
const
[
key
,
values
]
of
V
.
customItem
.
buttPlugs
)
{
const
option
=
App
.
UI
.
DOM
.
appendNewElement
(
"
option
"
,
select
,
values
.
name
);
option
.
value
=
key
;
if
(
option
.
value
===
buttPlugName
)
{
option
.
selected
=
true
;
matchFound
=
true
;
}
}
if
(
!
matchFound
)
{
select
.
selectedIndex
=
-
1
;
}
select
.
onchange
=
()
=>
{
const
O
=
select
.
options
[
select
.
selectedIndex
];
...
...
@@ -72,34 +113,7 @@ App.UI.toyShop = function() {
buttPlugData
=
V
.
customItem
.
buttPlugs
.
get
(
selectedPlug
);
refresh
();
};
el
.
append
(
descLocked
(),
title
(),
width
(),
length
(),
);
const
build
=
App
.
UI
.
DOM
.
appendNewElement
(
"
div
"
,
el
,
`Send updated design to production and make sure all appropriate slaves are updated `
);
const
linkArray
=
[];
linkArray
.
push
(
App
.
UI
.
DOM
.
link
(
"
Update the mold
"
,
()
=>
{
buildPlug
();
}
)
);
linkArray
.
push
(
App
.
UI
.
DOM
.
link
(
`Recall "
${
buttPlugName
}
"`
,
()
=>
{
deletePlug
();
}
)
);
build
.
append
(
App
.
UI
.
DOM
.
generateLinksStrip
(
linkArray
));
return
el
;
function
descLocked
()
{
return
App
.
UI
.
DOM
.
makeElement
(
"
div
"
,
`Description has already been selected for this model: "
${
buttPlugName
}
"`
);
}
}
function
desc
()
{
...
...
@@ -207,7 +221,6 @@ App.UI.toyShop = function() {
return
build
;
}
function
deletePlug
()
{
V
.
customItem
.
buttPlugs
.
delete
(
buttPlugName
);
for
(
const
slave
of
V
.
slaves
)
{
...
...
@@ -219,7 +232,6 @@ App.UI.toyShop = function() {
}
}
function
refresh
()
{
jQuery
(
container
).
empty
().
append
(
createPage
());
}
...
...
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