diff --git a/DNN Platform/Connectors/GoogleAnalytics/Scripts/connector.js b/DNN Platform/Connectors/GoogleAnalytics/Scripts/connector.js index 21a82adc088..b8b6147c3e4 100644 --- a/DNN Platform/Connectors/GoogleAnalytics/Scripts/connector.js +++ b/DNN Platform/Connectors/GoogleAnalytics/Scripts/connector.js @@ -1,132 +1,132 @@ -"use strict"; -define(["jquery", "knockout", "templatePath/scripts/config", "templatePath/scripts/PersonaBarDialog"], function ($, ko, cf) { - var helper, - bindViewModel, - rootFolder, - utility, - appId, - appSecret, - container; - - var wasDeactivated = false; - - var init = function (koObject, connectionHelper, pluginFolder, util) { - - helper = connectionHelper; - bindViewModel = koObject; - rootFolder = pluginFolder; - utility = util; - koObject.container = ko.observable(""); - - if (typeof dnn === "undefined") { - window.Sys = !window.Sys ? window.top.Sys : window.Sys; - window.dnn = !window.dnn ? window.top.dnn : window.dnn; - window.String = !window.String ? window.top.String : window.String; - window.String.format = !window.String.format ? window.top.String.format : window.String.format; - } - - }; - - var onSave = function (conn) { - - // Convert boolean to string as the API requires a dictionary of string values - conn.configurations[2].value(conn.configurations[2].value().toString()); - conn.configurations[3].value(conn.configurations[3].value().toString()); - conn.configurations[4].value(conn.configurations[4].value().toString()); - }; - - var onSaveComplete = function (conn, id) { - - // Deactivation / delete handled through the save since the delete function as - // of v9.2.2 only works with multiple connector support. This should be - // considered a temporary workaround until core behaviour updated. - - if (wasDeactivated) { - - // Was this just deactivated? clear the fields - conn.onDelete(conn, null, null); - wasDeactivated = false; - utility.notify(utility.resx.Connectors.txt_Deleted, true); - } - else { - - conn.connected("true"); - - if (bindViewModel.buttons().length === 1) { - - activateDeleteButton(conn); - } - utility.notify((utility.resx.Connectors || utility.resx.PersonaBar).txt_Saved, true); - } - }; - - var activateDeleteButton = function (conn) { - - if (conn.buttons().length === 1) { - - conn.buttons.push({ - className: "secondarybtn", - text: bindViewModel.resx.btnDelete, - action: function (conn, e) { - - // Set the isDeactivating flag to true to override the default save behaviour - // Temporary workaround until delete functionality on connectors is improved - conn.configurations[6].value("true"); - wasDeactivated = true; - conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); - } - }); - - } - - }; - - var getActionButtons = function () { - - - if (bindViewModel.connected()) { - - return [ - { - className: "primarybtn", - text: utility.resx.Connectors.btn_Save, - action: function (conn, e) { - conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); - } - }, - - { - className: "secondarybtn", - text: bindViewModel.resx.btnDelete, - action: function (conn, e) { - - // Set the isDeactivating flag to true to override the default save behaviour - // Temporary workaround until delete functionality on connectors is improved - conn.configurations[6].value("true"); - wasDeactivated = true; - conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); - } - } - ]; - - } else { - - return [ - { - className: "primarybtn", - text: utility.resx.Connectors.btn_Save, - action: function (conn, e) { - conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); - } - } - ]; - } - }; - - return { - init: init, - onSave: onSave, - getActionButtons: getActionButtons - }; - +"use strict"; +define(["jquery", "knockout", "templatePath/scripts/config", "templatePath/scripts/PersonaBarDialog"], function ($, ko, cf) { + var helper, + bindViewModel, + rootFolder, + utility, + appId, + appSecret, + container; + + var wasDeactivated = false; + + var init = function (koObject, connectionHelper, pluginFolder, util) { + + helper = connectionHelper; + bindViewModel = koObject; + rootFolder = pluginFolder; + utility = util; + koObject.container = ko.observable(""); + + if (typeof dnn === "undefined") { + window.Sys = !window.Sys ? window.top.Sys : window.Sys; + window.dnn = !window.dnn ? window.top.dnn : window.dnn; + window.String = !window.String ? window.top.String : window.String; + window.String.format = !window.String.format ? window.top.String.format : window.String.format; + } + + }; + + var onSave = function (conn) { + + // Convert boolean to string as the API requires a dictionary of string values + conn.configurations[2].value(conn.configurations[2].value() || 'false'); + conn.configurations[3].value(conn.configurations[3].value() || 'false'); + conn.configurations[4].value(conn.configurations[4].value() || 'false'); + }; + + var onSaveComplete = function (conn, id) { + + // Deactivation / delete handled through the save since the delete function as + // of v9.2.2 only works with multiple connector support. This should be + // considered a temporary workaround until core behaviour updated. + + if (wasDeactivated) { + + // Was this just deactivated? clear the fields + conn.onDelete(conn, null, null); + wasDeactivated = false; + utility.notify(utility.resx.Connectors.txt_Deleted, true); + } + else { + + conn.connected("true"); + + if (bindViewModel.buttons().length === 1) { + + activateDeleteButton(conn); + } + utility.notify((utility.resx.Connectors || utility.resx.PersonaBar).txt_Saved, true); + } + }; + + var activateDeleteButton = function (conn) { + + if (conn.buttons().length === 1) { + + conn.buttons.push({ + className: "secondarybtn", + text: bindViewModel.resx.btnDelete, + action: function (conn, e) { + + // Set the isDeactivating flag to true to override the default save behaviour + // Temporary workaround until delete functionality on connectors is improved + conn.configurations[6].value("true"); + wasDeactivated = true; + conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); + } + }); + + } + + }; + + var getActionButtons = function () { + + + if (bindViewModel.connected()) { + + return [ + { + className: "primarybtn", + text: utility.resx.Connectors.btn_Save, + action: function (conn, e) { + conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); + } + }, + + { + className: "secondarybtn", + text: bindViewModel.resx.btnDelete, + action: function (conn, e) { + + // Set the isDeactivating flag to true to override the default save behaviour + // Temporary workaround until delete functionality on connectors is improved + conn.configurations[6].value("true"); + wasDeactivated = true; + conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); + } + } + ]; + + } else { + + return [ + { + className: "primarybtn", + text: utility.resx.Connectors.btn_Save, + action: function (conn, e) { + conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); + } + } + ]; + } + }; + + return { + init: init, + onSave: onSave, + getActionButtons: getActionButtons + }; + }); \ No newline at end of file diff --git a/DNN Platform/Connectors/GoogleAnalytics/connector.htm b/DNN Platform/Connectors/GoogleAnalytics/connector.htm index d441b60a58a..4332fb96751 100644 --- a/DNN Platform/Connectors/GoogleAnalytics/connector.htm +++ b/DNN Platform/Connectors/GoogleAnalytics/connector.htm @@ -1,32 +1,32 @@ -
- -
- - -
- -
- - -
- -
- - -
- -
- - - - -
- -
- - -
- -
- +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + + +
+ +
+ + +
+ +
+
\ No newline at end of file diff --git a/DNN Platform/Connectors/GoogleAnalytics4/Scripts/connector.js b/DNN Platform/Connectors/GoogleAnalytics4/Scripts/connector.js index b607cf30422..650cacb2d83 100644 --- a/DNN Platform/Connectors/GoogleAnalytics4/Scripts/connector.js +++ b/DNN Platform/Connectors/GoogleAnalytics4/Scripts/connector.js @@ -1,130 +1,130 @@ -"use strict"; -define(["jquery", "knockout", "templatePath/scripts/config", "templatePath/scripts/PersonaBarDialog"], function ($, ko, cf) { - var helper, - bindViewModel, - rootFolder, - utility, - appId, - appSecret, - container; - - var wasDeactivated = false; - - var init = function (koObject, connectionHelper, pluginFolder, util) { - - helper = connectionHelper; - bindViewModel = koObject; - rootFolder = pluginFolder; - utility = util; - koObject.container = ko.observable(""); - - if (typeof dnn === "undefined") { - window.Sys = !window.Sys ? window.top.Sys : window.Sys; - window.dnn = !window.dnn ? window.top.dnn : window.dnn; - window.String = !window.String ? window.top.String : window.String; - window.String.format = !window.String.format ? window.top.String.format : window.String.format; - } - - }; - - var onSave = function (conn) { - - // Convert boolean to string as the API requires a dictionary of string values - conn.configurations[1].value(conn.configurations[1].value().toString()); - }; - - var onSaveComplete = function (conn, id) { - - // Deactivation / delete handled through the save since the delete function as - // of v9.2.2 only works with multiple connector support. This should be - // considered a temporary workaround until core behaviour updated. - - if (wasDeactivated) { - - // Was this just deactivated? clear the fields - conn.onDelete(conn, null, null); - wasDeactivated = false; - utility.notify(utility.resx.Connectors.txt_Deleted, true); - } - else { - - conn.connected("true"); - - if (bindViewModel.buttons().length === 1) { - - activateDeleteButton(conn); - } - utility.notify((utility.resx.Connectors || utility.resx.PersonaBar).txt_Saved, true); - } - }; - - var activateDeleteButton = function (conn) { - - if (conn.buttons().length === 1) { - - conn.buttons.push({ - className: "secondarybtn", - text: bindViewModel.resx.btnDelete, - action: function (conn, e) { - - // Set the isDeactivating flag to true to override the default save behaviour - // Temporary workaround until delete functionality on connectors is improved - conn.configurations[2].value("true"); - wasDeactivated = true; - conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); - } - }); - - } - - }; - - var getActionButtons = function () { - - - if (bindViewModel.connected()) { - - return [ - { - className: "primarybtn", - text: utility.resx.Connectors.btn_Save, - action: function (conn, e) { - conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); - } - }, - - { - className: "secondarybtn", - text: bindViewModel.resx.btnDelete, - action: function (conn, e) { - - // Set the isDeactivating flag to true to override the default save behaviour - // Temporary workaround until delete functionality on connectors is improved - conn.configurations[2].value("true"); - wasDeactivated = true; - conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); - } - } - ]; - - } else { - - return [ - { - className: "primarybtn", - text: utility.resx.Connectors.btn_Save, - action: function (conn, e) { - conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); - } - } - ]; - } - }; - - return { - init: init, - onSave: onSave, - getActionButtons: getActionButtons - }; - +"use strict"; +define(["jquery", "knockout", "templatePath/scripts/config", "templatePath/scripts/PersonaBarDialog"], function ($, ko, cf) { + var helper, + bindViewModel, + rootFolder, + utility, + appId, + appSecret, + container; + + var wasDeactivated = false; + + var init = function (koObject, connectionHelper, pluginFolder, util) { + + helper = connectionHelper; + bindViewModel = koObject; + rootFolder = pluginFolder; + utility = util; + koObject.container = ko.observable(""); + + if (typeof dnn === "undefined") { + window.Sys = !window.Sys ? window.top.Sys : window.Sys; + window.dnn = !window.dnn ? window.top.dnn : window.dnn; + window.String = !window.String ? window.top.String : window.String; + window.String.format = !window.String.format ? window.top.String.format : window.String.format; + } + + }; + + var onSave = function (conn) { + + // Convert boolean to string as the API requires a dictionary of string values + conn.configurations[1].value(conn.configurations[1].value() || 'false'); + }; + + var onSaveComplete = function (conn, id) { + + // Deactivation / delete handled through the save since the delete function as + // of v9.2.2 only works with multiple connector support. This should be + // considered a temporary workaround until core behaviour updated. + + if (wasDeactivated) { + + // Was this just deactivated? clear the fields + conn.onDelete(conn, null, null); + wasDeactivated = false; + utility.notify(utility.resx.Connectors.txt_Deleted, true); + } + else { + + conn.connected("true"); + + if (bindViewModel.buttons().length === 1) { + + activateDeleteButton(conn); + } + utility.notify((utility.resx.Connectors || utility.resx.PersonaBar).txt_Saved, true); + } + }; + + var activateDeleteButton = function (conn) { + + if (conn.buttons().length === 1) { + + conn.buttons.push({ + className: "secondarybtn", + text: bindViewModel.resx.btnDelete, + action: function (conn, e) { + + // Set the isDeactivating flag to true to override the default save behaviour + // Temporary workaround until delete functionality on connectors is improved + conn.configurations[2].value("true"); + wasDeactivated = true; + conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); + } + }); + + } + + }; + + var getActionButtons = function () { + + + if (bindViewModel.connected()) { + + return [ + { + className: "primarybtn", + text: utility.resx.Connectors.btn_Save, + action: function (conn, e) { + conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); + } + }, + + { + className: "secondarybtn", + text: bindViewModel.resx.btnDelete, + action: function (conn, e) { + + // Set the isDeactivating flag to true to override the default save behaviour + // Temporary workaround until delete functionality on connectors is improved + conn.configurations[2].value("true"); + wasDeactivated = true; + conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); + } + } + ]; + + } else { + + return [ + { + className: "primarybtn", + text: utility.resx.Connectors.btn_Save, + action: function (conn, e) { + conn.save(conn, e, onSaveComplete.bind(this, conn, conn.id)); + } + } + ]; + } + }; + + return { + init: init, + onSave: onSave, + getActionButtons: getActionButtons + }; + }); \ No newline at end of file diff --git a/DNN Platform/Connectors/GoogleAnalytics4/connector.htm b/DNN Platform/Connectors/GoogleAnalytics4/connector.htm index 524430d71bc..16f0188eb4b 100644 --- a/DNN Platform/Connectors/GoogleAnalytics4/connector.htm +++ b/DNN Platform/Connectors/GoogleAnalytics4/connector.htm @@ -1,15 +1,15 @@ -
- -
- - -
- -
- - -
- -
- +
+ +
+ + +
+ +
+ + +
+ +
+
\ No newline at end of file diff --git a/DNN Platform/Connectors/GoogleTagManager/Scripts/connector.js b/DNN Platform/Connectors/GoogleTagManager/Scripts/connector.js index b607cf30422..3d7c0cd79a6 100644 --- a/DNN Platform/Connectors/GoogleTagManager/Scripts/connector.js +++ b/DNN Platform/Connectors/GoogleTagManager/Scripts/connector.js @@ -30,7 +30,7 @@ define(["jquery", "knockout", "templatePath/scripts/config", "templatePath/scrip var onSave = function (conn) { // Convert boolean to string as the API requires a dictionary of string values - conn.configurations[1].value(conn.configurations[1].value().toString()); + conn.configurations[1].value(conn.configurations[1].value() || 'false'); }; var onSaveComplete = function (conn, id) { diff --git a/DNN Platform/Connectors/GoogleTagManager/connector.htm b/DNN Platform/Connectors/GoogleTagManager/connector.htm index 63b6646f85a..9aa0a9e117b 100644 --- a/DNN Platform/Connectors/GoogleTagManager/connector.htm +++ b/DNN Platform/Connectors/GoogleTagManager/connector.htm @@ -7,7 +7,7 @@
- +