The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

JS Code Blocking Chatbox

View previous topic View next topic Go down

Solved JS Code Blocking Chatbox

Post by J0k3R^ on April 23rd 2014, 5:31 pm

HiHello
irealized that a code on my js is blocking my chatbox popup.
i dont know js language, can somebody tell me what is this and if its necessary (maybe for other codes) ?
thanks:rose:


Code:
$(function() {
  var x = document.getElementById('variables').getElementsByTagName('span');
  for (var i = 0, v; (v = x[i++]); ) {
  $('.' + v.id).html(v.innerHTML);
  $('.' + v.id + '-replace').each(function(i, e) {
  e.innerHTML = e.innerHTML.replace( RegExp('{' + v.id + '}', 'g') , v.innerHTML );
  });
  }
  });
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi on April 23rd 2014, 5:35 pm

@J0k3R^ wrote:HiHello
irealized that a code on my js is blocking my chatbox popup.
i dont know js language, can somebody tell me what is this and if its necessary (maybe for other codes)?


Code:
$(function() {
  var x = document.getElementById('variables').getElementsByTagName('span');
  for (var i = 0, v; (v = x[i++]); ) {
  $('.' + v.id).html(v.innerHTML);
  $('.' + v.id + '-replace').each(function(i, e) {
  e.innerHTML = e.innerHTML.replace( RegExp('{' + v.id + '}', 'g') , v.innerHTML );
  });
  }
  });

Hi Very Happy

Judging from this line alone: var x = document.getElementById('variables').getElementsByTagName('span'); you can safely say that it involves anything that has span="variables". See the word Tag and ID? That technically makes up the one I just said.

The code just says that anything in the span="variables" will get replaced by a specific, I'm just not sure what it'll be replaced with since I'm sure that this isn't the full code right now.

Regards,
Pizza Boi
avatar
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ on April 23rd 2014, 5:40 pm

is it possible to berelated with my tabs on footer?



because my JS's code is named "FooterTabs2" and i have one more called "FooterTabs1" ↓ (the following)

Code:
Codes Removed

but when i disable the "FooterTabs2" (Placement: nothing) my forum's tabs are still working fine, atleast they seem so..


Last edited by J0k3R^ on April 23rd 2014, 5:51 pm; edited 1 time in total
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi on April 23rd 2014, 5:47 pm

Hi Very Happy

No, it's not related, just search for something that involves span="variable".

Regards,
Pizza Boi
avatar
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ on April 23rd 2014, 5:50 pm

yeah, i already tried that and i found nothing at css or templates


- Maybe i had removed the codes that were related with this js, is it possible right? Smile
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by DangerZone on April 23rd 2014, 5:58 pm

Easiest way to test is: Remove the JS and test if everything works WinkSave the JS in a document, in case you suddenly realize a malfunction on your website.
avatar
DangerZone
Forumember

Female Posts : 27
Reputation : 5
Language : .

http://downuptown.danskforum.net/

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ on April 23rd 2014, 5:59 pm

@DangerZone wrote:Easiest way to test is: Remove the JS and test if everything works WinkSave the JS in a document, in case you suddenly realize a malfunction on your website.

Good, i will go do that and will come back for feedback
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi on April 23rd 2014, 7:24 pm

@J0k3R^ wrote:yeah, i already tried that and i found nothing at css or templates


- Maybe i had removed the codes that were related with this js, is it possible right? Smile

Hi Very Happy

Yeah, that's highly probable and to be honest, I think I saw that code before. I saw a site that had it along with an avatar placed in the upper part of the header.

Anyway, just do what DZ says.

Regards,
Pizza Boi
avatar
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Jack Atlas on April 23rd 2014, 7:36 pm

why to not make a pop up javascript chatbox
Code:
jQuery(document).ready(function(){
jQuery('body').append('<span id="chatButton" title="Open/Close Chatbox">Open Chat</span><div id="chatBox"><iframe src="/chatbox/index.forum"></iframe></div>');
jQuery('#chatBox').hide();
jQuery('#chatButton').css('position', 'fixed').css('right', '0px').css('bottom', '0px');
jQuery('#chatBox iframe').css('position', 'fixed').css('right', '10px').css('bottom', '45px');
if(!document.getElementById('logout')){
jQuery('#chatButton').hide();
jQuery('#chatBox').hide();}
jQuery('#chatButton').click(function(){
jQuery('#chatBox').fadeToggle();
});
});
avatar
Jack Atlas
Forumember

Posts : 100
Reputation : 1
Language : english

http://hdaduelacademy.forumotion.com/forum

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ on April 23rd 2014, 7:41 pm

@Jack Atlas wrote:why to not make a pop up javascript chatbox
Code:
jQuery(document).ready(function(){
jQuery('body').append('<span id="chatButton" title="Open/Close Chatbox">Open Chat</span><div id="chatBox"><iframe src="/chatbox/index.forum"></iframe></div>');
jQuery('#chatBox').hide();
jQuery('#chatButton').css('position', 'fixed').css('right', '0px').css('bottom', '0px');
jQuery('#chatBox iframe').css('position', 'fixed').css('right', '10px').css('bottom', '45px');
if(!document.getElementById('logout')){
jQuery('#chatButton').hide();
jQuery('#chatBox').hide();}
jQuery('#chatButton').click(function(){
jQuery('#chatBox').fadeToggle();
});
});

u skipped css code because this code is not full:rose:
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Luffy on April 23rd 2014, 7:47 pm

Το me the chatbox opens fine! The and i can login fine also. What is the problem?





avatar
Luffy
Manager
Manager

Male Posts : 4460
Reputation : 443
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Jack Atlas on April 23rd 2014, 7:48 pm

