Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 2e8366f

Browse files
committed
more elegant solution
1 parent 5025acf commit 2e8366f

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

app/index.jade

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@ html
1717
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
1818
})(document);
1919

20-
script.
21-
if (location.href.match(/listings\/$/)) {
22-
(function() {
23-
var s = document.createElement("script");
24-
s.type = "text/javascript";
25-
s.async = true;
26-
s.src = '//api.usersnap.com/load/'+
27-
'3e7c8f0c-6cf6-41b6-9f2c-e8e4e60dfc59.js';
28-
var x = document.getElementsByTagName('script')[0];
29-
x.parentNode.insertBefore(s, x);
30-
})();
31-
}
32-
3320
include ../assets/scripts/google.analytics.jade
3421
include ../assets/scripts/zendesk-widget.jade
3522
include ../assets/scripts/raven-js.jade

app/listings/listings.controller.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ import { loadUser } from '../services/userv3.service.js'
2424
activate()
2525

2626
function activate() {
27+
28+
// add usersnap widget to /listings/ route
29+
(function() {
30+
var s = document.createElement("script");
31+
s.type = "text/javascript";
32+
s.async = true;
33+
s.src = '//api.usersnap.com/load/'+
34+
'3e7c8f0c-6cf6-41b6-9f2c-e8e4e60dfc59.js';
35+
var x = document.getElementsByTagName('script')[0];
36+
x.parentNode.insertBefore(s, x);
37+
})();
38+
2739
$scope.myChallenges = []
2840
$scope.reactProps = {
2941
config: CONSTANTS,

0 commit comments

Comments
 (0)