jscalc 0.0.95 → 0.0.96
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b02f837b68168212b6f61a5b5742a68d2f8cf14
|
4
|
+
data.tar.gz: 3b41f28b27ffddf46ab1e4ffcd95d53ae22d9717
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25920e8636be26ab73e6e9f63c1538ed3f5110da42625bd94790bd096ad68b4192865fc5e0ccfaac59e932e9cd4e7732452458ec83115a16e85904051832f2eb
|
7
|
+
data.tar.gz: 1e0e6c6dad7b6d875891eb5f91b9009ff4f1248df5b2406581d2ce435760b3d74bae763c39fe99156bbd7b73906c599a93971a6108c41b89744b9e56238864d9
|
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# jscals
|
2
|
+
|
3
|
+
jscalc is a calculator written in JavaScript/CSS3
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'jscalc'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle install
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install jscalc
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Add the following HTML code to the page where you want the calculator to appear
|
22
|
+
|
23
|
+
<div id = "myCalculator">
|
24
|
+
<div id="panelDiv">
|
25
|
+
<input type ="text" id = "calcPanel" />
|
26
|
+
</div> <!--End panelDiv-->
|
27
|
+
</div><!--End myCalculator Div-->
|
28
|
+
|
29
|
+
|
30
|
+
Add the following to the bottom of application.html.erb (the script file must render in the body
|
31
|
+
section of the HTML page, not in the head section)
|
32
|
+
|
33
|
+
<%= javascript_include_tag "jscalc_v3.js" %>
|
34
|
+
|
35
|
+
Add the following line to the head section of application.html.erb
|
36
|
+
|
37
|
+
<%= stylesheet_link_tag "jscalc.css" %>
|
38
|
+
|
39
|
+
TO MAKE THE CALCULATOR DRAGGABLE, ensure that jQuery-ui is installed or add the following to the head section of application.html.erb
|
40
|
+
|
41
|
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
|
42
|
+
|
43
|
+
## Contributing
|
44
|
+
|
45
|
+
Written by Thomas Dowling (tomgdow)
|
46
|
+
The National College of Ireland
|
47
|
+
thomasgdowling@gmail.com
|
48
|
+
|
@@ -1,7 +1,15 @@
|
|
1
1
|
var pane = document.getElementById('calcPanel');
|
2
|
-
|
3
2
|
$(dragDiv);
|
4
3
|
|
4
|
+
|
5
|
+
document.getElementById('myCalculator').appendChild(elementGenerateSimple('buttonsWrapper','', "div"))
|
6
|
+
document.getElementById('buttonsWrapper').appendChild(elementGenerateSimple('calcRowOne','', "div"))
|
7
|
+
document.getElementById('buttonsWrapper').appendChild(elementGenerateSimple('calcRowTwo','', "div"))
|
8
|
+
document.getElementById('buttonsWrapper').appendChild(elementGenerateSimple('calcRowThree','', "div"))
|
9
|
+
document.getElementById('buttonsWrapper').appendChild(elementGenerateSimple('calcRowFour','', "div"))
|
10
|
+
document.getElementById('buttonsWrapper').appendChild(elementGenerateSimple('calcRowFive','', "div"))
|
11
|
+
document.getElementById('buttonsWrapper').appendChild(elementGenerateSimple('calcRowSix','', "div"))
|
12
|
+
|
5
13
|
//Functions
|
6
14
|
function dragDiv() {
|
7
15
|
$('#myCalculator').draggable();
|
@@ -91,6 +99,13 @@ function elementGenerate(myId, myClass,myContent, myElement) {
|
|
91
99
|
return myElement;
|
92
100
|
}
|
93
101
|
|
102
|
+
function elementGenerateSimple(myId,myContent, myElement) {
|
103
|
+
var myElement = document.createElement(myElement);
|
104
|
+
myElement.setAttribute("id", myId);
|
105
|
+
myElement.innerHTML = myContent;
|
106
|
+
return myElement;
|
107
|
+
}
|
108
|
+
|
94
109
|
//Generate Button Elements and Add to DOM
|
95
110
|
|
96
111
|
//Row One
|
@@ -180,4 +195,4 @@ document.addEventListener('keypress',function (e) {
|
|
180
195
|
|
181
196
|
document.getElementById('calcPanel').value = evalAlt(pane.value.replace(/[^-()\d/*+.]/g, ''));
|
182
197
|
}*/
|
183
|
-
|
198
|
+
|
@@ -2,15 +2,7 @@ h1 {
|
|
2
2
|
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
|
3
3
|
font-style: italic;
|
4
4
|
font-weight: bold;
|
5
|
-
margin-left: 10px;
|
6
5
|
}
|
7
|
-
|
8
|
-
h2 {
|
9
|
-
font-family: verdana, arial, helvetica, sans-serif;
|
10
|
-
margin-left: 50px;
|
11
|
-
font-weight: bold;
|
12
|
-
}
|
13
|
-
|
14
6
|
.mybtn {
|
15
7
|
font-size: 20px;
|
16
8
|
height: 55px;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jscalc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.96
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tomgdow
|
@@ -16,10 +16,11 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
-
- app/assets/javascripts/
|
20
|
-
- app/assets/stylesheets/
|
19
|
+
- app/assets/javascripts/jscalc.js
|
20
|
+
- app/assets/stylesheets/jscalc.css
|
21
21
|
- lib/jscalc.rb
|
22
22
|
- lib/jscalc/engine.rb
|
23
|
+
- README.md
|
23
24
|
homepage: http://rubygems.org/gems/jscalc
|
24
25
|
licenses:
|
25
26
|
- MIT
|
@@ -43,5 +44,6 @@ rubyforge_project:
|
|
43
44
|
rubygems_version: 2.1.5
|
44
45
|
signing_key:
|
45
46
|
specification_version: 4
|
46
|
-
summary: An experimental JavaScript Calculator
|
47
|
+
summary: An experimental JavaScript Calculator, which is draggable (moveable) on the
|
48
|
+
HTML page
|
47
49
|
test_files: []
|