-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwoodchuck.js
More file actions
26 lines (22 loc) · 763 Bytes
/
Copy pathwoodchuck.js
File metadata and controls
26 lines (22 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
window.Woodchuck = function() {
this.start = function() {
this.addListeners();
this.inject();
};
this.defaultHostUrl = "https://crm.precisionnutrition.com";
var hostname = localStorage.getItem('es_hostname');
if (!hostname) {
console.log("Woodchuck >> I couldn't find hostname in localStorage, so i set it to " + this.defaultHostUrl);
localStorage.setItem('es_hostname', this.defaultHostUrl);
this.hostUrl = this.defaultHostUrl;
} else {
console.log("Woodchuck >> I grabbed " + hostname + " from localStorage");
this.hostUrl = hostname;
}
console.log("Woodchuck >> I'm going to talk to " + this.hostUrl + " for my data");
return this;
};
$(function() {
var woodchuck = new Woodchuck();
woodchuck.start();
});