Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { TrackJS } from 'trackjs';
import store from '../store';
// TrackJS Configuration
const isTrackJSEnabled = store.state.config.trackjs_enabled;
if (isTrackJSEnabled) {
TrackJS.install({
token: store.state.config.trackjs_customer,
application: store.state.config.trackjs_app_key,
userId: store.state.user.username,
version: __ASSETS_VERSION__ + '-nd' // eslint-disable-line
});
}
// Google Tag Manager
const tagManagerId = store.state.config.google_tag_manager_id;
if (tagManagerId) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
userId: store.state.user.id,
userAccountType: store.state.user.account_type,
userSignUpDate: Date.parse(store.state.user.created_at) / 1000
window.onload = function() {
if(checkBrowCompatibility()){
viewManager = new ViewManager();
console.log("Checking Host: ");
console.log(window.location.host);
if(window.location.host === "3duf.org"){
console.log("Enabling TrackJS");
TrackJS.install({
token: "1f4d3a9c263e4e3fb2fe4c7f96f8808e"
});
viewManager = TrackJS.watchAll(viewManager);
}
Registry.viewManager = viewManager;
viewManager.loadDeviceFromJSON(JSON.parse(Examples.example2));
viewManager.updateGrid();
Registry.currentDevice.updateView();
window.dev = Registry.currentDevice;
window.Registry = Registry;