updated css and gcube context's override of the XMLHttpRequest's send method to support EDISON case
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/liferay62-plugins/generic-configurable-theme@141821 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
6745fae9fa
commit
116f45f0bb
|
@ -17,34 +17,31 @@ function injectClientContext() {
|
||||||
groupId = Liferay.ThemeDisplay.getScopeGroupId();
|
groupId = Liferay.ThemeDisplay.getScopeGroupId();
|
||||||
//console.log('Not logged in, injecting groupId only');
|
//console.log('Not logged in, injecting groupId only');
|
||||||
}
|
}
|
||||||
|
//attach the 3 header params in all the XHR sends
|
||||||
var send = window.XMLHttpRequest.prototype.send;
|
(function(send) {
|
||||||
function sendReplacement(data) {
|
XMLHttpRequest.prototype.send = function(data) {
|
||||||
this.setRequestHeader("gcube-userId", userId);
|
this.setRequestHeader("gcube-userId", userId);
|
||||||
this.setRequestHeader("gcube-vreid", groupId);
|
this.setRequestHeader("gcube-vreid", groupId);
|
||||||
this.setRequestHeader("gcube-request-url", location.href);
|
this.setRequestHeader("gcube-request-url", location.href);
|
||||||
if(this.onreadystatechange) {
|
send.call(this, data);
|
||||||
this._onreadystatechange = this.onreadystatechange;
|
};
|
||||||
}
|
})(XMLHttpRequest.prototype.send);
|
||||||
return send.apply(this, arguments);
|
|
||||||
}
|
|
||||||
window.XMLHttpRequest.prototype.send = sendReplacement;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Override the expire function of the Liferay.Session javascript object. It makes the default behaviour and then open a modal
|
* Override the expire function of the Liferay.Session javascript object. It makes the default behaviour and then open a modal
|
||||||
* */
|
* */
|
||||||
$(function () {
|
$(function () {
|
||||||
AUI().use('liferay-session', function(A) {
|
AUI().use('liferay-session', function(A) {
|
||||||
if(Liferay.Session) {
|
if(Liferay.Session) {
|
||||||
console.log('Liferay session default overridden');
|
console.log('Liferay session default overridden');
|
||||||
Liferay.Session.expire = function() {
|
Liferay.Session.expire = function() {
|
||||||
var instance = this;
|
var instance = this;
|
||||||
instance.set('sessionState', 'expired', {});
|
instance.set('sessionState', 'expired', {});
|
||||||
$("#expirationModal").css("display", "block");
|
$("#expirationModal").css("display", "block");
|
||||||
$("#expirationModal").modal({backdrop: 'static', keyboard: false},'show');
|
$("#expirationModal").modal({backdrop: 'static', keyboard: false},'show');
|
||||||
$("body div.alert.alert-block.popup-alert-warning.alert-error").html("Due to inactivity your session has expired, please <a class='refresh' href=''>Refresh</a>");
|
$("body div.alert.alert-block.popup-alert-warning.alert-error").html("Due to inactivity your session has expired, please <a class='refresh' href=''>Refresh</a>");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue