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
Container Registry
Model registry
Operate
Environments
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
pregmodfan
fc-pregmod
Commits
f8399b5f
Commit
f8399b5f
authored
3 years ago
by
DCoded
Browse files
Options
Downloads
Patches
Plain Diff
More cleanup
parent
858bd938
No related branches found
No related tags found
1 merge request
!10654
Farmyard code cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/facilities/farmyard/animals/animals.js
+31
-31
31 additions, 31 deletions
src/facilities/farmyard/animals/animals.js
with
31 additions
and
31 deletions
src/facilities/farmyard/animals/animals.js
+
31
−
31
View file @
f8399b5f
...
...
@@ -315,7 +315,7 @@ App.Facilities.Farmyard.animals = function() {
const
frag
=
new
DocumentFragment
();
const
dickDiv
=
document
.
createElement
(
"
div
"
);
const
deadlinessDiv
=
document
.
createElement
(
"
div
"
);
const
addDiv
=
App
.
UI
.
DOM
.
makeElement
(
"
div
"
,
null
,
[
'
animal-add
'
]);
const
addDiv
=
App
.
UI
.
DOM
.
makeElement
(
"
div
"
,
null
,
[
'
margin-top
'
]);
const
animal
=
new
App
.
Entity
.
Animal
(
null
,
null
,
"
canine
"
,
"
domestic
"
);
...
...
@@ -335,41 +335,41 @@ App.Facilities.Farmyard.animals = function() {
return
frag
;
function
name
()
{
const
nameD
iv
=
document
.
createElement
(
"
div
"
);
const
d
iv
=
document
.
createElement
(
"
div
"
);
nameD
iv
.
append
(
d
iv
.
append
(
`Name: `
,
App
.
UI
.
DOM
.
makeTextBox
(
animal
.
name
||
''
,
value
=>
{
animal
.
setName
(
value
);
App
.
UI
.
DOM
.
replace
(
nameD
iv
,
name
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
name
()
);
App
.
UI
.
DOM
.
replace
(
dickDiv
,
dick
);
App
.
UI
.
DOM
.
replace
(
deadlinessDiv
,
deadliness
);
App
.
UI
.
DOM
.
replace
(
addDiv
,
add
);
App
.
UI
.
DOM
.
replace
(
addDiv
,
add
()
);
}),
);
return
nameD
iv
;
return
d
iv
;
}
function
species
()
{
const
speciesD
iv
=
document
.
createElement
(
"
div
"
);
const
d
iv
=
document
.
createElement
(
"
div
"
);
speciesD
iv
.
append
(
d
iv
.
append
(
`Species: `
,
App
.
UI
.
DOM
.
makeTextBox
(
animal
.
species
||
''
,
value
=>
{
animal
.
setSpecies
(
value
);
App
.
UI
.
DOM
.
replace
(
speciesD
iv
,
species
);
App
.
UI
.
DOM
.
replace
(
addDiv
,
add
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
species
()
);
App
.
UI
.
DOM
.
replace
(
addDiv
,
add
()
);
}),
);
return
speciesD
iv
;
return
d
iv
;
}
function
type
()
{
const
typeD
iv
=
document
.
createElement
(
"
div
"
);
const
d
iv
=
document
.
createElement
(
"
div
"
);
const
typeLinks
=
[];
...
...
@@ -379,12 +379,12 @@ App.Facilities.Farmyard.animals = function() {
App
.
UI
.
DOM
.
link
(
`Hooved`
,
()
=>
{
animal
.
setType
(
'
hooved
'
);
App
.
UI
.
DOM
.
replace
(
typeD
iv
,
type
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
type
()
);
}),
App
.
UI
.
DOM
.
link
(
`Feline`
,
()
=>
{
animal
.
setType
(
"
feline
"
);
App
.
UI
.
DOM
.
replace
(
typeD
iv
,
type
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
type
()
);
}),
);
}
else
if
(
animal
.
type
===
"
hooved
"
)
{
...
...
@@ -392,13 +392,13 @@ App.Facilities.Farmyard.animals = function() {
App
.
UI
.
DOM
.
link
(
`Canine`
,
()
=>
{
animal
.
setType
(
"
canine
"
);
App
.
UI
.
DOM
.
replace
(
typeD
iv
,
type
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
type
()
);
}),
App
.
UI
.
DOM
.
disabledLink
(
`Hooved`
,
[
`Already selected.`
]),
App
.
UI
.
DOM
.
link
(
`Feline`
,
()
=>
{
animal
.
setType
(
"
feline
"
);
App
.
UI
.
DOM
.
replace
(
typeD
iv
,
type
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
type
()
);
}),
);
}
else
{
...
...
@@ -406,24 +406,24 @@ App.Facilities.Farmyard.animals = function() {
App
.
UI
.
DOM
.
link
(
`Canine`
,
()
=>
{
animal
.
setType
(
"
canine
"
);
App
.
UI
.
DOM
.
replace
(
typeD
iv
,
type
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
type
()
);
}),
App
.
UI
.
DOM
.
link
(
`Hooved`
,
()
=>
{
animal
.
setType
(
"
hooved
"
);
App
.
UI
.
DOM
.
replace
(
typeD
iv
,
type
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
type
()
);
}),
App
.
UI
.
DOM
.
disabledLink
(
`Feline`
,
[
`Already selected.`
]),
);
}
typeD
iv
.
append
(
`Type: `
,
App
.
UI
.
DOM
.
generateLinksStrip
(
typeLinks
));
d
iv
.
append
(
`Type: `
,
App
.
UI
.
DOM
.
generateLinksStrip
(
typeLinks
));
return
typeD
iv
;
return
d
iv
;
}
function
rarity
()
{
const
rarityD
iv
=
document
.
createElement
(
"
div
"
);
const
d
iv
=
document
.
createElement
(
"
div
"
);
const
rarityLinks
=
[];
...
...
@@ -433,7 +433,7 @@ App.Facilities.Farmyard.animals = function() {
App
.
UI
.
DOM
.
link
(
`Exotic`
,
()
=>
{
animal
.
setRarity
(
'
exotic
'
);
App
.
UI
.
DOM
.
replace
(
rarityD
iv
,
rarity
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
rarity
()
);
}),
);
}
else
{
...
...
@@ -441,19 +441,19 @@ App.Facilities.Farmyard.animals = function() {
App
.
UI
.
DOM
.
link
(
`Domestic`
,
()
=>
{
animal
.
setRarity
(
'
domestic
'
);
App
.
UI
.
DOM
.
replace
(
rarityD
iv
,
rarity
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
rarity
()
);
}),
App
.
UI
.
DOM
.
disabledLink
(
`Exotic`
,
[
`Already selected.`
]),
);
}
rarityD
iv
.
append
(
`Rarity: `
,
App
.
UI
.
DOM
.
generateLinksStrip
(
rarityLinks
));
d
iv
.
append
(
`Rarity: `
,
App
.
UI
.
DOM
.
generateLinksStrip
(
rarityLinks
));
return
rarityD
iv
;
return
d
iv
;
}
function
article
()
{
const
articleD
iv
=
document
.
createElement
(
"
div
"
);
const
d
iv
=
document
.
createElement
(
"
div
"
);
const
articleLinks
=
[];
...
...
@@ -462,7 +462,7 @@ App.Facilities.Farmyard.animals = function() {
App
.
UI
.
DOM
.
link
(
"
Yes
"
,
()
=>
{
animal
.
articleAn
=
'
an
'
;
App
.
UI
.
DOM
.
replace
(
articleD
iv
,
article
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
article
()
);
App
.
UI
.
DOM
.
replace
(
dickDiv
,
dick
);
App
.
UI
.
DOM
.
replace
(
deadlinessDiv
,
deadliness
);
}),
...
...
@@ -474,16 +474,16 @@ App.Facilities.Farmyard.animals = function() {
App
.
UI
.
DOM
.
link
(
"
No
"
,
()
=>
{
animal
.
articleAn
=
'
a
'
;
App
.
UI
.
DOM
.
replace
(
articleD
iv
,
article
);
App
.
UI
.
DOM
.
replace
(
d
iv
,
article
()
);
App
.
UI
.
DOM
.
replace
(
dickDiv
,
dick
);
App
.
UI
.
DOM
.
replace
(
deadlinessDiv
,
deadliness
);
}),
);
}
articleD
iv
.
append
(
`Is this animal's name preceded by an 'an'? `
,
App
.
UI
.
DOM
.
generateLinksStrip
(
articleLinks
));
d
iv
.
append
(
`Is this animal's name preceded by an 'an'? `
,
App
.
UI
.
DOM
.
generateLinksStrip
(
articleLinks
));
return
articleD
iv
;
return
d
iv
;
}
function
dick
()
{
...
...
@@ -555,7 +555,7 @@ App.Facilities.Farmyard.animals = function() {
link
=
App
.
UI
.
DOM
.
link
(
`Add`
,
()
=>
{
App
.
Data
.
animals
.
push
(
animal
);
App
.
UI
.
DOM
.
replace
(
frag
,
addAnimal
());
App
.
UI
.
DOM
.
replace
(
addDiv
,
addAnimal
());
});
}
...
...
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