From 67b9fdd229a92f60fd0070869cb74f7e5d92ddd5 Mon Sep 17 00:00:00 2001 From: Mattia Gosetto Date: Thu, 14 Jan 2021 15:41:31 +0100 Subject: [PATCH] custom --- .../docroot/_diffs/js/custom.js | 12 ++++++++++++ .../portos-private-fe-theme/docroot/js/custom.js | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/_diffs/js/custom.js b/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/_diffs/js/custom.js index 7012f4a6..d8fc3572 100644 --- a/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/_diffs/js/custom.js +++ b/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/_diffs/js/custom.js @@ -2,6 +2,18 @@ var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; $(document).ready(function () { + + var doAsUserId = getParameterByName('doAsUserId'); + if(doAsUserId != null){ + $.each($('.doasuser-class a'), function(index, val) { + $(this).attr('href', $(this).attr('href')+'?doAsUserId='+doAsUserId); + }); + } + + function getParameterByName(name) { + var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search); + return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); + } /*optionalRadio();*/ diff --git a/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/js/custom.js b/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/js/custom.js index 7012f4a6..d8fc3572 100644 --- a/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/js/custom.js +++ b/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/js/custom.js @@ -2,6 +2,18 @@ var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; $(document).ready(function () { + + var doAsUserId = getParameterByName('doAsUserId'); + if(doAsUserId != null){ + $.each($('.doasuser-class a'), function(index, val) { + $(this).attr('href', $(this).attr('href')+'?doAsUserId='+doAsUserId); + }); + } + + function getParameterByName(name) { + var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search); + return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); + } /*optionalRadio();*/