yea this sorry ^^
Code:
/*Chatbox*/
#chatButton{
box-shadow:0px 10px 6px rgba(255,255,255, 0.2) inset, 0px -10px 6px rgba(0,0,0, 0.2) inset;
padding:10px 20px 10px 20px;
background-color:#000000;
border:1px solid #146;
font-weight:bold;
font-size:10px;
z-index:999;
color:#fff;
}
#chatButton:hover{
cursor:pointer;
color:#ff0000;
background-color:#000000;
}
#chatBox iframe{
z-index:999;
border:none;
height:50%;
width:65%;
}
#chatButton{
bottom:20px !important;
}
#chatBox iframe{
bottom:60px !important;
}
in css
avatar
Jack Atlas
Forumember

Posts : 100
Reputation : 1
Language : english

http://hdaduelacademy.forumotion.com/forum

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi on April 23rd 2014, 7:56 pm

Hi Very Happy

Hey, man, this is the one I use for my site, just add it anywhere (Preferably on top of your overall_header template) in anything that accepts HTML. Make sure to change the picture though...

Code:
<div style="overflow: visible; position: fixed; bottom: 30px; height: 350px; right: 0px; z-index:10000; "><iframe src="/chatbox/index.forum" id="chatboxpop" scrolling="yes" style="overflow: visible; width: 750px; height: 350px; display: none; float:right;box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-webkitbox-shadow: 0px 0px 3px rgba(0,0,0,0.25);-o-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);margin-left: 6px; -moz-border-radius: 6px;border-radius: 6px;-webkit-border-radius: 6px;-o-border-radius: 6px;" marginwidth="0" marginheight="0" frameborder="0"></iframe><div onclick="jQuery('#chatboxpop').animate({width:'toggle'},1200); jQuery('#chatboxopen,#chatboxclose').toggle();" style="cursor :pointer; float:left; box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-webkitbox-shadow: 0px 0px 3px rgba(0,0,0,0.25);-o-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-border-radius: 6px;border-radius: 6px;-webkit-border-radius: 6px;-o-border-radius: 6px;  padding: 6px 3px 6px 3px; position:relative; top:120px;"><img src="http://i.imgur.com/cfSuv2I.png" id="chatboxopen"><img src="http://i.imgur.com/FmfFT1j.png" id="chatboxclose" style="cursor :pointer; display:none;"></div></div>

Regards,
Pizza Boi
avatar
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ on April 23rd 2014, 7:59 pm

omg, its a triple chatbox



just kidding.. thanks for the chatbox @Jack Atlas






But should i remove this code from js? (this at first post)

@Pizza Boi wrote:HiVery Happy

Hey, man, this is the one I use for my site, just add it anywhere (Preferably on top of your overall_header template) in anything that accepts HTML. Make sure to change the picture though...

Code:
<div style="overflow: visible; position: fixed; bottom: 30px; height: 350px; right: 0px; z-index:10000; "><iframe src="/chatbox/index.forum" id="chatboxpop" scrolling="yes" style="overflow: visible; width: 750px; height: 350px; display: none; float:right;box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-webkitbox-shadow: 0px 0px 3px rgba(0,0,0,0.25);-o-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);margin-left: 6px; -moz-border-radius: 6px;border-radius: 6px;-webkit-border-radius: 6px;-o-border-radius: 6px;" marginwidth="0" marginheight="0" frameborder="0"></iframe><div onclick="jQuery('#chatboxpop').animate({width:'toggle'},1200); jQuery('#chatboxopen,#chatboxclose').toggle();" style="cursor :pointer; float:left; box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-webkitbox-shadow: 0px 0px 3px rgba(0,0,0,0.25);-o-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-border-radius: 6px;border-radius: 6px;-webkit-border-radius: 6px;-o-border-radius: 6px; padding: 6px 3px 6px 3px; position:relative; top:120px;"><img src="http://i.imgur.com/cfSuv2I.png" id="chatboxopen"><img src="http://i.imgur.com/FmfFT1j.png" id="chatboxclose" style="cursor :pointer; display:none;"></div></div>

Regards,
Pizza Boi

thanks, im just using a simple, small and convenient button for popup chat:rose:
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi on April 23rd 2014, 8:02 pm

Hi Very Happy

Generally speaking, I'd save it first and then if and only if you see a problem to occur, I'd re-install the script and see if it fixes that problem, for now, just have it backed up but removed from your forum~

Regards,
Pizza Boi
avatar
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ on April 23rd 2014, 8:03 pm

@Pizza Boi wrote:Hi Very Happy

Generally speaking, I'd save it first and then if and only if you see a problem to occur, I'd re-install the script and see if it fixes that problem, for now, just have it backed up but removed from your forum~

Regards,
Pizza Boi

got it, thanks for codes and help guys.

mark as *Solved*
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi on April 23rd 2014, 8:04 pm

Hi Very Happy

The pizza's here! That'd be $2.99 Wink .

No problem~

Regards,
Pizza Boi
avatar
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Jack Atlas on April 23rd 2014, 8:07 pm

heyo don't remove the javascript
avatar
Jack Atlas
Forumember

Posts : 100
Reputation : 1
Language : english

http://hdaduelacademy.forumotion.com/forum

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ on April 23rd 2014, 8:14 pm

@Jack Atlas wrote:heyo don't remove the javascript

i dont remove yours, it was question about the first post javascript Smile
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Jack Atlas on April 23rd 2014, 8:29 pm

yea ok Razz
avatar
Jack Atlas
Forumember

Posts : 100
Reputation : 1
Language : english

http://hdaduelacademy.forumotion.com/forum

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by SLGray on April 24th 2014, 1:37 am

Topic Solved & Archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 37996
Reputation : 2561
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum