Skip to content

Commit

Permalink
updated defaultCountryIp.js to use function
Browse files Browse the repository at this point in the history
  • Loading branch information
jackocnr committed Jun 5, 2015
1 parent 53a1ae2 commit f46bb7e
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 30 deletions.
10 changes: 5 additions & 5 deletions examples/gen/country-sync.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>Example: Country sync</title>
<link rel="stylesheet" href="../css/prism.css">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1426268823984">
<link rel="stylesheet" href="../../build/css/demo.css?1426268823984">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1433496965848">
<link rel="stylesheet" href="../../build/css/demo.css?1433496965848">

<link rel="stylesheet" href="../css/countrySync.css?1426268823984">
<link rel="stylesheet" href="../css/countrySync.css?1433496965848">


<!-- GOOGLE ANALYTICS -->
Expand Down Expand Up @@ -95,7 +95,7 @@ <h2>Result</h2>

<script src="../js/prism.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../../build/js/intlTelInput.js?1426268823984"></script>
<script src="../js/countrySync.js?1426268823984"></script>
<script src="../../build/js/intlTelInput.js?1433496965848"></script>
<script src="../js/countrySync.js?1433496965848"></script>
</body>
</html>
14 changes: 10 additions & 4 deletions examples/gen/default-country-ip.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="utf-8">
<title>Example: Lookup user&#39;s country</title>
<link rel="stylesheet" href="../css/prism.css">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1426268823984">
<link rel="stylesheet" href="../../build/css/demo.css?1426268823984">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1433496965848">
<link rel="stylesheet" href="../../build/css/demo.css?1433496965848">


<!-- GOOGLE ANALYTICS -->
Expand Down Expand Up @@ -33,6 +33,12 @@ <h2>Markup</h2>
<h2>Code</h2>
<pre><code class="language-javascript">$(&quot;#phone&quot;).intlTelInput({
defaultCountry: &quot;auto&quot;,
geoIpLookup: function(callback) {
$.get(&#39;http://ipinfo.io&#39;, function() {}, &quot;jsonp&quot;).always(function(resp) {
var countryCode = (resp &amp;&amp; resp.country) ? resp.country : &quot;&quot;;
callback(countryCode);
});
},
utilsScript: &quot;../../lib/libphonenumber/build/utils.js&quot; // just for formatting/placeholders etc
});</code></pre>

Expand All @@ -43,7 +49,7 @@ <h2>Result</h2>

<script src="../js/prism.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../../build/js/intlTelInput.js?1426268823984"></script>
<script src="../js/defaultCountryIp.js?1426268823984"></script>
<script src="../../build/js/intlTelInput.js?1433496965848"></script>
<script src="../js/defaultCountryIp.js?1433496965848"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/gen/hidden-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="utf-8">
<title>Example: Submitting the full international number when in nationalMode</title>
<link rel="stylesheet" href="../css/prism.css">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1426268823984">
<link rel="stylesheet" href="../../build/css/demo.css?1426268823984">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1433496965848">
<link rel="stylesheet" href="../../build/css/demo.css?1433496965848">


<!-- GOOGLE ANALYTICS -->
Expand Down Expand Up @@ -55,7 +55,7 @@ <h2>Result</h2>

<script src="../js/prism.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../../build/js/intlTelInput.js?1426268823984"></script>
<script src="../js/hiddenInput.js?1426268823984"></script>
<script src="../../build/js/intlTelInput.js?1433496965848"></script>
<script src="../js/hiddenInput.js?1433496965848"></script>
</body>
</html>
10 changes: 5 additions & 5 deletions examples/gen/is-valid-number.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>Example: Validation</title>
<link rel="stylesheet" href="../css/prism.css">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1426268823984">
<link rel="stylesheet" href="../../build/css/demo.css?1426268823984">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1433496965848">
<link rel="stylesheet" href="../../build/css/demo.css?1433496965848">

<link rel="stylesheet" href="../css/isValidNumber.css?1426268823984">
<link rel="stylesheet" href="../css/isValidNumber.css?1433496965848">


<!-- GOOGLE ANALYTICS -->
Expand Down Expand Up @@ -73,7 +73,7 @@ <h2>Result</h2>

<script src="../js/prism.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../../build/js/intlTelInput.js?1426268823984"></script>
<script src="../js/isValidNumber.js?1426268823984"></script>
<script src="../../build/js/intlTelInput.js?1433496965848"></script>
<script src="../js/isValidNumber.js?1433496965848"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/gen/modify-country-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="utf-8">
<title>Example: Modify country data</title>
<link rel="stylesheet" href="../css/prism.css">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1426268823984">
<link rel="stylesheet" href="../../build/css/demo.css?1426268823984">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1433496965848">
<link rel="stylesheet" href="../../build/css/demo.css?1433496965848">


<!-- GOOGLE ANALYTICS -->
Expand Down Expand Up @@ -47,7 +47,7 @@ <h2>Result</h2>

<script src="../js/prism.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../../build/js/intlTelInput.js?1426268823984"></script>
<script src="../js/modifyCountryData.js?1426268823984"></script>
<script src="../../build/js/intlTelInput.js?1433496965848"></script>
<script src="../js/modifyCountryData.js?1433496965848"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/gen/national-mode.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="utf-8">
<title>Example: National Mode</title>
<link rel="stylesheet" href="../css/prism.css">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1426268823984">
<link rel="stylesheet" href="../../build/css/demo.css?1426268823984">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1433496965848">
<link rel="stylesheet" href="../../build/css/demo.css?1433496965848">


<!-- GOOGLE ANALYTICS -->
Expand Down Expand Up @@ -58,7 +58,7 @@ <h2>Result</h2>

<script src="../js/prism.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../../build/js/intlTelInput.js?1426268823984"></script>
<script src="../js/nationalMode.js?1426268823984"></script>
<script src="../../build/js/intlTelInput.js?1433496965848"></script>
<script src="../js/nationalMode.js?1433496965848"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/gen/only-countries-europe.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="utf-8">
<title>Example: European countries</title>
<link rel="stylesheet" href="../css/prism.css">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1426268823984">
<link rel="stylesheet" href="../../build/css/demo.css?1426268823984">
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1433496965848">
<link rel="stylesheet" href="../../build/css/demo.css?1433496965848">


<!-- GOOGLE ANALYTICS -->
Expand Down Expand Up @@ -46,7 +46,7 @@ <h2>Result</h2>

<script src="../js/prism.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../../build/js/intlTelInput.js?1426268823984"></script>
<script src="../js/onlyCountriesEurope.js?1426268823984"></script>
<script src="../../build/js/intlTelInput.js?1433496965848"></script>
<script src="../js/onlyCountriesEurope.js?1433496965848"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions examples/js/defaultCountryIp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
$("#phone").intlTelInput({
defaultCountry: "auto",
geoIpLookup: function(callback) {
$.get('http://ipinfo.io', function() {}, "jsonp").always(function(resp) {
var countryCode = (resp && resp.country) ? resp.country : "";
callback(countryCode);
});
},
utilsScript: "../../lib/libphonenumber/build/utils.js" // just for formatting/placeholders etc
});

0 comments on commit f46bb7e

Please sign in to comment.