Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
nandomoreirame committed Jan 16, 2017
2 parents 17bd45c + e2a9cf8 commit 847b029
Show file tree
Hide file tree
Showing 20 changed files with 311 additions and 208 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.html]
indent_size = 4
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ Thumbs.db

# Node Modules #
################
node_modules
node_modules/
.publish/
.dist/

25 changes: 25 additions & 0 deletions docs/example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>JQuery Price Format - Examples</title>
<link href="//fonts.googleapis.com/css?family=Architects+Daughter" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="../stylesheets/github-light.css" media="screen">
<link rel="stylesheet" type="text/css" href="../stylesheets/print.css" media="print">
</head>
<body>
<div id="content-wrapper">
<div class="inner clearfix">
<section id="main-content">
<h1>JQuery Price Format - Examples</h1>
<p><a href="./jquery/">jQuery example</a></p>
<p><a href="./prototype/">Prototype example</a></p>
</section>
</div>
</div>
</body>
</html>
163 changes: 163 additions & 0 deletions docs/example/jquery/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>JQuery Price Format Examples</title>
<link href="//fonts.googleapis.com/css?family=Architects+Daughter" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../../stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="../../stylesheets/github-light.css" media="screen">
<link rel="stylesheet" type="text/css" href="../../stylesheets/print.css" media="print">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../javascripts/jquery.priceformat.min.js"></script>
<script type="text/javascript">
$(function() {
// Example 1
$('#example1').priceFormat();

// Example 2
$('#example2').priceFormat({
prefix: 'R$ ',
centsSeparator: ',',
thousandsSeparator: '.'
});

// Example 3
$('#example3').priceFormat({
prefix: '',
thousandsSeparator: '',
clearOnEmpty: true
});

// Example 4
$('#example4').priceFormat({
limit: 2,
centsLimit: 1
});

// Example 5
$('#example5').priceFormat({
clearPrefix: true
});

// Example 6
$('#example6').priceFormat({
allowNegative: true
});

$("#unmask-test").click(function() {
alert($('#example6').unmask());
});

// Example 7
$('#example7').priceFormat({
prefix: 'R$',
suffix: '$$',
clearSuffix: true,
clearPrefix: true
});

$("#unprice-test").click(function() {
$('#example7').unpriceFormat();
});

$("#price-test").click(function() {
$('#example7').priceFormat({
prefix: 'R$',
suffix: '$$',
clearSuffix: true,
clearPrefix: true
});
});

// Example 8
$('#example8').priceFormat({
prefix: 'R$ ',
allowNegative: true
});

$("#float-test").click(function() {
alert($('#example8').priceToFloat());
});

// Example 9
$('#example9').priceFormat({
prefix: '',
thousandsSeparator: '',
insertPlusSign: true
});

// Example 10
$('#htmlfield').priceFormat({
prefix: 'R$ ',
centsSeparator: ',',
thousandsSeparator: '.',
insertPlusSign: true
});
});
</script>
</head>
<body>
<div id="content-wrapper">
<div class="inner clearfix">
<section id="main-content">
<h1>JQuery Price Format Examples</h1>

<p>
1 - Basic usage
<input type="text" value="" id="example1" name="example1">
</p>

<p>
2 - Customize
<input type="text" value="123456" id="example2" name="example2">
</p>

<p>
3 - Skipping some option and Cleanup on Empty
<input type="text" value="123456" id="example3" name="example3">
</p>

<p>
4 - Working with limits
<input type="text" value="123456" id="example4" name="example4">
</p>

<p>
5 - Clear Prefix on Blur
<input type="text" value="123456" id="example5" name="example5">
</p>

<p>
6 - Allow Negatives and Unmask function
<input type="text" value="-123456" id="example6" name="example6">
<button id="unmask-test" class="button">Alert Value Unmask</button>
</p>

<p>
7 - Add Suffix and Prefix and clean them on blur. Also buttons to unprice and price the input
<input type="text" value="123456" id="example7" name="example7">
<button id="unprice-test" class="button">Unprice Format</button>
<button id="price-test" class="button">Price Format</button>
</p>

<p>
8 - To Float
<input type="text" value="-123456" id="example8" name="example8">
<button id="float-test" class="button">Alert Float value</button>
</p>

<p>
9 - Using the plus sign
<input type="text" value="123456" id="example9" name="example9">
</p>

<h4>10 - Price a span HTML Tag <span id="htmlfield">1234567</span></h4>
</section>
</div>
</div>
</body>
</html>
32 changes: 32 additions & 0 deletions docs/example/prototype/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>JQuery Price Format - Prototype Version - Example</title>
<link href="//fonts.googleapis.com/css?family=Architects+Daughter" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../../stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="../../stylesheets/github-light.css" media="screen">
<link rel="stylesheet" type="text/css" href="../../stylesheets/print.css" media="print">

<script src="//ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js"></script>
<script type="text/javascript" src="../../javascripts/prototype.priceformat.min.js"></script>
<script type="text/javascript">
document.observe("dom:loaded", function() {
new NumberFormat('money', {prefix: 'U$', thousandsSeparator: ',', allowNegative: true});
});
</script>
</head>
<body>
<div id="content-wrapper">
<div class="inner clearfix">
<section id="main-content">
<h1>JQuery Price Format - Prototype Version - Example</h1>
<p><input type="text" value="123456" id="money" name="example1"></p>
</section>
</div>
</div>
</body>
</html>
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
20 changes: 6 additions & 14 deletions index.html → docs/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">

<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<title>Jquery-price-format by flaviosilveira</title>
<link href="//fonts.googleapis.com/css?family=Architects+Daughter" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="./stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="./stylesheets/github-light.css" media="screen">
<link rel="stylesheet" type="text/css" href="./stylesheets/print.css" media="print">
</head>

<body>
<header>
<div class="inner">
Expand All @@ -31,7 +25,7 @@ <h2>jQuery Price Format Plugin is useful to format input fields and HTML element
<h1>
<a id="jquery-price-format" class="anchor" href="#jquery-price-format" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Jquery-Price-Format</h1>

<p>jQuery Price Format Plugin is useful to format input fields and HTML elements as prices.
<p>jQuery Price Format Plugin is useful to format input fields and HTML elements as prices.
For example, if you type 123456, the plugin updates it to US$ 1,234.56.</p>

<p>Yes, we also have a prototype version but it is out of maintenace.</p>
Expand Down Expand Up @@ -174,7 +168,5 @@ <h3>
</aside>
</div>
</div>


</body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions stylesheets/stylesheet.css → docs/stylesheets/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,23 @@ form {

}

input[type="text"],
button.button {
padding: 0 12px;
border-radius: 3px;
line-height: 30px;
margin: 0 0 5px;
}

input[type="text"] {
border: 1px solid #acacac;
}

button.button {
border: 1px solid #2e7fde;
background-color: #2e7fde;
color: #fff;
}

/* GENERAL ELEMENT TYPE STYLES */

Expand Down
Loading

0 comments on commit 847b029

Please sign in to comment.