intl_phone_picker 0.0.7.1 → 0.0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +9 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +45 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +23 -0
- data/README.md +101 -0
- data/Rakefile +9 -0
- data/TODO.md +2 -0
- data/app/assets/images/flags.png +0 -0
- data/app/assets/images/flags@2x.png +0 -0
- data/app/assets/javascripts/intlTelInput.js +1183 -0
- data/app/assets/javascripts/intlTelInputLang.js +43 -0
- data/app/assets/stylesheets/intlTelInput.scss +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/config/locales/fr.yml +234 -0
- data/config/locales/us.yml +231 -0
- data/intl_phone_picker.gemspec +29 -0
- data/lib/intl_phone_picker/activerecord_helpers.rb +16 -0
- data/lib/intl_phone_picker/railtie.rb +13 -0
- data/lib/intl_phone_picker/version.rb +3 -0
- data/lib/intl_phone_picker/view_helpers.rb +18 -0
- data/lib/intl_phone_picker.rb +18 -0
- data/test/test_helper.rb +4 -0
- data/vendor/assets/javascripts/libphonenumber/utils.js +481 -0
- metadata +27 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01525381a3912c9b1f02d3d246e5cf3b18145c39
|
4
|
+
data.tar.gz: 8967ca271bff095b67a3446d3416762c202f41ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4606ff53b34c662e6c42cb7de97ff359453d6e4b15711e2c28c11ee2bd0ff175414fdd350bde7b3f84fc1fef5d3e42e301f609e6a92b289a10641705a8b2dde0
|
7
|
+
data.tar.gz: e979e6e0816d9d5e6105f484fa764ae9813721085c7741f8996d1273da866741a989057afbcf5e00368b8ddbcafa154d2a22ed6140ab1cb099f7ba79a85030f2
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Version 0.0.1
|
2
|
+
|
3
|
+
- Import javascript and css libraries.
|
4
|
+
|
5
|
+
# Version 0.0.2
|
6
|
+
|
7
|
+
- Change specifications
|
8
|
+
- Automatically import 'utils.js' and 'intl_phone_picker' when include javascript
|
9
|
+
- Add France (fr) to supported countries. Credits to Harold Simpson : https://github.com/harold-s/harold-s
|
10
|
+
- Include '//= require intlTelInput_fr' to use it.
|
11
|
+
- Include '//= require intlTelInput_us' to use default english number picker.
|
12
|
+
- Phone number picker is automatically added to all 'tel' fields.
|
13
|
+
|
14
|
+
# Version 0.0.3
|
15
|
+
|
16
|
+
- Fix US and FR translations .yml files (Can bug when integrating to existing rails project)
|
17
|
+
|
18
|
+
# Version 0.0.4
|
19
|
+
|
20
|
+
- Call only one stylesheet file and one javascript file
|
21
|
+
- Helpers 'intl_phone_fr_tag' and 'intl_phone_us_tag' were created
|
22
|
+
- Only one javascript file which contains all traductions.
|
23
|
+
- Can swith switch between languages inside the same project (calling corresponding helper)
|
24
|
+
- Helpers overrides 'telephone_field_tag' (can use same attributes)
|
25
|
+
|
26
|
+
# Version 0.0.5
|
27
|
+
|
28
|
+
- Add Activerecord Helpers : 'intl_phone_input_fr' and 'intl_phone_input_us'
|
29
|
+
- Change name of view methods to 'intl_phone_tag_fr' and 'intl_phone_tag_us'
|
30
|
+
|
31
|
+
# Version 0.0.6
|
32
|
+
|
33
|
+
- Select number picker country by locale of main application
|
34
|
+
- Only 2 helpers : 'intl_phone_tag' and 'intl_phone_input'
|
35
|
+
|
36
|
+
# Version 0.0.7
|
37
|
+
|
38
|
+
- Update to International Telephone Input v6.0.4
|
39
|
+
- Split Javascript manifest files with 'intlTelInput' and 'intlTelInputLang' (optionnal, for default phone pickers integrations)
|
40
|
+
- An argument named 'hidden_intl_field' can be passed into 'intl_phone_tag' options which add an hidden_field storing international phone (on submit of closest form)
|
41
|
+
- This argument can either be named 'hidden_intl_field' or :hidden_intl_field (string or symbol)
|
42
|
+
- Its name can be choose (ex: hidden_intl_field: 'test_hidden') and return when form will be submit if 'intlTelInputLang' is required in Javascript manifest file
|
43
|
+
- Hidden filed option is also available for Activerecord helper 'intl_phone_input'. You will need to create an 'attr_accessor' with the name you choose, like 'full_phone'. Exemple : 'f.intl_phone_input :Phone, { hidden_intl_field: :full_phone }'
|
44
|
+
- Fix Travis builds by adding default test
|
45
|
+
- Code Refacto
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Fabien Dobat
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
9
|
+
in the Software without restriction, including without limitation the rights
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
12
|
+
furnished to do so, subject to the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
15
|
+
all copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
# IntlPhonePicker
|
2
|
+
[](https://travis-ci.org/SeniorMedia/intl_phone_picker)
|
3
|
+
|
4
|
+
https://rubygems.org/gems/intl_phone_picker
|
5
|
+
|
6
|
+
IntlPhonePicker is a ruby gem which allow you to change your html5 "tel" fields into jQuery international phone number pickers.
|
7
|
+
|
8
|
+
Feel free to contribute and add your own config translation files through pull requests !
|
9
|
+
If you want to add a tranlation file, just put it into config/locales ! Or if you can't just send us by email, we will do it for you.
|
10
|
+
|
11
|
+
Currently supported languages : US (default), FR. The gem takes the language of the locale from your project.
|
12
|
+
|
13
|
+
## Sources
|
14
|
+
|
15
|
+
- Javascript based library : https://github.com/Bluefieldscom/intl-tel-input
|
16
|
+
- Ruby based gem : https://github.com/ispyropoulos/intl-tel-input-rails
|
17
|
+
- French language generator : https://github.com/harold-s/harold-s/tree/master/intl-tel-input-french-translation
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
Add this line to your application's Gemfile:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
gem 'intl_phone_picker'
|
25
|
+
```
|
26
|
+
|
27
|
+
And then execute:
|
28
|
+
|
29
|
+
$ bundle
|
30
|
+
|
31
|
+
Or install it yourself as:
|
32
|
+
|
33
|
+
$ gem install intl_phone_picker
|
34
|
+
|
35
|
+
To use javascript and stylesheet libraries you need to add :
|
36
|
+
|
37
|
+
- In application default stylesheet file :
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
*= require intlTelInput
|
41
|
+
```
|
42
|
+
|
43
|
+
- In application default javascript file :
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
//= require intlTelInput
|
47
|
+
```
|
48
|
+
|
49
|
+
- Coffeescript version :
|
50
|
+
```ruby
|
51
|
+
#= require intlTelInput
|
52
|
+
```
|
53
|
+
|
54
|
+
- If you want to auto convert your tel inputs into phone pickers fields :
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
//= require intlTelInputLang
|
58
|
+
```
|
59
|
+
|
60
|
+
## Usage
|
61
|
+
|
62
|
+
- To call intlTelInput input :
|
63
|
+
```ruby
|
64
|
+
<%= intl_phone_tag([your_specific_name]) %>
|
65
|
+
```
|
66
|
+
|
67
|
+
- Example :
|
68
|
+
```ruby
|
69
|
+
<%= intl_phone_tag('test') %>
|
70
|
+
```
|
71
|
+
|
72
|
+
- To use with a model (Activerecord) :
|
73
|
+
```ruby
|
74
|
+
<%= f.intl_phone_input(:phone) %>
|
75
|
+
```
|
76
|
+
|
77
|
+
## Options
|
78
|
+
|
79
|
+
- If you want to enable an hidden field which store the international number of your field :
|
80
|
+
```ruby
|
81
|
+
<%= intl_phone_tag('test', hidden_intl_field: :full_phone) %>
|
82
|
+
```
|
83
|
+
|
84
|
+
- Activerecord way (Don't forget to create the named accessor in your model, full_phone in this example) :
|
85
|
+
```ruby
|
86
|
+
<%= f.intl_phone_input :Phone, { hidden_intl_field: :full_phone } %>
|
87
|
+
```
|
88
|
+
|
89
|
+
## Development
|
90
|
+
|
91
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
92
|
+
|
93
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
94
|
+
|
95
|
+
## Contributing
|
96
|
+
|
97
|
+
1. Fork it ( https://github.com/[my-github-username]/intl_phone_picker/fork )
|
98
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
99
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
100
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
101
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/TODO.md
ADDED
Binary file
|
Binary file
|