JSFiddle - React, Tailwind, and code Playground
by nsshrinivasan
HTML
//launch AIM client from the header code
<div id="topbar">
<div id="my-tc"></div>
</div>
JavaScript
if (typeof SNI === 'undefined') {
SNI = {};
}
if (SNI.Community === undefined) {
SNI.Community = {};
}
if (SNI.Community.UR === undefined) {
SNI.Community.UR = {};
}
if (typeof SNI == "undefined" || !SNI) {
var SNI = {};
}
SNI.Config = {
env: "dev2",
site: "TC",
domain: "www.travelchannel.com",
autoSuggestContainer: "",
autoSuggestService: "",
omnitureMultiVariable: "prop14,eVar16,prop15,eVar18,prop16,eVar17,prop17,eVar19,prop18,prop19,eVar20,prop20",
omnitureSingleVariable: "prop26",
rsiKeyWord: "searchTerm",
UR3: false,
AIM: true,
// snapPlayListUrl: "",
// snapBinary: "",
// snapConfigs: "",
// animationSpeed: 250,
// navDropJsonPath: "",
// navHoverDelay: 350,
Community: {
ur3Domain: "my.travelchannel.com",
aimDomain: "aim.travelchannel.com",
ssoControllerPath: "www.test1-scrippscontroller.com/sso/checkcontrollercookie.html",
url: "aim.travelchannel.com/aim/getjs.do"
},
searchUrlHash: []
};
// signInWidget function definition
SNI.Community.UR.signInWidget = function (el, config, loginSelector, registerSelector) {
SNI.Config.AIM = true;
/***This is the part of the code to supply the configs for AIM client plugin - start**/
if (SNI.Config.AIM) {
this.widgetCfg = {
localFrameURL: window.location.protocol + "//" + window.location.host + "/static_files/communitytools/iframeproxy.html",
loginSelector: (typeof loginSelector !== "undefined") ? loginSelector : '#ur-header-links .sign-in',
registerSelector: (typeof registerSelector !== "undefined") ? registerSelector : '#ur-header-links .register'
}
}
/***This is the part of the code to supply the configs for AIM client plugin - end**/
var config = $.extend(true, {
callbacks: {
preLoggedIn: function () {},
postCallback: function () {}
},
menuItems: []
},...