Skip to content

Commit 6298dc8

Browse files
author
jSAS
authored
Merge pull request #1 from jsas-development/v1.0.0
1.0.0
2 parents 6705ca2 + b3b84b1 commit 6298dc8

File tree

7 files changed

+677
-3
lines changed

7 files changed

+677
-3
lines changed

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* -crlf
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Cache #
2+
###################
3+
*.cache
4+
5+
# Packages #
6+
############
7+
# it's better to unpack these files and commit the raw source
8+
# git has its own built in compression methods
9+
*.7z
10+
*.dmg
11+
*.gz
12+
*.iso
13+
*.jar
14+
*.tar
15+
16+
# Logs #
17+
######################
18+
*.log
19+
20+
# Backups #
21+
###########
22+
*.bak
23+
*.old
24+
25+
# OS generated files #
26+
######################
27+
.DS_Store
28+
.DS_Store?
29+
.Spotlight-V100
30+
.Trashes
31+
ehthumbs.db
32+
Thumbs.db
33+
34+
# Other #
35+
#########
36+
*App_Data*
37+
*aspnet_client*
38+
_project
39+
*error_log*
40+
*access_log*
41+
*.sass-cache
42+
*.idea*
43+
*.buildpath
44+
.buildpath
45+
*.project
46+
.project
47+
*nbproject*
48+
*.settings*
49+
*.lnk
50+
*.user.ini
51+
*.url
52+
_site
53+
_admin
54+
_project
55+
_info
56+
_shortcuts
57+
.permissions.sh
58+
.publish.sh
59+
.refresh.sh
60+
.database.sh
61+
.make-site.sh
62+
.commit.sh
63+
.permissions.cmd
64+
.publish.cmd
65+
.refresh.cmd
66+
.database.cmd
67+
.make-site.cmd
68+
.simple-refresh.cmd
69+
.build.cmd
70+
.git-load.cmd
71+
.load-git.cmd
72+
.migrate.cmd
73+
.new-migration.cmd
74+
*~
75+
*backwpup_log_*.html
76+
.picasa.ini
77+
*.sublime
78+
*.sublime*
79+
*.svn*
80+
*prepros*
81+
82+
# Composer #
83+
######################
84+
.composer-install.cmd
85+
.composer-update.cmd
86+
/vendor
87+
88+
# BackWPup #
89+
######################
90+
*backwpup-*-temp*
91+
*backwpup-*-logs*
92+
93+
# DevHtaccess #
94+
######################
95+
/.htaccess.dev
96+
97+
# Magento #
98+
######################
99+
/var/cache
100+
/var/session
101+
102+
# Other #
103+
######################
104+
/.admin
105+
/upstream.sh

README.md

Lines changed: 89 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,89 @@
1-
# jQuery Numeric()
2-
3-
Allows only valid numbers to be typed into a text box. Can take negative numbers and a decimal point. You can also supply a callback that runs when focus is lost and the value in the text box is not a valid number.
1+
# jQuery.numeric()
2+
3+
Allows only valid numbers to be typed into a text box. Can take negative numbers and a decimal point. You can also supply a callback that runs when focus is lost and the value in the text box is not a valid number.
4+
5+
Original Plugin: http://www.texotela.co.uk/code/jquery/numeric/.
6+
7+
## Usage
8+
9+
```html
10+
<!DOCTYPE html>
11+
<html>
12+
<head>
13+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
14+
<script type="text/javascript" src="jquery.numeric.min.js"></script>
15+
</head>
16+
<body>
17+
<form>
18+
<label for="numbers-only">Numbers only:</label>
19+
<input class="numeric" type="text" id="numbers-only" />
20+
<br /><br />
21+
<label for="integers-only">Integers only:</label>
22+
<input class="integer" type="text" id="integers-only" />
23+
<br /><br />
24+
<label for="positive">No negative values:</label>
25+
<input class="positive" type="text" id="positive"/>
26+
<br /><br />
27+
<label for="no-negative">No negative values (integer only):</label>
28+
<input class="positive-integer" type="text" id="no-negative"/>
29+
<br /><br />
30+
<label for="decimal-2-places">Numbers with up to 2 decimal places:</label>
31+
<input class="decimal-2-places" type="text" id="decimal-2-places"/>
32+
<br /><br />
33+
<label for="alternative-decimal-separator">Alternative (,) changes to standard (.) decimal separator:</label>
34+
<input class="alternative-decimal-separator" type="text" id="alternative-decimal-separator"/>
35+
<br /><br />
36+
<label for="alternative-decimal-separator-reverse">Reverse change from alternative (.) to standard (,) decimal separator:</label>
37+
<input class="alternative-decimal-separator-reverse" type="text" id="alternative-decimal-separator-reverse" />
38+
<br /><br />
39+
<a href="#" id="remove">Remove numeric</a>
40+
</form>
41+
<script type="text/javascript">
42+
$('.numeric').numeric();
43+
44+
$('.integer').numeric(
45+
false,
46+
function () {
47+
alert('Integers only');
48+
this.value = '';
49+
this.focus();
50+
}
51+
);
52+
53+
$('.positive').numeric(
54+
{negative: false},
55+
function () {
56+
alert('No negative values');
57+
this.value = '';
58+
this.focus();
59+
}
60+
);
61+
62+
$('.positive-integer').numeric(
63+
{decimal: false, negative: false},
64+
function () {
65+
alert('Positive integers only');
66+
this.value = '';
67+
this.focus();
68+
}
69+
);
70+
71+
$('.decimal-2-places').numeric({decimalPlaces: 2});
72+
73+
$('.alternative-decimal-separator').numeric({altDecimal: ','});
74+
75+
$('.alternative-decimal-separator-reverse').numeric({altDecimal: '.', decimal: ','});
76+
77+
$('#remove').on(
78+
'click',
79+
function (e) {
80+
e.preventDefault();
81+
82+
$('.numeric,.integer,.positive,.positive-integer,.decimal-2-places,.alternative-decimal-separator,.alternative-decimal-separator-reverse').removeNumeric();
83+
}
84+
);
85+
</script>
86+
</body>
87+
</html>
88+
```
89+

