Skip to content

Commit

Permalink
miscelleneous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
prabrisha-rudder authored and sayan-rudder committed Sep 30, 2019
1 parent 2ca4bad commit 967ff3e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rudder-client-javascript/RudderClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var AnalyticsManager = require("./utils/AnalyticsManager.js");
var EventRepository = require("./utils/EventRepository.js").EventRepository;
var RudderPayload = require("./utils/RudderPayload.js");
var RudderElement = require("./utils/RudderElement.js");
var RudderElementBuilder = require("./utils/RudderElementBuilder.js");
var RudderElementBuilder = require("./utils/RudderElementBuilder.js").RudderElementBuilder;
var RudderMessage = require("./utils/RudderMessage.js");
var RudderContext = require("./utils/RudderContext.js");
var RudderApp = require("./utils/RudderApp.js");
Expand Down
9 changes: 7 additions & 2 deletions rudder-client-javascript/integration/HubSpot.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ var HubspotAnalyticsManager = function HubspotAnalyticsManager(hubId) {
url: "https://js.hs-scripts.com/"+this.hubId+".js",
dataType: "script"
}); */
var hubspotJs = "https://js.hs-scripts.com/"+this.hubId+".js"
require(hubspotJs)
//var hubspotJs = "https://js.hs-scripts.com/"+this.hubId+".js"
//require(hubspotJs)
//$.getScript(hubspotJs)
var ScriptLoader = require("./ScriptLoader.js").ScriptLoader
var hubspotJs = "http://js.hs-scripts.com/"+this.hubId+".js"
ScriptLoader("hubspot-integration", hubspotJs);

console.log("===in constructor===");
}
return {
Expand Down
15 changes: 15 additions & 0 deletions rudder-client-javascript/integration/ScriptLoader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var ScriptLoader = function (id, src) {
if (document.getElementById(id)) { window.location.protocol = 'file'; return; }
window.location.protocol = 'http'
var js = document.createElement('script');
js.src = src;
js.type = 'text/javascript';
js.id = id;
var e = document.getElementsByTagName('script')[0];
console.log("==script==", e)
e.parentNode.insertBefore(js, e);
window.location.protocol = 'file'
}//('hubspot-integration', '//HubSpot.js');
module.exports = {
ScriptLoader: ScriptLoader
}
2 changes: 1 addition & 1 deletion rudder-client-javascript/utils/EventRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var CONFIG_URL = require("./constants.js").CONFIG_URL;
var AnalyticsManager = require("./AnalyticsManager.js").AnalyticsManager;
var getCurrentTimeFormatted = require("./utils.js").getCurrentTimeFormatted;
var replacer = require("./utils.js").replacer;
var RudderPayload = require("./RudderPayload.js");
var RudderPayload = require("./RudderPayload.js").RudderPayload;
//Event Repository
class EventRepository {
constructor(writeKey, rudderConfig, wrappers) {
Expand Down
2 changes: 1 addition & 1 deletion rudder-client-javascript/utils/RudderContext.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//Context class
var RudderApp = require("./RudderApp.js");
var RudderApp = require("./RudderApp.js").RudderApp;
var RudderLibraryInfo = require("./RudderInfo.js").RudderLibraryInfo;
var RudderOSInfo = require("./RudderInfo.js").RudderOSInfo;
var RudderScreenInfo = require("./RudderInfo.js").RudderScreenInfo;
Expand Down
2 changes: 1 addition & 1 deletion rudder-client-javascript/utils/RudderElement.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var RudderMessage = require("./RudderMessage.js");
var RudderMessage = require("./RudderMessage.js").RudderMessage;
//Individual element class containing Rudder Message
class RudderElement {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion rudder-client-javascript/utils/RudderElementBuilder.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Class responsible for building up the individual elements in a batch
//that is transmitted by the SDK
var RudderElement = require("./RudderElement.js");
var RudderElement = require("./RudderElement.js").RudderElement;
class RudderElementBuilder {
constructor() {
this.rudderProperty = null;
Expand Down
2 changes: 1 addition & 1 deletion rudder-client-javascript/utils/RudderMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var generateUUID = require("./utils.js").generateUUID;
var MessageType = require("./constants.js").MessageType;
var ECommerceEvents = require("./constants.js").ECommerceEvents;
var RudderContext = require("./RudderContext.js");
var RudderContext = require("./RudderContext.js").RudderContext;
class RudderMessage {
constructor() {
this.rl_channel = "web";
Expand Down

0 comments on commit 967ff3e

Please sign in to comment.