Select and Expand in one go
 
 
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Select Expand BBCodes
View previous topic :: View next topic  
Author Message
Officeforum
Apprentice
Apprentice


Joined: 30 Aug 2006
Posts: 7

PostPosted: Wed Aug 30, 2006 5:32 pm    Post subject: Select and Expand in one go Reply with quote

Hi there, Very Happy

Would it be possible if you pressed the select button the box would expand automaticaly?

That script is just a bit to advanced for me to edit.

Thanks.
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Wed Aug 30, 2006 8:59 pm    Post subject: Re: Select and Expand in one go Reply with quote

hmm... I believe that you need to invoke the resize method of the SXBB object passing the proper command, from inside the select method.

FIND:
Code:
r.select();

AFTER, ADD:
Code:
this.resize(this.T['contract']);

FIND:
Code:
s.addRange(r);

AFTER, ADD:
Code:
this.resize(this.T['contract']);

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Officeforum
Apprentice
Apprentice


Joined: 30 Aug 2006
Posts: 7

PostPosted: Wed Aug 30, 2006 9:38 pm    Post subject: Reply with quote

Hi Markus, Very Happy

Thank you so much that worked like a beaut.

Btw I changed the after add after r.select(); to:
Code:

this.resize(this.T['expand']);


One more question but it's a difficult one I think. (for me at least)

I would like to add a third option to the boxes and the would be Copy to get the content of the selected text to the clipboard if one ones too..

Would that be possible too?

Again you've made my day. Wink
 
Back to top
View user's profile Send private message
Officeforum
Apprentice
Apprentice


Joined: 30 Aug 2006
Posts: 7

PostPosted: Wed Aug 30, 2006 10:21 pm    Post subject: Reply with quote

Was one more problem so I changed the second line to: 'expand' too seams solved now.. Laughing 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Aug 31, 2006 7:51 am    Post subject: Reply with quote

LOL. Yeah, when I said 'contract' I meant 'expand', my fault. Glad you found it.

Copy to clipboard is possible with IE (easy) and Mozilla/Firefox (a bit more complex). However, I refused to implement such a feature because it could expose user's privacy (you could also access what they have in their clipboard, maybe a password...). That's something the user her/himself can do easily (Ctrl+C) anyway... Wink

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Officeforum
Apprentice
Apprentice


Joined: 30 Aug 2006
Posts: 7

PostPosted: Thu Aug 31, 2006 8:06 am    Post subject: Reply with quote

markus wrote:
LOL. Yeah, when I said 'contract' I meant 'expand', my fault. Glad you found it.

Hi Markus, Very Happy

Well if you make ti so easy on me..

markus wrote:

Copy to clipboard is possible with IE (easy) and Mozilla/Firefox (a bit more complex). However, I refused to implement such a feature because it could expose user's privacy (you could also access what they have in their clipboard, maybe a password...). That's something the user her/himself can do easily (Ctrl+C) anyway... Wink


Ah Ok.. I know Ctrl+C will get you there of course but I had easy of use in mind...

But your motivation is something I hadn't thought of yet so I won't be pursuing this any further cause I hate a security breach as much as you.

Thanks for pointing this out to me.
And again all works sweet. Wink
 
Back to top
View user's profile Send private message
Officeforum
Apprentice
Apprentice


Joined: 30 Aug 2006
Posts: 7

PostPosted: Wed Sep 06, 2006 9:11 pm    Post subject: Reply with quote

Hi Markus, Very Happy

My users found the box height by default a little to small (they would like to see 6 lines if instead of three) so I changed the
Code:
this.size = this.min = 80;
instead of the default 40.

However when there are fewer then 6 lines the box doesn't resize to the three lines but filles itself up to 6 lines

I hope you understand what I mean but basicly I'd like a check in the code to have the box collapse to the nr of lines if the total count of lines in a message is smaller then six (height 80)

Men I really hope I've put my question down right cause even I have trouble reading. LOL!
 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Select Expand BBCodes All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum