retreaverjs-rails 0.2.18 → 0.2.19

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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/retreaverjs/rails/version.rb +1 -1
  3. data/package.json +1 -1
  4. data/src/retreaver/campaign.js +49 -1
  5. data/vendor/assets/javascripts/retreaver.js +49 -1
  6. data/vendor/assets/javascripts/retreaver.min.js +2 -2
  7. data/vendor/documentation/javascript/dev/Retreaver.Campaign.html +654 -0
  8. data/vendor/documentation/javascript/dev/Retreaver.Number.html +1615 -0
  9. data/vendor/documentation/javascript/dev/Retreaver.html +330 -0
  10. data/vendor/documentation/javascript/dev/campaign.js.html +270 -0
  11. data/vendor/documentation/javascript/dev/global.html +232 -0
  12. data/vendor/documentation/javascript/dev/index.html +67 -0
  13. data/vendor/documentation/javascript/dev/number.js.html +274 -0
  14. data/vendor/documentation/javascript/dev/retreaver.js.html +84 -0
  15. data/vendor/documentation/javascript/dev/scripts/linenumber.js +17 -0
  16. data/vendor/documentation/javascript/dev/scripts/prettify/Apache-License-2.0.txt +202 -0
  17. data/vendor/documentation/javascript/dev/scripts/prettify/lang-css.js +2 -0
  18. data/vendor/documentation/javascript/dev/scripts/prettify/prettify.js +28 -0
  19. data/vendor/documentation/javascript/dev/styles/jsdoc-default.css +290 -0
  20. data/vendor/documentation/javascript/dev/styles/prettify-jsdoc.css +111 -0
  21. data/vendor/documentation/javascript/dev/styles/prettify-tomorrow.css +132 -0
  22. data/vendor/documentation/javascript/v1/Retreaver.Campaign.html +3 -3
  23. data/vendor/documentation/javascript/v1/Retreaver.Number.html +1 -1
  24. data/vendor/documentation/javascript/v1/Retreaver.html +1 -1
  25. data/vendor/documentation/javascript/v1/campaign.js.html +50 -2
  26. data/vendor/documentation/javascript/v1/global.html +2 -2
  27. data/vendor/documentation/javascript/v1/index.html +1 -1
  28. data/vendor/documentation/javascript/v1/number.js.html +1 -1
  29. data/vendor/documentation/javascript/v1/retreaver.js.html +1 -1
  30. metadata +18 -3
