Javascript: Measures converter (US units to Metric system and vice versa)

This project was awarded to tuanlm101 for $350 USD.

Get free quotes for a project like this
Project Budget
$250 - $750 USD
Total Bids
Project Description

General Description:

write a JS code, that identifies measurements on the current page that can be converted to the user's preference.

When a unit that can be converted is detected, it will be marked with a double underline (an example: [url removed, login to view] ), and when its hovered, the converted unit will be displayed in a tooltip bubble.


The JS code will be injected to any page the user loads via an addon for IE 7-10/Firefox/Chrome to any page.

The addon that injects the JS is already built, no need for it.

Supported unit systems:

The metric system -

* Length - meter, kilometer, centimeter, decimeter, millimeter

* Weight - kilogram, gram, milligram, tonne

* Volume - cubic meter, cubic centimeter, cubic decimeter, liter, milliliter

* Area - square centimeter, Square meter, square kilometer

* Temperature - Celsius

US Units -

* Length - inch, foot, yard, mile

* Weight - ounce, pound

* Volume - cubic foot, cubic inch, pint, gallon, fluid ounce

* Area - square inch, square yard, square foot, acre, square mile

* Temperature - Fahrenheit

The tooltip will include a 'settings' icon. when clicked: the user will be able to choose his preferred unit system (Metric / US / Both). After the user has made his choice, the tooltip will appear only for units that are not part of the unit system chosen, and will display the tooltip in his chosen preference unit system.

If no preference was chosen, the tooltip will appear for both variations.

General guidelines:

* The JS code needs to work cross-browser (IE 7-10, FF, Chrome)

* The JS code needs to work on as many Doctypes as possible (a list of doctypes with demo pages can be found here: [url removed, login to view] )

* There wont be any use of external frameworks (jQuery/prototype/YUI, etc.)

* The code should be as efficient as possible

* The code should contain basic documentation (commented code)

* The JS should contain a configuration section (to change icons/texts/colors)

Storing Data:

Will be required to store the user settings: Since the JS code will be injected to multiple domains - cookies will not work across domains.

As said, the JS will be injected via an addon that we already developed.

The addon we use to inject the JS will soon expose an API that will allow the injected JS to store data across domains (by utilizing the addon-level code).

It will take some time until the development will be done and fully tested, so we wont be able to use this functionality in the near future.

Bottom line, for saving the data:

Maintain set/get functions, that will save the data, in the following manner -

function get(hostName) {...} // returns a JSON with the saved data for hostName

function set(hostName, dataToSave) {...} // reads the JSON that is already stored for hostName (if exists), and adds dataToSave to it

These functions will inject an iframe to the DOM on a domain that will centralize the data saving/loading.

We will also provide the details for the data saving via our API, so please include the alternative for using it, so we'll be able to remove the iframe solution and handle data setting/getting with the addon-level based code.

The design that will be used in the addon will also be provided, and the design should be implemented as part of the project.

Awarded to:
Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online