Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
faang
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CSE 391
24wi
faang
Commits
a51bf285
Verified
Commit
a51bf285
authored
1 year ago
by
Matthew Wang
Browse files
Options
Downloads
Patches
Plain Diff
Generate (and require) alt text for images
parent
5184500e
No related branches found
No related tags found
No related merge requests found
Pipeline
#575985
passed
1 year ago
Stage: test
Stage: deploy
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Employee.java
+7
-1
7 additions, 1 deletion
Employee.java
GenerateStaff.java
+2
-1
2 additions, 1 deletion
GenerateStaff.java
Product.java
+7
-1
7 additions, 1 deletion
Product.java
Products.java
+7
-1
7 additions, 1 deletion
Products.java
Staff.java
+14
-2
14 additions, 2 deletions
Staff.java
with
37 additions
and
6 deletions
Employee.java
+
7
−
1
View file @
a51bf285
...
@@ -3,18 +3,24 @@ public class Employee {
...
@@ -3,18 +3,24 @@ public class Employee {
public
String
position
;
public
String
position
;
public
String
description
;
public
String
description
;
public
String
picture
;
public
String
picture
;
public
String
altText
;
public
Employee
(
String
name
,
String
position
,
String
description
,
String
picture
)
{
public
Employee
(
String
name
,
String
position
,
String
description
,
String
picture
,
String
altText
)
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
position
=
position
;
this
.
position
=
position
;
this
.
description
=
description
;
this
.
description
=
description
;
this
.
picture
=
picture
;
this
.
picture
=
picture
;
this
.
altText
=
altText
;
}
}
public
String
getName
()
{
public
String
getName
()
{
return
this
.
name
;
return
this
.
name
;
}
}
public
String
getAltText
()
{
return
this
.
altText
;
}
public
String
getDescription
()
{
public
String
getDescription
()
{
return
this
.
description
;
return
this
.
description
;
}
}
...
...
This diff is collapsed.
Click to expand it.
GenerateStaff.java
+
2
−
1
View file @
a51bf285
...
@@ -30,6 +30,7 @@ public class GenerateStaff {
...
@@ -30,6 +30,7 @@ public class GenerateStaff {
String
description
=
p
.
getDescription
();
String
description
=
p
.
getDescription
();
String
picture
=
p
.
getPicture
();
String
picture
=
p
.
getPicture
();
String
position
=
p
.
getPosition
();
String
position
=
p
.
getPosition
();
String
altText
=
p
.
getAltText
();
// Create new file
// Create new file
File
employeeFile
=
new
File
(
"staff/"
+
name
+
".html"
);
File
employeeFile
=
new
File
(
"staff/"
+
name
+
".html"
);
...
@@ -42,7 +43,7 @@ public class GenerateStaff {
...
@@ -42,7 +43,7 @@ public class GenerateStaff {
outEmployeeFile
.
println
(
indent
(
3
)
+
listStart
);
outEmployeeFile
.
println
(
indent
(
3
)
+
listStart
);
outEmployeeFile
.
println
(
indent
(
4
)
+
itemStart
+
"<span class=\"about\">Position: "
+
position
+
"</span>"
+
itemEnd
);
outEmployeeFile
.
println
(
indent
(
4
)
+
itemStart
+
"<span class=\"about\">Position: "
+
position
+
"</span>"
+
itemEnd
);
outEmployeeFile
.
println
(
indent
(
4
)
+
itemStart
+
"<span class=\"about\">About: "
+
description
+
"</span>"
+
itemEnd
);
outEmployeeFile
.
println
(
indent
(
4
)
+
itemStart
+
"<span class=\"about\">About: "
+
description
+
"</span>"
+
itemEnd
);
outEmployeeFile
.
println
(
indent
(
4
)
+
"<img src=\""
+
"../images/staff/"
+
picture
+
"\" target=\"_blank\"></img>"
);
outEmployeeFile
.
println
(
indent
(
4
)
+
"<img src=\""
+
"../images/staff/"
+
picture
+
"\" target=\"_blank\"
alt=\""
+
altText
+
"\"
></img>"
);
outEmployeeFile
.
println
(
indent
(
3
)
+
listEnd
);
outEmployeeFile
.
println
(
indent
(
3
)
+
listEnd
);
printFooter
(
outEmployeeFile
);
printFooter
(
outEmployeeFile
);
...
...
This diff is collapsed.
Click to expand it.
Product.java
+
7
−
1
View file @
a51bf285
...
@@ -2,12 +2,14 @@ public class Product {
...
@@ -2,12 +2,14 @@ public class Product {
public
String
name
;
public
String
name
;
public
String
description
;
public
String
description
;
public
String
picture
;
public
String
picture
;
public
String
altText
;
public
double
price
;
public
double
price
;
public
Product
(
String
name
,
String
description
,
String
picture
,
double
price
)
{
public
Product
(
String
name
,
String
description
,
String
picture
,
String
altText
,
double
price
)
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
description
=
description
;
this
.
description
=
description
;
this
.
picture
=
picture
;
this
.
picture
=
picture
;
this
.
altText
=
altText
;
this
.
price
=
price
;
this
.
price
=
price
;
}
}
...
@@ -15,6 +17,10 @@ public class Product {
...
@@ -15,6 +17,10 @@ public class Product {
return
this
.
name
;
return
this
.
name
;
}
}
public
String
getAltText
()
{
return
this
.
altText
;
}
public
String
getDescription
()
{
public
String
getDescription
()
{
return
this
.
description
;
return
this
.
description
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Products.java
+
7
−
1
View file @
a51bf285
/* check out these products! */
/* check out these products! */
public
class
Products
{
/* a good class, but not as good as cse391 */
public
class
Products
{
/* a good class, but not as good as cse391 */
public
Product
joshsProduct
()
{
public
Product
joshsProduct
()
{
return
new
Product
(
"Dirt"
,
"The good stuff"
,
"dirt.jpeg"
,
0.0
);
return
new
Product
(
"Dirt"
,
"The good stuff"
,
"dirt.jpeg"
,
"some normal brown dirt"
,
0.0
);
}
}
}
}
This diff is collapsed.
Click to expand it.
Staff.java
+
14
−
2
View file @
a51bf285
public
class
Staff
{
public
class
Staff
{
public
Employee
faangPup
()
{
public
Employee
faangPup
()
{
return
new
Employee
(
"Steve"
,
"Company Pup"
,
"Provides Moral Support"
,
"pup.jpg"
);
return
new
Employee
(
"Steve"
,
"Company Pup"
,
"Provides Moral Support"
,
"pup.jpg"
,
"the goodest boi"
);
}
}
public
Employee
cjobes
()
{
public
Employee
cjobes
()
{
return
new
Employee
(
"Colton"
,
"Lead Naps Analyst"
,
"What do you mean I'm not valuable to the company?"
,
"colton.jpg"
);
return
new
Employee
(
"Colton"
,
"Lead Naps Analyst"
,
"What do you mean I'm not valuable to the company?"
,
"colton.jpg"
,
"Colton smiling with a forest in the background"
);
}
}
}
}
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