Permalink
Browse files

Merge pull request #4 from giggsey/rewrite

Recent changes
  • Loading branch information...
giggsey committed Oct 5, 2017
2 parents 6a486ef + 1b390b2 commit 087b45d16592cf9dc744e1479927964b1b5b9ff2
Showing with 151 additions and 174 deletions.
  1. +0 −3 .gitignore
  2. +14 −0 README.md
  3. +0 −8 bower.json
  4. +0 −26 gulpfile.js
  5. +0 −15 index.php
  6. +0 −7 package.json
  7. +0 −23 resources/assets/sass/app.scss
  8. +7 −0 resources/css/app.css
  9. +49 −29 templates/_page.twig
  10. +22 −12 templates/data.twig
  11. +2 −2 templates/error.twig
  12. +31 −27 templates/home.twig
  13. +26 −22 templates/inputData.twig
View
@@ -1,4 +1 @@
.idea/
vendor/
bower_components/
/node_modules
View
@@ -2,3 +2,17 @@ libphonenumber-example
======================
Source of a demo website showing the functionality of libphonenumber as well as the Geolocation.
### Todo
- Get rid of Bower / SASS requirement (no point)
- Show examples in PHP for each function
- Allow multiple versions of libphonenumber (to compare versions)
- Demo all features
- Phone Number Util
- Short Number Info
- Geolocation
- Carrier Mapping
- Timezone Mapping
- Phone Number Matcher
- As You Type Formatter
View

