callpixelsjs-rails 0.0.1

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.
data/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # jsdocs
2
+
3
+ https://callpixels.com/documentation/javascript/v1/Callpixels.Number.html
4
+
5
+
6
+ # Usage
7
+
8
+ Include the callpixels.js script on the page.
9
+
10
+ ```
11
+ <script src="/path/to/callpixels.js" type="text/javascript"></script>
12
+ ```
13
+
14
+
15
+ # Examples
16
+
17
+ ### Campaign
18
+
19
+ Initialize a campaign that will return numbers matching home_value:50000
20
+
21
+ ```javascript
22
+ var campaign = new Callpixels.Campaign({ campaign_key: 'the_key_example' });
23
+ ```
24
+
25
+ Request a number from the campaign matching tags, and use jQuery to display it on the page.
26
+
27
+ ```javascript
28
+ var tags = {
29
+ home_value: '50000'
30
+ };
31
+ campaign.request_number(tags, function (number) {
32
+ $('#number_on_page').html( number.get('formatted_number') );
33
+ });
34
+ ```
35
+
36
+
37
+ ### Number
38
+
39
+ ##### Tags
40
+
41
+ Display the tags currently attached to this number.
42
+
43
+ ```javascript
44
+ number.get('tag_values');
45
+ ```
46
+
47
+ Add / Remove / Clear Tags
48
+
49
+ ```javascript
50
+ number.add_tags({'date_of_birth': '1980/01/01'});
51
+ number.remove_tags({'date_of_birth': '1980/01/01'});
52
+ number.clear_tags();
53
+ ```
54
+
55
+ ##### Release
56
+
57
+ When you are finished with a number you can release it back to the campaign.
58
+
59
+ ```javascript
60
+ number.release();
61
+ ```
62
+
63
+ ##### Initiate Call
64
+
65
+ You can initiate a call with the user.
66
+
67
+ ```javascript
68
+ number.initiate_call('1112224444', {}, function(call){
69
+ // Call initiated
70
+ });
71
+ ```
72
+
73
+ ##### Attributes
74
+
75
+ Numbers have attributes that can be retrieved.
76
+
77
+ ```javascript
78
+ number.get('campaign_key');
79
+ ```
80
+
81
+ | Attribute | Type | Description |
82
+ | ----------------- |:---------------:|:-------------------------------------------------------------------:|
83
+ | id | numeric | number id |
84
+ | campaign_key | alpha-numeric | campaign key |
85
+ | formatted_number | string | formatted number according to national style `(866) 898-7878` |
86
+ | number | string | E.164 formatted number `+18668987878` |
87
+ | plain_number | string | unformatted phone number digits `8668987878` |
88
+ | target_open | boolean | does this number have targets that are available to take calls? |
89
+ | is_per_visitor | boolean | does this number track unique visitors? |
90
+ | tag_values | object | the tags currently assigned to this number |
@@ -0,0 +1,5 @@
1
+ module Callpixelsjs
2
+ module Rails
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ require "callpixelsjs/rails/version"
2
+
3
+ module Callpixelsjs
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end