JavaScript代写 | Homework 4: JavaScript Widgets

本次JavaScript代写是使用Jquery完成页面表单的校验等

Homework 4: JavaScript Widgets

Problem 1.
Logging Paper Sales with an Autocomplete Widget.
You a building a website called Columbia Paper Infinity for the salespeople at Columbia Paper
to log their paper sales.
The interface to log sales should allow users to enter a sale, see all previously entered sales,
and delete sales. It will all be implemented in HTML, CSS, Bootstrap, JavaScript, and JQuery. It
will not have a back-end, so the results won’t actually save if you close the page and open it
again. Focus on the implementation of features, rather than design.
The requirements for the site are as follows:
1. The site should be implemented as an
§ One HTML file called 1_log_sales.html (all CSS goes here)
§ One JS file called 1_log_sales.js
2. At the top of the page should be a large header that says “Columbia Paper Infinity”
3. The user must see two text boxes: one to enter the client to whom the paper was sold,
and another to enter the number of reams of paper.
The client text entry widget should have the word “client” as placeholder text.
The reams text entry widget should be short and have the word “# reams” as
placeholder text.
4. The client box must have JQuery autocomplete populated with the names of clients
from this file:
§ Copy the data from this file into your own js file (1_log_sales.js)
§ Use the JQuery autocomplete feature. If conflicts with bootstrap, so you may
have to not to bootstrap for these text inputs (however, you will still be able to
use bootstrap for the other parts of the page.)
5. If the user enters a client name that is not in the autocomplete, add it so that it will be in
the autocomplete the next time they type the same name.
6. Beneath the client entry box, there must be a list of previously entered sales records.
The information in the records must align with the grid structure with the input boxes
above them.
§ Copy the data from this file into your own js file (1_log_sales.js)
§ You may not change the data format.
§ No <table>’s.
7. When the user enters a new sale, a new record must show up as the first record in the
list, directly below the input boxes. It must include the salesperson’s name. Hard code
the name of the salesperson in JavaScript. That will be the only person logging sales in
this assignment. This must be implemented in the Model + View/Controller style
demonstrated in class. This means that:
§ NOTE: When a change is made to the underlying data (the model), you do not
make changes to the UI (the view) directly. Instead, you first update the json
data (the model), then update the appearance (the view). This way the model
and the view are always in sync. The easiest way to update he view from the
model is to remove the entire list from the UI and then regenerate the entire list
(with the updates) from the updated data. You could do clever things with
adding and deleting elements, but removing and regenerating is actually an easy
and great way to do this.
8. For each sales record, there must be a delete button which will remove it from the list of
sales records. This must be implemented in the Model + View/Controller style
demonstrated in class. (See the above note about Model + View/Controller)
9. After the new entry is added, the interface must go back to a state where the user can
immediately start typing a new sale. This means:
§ The text boxes must clear
§ The cursor must go to the client input box.
10. There must be two ways to enter a sales record:
1. Pressing a “submit” button near the text input fields
2. Pressing “enter” in the “# reams” text input
11. If either the client field or the reams field is empty when the user tries to submit, three
things must happen:
1. The data must not submit
2. The webpage must throw produce a warning in the UI to identify each error next to
the field where it should be corrected. Do not use an alert() box.
3. The webpage must move the cursor to the first field that was empty (so that the
user can easily type there)
4. Once the data is correctly submitted, the warnings should disappear.
12. If the “# reams” is not a number (but is non-empty), the webpage must warn the user
that the number of reams is not a number in a manner consistent with the warning
produced in the previous problem. The data must not submit, and the cursor should go
back to the reams field. Do not clear the data in either field.
Here are JS + Bootstrap you will need:
<!– JQuery –>
<script src=”http://code.jquery.com/jquery-3.3.1.min.js”></script>
<script src=”https://code.jquery.com/ui/1.12.0/jquery-ui.min.js”></script>
<link rel=”stylesheet” href=”http://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css”>
<!– bootstrap same as before –>
<link rel=”stylesheet”
href=”https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css”>
Here is a screenshot of my design.
You do not have to copy it.
It should only serve as a guide to what we expect.
Problem 2:
Editing the Party Planning Committee with Drag & Drop
You a building a website called Party Planning Committee for the employee at Columbia Paper
to keep track of who is on the party planning committee by moving people on and off with a
drag and drop interface. It will all be implemented in HTML, CSS, Bootstrap, JavaScript, and
JQuery. It will not have a back-end, so the results won’t actually save if you close the page and
open it again. Focus on the implementation of features, rather than design. Design should be
minimal.
The requirements for the site are as follows:
1. The site should be implemented as
• One HTML file called 2_ppc.html (all CSS goes here)
• One JS file called 2_ppc.js
2. At the top of the page should be a large header that says “Party Planning Committee”
3. The PPC site needs to display two lists:
• People not on the PPC:
1. In its default state it should all the employees.
2. You can copy that from here:
• People on the PPC.
1. In its default state, the party planning committee is empty.
4. Each list must have a div at the top of the list with the label “Non-PPC” or “PPC”. This
label should be large enough to serve as a drop target. They should be big enough so
that it’s not painful to try to drop things there.
5. Using JQuery Draggable and Droppable events, implement an interface where the user
can drag names from the Non-PPC list to the head of the of the PPC list, and when they
drop it, the name will get added to the end of the PPC list. The reverse must also be
true: names from the PPC list can be dragged to the header of the non-PPC list to move
them off the PPC.


程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: [email protected]  微信:itcsdx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

blank

发表评论