This file was deleted.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.
View
@@ -24,21 +24,6 @@
$twig->addFunction('get_class', new Twig_Function_Function('get_class'));
$twig->addFunction(
new Twig_SimpleFunction(
'elixir', function ($file) {
// Borrowed from Laravel
$manifest = json_decode(file_get_contents(__DIR__ . '/build/rev-manifest.json'), true);
if (isset($manifest[$file])) {
return 'build/' . $manifest[$file];
}
throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
}
)
);
/* Check if we have loaded variables */
if (isset($_GET['phonenumber']) && $_GET['phonenumber'] != '') {
View

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
View
@@ -0,0 +1,7 @@
body {
padding-top: 70px;
}
dt, dd {
line-height: 2.75;
}
View
@@ -6,50 +6,70 @@
<title>{% block title %}{% endblock %}</title>
<meta name="description" content="Example of libphonenumber-for-php">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{{ elixir("css/app.css") }}">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/2.8.0/css/flag-icon.min.css"
integrity="sha256-EQjZwW4ljrt9dsonbyX+si6kbxgkVde47Ty9FQehnUg=" crossorigin="anonymous"/>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" href="resources/css/app.css">
</head>
<body>
<a href="https://github.com/giggsey/libphonenumber-example"><img style="z-index: 100000; position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<a href="https://github.com/giggsey/libphonenumber-example"><img
style="z-index: 100000; position: fixed; top: 0; right: 0; border: 0;" class="hidden-md-down"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<nav class="navbar navbar-inverse navbar-toggleable-sm bg-inverse fixed-top">
<div class="container">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
data-target="#navbarText" aria-controls="navbarText" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="{{ baseurl }}"><i class="fa fa-phone"></i> libphonenumber Demo</a>
</div>
<div class="nav-collapse navbar-right">
<ul class="nav navbar-nav">
<li><a href="https://github.com/giggsey/libphonenumber-for-php"><i class="fa fa-github"></i>
libphonenumber</a></li>
</ul>
<a class="navbar-brand" href="{{ baseurl }}"><i class="fa fa-phone"></i> libphonenumber-for-php Demo</a>
<div class="collapse navbar-collapse" id="navbarText">
<div class="navbar-nav ml-auto">
<a href="https://github.com/giggsey/libphonenumber-for-php" class="nav-link"><i
class="fa fa-github"></i> libphonenumber-for-php</a>
</div>
</div>
</div>
</div>
</nav>
<div class="container">
{% block content %}{% endblock %}
<hr />
<footer>
<p class="text-muted"><small>Running <a href="https://github.com/giggsey/libphonenumber-for-php">libphonenumber-for-php</a> at
<a href='https://github.com/giggsey/libphonenumber-for-php/tree/{{ version['giggsey/libphonenumber-for-php'].actual }}'>{{ version['giggsey/libphonenumber-for-php'].version }}</a> on PHP version {{ phpversion }}.
The code for this demo can be found on <a href='https://github.com/giggsey/libphonenumber-example'>GitHub</a>.
</small></p>
<p class="text-muted">
<small>Running <a href="https://github.com/giggsey/libphonenumber-for-php">libphonenumber-for-php</a> at
<a href='https://github.com/giggsey/libphonenumber-for-php/tree/{{ version['giggsey/libphonenumber-for-php'].actual }}'>{{ version['giggsey/libphonenumber-for-php'].version }}</a>
on PHP version {{ phpversion }}.
The code for this demo can be found on <a href='https://github.com/giggsey/libphonenumber-example'>GitHub</a>.
</small>
</p>
</footer>
</div>
<script src="{{ elixir("js/app.js") }}" type="text/javascript"></script>
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"
integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"
integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"
integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn"
crossorigin="anonymous"></script>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
@@ -60,9 +80,9 @@
</script>
<script type="text/javascript">
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
</body>
</html>
View
@@ -1,5 +1,5 @@
{% extends '_page.twig' %}
{% block title %}libphonenumber Demo{% endblock %}
{% block title %}libphonenumber-for-php Demo{% endblock %}
{% block content %}
{% set tableWidth=6 %}
<p class="lead"><a href="{{ baseurl }}">&laquo; Back to form</a></p>
@@ -9,7 +9,7 @@
<h2><code>{{ get_class(phoneNumberObj) }}</code> Object</h2>
<div class="row">
<div class="col-sm-{{ tableWidth }}">
<div class="col-{{ tableWidth }}">
<table class="table table-striped table-bordered">
<thead>
<tr>
@@ -63,7 +63,7 @@
<h2>Validation Results</h2>
<div class="row">
<div class="col-sm-{{ tableWidth }}">
<div class="col-{{ tableWidth }}">
<table class="table table-striped table-bordered">
<thead>
<tr>
@@ -157,7 +157,7 @@
<h2>Formatting</h2>
<div class="row">
<div class="col-sm-{{ tableWidth }}">
<div class="col-{{ tableWidth }}">
<table class="table table-striped table-bordered">
<thead>
<tr>
@@ -215,19 +215,29 @@
{% if validNumber == true %}
<h3>Format Out of Country Calling Number</h3>
<div class="row">
<div class="col-sm-{{ tableWidth }}">
<div class="col-{{ tableWidth }}">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Region</th>
<th>Formatted Number</th>
</tr>
</thead>
<tbody
<tbody>
{% for region in regions %}
<tr>
<td class='f32'><div class='flag {{region|lower}}' title='{{ region }}' data-toggle="tooltip" data-placement="top">{% if countries[region] is defined %}{{ countries[region]}}{% else %}<em>{{ region }}</em>{% endif %}</div></td>
<td>
<span title='{{ region }}' data-toggle="tooltip" data-placement="top" class="flag-country">
<span class='flag-icon flag-icon-{{ region|lower }}'></span>
{% if countries[region] is defined %}
{{ countries[region] }}
{% else %}
<em>{{ region }}</em>
{% endif %}
</span>
</td>
<td>{{ phoneUtil.formatOutOfCountryCallingNumber(phoneNumberObj, region)}}</td>
</tr>
{% endfor %}
</tbody>
</table>
@@ -240,7 +250,7 @@
<h2>ShortNumberInfo</h2>
<div class="row">
<div class="col-sm-{{ tableWidth }}">
<div class="col-{{ tableWidth }}">
<table class="table table-striped table-bordered">
<thead>
<tr>
@@ -314,7 +324,7 @@
<h2>Example Numbers</h2>
<div class="row">
<div class="col-sm-{{ tableWidth }}">
<div class="col-{{ tableWidth }}">
<table class="table table-striped table-bordered">
<thead>
<tr>
@@ -349,7 +359,7 @@
<h2>PhoneNumberOfflineGeocoder Result</h2>
<div class="row">
<div class="col-sm-{{ tableWidth }}">
<div class="col-{{ tableWidth }}">
<table class="table table-striped table-bordered">
<thead>
<tr>
@@ -374,7 +384,7 @@
<h2>PhoneNumberToCarrierMapper Result</h2>
<div class="row">
<div class="col-sm-{{ tableWidth }}">
<div class="col-{{ tableWidth }}">
<table class="table table-striped table-bordered">
<thead>
<tr>
@@ -399,7 +409,7 @@
<h2>PhoneNumberToTimeZonesMapper Result</h2>
<div class="row">
<div class="col-sm-{{ tableWidth }}">
<div class="col-{{ tableWidth }}">
<table class="table table-striped table-bordered">
<thead>
<tr>
View
@@ -1,5 +1,5 @@
{% extends '_page.twig' %}
{% block title %}libphonenumber Demo &raquo; Error{% endblock %}
{% block title %}libphonenumber-for-php Demo &raquo; Error{% endblock %}
{% block content %}
<p class="lead"><a href="{{ baseurl }}">&laquo; Back to form</a></p>
@@ -8,7 +8,7 @@
<h2>Exception Thrown: <code title="Exception Class">{{ get_class(exception) }}</code> (<code
title="Exception Code">{{ exception.getCode() }}</code>)</h2>
<blockquote><p title="Exception Message">{{ exception.getMessage() }}</p></blockquote>
<blockquote class="blockquote"><p title="Exception Message">{{ exception.getMessage() }}</p></blockquote>
{% endblock %}
Oops, something went wrong.

0 comments on commit 087b45d

Please sign in to comment.