examples/numeric.html

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
5+
<script type="text/javascript" src="../jquery.numeric.min.js"></script>
6+
</head>
7+
<body>
8+
<form>
9+
<label for="numbers-only">Numbers only:</label>
10+
<input class="numeric" type="text" id="numbers-only" />
11+
<br /><br />
12+
<label for="integers-only">Integers only:</label>
13+
<input class="integer" type="text" id="integers-only" />
14+
<br /><br />
15+
<label for="positive">No negative values:</label>
16+
<input class="positive" type="text" id="positive"/>
17+
<br /><br />
18+
<label for="no-negative">No negative values (integer only):</label>
19+
<input class="positive-integer" type="text" id="no-negative"/>
20+
<br /><br />
21+
<label for="decimal-2-places">Numbers with up to 2 decimal places:</label>
22+
<input class="decimal-2-places" type="text" id="decimal-2-places"/>
23+
<br /><br />
24+
<label for="alternative-decimal-separator">Alternative (,) changes to standard (.) decimal separator:</label>
25+
<input class="alternative-decimal-separator" type="text" id="alternative-decimal-separator"/>
26+
<br /><br />
27+
<label for="alternative-decimal-separator-reverse">Reverse change from alternative (.) to standard (,) decimal separator:</label>
28+
<input class="alternative-decimal-separator-reverse" type="text" id="alternative-decimal-separator-reverse" />
29+
<br /><br />
30+
<a href="#" id="remove">Remove numeric</a>
31+
</form>
32+
<script type="text/javascript">
33+
$('.numeric').numeric();
34+
35+
$('.integer').numeric(
36+
false,
37+
function () {
38+
alert('Integers only');
39+
this.value = '';
40+
this.focus();
41+
}
42+
);
43+
44+
$('.positive').numeric(
45+
{negative: false},
46+
function () {
47+
alert('No negative values');
48+
this.value = '';
49+
this.focus();
50+
}
51+
);
52+
53+
$('.positive-integer').numeric(
54+
{decimal: false, negative: false},
55+
function () {
56+
alert('Positive integers only');
57+
this.value = '';
58+
this.focus();
59+
}
60+
);
61+
62+
$('.decimal-2-places').numeric({decimalPlaces: 2});
63+
64+
$('.alternative-decimal-separator').numeric({altDecimal: ','});
65+
66+
$('.alternative-decimal-separator-reverse').numeric({altDecimal: '.', decimal: ','});
67+
68+
$('#remove').on(
69+
'click',
70+
function (e) {
71+
e.preventDefault();
72+
73+
$('.numeric,.integer,.positive,.positive-integer,.decimal-2-places,.alternative-decimal-separator,.alternative-decimal-separator-reverse').removeNumeric();
74+
}
75+
);
76+
</script>
77+
</body>
78+
</html>

0 commit comments

Comments
 (0)