Skip to content

Commit

Permalink
Push down demo.html and phoneItIn.js files and extract css file.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevecj committed Sep 3, 2013
1 parent 2e5587f commit 976d4ec
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 28 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,5 @@ number will look, whether there are any problems, and whether
entry is complete. Upon leaving the input, the value is re-
formatted to standard.

Note: This project is in early develpment and has just reached
the point of starting to be useful in production. It currently
works only with very modern browsers and it will be much
firendlier once it can display an indication of when a complete
phone number has been entered or when invalid or extra characters
have been entered. These indications are coming very soon.
Note that this code currently relies on features only present
in up-to-date modern browsers.
2 changes: 1 addition & 1 deletion SpecRunner.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script type="text/javascript" src="lib/jasmine-1.3.1/jasmine-html.js"></script>

<!-- include source files here... -->
<script type="text/javascript" src="src/phoneItIn.js"></script>
<script type="text/javascript" src="src/scripts/phoneItIn.js"></script>

<!-- include spec files here... -->
<script type="text/javascript" src="spec/support/phoneItInDrivers/Browser.js"></script>
Expand Down
21 changes: 0 additions & 21 deletions demo.html

This file was deleted.

16 changes: 16 additions & 0 deletions src/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles/phoneItIn.css">
</head>
<body>
<label for='name'>Name</label><input id='name' type='text' /><br />
<label for='phone'>Phone</label><input id='phone' type='tel' /><br />

<script type="text/javascript" src="scripts/phoneItIn.js"></script>
<script>
var phoneItInUI = new phoneItIn.UI();
phoneItInUI.bindToInput( document.getElementById('phone') );
</script>
</body>
</html>
27 changes: 27 additions & 0 deletions src/phoneItIn.js → src/scripts/phoneItIn.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/****
* Copyright (c) 2013 Steve Jorgensen
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
****/

/****
* See https://github.com/stevecj/phoneItIn for information and updates.
****/

var phoneItIn = phoneItIn || {};

phoneItIn.formatters = phoneItIn.formatters || {};
Expand Down
15 changes: 15 additions & 0 deletions src/styles/phoneItIn.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#phin-help {
padding: 3px
}

#phin-help-inner {
border: solid 1px #bbb; padding: 0.125em 0.25em; color: #666;
}

.phin-invalid #phin-help-inner {
background-color: #fbb; color: #844;
}

.phin-complete #phin-help-inner {
background-color: #bfb; color: #484;
}

0 comments on commit 976d4ec

Please sign in to comment.