Basic Calculator: Process operations of a calculator

Recommend this page to a friend!
  Info   View files View files (10)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 242 All time: 191 This week: 3Up
Version License JavaScript version Categories
js-basic-calculator 1.1Artistic License1.8Math
Description Author

This object can process operations of a calculator.

It can attach an handler to process the click events on form buttons of a calculator on the current page.

The object can perform the calculations with the numbers and operations clicked by the user and display the result in a read-only text input.

Currently it supports the operations for addition, subtraction, multiplication, division, percentage, inversion, memory clear, retrieve add and subtract, clear result and clear entry.

Picture of Abdoul-Madjid AMADOU
  Performance   Level  
Name: Abdoul-Madjid AMADOU <contact>
Classes: 7 packages by
Country: Benin Benin
Innovation award
Innovation award
Nominee: 1x

Winner: 1x

Details
New argument is added to the init method:
 - $options argument is added to allowed user customization.

New method is added:
- bip() method to produce sound on error

Bugs fixed
- Start new operation without initialization
- toggling equal key result to an addition to the last result
- a calculation result can not be backspaced. Backspace toggling several 
  time on a calculation result wont produce anything.
- The sign of the output result can not be changed by single click even by 
  toggling the sign key.
- key press event is now cached by the input field to avoid focus lost.

Code structure change:
- objects properties are valuable renamed to suit the coding purpose.

Change of the graphical representation:
- The calculator graphical interface (UI) is redesigned with the latest HTML and css
  version (HTML 5 and CSS3).
  Files folder image Files  
File Role Description
Files folder imageimages (1 file)
Image file basic-calculator-screenshot.jpg Screen Basic calculator screen shot
Image file calc-close-button.png Icon image file
Image file calc-drag.png Icon image file
Plain text file drag.js Appl. javascript file
HTML file example.html Example Example file
Plain text file jcalculator-1.3.css Conf. css source file
Plain text file jcalculator-1.3.js Class js source file
Plain text file jquery-1.9.1.min.js Appl. jquery latest version by time of writing this code
Plain text file readme.txt Doc. changes made

  Files folder image Files  /  images  
File Role Description
  Image file subfield.jpg Data Calculator output background image

 Version Control Unique User Downloads Download Rankings  
 0%
Total:242
This week:0
All time:191
This week:3Up