jscalc 0.0.99 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +28 -33
- 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: 1141416178bf3601fd9f28706f5a6f6072c0d38f
|
4
|
+
data.tar.gz: de14e1caa5e743c6a4c331b8b0e829c35ed3d53a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0ff32264b628056399ea3f0da90c84d40c18b21b93f4161ba6ccdcde2e3fe2195aeed59ced827f884c896fd5c255619b110ed7246cc8b10ee456aba59dd3dac
|
7
|
+
data.tar.gz: 423ae4292347533757a62d466dd26085f13af58171ce5ef1b20289ce6a7f7503e62268d6ac9b1ed6b6725db772e2846ed0d7b8f1569cdb9649058232901e3488
|
data/README.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
#
|
1
|
+
# JavaScript Calculator (jscalc)
|
2
2
|
|
3
|
-
jscalc is
|
4
|
-
|
5
|
-
|
3
|
+
jscalc is written in JavaScript and CSS3, and may be easilty incorporated into a
|
4
|
+
web-page.
|
5
|
+
|
6
|
+
To make it draggable (moveable), jQuery-UI is required.
|
7
|
+
|
8
|
+
As well as having basic mathematical functions, many in-build JavaScript
|
9
|
+
functions, such as **Math.random ()**, are available
|
6
10
|
|
7
11
|
## Installation
|
8
12
|
|
@@ -20,49 +24,43 @@ Or install it yourself as:
|
|
20
24
|
|
21
25
|
Add the following HTML code to the page where you want the calculator to appear
|
22
26
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
><div id = "myCalculator">
|
28
|
+
> <div id="panelDiv">
|
29
|
+
><input type ="text" id = "calcPanel" />
|
30
|
+
> </div> <!--End panelDiv-->
|
31
|
+
></div><!--End myCalculator Div-->
|
32
|
+
|
28
33
|
|
29
34
|
|
30
|
-
Add the following to the bottom of application.html.erb (the script file must render in the body
|
35
|
+
Add the following to the bottom of **application.html.erb** (the script file must render in the body
|
31
36
|
section of the HTML page, not in the head section)
|
32
37
|
|
33
|
-
|
38
|
+
>**<%= javascript\_include\_tag "jscalc.js" %>**
|
34
39
|
|
35
|
-
Add the following line to the head section of application.html.erb
|
40
|
+
Add the following line to the head section of **application.html.erb**
|
36
41
|
|
37
|
-
|
42
|
+
>**<%= stylesheet\_link\_tag "jscalc.css" %>**
|
38
43
|
|
39
|
-
**TO MAKE THE CALCULATOR DRAGGABLE**, ensure that jQuery-ui is installed or add the following files to the head section of application.html.erb BEFORE the stylesheet link tag.
|
44
|
+
**TO MAKE THE CALCULATOR DRAGGABLE**, ensure that jQuery-ui is installed or add the following files to the head section of **application.html.erb** BEFORE the stylesheet link tag.
|
40
45
|
|
41
|
-
|
42
|
-
|
46
|
+
> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
|
47
|
+
|
48
|
+
><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
|
43
49
|
## Usage
|
44
50
|
|
45
51
|
Math.random()
|
46
52
|
|
47
53
|
x = new Date()
|
48
54
|
|
49
|
-
x.getMonth()
|
50
|
-
|
51
|
-
x.getDate() => 26
|
52
|
-
|
53
|
-
x.getDay() => 4
|
55
|
+
x.getMonth()
|
54
56
|
|
55
|
-
x.
|
57
|
+
x.getDate()
|
56
58
|
|
57
|
-
x.
|
59
|
+
x.getDay()
|
58
60
|
|
59
|
-
x.
|
61
|
+
x.getFullYear()
|
60
62
|
|
61
|
-
|
62
|
-
|
63
|
-
x.getMilliseconds();
|
64
|
-
|
65
|
-
Math.round();
|
63
|
+
Math.round()
|
66
64
|
|
67
65
|
navigator.appName
|
68
66
|
|
@@ -74,12 +72,9 @@ typeof(2)
|
|
74
72
|
|
75
73
|
## Contributing
|
76
74
|
|
77
|
-
Written by Thomas Dowling (tomgdow)
|
75
|
+
Written by Thomas Dowling ([tomgdow](http://mathematica.stackexchange.com/users/106/tomd))
|
78
76
|
|
79
77
|
The National College of Ireland
|
80
78
|
|
81
79
|
thomasgdowling@gmail.com
|
82
80
|
|
83
|
-
|
84
|
-
|
85
|
-
|