Skip to first unread message

SuperRemalia

unread,
Apr 10, 2015, 12:23:30 PM4/10/15
to ajax...@googlegroups.com
initEmoticons: function() {
       
this.DOMbuffer = "";
       
var emoticonDisplayPopUpCount=0;
       
for(var i=0; i<this.emoticonCodes.length; i++) {
           
// Replace specials characters in emoticon codes:
           
this.emoticonCodes[i] = this.encodeSpecialChars(this.emoticonCodes[i]);
           
if(this.emoticonDisplay[i] == 2 || this.emoticonDisplay[i] == 3){
           
if(this.dom['emoticonsContainer']) {
                   
this.updateDOM(
                       
'emoticonsContainer',
                       
'<a href="javascript:ajaxChat.insertText(\''
                       
+ this.scriptLinkEncode(this.emoticonCodes[i])
                       
+ '\');"><img src="'
                       
+ this.dirs['emoticons']
                       
+ this.emoticonFiles[i]
                       
+ '" alt="'
                       
+ this.emoticonCodes[i]
                       
+ '" title="'
                       
+ this.emoticonCodes[i]
                       
+ '"/></a>'
                   
);
           
}
           
}
           
if((this.emoticonDisplay[i] == 1 || this.emoticonDisplay[i] == 2) && (this.emoticonDisplay[i] != 3)){
            emoticonDisplayPopUpCount
++;
           
if(this.dom['emoticonsContainerPopUp']) {
                   
this.updateDOM(
                       
'emoticonsContainerPopUp',
                       
'<a href="javascript:ajaxChat.insertText(\''
                       
+ this.scriptLinkEncode(this.emoticonCodes[i])
                       
+ '\');"><img src="'
                       
+ this.dirs['emoticons']
                       
+ this.emoticonFiles[i]
                       
+ '" alt="'
                       
+ this.emoticonCodes[i]
                       
+ '" title="'
                       
+ this.emoticonCodes[i]
                       
                         
+ '" height="'
                       
+ 30
                       
+ '" width="'
                       
+ 60
                       
                       
+ '" style="padding: 10px"/></a>'
                   
);
           
}
           
}
       
}
   
},
 Hi Guys. I have this code inside the Chat.js . Any ideas how to close the popup window on selection ? Perhaps somewhere it needs something like  " + '" onclick="ajaxChat.insertText(this.firstChild.nodeValue);">'    "  . Thanks

Stephen Gemme

unread,
Apr 14, 2015, 8:49:58 AM4/14/15
to ajax...@googlegroups.com
Am I understanding you correctly that you'd like the popup window to close after having selected an emoticon?

Like you're saying, you'll have to add an onclick listener that specifically tells the current window to close. I have not experimented with this before, but it should be possible. 

<span id='close' onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); return false;'>x</span>

Personally I like allowing people to click the emoticons more than once, perhaps another course of action would be to have the container close each time a message is submit to the shoutbox. 

jutukas jututuba

unread,
May 21, 2015, 1:54:58 PM5/21/15
to ajax...@googlegroups.com
i have same problem,but im not good at all,where i have to place that code?

jonnyboy

unread,
May 21, 2015, 6:04:43 PM5/21/15
to ajax...@googlegroups.com
If you have added jQuery in like I have, just add:

onclick="$(this).parent().hide();"



to this line:

+ '" style="padding: 10px"/></a>'



so, like this:
+ '" style="padding: 10px" onclick="$(this).parent().hide();" /></a>'



I have added this to the popup for font color and it works just fine.

Reply all
Reply to author
Forward
0 new messages