jscalc 0.0.96 → 0.0.99
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +45 -8
- data/app/assets/stylesheets/jscalc.css +1 -5
- 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: 0f27b0b20844ccc8fb246eef995bffcaeb005d0c
|
4
|
+
data.tar.gz: b0f4a0ecfbf2cb938aa3490d85753137808412de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ac35995c7d4cdbb1e6d4ca1c0c480b67525f6b7db7c9b9c06574bad7fe1ac6763f8bd212f164b8dc90d7885e20347b1b2efba74e88fe84e7f0465a6e27fc2e6
|
7
|
+
data.tar.gz: bdb502540645420a29972c6e53a0f140ea193f39267b4571331fc6ec0cc9abe50e09fd1dbed570e361a9bd8c3ddb0c2a1025acf10546994e2049b0ca2dd5fec9
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# jscals
|
2
2
|
|
3
3
|
jscalc is a calculator written in JavaScript/CSS3
|
4
|
+
As well as having basic calculator functions, many in-build JavaScript
|
5
|
+
functions (such as Math.random ()) are available
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -16,33 +18,68 @@ Or install it yourself as:
|
|
16
18
|
|
17
19
|
$ gem install jscalc
|
18
20
|
|
19
|
-
## Usage
|
20
|
-
|
21
21
|
Add the following HTML code to the page where you want the calculator to appear
|
22
22
|
|
23
|
-
<div id = "myCalculator">
|
23
|
+
**"<div id = "myCalculator">
|
24
24
|
<div id="panelDiv">
|
25
25
|
<input type ="text" id = "calcPanel" />
|
26
26
|
</div> <!--End panelDiv-->
|
27
|
-
</div><!--End myCalculator Div-->
|
27
|
+
</div><!--End myCalculator Div-->"**
|
28
28
|
|
29
29
|
|
30
30
|
Add the following to the bottom of application.html.erb (the script file must render in the body
|
31
31
|
section of the HTML page, not in the head section)
|
32
32
|
|
33
|
-
|
33
|
+
**<%= javascript_include_tag "jscalc.js" %>**
|
34
34
|
|
35
35
|
Add the following line to the head section of application.html.erb
|
36
36
|
|
37
|
-
|
37
|
+
**<%= stylesheet_link_tag "jscalc.css" %>**
|
38
|
+
|
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.
|
40
|
+
|
41
|
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
|
42
|
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
|
43
|
+
## Usage
|
44
|
+
|
45
|
+
Math.random()
|
46
|
+
|
47
|
+
x = new Date()
|
48
|
+
|
49
|
+
x.getMonth() => 8
|
50
|
+
|
51
|
+
x.getDate() => 26
|
52
|
+
|
53
|
+
x.getDay() => 4
|
54
|
+
|
55
|
+
x.getFullYear() => 13
|
56
|
+
|
57
|
+
x.getHours()
|
38
58
|
|
39
|
-
|
59
|
+
x.getMinutes()
|
40
60
|
|
41
|
-
|
61
|
+
x.getSeconds()
|
62
|
+
|
63
|
+
x.getMilliseconds();
|
64
|
+
|
65
|
+
Math.round();
|
66
|
+
|
67
|
+
navigator.appName
|
68
|
+
|
69
|
+
parseInt(1101,2)
|
70
|
+
|
71
|
+
isNaN(2)
|
72
|
+
|
73
|
+
typeof(2)
|
42
74
|
|
43
75
|
## Contributing
|
44
76
|
|
45
77
|
Written by Thomas Dowling (tomgdow)
|
78
|
+
|
46
79
|
The National College of Ireland
|
80
|
+
|
47
81
|
thomasgdowling@gmail.com
|
48
82
|
|
83
|
+
|
84
|
+
|
85
|
+
|