1. When a page is loaded, the script inserts current ratings for each element and binds mouse actions to elements. If a user clicks on stars to give his rating of the element, the script sends this to API endpoint and then receives a response, adjusts visible start and informs a user about success or faillure.
2. On some pages there are multiple objects with their ratings, on some there is only a single entity with its rating.
3. "data-id" HTML parameter (example: "8.47-6053") is a combination of average rating and entity ID.
4. No additional libraries/dependencies/files may be required to run this code after you make your changes.
5. Serverside (PHP) code is OK, it will not be modified and SHOULD NOT BE AFFECTED by this JS code change. The API endpoint should receive the data in the same format as before.
6. All endpoints, URLs, included HTML code, CSS class names, comments and variable names (wherever possible) should remain unmodified. The main thing is to convert the jQuery functions and logic to Vanilla JS.
7. Do not change the logic of the script. It should work just after replacing current version.
8. Keep in mind that jQuery .append() / .prepend() and JS [login to view URL]() / [login to view URL]() functions do not work exactly the same way. [login to view URL]("<p>Hello</p>") does not insert a HTML paragraph node with "Hello "text inside, it just inserts "<p>Hello</p>" text inside element.
I attach a JS file with the jQuery code be converted and - for your reference, do not to update it - second file with example of usage in the HTML code (multiple elements on a single page). Please convert code in the JS file.
1. Before posting an offer, look at the script carefully and be sure you are really able to convert it.
2. If your offer is selected, before submitting the converted code please ensure that all jQuery code/functions are updated. I don't want to waste time to send code to correction multiple times. Money will not be paid untid the code is completly and correctly converted. After receiving code I need some time (1-2 days) to check and verify. I may not be able to do this right away after receiving the code.
3. Deadline for delivering your first version of code (hopefully correct from the beginning) is 3 days from the moment I accept your offer. Final deadline for delivering completly converted and correct working code, including my checking/verifying time and your time for correctios, is 5 days from the moment I accept your offer.