We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
  • Pages:
  • 1
  • 2
[ C ] A small shoutbox feature request
Topic Started: Aug 28 2015, 08:53 AM (1,635 Views)
Devourz
Member Avatar
Member
[ *  *  * ]
Is it possible to get a feature like this http://prntscr.com/89v4pq (that's a IPB forum btw) for my shoutbox which would put a little "@" before a user's name and when clicked it will do this http://prntscr.com/89v546 for example so it would basically when you click the "@" infront of someones username for example "@ Nick" when you click the @ before my name it would put a "@Nick" in the text box so that person knows you're talking to them





so


"@ Nick"
say i pressed the @

Chatbox here: @Nick (then i could type here)
Offline Profile Goto Top
 
Replies:
Devourz
Member Avatar
Member
[ *  *  * ]
-The-
Aug 30 2015, 01:54 PM
Try removing the code and clearing your cache. Does it work now or not?
Edit: still does NOT work.
Edited by Devourz, Aug 31 2015, 07:52 AM.
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
GamingNick
Aug 31 2015, 03:06 AM
-The-
Aug 30 2015, 01:54 PM
Try removing the code and clearing your cache. Does it work now or not?
Edit: still does NOT work.
Here's the updated code.
Code: Below the Board
 
<script>
$(function(){
var sbx = $('#shoutbox').find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>").end().on('click', '.at', function(){
var $this = $(this), input = sbx.closest('table').find('[name=shouttext]'), txt = input.val(), user = $this.next().text();
input.val(txt+"@"+user+" ").focus();
});
$(document).ajaxSuccess(function(e,xhr,s){
if(/task/.test(s.url) && !sbx.find('a.member').prev('.at').length) sbx.find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>");
});
});
</script>
Offline Profile Goto Top
 
Jason
Member Avatar
Member
[ *  *  *  *  * ]
That works, in so much as if you click this @ sign -

Posted Image

It will populate the text entry part as you requested, however if you then click this @ sign -

Posted Image

It does nothing further, so hopefully that works for you :)

EDIT: That's actually pretty neat - good job Quozzo :up:
Edited by Jason, Sep 1 2015, 05:52 PM.
Offline Profile Goto Top
 
Devourz
Member Avatar
Member
[ *  *  * ]
Quozzo
Sep 1 2015, 01:46 PM
GamingNick
Aug 31 2015, 03:06 AM
-The-
Aug 30 2015, 01:54 PM
Try removing the code and clearing your cache. Does it work now or not?
Edit: still does NOT work.
Here's the updated code.
Code: Below the Board
 
<script>
$(function(){
var sbx = $('#shoutbox').find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>").end().on('click', '.at', function(){
var $this = $(this), input = sbx.closest('table').find('[name=shouttext]'), txt = input.val(), user = $this.next().text();
input.val(txt+"@"+user+" ").focus();
});
$(document).ajaxSuccess(function(e,xhr,s){
if(/task/.test(s.url) && !sbx.find('a.member').prev('.at').length) sbx.find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>");
});
});
</script>
I'd hate to be a pain in the arse but is there anyway to make this script work with the automatic refresh shoutbox feature? :o




if not i'll just use this code instead of auto refresh but i wish both would stack and work together
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
GamingNick
Sep 2 2015, 10:26 AM
Quozzo
Sep 1 2015, 01:46 PM
GamingNick
Aug 31 2015, 03:06 AM
-The-
Aug 30 2015, 01:54 PM
Try removing the code and clearing your cache. Does it work now or not?
Edit: still does NOT work.
Here's the updated code.
Code: Below the Board
 
<script>
$(function(){
var sbx = $('#shoutbox').find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>").end().on('click', '.at', function(){
var $this = $(this), input = sbx.closest('table').find('[name=shouttext]'), txt = input.val(), user = $this.next().text();
input.val(txt+"@"+user+" ").focus();
});
$(document).ajaxSuccess(function(e,xhr,s){
if(/task/.test(s.url) && !sbx.find('a.member').prev('.at').length) sbx.find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>");
});
});
</script>
I'd hate to be a pain in the arse but is there anyway to make this script work with the automatic refresh shoutbox feature? :o




if not i'll just use this code instead of auto refresh but i wish both would stack and work together
It does should. Hence the update.
Offline Profile Goto Top
 
Devourz
Member Avatar
Member
[ *  *  * ]
Quozzo
Sep 2 2015, 12:17 PM
GamingNick
Sep 2 2015, 10:26 AM
Quozzo
Sep 1 2015, 01:46 PM
GamingNick
Aug 31 2015, 03:06 AM
-The-
Aug 30 2015, 01:54 PM
Try removing the code and clearing your cache. Does it work now or not?
Edit: still does NOT work.
Here's the updated code.
Code: Below the Board
 
<script>
$(function(){
var sbx = $('#shoutbox').find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>").end().on('click', '.at', function(){
var $this = $(this), input = sbx.closest('table').find('[name=shouttext]'), txt = input.val(), user = $this.next().text();
input.val(txt+"@"+user+" ").focus();
});
$(document).ajaxSuccess(function(e,xhr,s){
if(/task/.test(s.url) && !sbx.find('a.member').prev('.at').length) sbx.find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>");
});
});
</script>
I'd hate to be a pain in the arse but is there anyway to make this script work with the automatic refresh shoutbox feature? :o




if not i'll just use this code instead of auto refresh but i wish both would stack and work together
It does should. Hence the update.
works a charm topic can be closed now thanks
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Free Forums. Reliable service with over 8 years of experience.
« Previous Topic · Closed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2