-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetfarmcreditmap.js.tpl
More file actions
37 lines (36 loc) · 1.59 KB
/
getfarmcreditmap.js.tpl
File metadata and controls
37 lines (36 loc) · 1.59 KB
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
27
28
29
30
31
32
33
34
35
36
37
// Add this script to any page to display the app
// Add the config script before this script to customize the app
(function () {
// app.css
var getFarmStyles = document.createElement('link');
getFarmStyles.href = 'https://www.getfarmcredit.com/modules/custom/getfarmcreditmap/css/__VAR_STYLE__';
getFarmStyles.setAttribute('rel','stylesheet');
getFarmStyles.setAttribute('type','text/css');
document.head.appendChild(getFarmStyles);
// <div id="app"></div>
if (!document.getElementById('app')) {
var getFarmWrapper = document.createElement('div');
getFarmWrapper.setAttribute('id','app');
document.body.appendChild(getFarmWrapper);
}
// manifest.js
var getFarmManifest = document.createElement('script');
getFarmManifest.src = 'https://www.getfarmcredit.com/modules/custom/getfarmcreditmap/js/__VAR_MANIFEST__';
getFarmManifest.setAttribute('type','text/javascript');
getFarmManifest.async = true;
document.body.appendChild(getFarmManifest);
// vendor.js
var getFarmVendor = document.createElement('script');
getFarmVendor.src = 'https://www.getfarmcredit.com/modules/custom/getfarmcreditmap/js/__VAR_VENDOR__';
getFarmVendor.setAttribute('type','text/javascript');
getFarmVendor.async = true;
document.body.appendChild(getFarmVendor);
window.onload = function() {
// app.js
var getFarmApp = document.createElement('script');
getFarmApp.src = 'https://www.getfarmcredit.com/modules/custom/getfarmcreditmap/js/__VAR_APP__';
getFarmApp.setAttribute('type','text/javascript');
getFarmApp.async = true;
document.body.appendChild(getFarmApp);
};
})();