mirror of
https://github.com/Mibew/mibew.git
synced 2024-11-16 00:54:12 +03:00
Remove invitation iframe border in IE<9
This commit is contained in:
parent
8c0dca3df7
commit
15b494a2ac
@ -13,6 +13,6 @@ this.loadScript(f));for(var j in a)a.hasOwnProperty(j)&&(j in this.handlersDepen
|
||||
b.Widget.prototype.loadScript=function(a){var c=this,b=this.doLoadScript(this.requestedScripts[a].url,a);b.onload=function(){c.scriptReady(a)};b.onreadystatechange=function(){("complete"==this.readyState||"loaded"==this.readyState)&&c.scriptReady(a)}};b.Widget.prototype.doLoadScript=function(a,b){var d=document.createElement("script");d.setAttribute("type","text/javascript");d.setAttribute("src",a);d.setAttribute("id",b);document.getElementsByTagName("head")[0].appendChild(d);return d};b.Widget.prototype.scriptReady=
|
||||
function(a){this.requestedScripts[a].status="ready";for(var b in this.handlers)this.handlers.hasOwnProperty(b)&&this.canRunHandler(b)&&(this.handlers[b](),delete this.handlers[b])};b.Widget.prototype.canRunHandler=function(a){a=this.handlersDependences[a];for(var b=0;b<a.length;b++)if("ready"!=this.requestedScripts[a[b]].status)return!1;return!0};b.Widget.init=function(a){b.Objects.widget=new b.Widget(a);b.Objects.widget.makeRequest()};b.Utils={};b.Utils.createCookie=function(a,b){var d=/([^\.]+\.[^\.]+)$/.exec(document.location.hostname)[1];
|
||||
document.cookie=""+a+"="+b+"; path=/; "+(d?"domain="+d+";":"")};b.Utils.readCookie=function(a){var b=document.cookie.split("; ");a+="=";for(var d=!1,e=0;e<b.length;e++)if(-1!=b[e].indexOf(a)){d=b[e].substr(a.length);break}return d};b.Invitation={};b.Invitation.create=function(a){var b=a.operatorName,d=a.avatarUrl,e=a.threadUrl,h=a.acceptCaption;a='<div id="mibewinvitationpopup" style="display: none;"><div id="mibewinvitationclose"><a href="javascript:void(0);" onclick="Mibew.Invitation.reject();">×</a></div>';
|
||||
b&&(a+='<h1 onclick="Mibew.Invitation.accept();">'+b+"</h1>");d&&(a+='<img id="mibewinvitationavatar" src="'+d+'" title="'+b+'" alt="'+b+'" onclick="Mibew.Invitation.accept();" />');e&&(a+='<iframe id="mibewinvitationframe" src="'+e+'" onload="Mibew.Invitation.show();"></iframe>');h&&(a+='<div id="mibewinvitationaccept" onclick="Mibew.Invitation.accept();">'+h+"</div>");a+='<div style="clear: both;"></div></div>';if(b=document.getElementById("mibewinvitation"))b.innerHTML=a};b.Invitation.show=function(){var a=
|
||||
document.getElementById("mibewinvitationpopup");a&&(a.style.display="block")};b.Invitation.hide=function(){var a=document.getElementById("mibewinvitationpopup");a&&a.parentNode.removeChild(a)};b.Invitation.accept=function(){document.getElementById("mibewAgentButton")&&(document.getElementById("mibewAgentButton").onclick(),b.Invitation.hide())};b.Invitation.reject=function(){b.Objects.widget.sendToServer({invitation_rejected:1});b.Invitation.hide()};b.APIFunctions={};b.APIFunctions.updateUserId=function(a){b.Utils.createCookie(b.Objects.widget.visitorCookieName,
|
||||
a.user.id)};b.APIFunctions.invitationCreate=function(a){b.Invitation.create(a.invitation)};b.APIFunctions.invitationClose=function(){b.Invitation.hide()}})(Mibew);
|
||||
b&&(a+='<h1 onclick="Mibew.Invitation.accept();">'+b+"</h1>");d&&(a+='<img id="mibewinvitationavatar" src="'+d+'" title="'+b+'" alt="'+b+'" onclick="Mibew.Invitation.accept();" />');e&&(a+='<iframe id="mibewinvitationframe" src="'+e+'" onload="Mibew.Invitation.show();" frameBorder="0"></iframe>');h&&(a+='<div id="mibewinvitationaccept" onclick="Mibew.Invitation.accept();">'+h+"</div>");a+='<div style="clear: both;"></div></div>';if(b=document.getElementById("mibewinvitation"))b.innerHTML=a};b.Invitation.show=
|
||||
function(){var a=document.getElementById("mibewinvitationpopup");a&&(a.style.display="block")};b.Invitation.hide=function(){var a=document.getElementById("mibewinvitationpopup");a&&a.parentNode.removeChild(a)};b.Invitation.accept=function(){document.getElementById("mibewAgentButton")&&(document.getElementById("mibewAgentButton").onclick(),b.Invitation.hide())};b.Invitation.reject=function(){b.Objects.widget.sendToServer({invitation_rejected:1});b.Invitation.hide()};b.APIFunctions={};b.APIFunctions.updateUserId=
|
||||
function(a){b.Utils.createCookie(b.Objects.widget.visitorCookieName,a.user.id)};b.APIFunctions.invitationCreate=function(a){b.Invitation.create(a.invitation)};b.APIFunctions.invitationClose=function(){b.Invitation.hide()}})(Mibew);
|
||||
|
@ -404,8 +404,9 @@ var Mibew = {};
|
||||
|
||||
// Broadcast message from the thread related with invitation into iframe
|
||||
if (threadUrl) {
|
||||
popuptext += '<iframe id="mibewinvitationframe" src="' + threadUrl
|
||||
+ '" onload="Mibew.Invitation.show();"></iframe>';
|
||||
popuptext += '<iframe id="mibewinvitationframe" '
|
||||
+ 'src="' + threadUrl + '" onload="Mibew.Invitation.show();" '
|
||||
+ 'frameBorder="0"></iframe>';
|
||||
}
|
||||
|
||||
// Add accept button if acceptCaption set
|
||||
|
Loading…
Reference in New Issue
Block a user