News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

How to add button in editor that popup a small window and post a bbcode ?

Started by SAFAD, July 18, 2009, 12:01:03 PM

Previous topic - Next topic

SAFAD

Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Arantor

Did you post in Help Wanted like I suggested? More people check that out than here.

Of course you could do it yourself by looking at the code that comes with SMF because it's already in there.

SAFAD

is there a popup on smf that on click modify things on editor
naaaaaaaaah
i will try to post it there
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Arantor

Well, the popup is the easy part (Google for window.open()). Putting it around smileys is part of the editor - ever try selecting text then hitting a BBcode button? It puts the BBcode around the highlighted text.

Since both of those are in the SMF code you could look there for it.

SAFAD

Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

SAFAD

O No
Its Very Java Scripted
What To Do What To Do ?
argh i need  Javascript
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

SAFAD

Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Arantor

Please do not keep bumping inside 24 hours.

What is so complex about the Javascript in how the smileys work that is troubling you? Note that the code is virtually identical there to what you want.

SAFAD

Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

SAFAD

Welll
I Waited More Than 2 Days Waiting Help In Help Wanted
I Might Find Here SomeThing
Can AnyBody Help Me With The Code ?
Thx
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Arantor

All right, let's go back to the start.

What do you want?

You want the ability to have a button that you click on, it provides a pop-up and then inserts BBcode. What does the popup contain? Does the contents of the popup affect the contents of the BBcode? Does the user have to do anything with the popup for the BBcode to work?

What is the BBcode? What does it do? Does it have any parameters?

You haven't given us enough information to work with.

SAFAD

Sorry Bro But I Will Send You A Pm With The Content After I Recover My Dead Hard Disk
AnyWay It Contains 2 Drop Down Menu
"Listg"
And
"Listb"
They have a value
I Wanna transfer those values in bbcode
like this
"[bgi b="listb.value" , g="listg.value"]texet[/bgi]"
Best Regards
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

SAFAD

Am Really Sad
250Gb Is Lost
Including This File
I Will Try Make Another One
But Would Like To Find A Really Good Answer For My Problem
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

SAFAD

Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Arantor

You do realise that you won't be able to just add it to the standard BBcode array in Subs-Editor.php if you want a custom action attached to it? (At least not without plenty more JS work)

SAFAD

no i can
using advanced regular expression
but now i must focus on the Current JS Part
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Arantor

So, which part are you having trouble with, and what exactly have you got so far (everything you have thus far is relevant)

SAFAD

So I Can PopUp The Window
But
I Want When I Click He Get My List1.value and list2.value
To The Editor Like This
And Become Like This

[bgi b1="list1.value" , b2="list2.value"]My Text[bgi]

Best Regards
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Arantor

So what does this window contain and where does that come from? I get that it's two list boxes. Is the content the same every time? Does the contents of the second depend on the first or vice versa?

Do you want it to work instantly after pressing an entry in both list boxes, or have an OK button?

Özgür

I need something smilar for this so i don't open new topic. Can i ask on this topic ?
So Long

Advertisement: