Init Try
Some checks failed
Build and Deploy Angular App (Artifacts, Gitea-safe) / test (push) Failing after 1m39s
Build and Deploy Angular App (Artifacts, Gitea-safe) / build (push) Has been skipped
Build and Deploy Angular App (Artifacts, Gitea-safe) / scan (push) Has been skipped
Build and Deploy Angular App (Artifacts, Gitea-safe) / deploy (push) Has been skipped
Some checks failed
Build and Deploy Angular App (Artifacts, Gitea-safe) / test (push) Failing after 1m39s
Build and Deploy Angular App (Artifacts, Gitea-safe) / build (push) Has been skipped
Build and Deploy Angular App (Artifacts, Gitea-safe) / scan (push) Has been skipped
Build and Deploy Angular App (Artifacts, Gitea-safe) / deploy (push) Has been skipped
This commit is contained in:
50
niayesh/dnn.servicesframework.js.download
Normal file
50
niayesh/dnn.servicesframework.js.download
Normal file
@@ -0,0 +1,50 @@
|
||||
(function ($) {
|
||||
$.dnnSF = function (moduleId) {
|
||||
// To avoid scope issues, use 'base' instead of 'this'
|
||||
// to reference this class from internal events and functions.
|
||||
var base = this;
|
||||
|
||||
base.getServiceRoot = function (moduleName) {
|
||||
var serviceRoot = dnn.getVar("sf_siteRoot", "/");
|
||||
serviceRoot += "API/" + moduleName + "/";
|
||||
return serviceRoot;
|
||||
};
|
||||
|
||||
base.getTabId = function () {
|
||||
return dnn.getVar("sf_tabId", -1);
|
||||
};
|
||||
|
||||
base.getModuleId = function () {
|
||||
return moduleId;
|
||||
};
|
||||
|
||||
base.setModuleHeaders = function (xhr) {
|
||||
var tabId = base.getTabId();
|
||||
if (tabId > -1) {
|
||||
xhr.setRequestHeader("ModuleId", base.getModuleId());
|
||||
xhr.setRequestHeader("TabId", tabId);
|
||||
}
|
||||
|
||||
var afValue = base.getAntiForgeryValue();
|
||||
if (afValue) {
|
||||
xhr.setRequestHeader("RequestVerificationToken", afValue);
|
||||
}
|
||||
};
|
||||
|
||||
base.getAntiForgeryKey = function () {
|
||||
return "__RequestVerificationToken";
|
||||
};
|
||||
|
||||
base.getAntiForgeryValue = function () {
|
||||
return $('[name="__RequestVerificationToken"]').val();
|
||||
};
|
||||
|
||||
return base;
|
||||
};
|
||||
|
||||
$.ServicesFramework = function (moduleId) {
|
||||
return new $.dnnSF(moduleId);
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
//----------------------------
|
||||
Reference in New Issue
Block a user