jscalc 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45993b6b9133051df015863dec96f473ecbe4b0a
|
4
|
+
data.tar.gz: 42a5a7a2f13ff520edb3428549848f9b139f11e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75d519734eec2c2e19626afa69311660c3743336b484314683f9378d16e729b840b72c439453be9f44b0e4428121814a3475c3d0396bb77651563eab7f7e48cb
|
7
|
+
data.tar.gz: 724b55040a9913a08d0a02e18928b9ec7da6e1160330a0468bad2a835d672d88fdd8c2f782cdf1d2fb75e5be416488e394066e234fb6a8533053d6fef76657e3
|
data/README.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
# JavaScript Calculator (jscalc)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/jscalc.png)](http://badge.fury.io/rb/jscalc)
|
2
3
|
|
3
|
-
jscalc is written in JavaScript and
|
4
|
-
web-page.
|
4
|
+
**jscalc is a calculator written entirely in JavaScript and CSS-3, and may be easily incorporated into a
|
5
|
+
web-page. There are no images.
|
5
6
|
|
6
7
|
To make it draggable (moveable), jQuery-UI is required.
|
7
8
|
|
8
|
-
As well as having basic mathematical functions, many in
|
9
|
-
functions, such as **Math
|
9
|
+
As well as having basic mathematical functions, many built-in JavaScript
|
10
|
+
functions, such as those available in the **Math** Object are available.
|
11
|
+
Examples are **Math.random ()** and **parseInt()**.
|
10
12
|
|
11
13
|
## Installation
|
12
14
|
|
@@ -25,14 +27,18 @@ Or install it yourself as:
|
|
25
27
|
Add the following HTML code to the page where you want the calculator to appear
|
26
28
|
|
27
29
|
>`<div id = "myCalculator">
|
30
|
+
|
28
31
|
<div id="panelDiv">
|
32
|
+
|
29
33
|
<input type ="text" id = "calcPanel" />
|
34
|
+
|
30
35
|
</div> <!--End panelDiv-->
|
36
|
+
|
31
37
|
</div><!--End myCalculator Div-->`
|
32
38
|
|
33
39
|
|
34
40
|
Add the following to the bottom of **application.html.erb** (the script file must render in the body
|
35
|
-
section of the HTML page, not in the
|
41
|
+
section of the HTML page, not in the Head section)
|
36
42
|
|
37
43
|
> `<%= javascript_include_tag "jscalc.js" %>`
|
38
44
|
|
@@ -40,7 +46,7 @@ Add the following line to the head section of **application.html.erb**
|
|
40
46
|
|
41
47
|
> `<%= stylesheet_link_tag "jscalc.css" %>`
|
42
48
|
|
43
|
-
**TO MAKE THE CALCULATOR DRAGGABLE**, ensure that jQuery-ui is installed or add the following
|
49
|
+
**TO MAKE THE CALCULATOR DRAGGABLE**, ensure that jQuery-ui is installed or add the following code to the Head section of **application.html.erb** BEFORE the stylesheet link tag.
|
44
50
|
|
45
51
|
`<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>`
|
46
52
|
|
@@ -49,6 +55,18 @@ Add the following line to the head section of **application.html.erb**
|
|
49
55
|
|
50
56
|
Math.random()
|
51
57
|
|
58
|
+
Math.PI
|
59
|
+
|
60
|
+
Math.sqrt()
|
61
|
+
|
62
|
+
Math.exp()
|
63
|
+
|
64
|
+
Math.pow(10,3)
|
65
|
+
|
66
|
+
Math.E
|
67
|
+
|
68
|
+
Math.round()
|
69
|
+
|
52
70
|
x = new Date()
|
53
71
|
|
54
72
|
x.getMonth()
|
@@ -59,8 +77,6 @@ x.getDay()
|
|
59
77
|
|
60
78
|
x.getFullYear()
|
61
79
|
|
62
|
-
Math.round()
|
63
|
-
|
64
80
|
navigator.appName
|
65
81
|
|
66
82
|
parseInt(1101,2)
|
@@ -69,6 +85,8 @@ isNaN(2)
|
|
69
85
|
|
70
86
|
typeof(2)
|
71
87
|
|
88
|
+
See [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math) for a more comprehensive list.
|
89
|
+
|
72
90
|
## Contributing
|
73
91
|
|
74
92
|
Written by Thomas Dowling ([tomgdow](http://mathematica.stackexchange.com/users/106/tomd))
|