1
hervet
TinyEditor and Javascript [solved]
  • 2008/11/5 14:32

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Hello,

I'd like to dynamically write a content in a form managed by TinyEditor.
Imagine any form and a button, on the click on this button, I want to write a text in the "textarea".
How to do it ?

As an example, imagine CBB with TinyEditor and a "Quote" button.
When you click on it, the "textarea" will contains the original post.

bye,
Hervé

2
ghia
Re: TinyEditor and Javascript.
  • 2008/11/5 15:54

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


In general, you want pass variables from PHP to JavaScript and vice-versa?

3
Burning
Re: TinyEditor and Javascript.
  • 2008/11/5 15:54

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


hello,

Don't know with Tinyeditor but with FCKeditor it is possible : you get one button to insert a "mask" (in french : un masque de saisie)

- you just have to write your masks (unlimited) in fckeditor/fcktemplates-xoops.xml
- then user can choose wich mask to insert (and you can help him to choose by insert little thumb for each mask)

Hope its help (if you want an example, I send you a PM)
Still learning CSS and... english

4
hervet
Re: TinyEditor and Javascript.
  • 2008/11/5 15:56

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Quote:

ghia wrote:
In general, you want pass variables from PHP to JavaScript and vice-versa?

No, I have a button which must put content inside TinyEditor (via Javascript, in the client side)
This is the exact case that what you can do with the Quote button when you reply to a post.

5
ghia
Re: TinyEditor and Javascript.
  • 2008/11/5 15:56

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


For TinyMCE see also creating buttons and plugins.

6
hervet
Re: TinyEditor and Javascript.
  • 2008/11/5 15:59

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


to make it simple, if in a forum module I replace the standard dhtml text area with TinyEditor, how can I use the quote button ?

7
frankblack
Re: TinyEditor and Javascript.
  • 2008/11/5 17:30

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Hi Hervet, I guess you problem is that the bbcode is now treated as plain text when you use the quote function?

Perhaps you can do it with a little piece of javascript in initcode.php? There is already a snippet exchanging relative paths. If you do not use relative paths you can rewrite it for your purpose. Instead of replacing the path you can replace [ quote ] and [ / quote ] with the html-code and add the css for xoopsQuote.

Not tested, just a wild guess. HTH

8
hervet
Re: TinyEditor and Javascript.
  • 2008/11/5 17:38

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Hello Frank,

No, the problem is that from a javascript, script, I don't know how to write inside Tinyeditor's area.

With the help of the Firefox "Web developper" extension, I can see that the place where I write my text in TinyEditor is an iframe, but how can I write inside it ... ?

But the point you are talking of is "interesting".
I will surely have to face it ...

Bye,
Hervé

9
frankblack
Re: TinyEditor and Javascript.
  • 2008/11/5 17:42

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Have a look at the plugin ximagemanager and its templates. This plugin mimics the default imagemanager from xoops. There is a button which "moves" the information of the image to the editor. Perhaps this is of help for you?

10
hervet
Re: TinyEditor and Javascript.
  • 2008/11/5 17:45

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Give me the time to see it and if I find the solution then I will post it here.

Thank you very much Frank

Login

Who's Online

354 user(s) are online (269 user(s) are browsing Support Forums)


Members: 0


Guests: 354


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits