zendesk_apps_support 4.12.0 → 4.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: b15fb4519e8970b7d758ba52fb983894d0453f763d10949c24881298997aaf80
4
- data.tar.gz: 67bc5ddfa7ecbd027a953c89272bdce33d2265cf956a793212f946519bd2c956
2
+ SHA1:
3
+ metadata.gz: 36128bad8a975fd6a4806d325ad2da64ad9d2bda
4
+ data.tar.gz: ba2770fdfaa2c168aa1cebb8e2627f7285806616
5
5
  SHA512:
6
- metadata.gz: 1b3b5456c6c059dc6b196115746930319066327074eadbad36f38e92173acae0ef76650cdc827f99e67d9de1059f093e5a166ac147cf02958a06ee2639d80494
7
- data.tar.gz: 8d789571704c1164d949cd4eb9395b42301f5919b9547f58f45226b235abf771f9b4576ec4094b8a2d5e4e394d7fe34a2b6cd4d7bb234f3ce711bc985f5c5cdb
6
+ metadata.gz: '08fde5da17ecbc0a46f5507c3521beadee4152610b46ee88dba6642d150afce21acf59240ab84d76051110c863bf39b0675dfe95be1e1af800f662ba9b54d4cd'
7
+ data.tar.gz: 83e88e22a505e175fdb99b602e7d7c4acb89340f3525456221d34bc2a4b5644f8ac20f6f6bf11715b974bf2b5aeaf8951d54f028526b24c21001cd3516188df2
@@ -1,6 +1,37 @@
1
1
  (function() {
2
+ var self = this;
3
+ var reporter = window.ZendeskReporter ? new window.ZendeskReporter() : {};
4
+
5
+ // This is just defining a wrapped version of jQuery which simply makes a
6
+ // pass through call to global window.jQuery and adds logging information
7
+ // about the origin of the page to Datadog.
8
+ function wrapped$() {
9
+ reporter.increment && reporter.increment(
10
+ 'app_framework.app_scope.violated',
11
+ 1,
12
+ ['origin:' + self.location.hostname]
13
+ );
14
+ return self.$.apply(null, arguments);
15
+ }
16
+
17
+ // Adding the wrapped version of jQeury to a clone of window object, which
18
+ // will be used to bind the app's scope.
19
+ var wrappedWindow = this.$.extend(true, {}, self, { $: wrapped$ });
20
+ wrappedWindow.window = wrappedWindow;
21
+ wrappedWindow.top = wrappedWindow;
22
+
2
23
  <% appsjs.each do |appjs| %>
3
- <%= appjs %>
24
+ <% if apps_zaf_naughty_v1_logging %>
25
+ // Trying to match a v1 apps self executing function here and bind it to the
26
+ // wrappedWindow instance defined above.
27
+ // }()); ==> }.bind(wrappedWindow)());
28
+ <%= appjs.gsub(
29
+ /}\(\)\)\;*\s*;*\s*}\s*var\s*app\s*=\s*ZendeskApps\.defineApp\(source\)/mx,
30
+ "}.bind(wrappedWindow)());\n;\n}\n\nvar app = ZendeskApps.defineApp(source)"
31
+ ) %>
32
+ <% else %>
33
+ <%= appjs %>
34
+ <% end %>
4
35
  <% end %>
5
36
 
6
37
  <% installations.each do |installation| %>
@@ -17,7 +17,8 @@ module ZendeskAppsSupport
17
17
  appsjs: @appsjs,
18
18
  installations: @installations,
19
19
  installation_orders: options.fetch(:installation_orders, {}),
20
- rollbar_zaf_access_token: options.fetch(:rollbar_zaf_access_token, '')
20
+ rollbar_zaf_access_token: options.fetch(:rollbar_zaf_access_token, ''),
21
+ apps_zaf_naughty_v1_logging: options.fetch(:apps_zaf_naughty_v1_logging, false)
21
22
  )
22
23
  end
23
24
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_apps_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.0
4
+ version: 4.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James A. Rosen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-07-20 00:00:00.000000000 Z
14
+ date: 2018-08-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: i18n
@@ -274,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
274
  version: 1.3.6
275
275
  requirements: []
276
276
  rubyforge_project:
277
- rubygems_version: 2.7.6
277
+ rubygems_version: 2.6.8
278
278
  signing_key:
279
279
  specification_version: 4
280
280
  summary: Support to help you develop Zendesk Apps.