Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#673 2009-12-04 10:19:48

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: hak_tinymce WYSIWYG article editor

hakjoon wrote:

…0.9.7 should allow you to turn the editor on for all textareas…

Hi,
the good news is it works ok. The bad news is it targets each textarea including the “keywords” textarea.
Not a big problem for me given that I always hide it, but someone might find it useful to target all textareas excluding keywords.
Anyway thanks, this did help!

Edit
I think an easier way is to target each textarea having a class of “glz_text_area_field”. I’ll see if there is a way. Of course any hint on how to do it is welcome.

Last edited by redbot (2009-12-04 10:31:40)

Offline

#674 2009-12-04 13:44:33

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_tinymce WYSIWYG article editor

@redbot: There are a couple of ways of targeting the textareas (I don’t know what glz sits out for them). Check out the editor_selector docs in how to target a class.

There is an object called settings that holds the init objects. settings.body is for the body, settings.excerpt is for the excerpt. but if you are using other selectors you only need one. So to do what you want do try:

settings.body.mode = "specific_textareas";
settings.body.editor_selector = "glz_text_area_field";

Otherwise if you know the ids for the textareas we want you can do:

settings.body.mode = "exact";
settings.body.elements = "id1,id2,id3";

one of these should get you close at least.

Last edited by hakjoon (2009-12-04 13:45:50)


Shoving is the answer – pusher robot

Offline

#675 2009-12-04 13:57:17

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_tinymce WYSIWYG article editor

@tRM: I’ll need to setup a php4 environment to test this out on. According to the docs what I’m doing should work. I might revert to having explicit global functions for the callbacks and have those call the class methods.

I’ll see if I have time to build that out in the next couple days.


Shoving is the answer – pusher robot

Offline

#676 2009-12-04 15:25:26

faltik
New Member
From: Czech Rep.
Registered: 2009-12-03
Posts: 7

Re: hak_tinymce WYSIWYG article editor

@faltik: Try 0.9.6.1 see if it helps.

Nevermind found a bug that kept the editors form displaying when the toggle was hidden, so going straight to 0.9.7

Everything works like a charm now, thanks!

Offline

#677 2009-12-04 16:07:11

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: hak_tinymce WYSIWYG article editor

hakjoon wrote:

…Otherwise if you know the ids for the textareas we want you can do:

settings.body.mode = "exact";
settings.body.elements = "id1,id2,id3";

Thank you Patrick it works perfectly!
To summarize I wrote something like this in the “Callback functions” box:

settings.excerpt.mode = "exact";
settings.excerpt.elements = "custom-3, custom-7";
settings.body.mode = "exact";
settings.body.elements = "custom-4,custom-6";

This way textareas with an id of custom-3 and custom-7 will have the same settings (in particular height) of excerpts and textareas with an id of custom-4 and custom-6 the same of body. This was exactly what I was looking for (without even hacking the plugin).

I have another problem though (not related to the above): when I try to insert an image the new window opens but thumbnails are not shown and the loader gif goes on forever.
Seems like it doesen’t find any image though I’m testing in a pretty standard install (images are in the “images” dir). Mhm… must be a problem of mine since no one reported it untill now.
Any ideas?

Thank you again for the help.

Offline

#678 2009-12-04 18:08:39

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_tinymce WYSIWYG article editor

Check for any JS errors. There is some potential for alt and title to maybe break the js which i think I need to improve.


Shoving is the answer – pusher robot

Offline

#679 2009-12-05 17:48:19

MustangMatt
New Member
Registered: 2009-12-05
Posts: 4

Re: hak_tinymce WYSIWYG article editor

I just installed 0.9.7 and the image picker is not working correctly for me. When I click to add an image, the pop up box displays my website homepage under the General tab (therefore I am unable to choose an image, I just see my complete homepage in the small pop up box). If I click the Appearance and Advanced tabs, they display correctly. But without being able to access the General tab, I can’t add an image.

Don’t know if I’m the only one experiencing this?…. any help you can provide is appreciated.
BTW I’m using Firefox 3.5.5 on a Mac, php 5.2.9 running on XAMPP test server.
Thanks!

Offline

#680 2009-12-05 18:10:07

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_tinymce WYSIWYG article editor

it looks like it’s not picking up the events properly. I’m not being able to replicate it. Is your site in a folder?

In firebug can you check where the Ajax calls are going to? I seems like they are going to the wrong path somehow.

Last edited by hakjoon (2009-12-05 18:12:36)


Shoving is the answer – pusher robot

Offline

#681 2009-12-05 19:25:20

MustangMatt
New Member
Registered: 2009-12-05
Posts: 4

Re: hak_tinymce WYSIWYG article editor

Thanks for the quick reply!

The site is installed at http://localhost/textpattern/

Firebug is showing:
location:
http://localhost/textpattern/textpattern/tiny_mce/plugins/txpimage/image.htm host=localhost hostname=localhost

I must admit, I am not quite sure where to check in firebug to see where the ajax calls are going?

Looking closer, when I click the insert image icon I noticed what appears to be the general tab beginning loading, but it is quickly replaced by my homepage (if you blink you will miss it).

Offline

#682 2009-12-05 19:28:49

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: hak_tinymce WYSIWYG article editor

hakjoon wrote:

Check for any JS errors. There is some potential for alt and title to maybe break the js which i think I need to improve.

MustangMatt wrote:

When I click to add an image, the pop up box displays my website homepage under the General tab

Hi, I don’t seem to notice any js errors. All in all my problem seems similar to the one reported by MustangMatt, the only difference being I don’t display the homepage but the loader gif.
I have tried to check where the ajax calls are going, as you suggest to MustangMatt, but I’m not too acquainted with firebug and js in general.
Pardon my ignorance if I didn’t proceed the right way. I open firebug > hit “net” tab > click on the “insert image” icon. I can see there is one request but I’m not able to find any hint about “where the Ajax calls are going to”.

Offline

#683 2009-12-05 19:55:17

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_tinymce WYSIWYG article editor

In Firebug if you go to Net select “XHR”. This will show you any ajax requests that happen. When you click on insert image you should see two requests fire. One to your domain and path/textpattern/index.php?event=hak_txpcatselect and one to your domain and path/textpattern/index.php?event=hak_txpimage&src=&c=

You should also see the stats returned by the server like 200 OK or 404 Not Found. RedBot I think you are getting a 404 but MustangMatt I think is getting a 200.

If you right click on the url you can choose open in new tab. This will show you what the ajax call is pointing to, something in that url is probably wrong, domain, path I don’t know. See if anything looks weird.

Last edited by hakjoon (2009-12-05 19:58:20)


Shoving is the answer – pusher robot

Offline

#684 2009-12-05 20:08:00

MustangMatt
New Member
Registered: 2009-12-05
Posts: 4

Re: hak_tinymce WYSIWYG article editor

hakjoon wrote:

In Firebug if you go to Net select “XHR”. This will show you any ajax requests that happen. When you click on insert image you should see two requests fire. One to your domain and path/textpattern/index.php?event=hak_txpcatselect and one to your domain and path/textpattern/index.php?event=hak_txpimage&src=&c= You should also see the stats returned by the server like 200 OK or 404 Not Found.

Thanks for the instructions…
There are 2 requests shown:
http://localhost/textpattern/index.php?event=hak_txpcatselect
200 OK

http://localhost/textpattern/index.php?event=hak_txpimage&src=&c=
200 OK

Opening each of these links in a new tab displays my homepage.

Offline

Board footer

Powered by FluxBB