X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=portal-FE-os%2Fsrc%2Fapp%2Fshared%2Futils%2Futils.js;fp=portal-FE-os%2Fsrc%2Fapp%2Fshared%2Futils%2Futils.js;h=3c99f4ac50e57032ef9c2dea434f1a512c8c50b2;hb=3f7386d4245f9a05db961440ebf80d97d788f902;hp=0000000000000000000000000000000000000000;hpb=e0b464f75666b80976466437fa1057c3b4efd39f;p=portal.git diff --git a/portal-FE-os/src/app/shared/utils/utils.js b/portal-FE-os/src/app/shared/utils/utils.js new file mode 100644 index 00000000..3c99f4ac --- /dev/null +++ b/portal-FE-os/src/app/shared/utils/utils.js @@ -0,0 +1,21 @@ +function getCookies() { + var cookies = { }; + if (document.cookie && document.cookie != '') { + var split = document.cookie.split(';'); + for (var i = 0; i < split.length; i++) { + var name_value = split[i].split("="); + name_value[0] = name_value[0].replace(/^ /, ''); + cookies[decodeURIComponent(name_value[0])] = decodeURIComponent(name_value[1]); + } + } + return cookies; +} + +function getContextRoot(){ + var pathName = window.location.pathname; + var pathArray = pathName.split( '/' ); + var contextRoot=''; + if(pathArray.length!=0 && pathArray.length>=1) + contextRoot = pathArray[1]; + return contextRoot; +} \ No newline at end of file