zendesk_apps_support 4.12.1 → 4.12.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/lib/zendesk_apps_support/assets/installed.js.erb +36 -21
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dd1ae30c3fa86d421b5eb617f21379dd75eac3d
|
4
|
+
data.tar.gz: a46ee2adb8b00121f0fe94c7b5a93d38c393dfbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 006bad071aa45ddcb2bb9f7cfcfeb554b3cb059daa7f09f1735097f788fb0190186f1aa861c9def4e5f7b905685e4377525f4394095fc22e90757d5290cc67a9
|
7
|
+
data.tar.gz: 3d91c4c79009d9b9bbcd384ee1b4a891ac364b7dfba034d7e946acb2835c8b22b098b00b02f0df2f2d37026d2b2ad5f66b1306de0ec9174b5d1ca6e2ba1dad3d
|
@@ -1,33 +1,48 @@
|
|
1
1
|
(function() {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
2
|
+
<% if apps_zaf_naughty_v1_logging %>
|
3
|
+
var self = this;
|
4
|
+
var reporter = window.ZendeskReporter ? new window.ZendeskReporter() : {};
|
5
|
+
|
6
|
+
function getWrappedWindow(appName) {
|
7
|
+
// This is just defining a wrapped version of jQuery which simply makes a
|
8
|
+
// pass through call to global window.jQuery and adds logging information
|
9
|
+
// about the origin of the page to Datadog.
|
10
|
+
function wrapped$() {
|
11
|
+
reporter.increment && reporter.increment(
|
12
|
+
'app_framework.app_scope.violated',
|
13
|
+
1,
|
14
|
+
['origin:' + self.location.hostname, 'app_name:' + appName]
|
15
|
+
);
|
16
|
+
|
17
|
+
return self.$.apply(null, arguments);
|
18
|
+
}
|
19
|
+
|
20
|
+
// Adding the wrapped version of jQeury to a clone of window object, which
|
21
|
+
// will be used to bind the app's scope.
|
22
|
+
var wrappedWindow = this.$.extend({}, self, { $: wrapped$ });
|
23
|
+
wrappedWindow.window = wrappedWindow;
|
24
|
+
wrappedWindow.top = wrappedWindow;
|
25
|
+
|
26
|
+
return wrappedWindow;
|
27
|
+
}
|
28
|
+
<% end %>
|
22
29
|
|
23
30
|
<% appsjs.each do |appjs| %>
|
24
31
|
<% if apps_zaf_naughty_v1_logging %>
|
32
|
+
// Find the appName from source
|
33
|
+
var appName = "UNKNOWN";
|
34
|
+
|
35
|
+
<% appNameMatch = appjs.match(/\.reopen\(\{\s*appName\: (\"[^\n]*\"),/m) %>
|
36
|
+
<% if appNameMatch && appNameMatch.captures.any? %>
|
37
|
+
appName = <%= appNameMatch.captures[0] %>;
|
38
|
+
<% end %>
|
39
|
+
|
25
40
|
// Trying to match a v1 apps self executing function here and bind it to the
|
26
41
|
// wrappedWindow instance defined above.
|
27
42
|
// }()); ==> }.bind(wrappedWindow)());
|
28
43
|
<%= appjs.gsub(
|
29
44
|
/}\(\)\)\;*\s*;*\s*}\s*var\s*app\s*=\s*ZendeskApps\.defineApp\(source\)/mx,
|
30
|
-
"}.bind(
|
45
|
+
"}.bind(getWrappedWindow(appName))());\n;\n}\n\nvar app = ZendeskApps.defineApp(source)"
|
31
46
|
) %>
|
32
47
|
<% else %>
|
33
48
|
<%= appjs %>
|
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.
|
4
|
+
version: 4.12.2
|
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-08-
|
14
|
+
date: 2018-08-24 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: i18n
|