@@ -0,0 +1,132 @@
1
+ /* Tomorrow Theme */
2
+ /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3
+ /* Pretty printing styles. Used with prettify.js. */
4
+ /* SPAN elements with the classes below are added by prettyprint. */
5
+ /* plain text */
6
+ .pln {
7
+ color: #4d4d4c; }
8
+
9
+ @media screen {
10
+ /* string content */
11
+ .str {
12
+ color: #718c00; }
13
+
14
+ /* a keyword */
15
+ .kwd {
16
+ color: #8959a8; }
17
+
18
+ /* a comment */
19
+ .com {
20
+ color: #8e908c; }
21
+
22
+ /* a type name */
23
+ .typ {
24
+ color: #4271ae; }
25
+
26
+ /* a literal value */
27
+ .lit {
28
+ color: #f5871f; }
29
+
30
+ /* punctuation */
31
+ .pun {
32
+ color: #4d4d4c; }
33
+
34
+ /* lisp open bracket */
35
+ .opn {
36
+ color: #4d4d4c; }
37
+
38
+ /* lisp close bracket */
39
+ .clo {
40
+ color: #4d4d4c; }
41
+
42
+ /* a markup tag name */
43
+ .tag {
44
+ color: #c82829; }
45
+
46
+ /* a markup attribute name */
47
+ .atn {
48
+ color: #f5871f; }
49
+
50
+ /* a markup attribute value */
51
+ .atv {
52
+ color: #3e999f; }
53
+
54
+ /* a declaration */
55
+ .dec {
56
+ color: #f5871f; }
57
+
58
+ /* a variable name */
59
+ .var {
60
+ color: #c82829; }
61
+
62
+ /* a function name */
63
+ .fun {
64
+ color: #4271ae; } }
65
+ /* Use higher contrast and text-weight for printable form. */
66
+ @media print, projection {
67
+ .str {
68
+ color: #060; }
69
+
70
+ .kwd {
71
+ color: #006;
72
+ font-weight: bold; }
73
+
74
+ .com {
75
+ color: #600;
76
+ font-style: italic; }
77
+
78
+ .typ {
79
+ color: #404;
80
+ font-weight: bold; }
81
+
82
+ .lit {
83
+ color: #044; }
84
+
85
+ .pun, .opn, .clo {
86
+ color: #440; }
87
+
88
+ .tag {
89
+ color: #006;
90
+ font-weight: bold; }
91
+
92
+ .atn {
93
+ color: #404; }
94
+
95
+ .atv {
96
+ color: #060; } }
97
+ /* Style */
98
+ /*
99
+ pre.prettyprint {
100
+ background: white;
101
+ font-family: Menlo, Monaco, Consolas, monospace;
102
+ font-size: 12px;
103
+ line-height: 1.5;
104
+ border: 1px solid #ccc;
105
+ padding: 10px; }
106
+ */
107
+
108
+ /* Specify class=linenums on a pre to get line numbering */
109
+ ol.linenums {
110
+ margin-top: 0;
111
+ margin-bottom: 0; }
112
+
113
+ /* IE indents via margin-left */
114
+ li.L0,
115
+ li.L1,
116
+ li.L2,
117
+ li.L3,
118
+ li.L4,
119
+ li.L5,
120
+ li.L6,
121
+ li.L7,
122
+ li.L8,
123
+ li.L9 {
124
+ /* */ }
125
+
126
+ /* Alternate shading for lines */
127
+ li.L1,
128
+ li.L3,
129
+ li.L5,
130
+ li.L7,
131
+ li.L9 {
132
+ /* */ }
@@ -389,7 +389,7 @@ Calls campaign.request_number
389
389
 
390
390
  <dt class="tag-source">Source:</dt>
391
391
  <dd class="tag-source"><ul class="dummy"><li>
392
- <a href="campaign.js.html">retreaver/campaign.js</a>, <a href="campaign.js.html#line108">line 108</a>
392
+ <a href="campaign.js.html">retreaver/campaign.js</a>, <a href="campaign.js.html#line156">line 156</a>
393
393
  </li></ul></dd>
394
394
 
395
395
 
@@ -589,7 +589,7 @@ Calls campaign.request_number
589
589
 
590
590
  <dt class="tag-source">Source:</dt>
591
591
  <dd class="tag-source"><ul class="dummy"><li>
592
- <a href="campaign.js.html">retreaver/campaign.js</a>, <a href="campaign.js.html#line48">line 48</a>
592
+ <a href="campaign.js.html">retreaver/campaign.js</a>, <a href="campaign.js.html#line90">line 90</a>
593
593
  </li></ul></dd>
594
594
 
595
595
 
@@ -645,7 +645,7 @@ Calls campaign.request_number
645
645
  <br clear="both">
646
646
 
647
647
  <footer>
648
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Dec 15 2022 15:03:30 GMT+0200 (EET)
648
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Wed Jun 19 2024 12:13:17 GMT+0300 (EEST)
649
649
  </footer>
650
650
 
651
651
  <script> prettyPrint(); </script>
@@ -1606,7 +1606,7 @@ with per-visitor numbers enabled.
1606
1606
  <br clear="both">
1607
1607
 
1608
1608
  <footer>
1609
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Dec 15 2022 15:03:30 GMT+0200 (EET)
1609
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Wed Jun 19 2024 12:13:17 GMT+0300 (EEST)
1610
1610
  </footer>
1611
1611
 
1612
1612
  <script> prettyPrint(); </script>
@@ -318,7 +318,7 @@
318
318
  <br clear="both">
319
319
 
320
320
  <footer>
321
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Dec 15 2022 15:03:30 GMT+0200 (EET)
321
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Wed Jun 19 2024 12:13:17 GMT+0300 (EEST)
322
322
  </footer>
323
323
 
324
324
  <script> prettyPrint(); </script>
@@ -67,6 +67,48 @@
67
67
  }
68
68
  }
69
69
 
70
+ function handle_true_call_integration(number) {
71
+ const integrations = number.get("integrations");
72
+
73
+ if (typeof(integrations) != 'object'){
74
+ return;
75
+ }
76
+
77
+ const trueCallConfig = integrations["truecall.com"];
78
+ if (typeof(trueCallConfig) == 'undefined') {
79
+ return;
80
+ }
81
+
82
+ // Load the trueCall script into the page it it's missing
83
+ if(!document.getElementById("__tc_script") || !window.TrueCall) {
84
+ (function () {
85
+ const trueCallScriptTag = document.createElement('script');
86
+ trueCallScriptTag.type = 'text/javascript';
87
+ trueCallScriptTag.async = true;
88
+ trueCallScriptTag.defer = true;
89
+ trueCallScriptTag.dataset.tc_campaign_id = trueCallConfig["tcCampaignId"];
90
+ trueCallScriptTag.id = "__tc_script"
91
+ trueCallScriptTag.src = trueCallConfig["scriptSrc"];
92
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(trueCallScriptTag);
93
+ })();
94
+ }
95
+
96
+ const obtainTrueCallId = new Promise(function(resolve) {
97
+ const trueCallInterval = setInterval(function() {
98
+ if (window.TrueCall && window.TrueCall.getId()) {
99
+ resolve(window.TrueCall.getId())
100
+ clearInterval(trueCallInterval);
101
+ }
102
+ }, trueCallConfig["checkIntervalMs"]); // Try to get the trueCallId every X milliseconds
103
+ })
104
+
105
+ obtainTrueCallId.then(function (trueCallId) {
106
+ const tags = {};
107
+ tags[trueCallConfig["tagName"]] = trueCallId;
108
+ number.replace_tags(tags);
109
+ });
110
+ }
111
+
70
112
  var self = this;
71
113
  self.type = 'campaigns';
72
114
  self.primary_key('campaign_key');
@@ -117,7 +159,13 @@
117
159
  // initialize number
118
160
  var number = new Retreaver.Number(data.number);
119
161
 
120
- // if there is a replacement in the response, replace all occurances
162
+ try {
163
+ handle_true_call_integration(number);
164
+ } catch (e) {
165
+ console.error("Could not integrate with truecall.com, ", e);
166
+ }
167
+
168
+ // if there is a replacement in the response, replace all occurrences
121
169
  // of that number on the page with the retreaver number
122
170
  if (typeof(data.number.replacement_numbers) !== 'undefined') {
123
171
  find_and_replace_number(data.number.replacement_numbers);
@@ -216,7 +264,7 @@
216
264
  <br clear="both">
217
265
 
218
266
  <footer>
219
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Dec 15 2022 15:03:30 GMT+0200 (EET)
267
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Wed Jun 19 2024 12:13:17 GMT+0300 (EEST)
220
268
  </footer>
221
269
 
222
270
  <script> prettyPrint(); </script>
@@ -178,7 +178,7 @@
178
178
 
179
179
  <dt class="tag-source">Source:</dt>
180
180
  <dd class="tag-source"><ul class="dummy"><li>
181
- <a href="campaign.js.html">retreaver/campaign.js</a>, <a href="campaign.js.html#line135">line 135</a>
181
+ <a href="campaign.js.html">retreaver/campaign.js</a>, <a href="campaign.js.html#line183">line 183</a>
182
182
  </li></ul></dd>
183
183
 
184
184
 
@@ -223,7 +223,7 @@
223
223
  <br clear="both">
224
224
 
225
225
  <footer>
226
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Dec 15 2022 15:03:30 GMT+0200 (EET)
226
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Wed Jun 19 2024 12:13:17 GMT+0300 (EEST)
227
227
  </footer>
228
228
 
229
229
  <script> prettyPrint(); </script>
@@ -58,7 +58,7 @@
58
58
  <br clear="both">
59
59
 
60
60
  <footer>
61
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Dec 15 2022 15:03:30 GMT+0200 (EET)
61
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Wed Jun 19 2024 12:13:17 GMT+0300 (EEST)
62
62
  </footer>
63
63
 
64
64
  <script> prettyPrint(); </script>
@@ -265,7 +265,7 @@
265
265
  <br clear="both">
266
266
 
267
267
  <footer>
268
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Dec 15 2022 15:03:30 GMT+0200 (EET)
268
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Wed Jun 19 2024 12:13:17 GMT+0300 (EEST)
269
269
  </footer>
270
270
 
271
271
  <script> prettyPrint(); </script>
@@ -74,7 +74,7 @@
74
74
  <br clear="both">
75
75
 
76
76
  <footer>
77
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Dec 15 2022 15:03:30 GMT+0200 (EET)
77
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Wed Jun 19 2024 12:13:17 GMT+0300 (EEST)
78
78
  </footer>
79
79
 
80
80
  <script> prettyPrint(); </script>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retreaverjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hilscher
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-12-15 00:00:00.000000000 Z
12
+ date: 2024-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -100,6 +100,21 @@ files:
100
100
  - src/retreaver/vendor/find_and_replace_dom_text.js
101
101
  - vendor/assets/javascripts/retreaver.js
102
102
  - vendor/assets/javascripts/retreaver.min.js
103
+ - vendor/documentation/javascript/dev/Retreaver.Campaign.html
104
+ - vendor/documentation/javascript/dev/Retreaver.Number.html
105
+ - vendor/documentation/javascript/dev/Retreaver.html
106
+ - vendor/documentation/javascript/dev/campaign.js.html
107
+ - vendor/documentation/javascript/dev/global.html
108
+ - vendor/documentation/javascript/dev/index.html
109
+ - vendor/documentation/javascript/dev/number.js.html
110
+ - vendor/documentation/javascript/dev/retreaver.js.html
111
+ - vendor/documentation/javascript/dev/scripts/linenumber.js
112
+ - vendor/documentation/javascript/dev/scripts/prettify/Apache-License-2.0.txt
113
+ - vendor/documentation/javascript/dev/scripts/prettify/lang-css.js
114
+ - vendor/documentation/javascript/dev/scripts/prettify/prettify.js
115
+ - vendor/documentation/javascript/dev/styles/jsdoc-default.css
116
+ - vendor/documentation/javascript/dev/styles/prettify-jsdoc.css
117
+ - vendor/documentation/javascript/dev/styles/prettify-tomorrow.css
103
118
  - vendor/documentation/javascript/v1/Retreaver.Campaign.html
104
119
  - vendor/documentation/javascript/v1/Retreaver.Number.html
105
120
  - vendor/documentation/javascript/v1/Retreaver.html
@@ -134,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
149
  - !ruby/object:Gem::Version
135
150
  version: '0'
136
151
  requirements: []
137
- rubygems_version: 3.1.6
152
+ rubygems_version: 3.5.6
138
153
  signing_key:
139
154
  specification_version: 4
140
155
  summary: retreaver.js rails wrapper