Forum closed. New forum available at http://community.wymeditor.org/

Inserting Images

Support forum for WYMeditor.

Inserting Images

Postby Pezmc on Fri Mar 06, 2009 6:25 pm

Whenever (using WYMeditor) I add an image, instead of adding the correct URL it adds something like: <img src="wym-1236363767909" /> do you have any idea why? It just means the image is broken and the image function serves no purpose!

Hope you can help,
Pezmc
 
Posts: 7
Joined: Fri Mar 06, 2009 6:23 pm

Re: Inserting Images

Postby Pezmc on Fri Mar 06, 2009 7:28 pm

So far I have got (the \'s are as it is in PHP, just ignore them):
var html = '<li class=\"wym_tools_gallery\">'
+ '<a href=\"#\"'
+ ' title=\"Add image from gallery\"'
+ ' style=\"background-image:'
+ ' url(wymeditor/skins/default/icons.png)\">'
+ 'Add image from gallery'
+ '</a></li>';
jQuery(wym._box)
.find(wym._options.toolsSelector + wym._options.toolsListSelector)
.append(html);

jQuery(wym._box)
.find('li.wym_tools_gallery a').click(function() {
alert('Test');
g_window = window.open('gallery.php', 'filebrowser', 'height=600,width=840,resizable=yes,scrollbars=yes');
g_window.focus();
return(false);
});

Does anyone who knows javascript know how to get a link on the gallery.php page to close the window (gallery page) and insert content to wymeditor?

PS Glad to make all the code public once it is finished!
Pezmc
 
Posts: 7
Joined: Fri Mar 06, 2009 6:23 pm

Re: Inserting Images

Postby KevBurns on Mon Mar 09, 2009 10:53 pm

You need to downgrade to jQuery 1.2.6

WYMeditor does not play nice with 1.3.1
KevBurns
 
Posts: 1
Joined: Thu Nov 20, 2008 11:34 pm

Re: Inserting Images

Postby wilhelm on Tue Mar 10, 2009 12:19 am

I've had this exact same problem. Downgrading from 1.3.1 to 1.2.6 didn't solve my problem. It _changed_ the problem, however. Now it doesn't insert random gibberish (wym-2314234234) anymore. It just doesn't do _anything_ when I click OK or Cancel in the popup dialogs.

Any suggestions to why?
wilhelm
 
Posts: 5
Joined: Sun Jan 14, 2007 3:54 pm

Re: Inserting Images

Postby mr_lundis on Tue Mar 10, 2009 2:32 pm

@Pezmc:
The current dialogue handling in WYMeditor is just a mess. If you still want to get your hands dirty, you'll need to execute some JavaScript in the new window you're opening. See the INIT_DIALOG method in the WYMeditor source.

@wilhelm, KevBurns:
jQuery 1.3 support now in trunk ;)

Cheers!
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: Inserting Images

Postby Pezmc on Wed Mar 11, 2009 2:55 pm

mr_lundis wrote:@Pezmc:
@wilhelm, KevBurns:
jQuery 1.3 support now in trunk ;)


With the latest 1.3.2 jQuery and the copy from the trunk (http://trac.wymeditor.org/trac/browser/ ... meditor.js) I still get the random gibberish (wym-2314234234) bug, but pressing ok in the text box does no longer close the window. Any ideas?

PS opened a new thread for the Gallery script I am planning.
Pezmc
 
Posts: 7
Joined: Fri Mar 06, 2009 6:23 pm

Re: Inserting Images

Postby mr_lundis on Wed Mar 11, 2009 3:02 pm

Pezmc wrote:With the latest 1.3.2 jQuery and the copy from the trunk (http://trac.wymeditor.org/trac/browser/ ... meditor.js) I still get the random gibberish (wym-2314234234) bug, but pressing ok in the text box does no longer close the window. Any ideas?

Have you done a fresh checkout of the new code?

Pezmc wrote:PS opened a new thread for the Gallery script I am planning.

I've noticed, but can you clarify one thing for me - when do you get these errors? Is it when you try to insert an image the "normal" way, or when you're using your plug-in?

Cheers!
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: Inserting Images

Postby Pezmc on Wed Mar 11, 2009 3:10 pm

It was a fresh checkout. Even cleared by cache just to be sure!

I am talking about when using your version.

I eagerly await your response!
Pezmc
 
Posts: 7
Joined: Fri Mar 06, 2009 6:23 pm

Re: Inserting Images

Postby mr_lundis on Wed Mar 11, 2009 3:21 pm

Okey, that sounds weird. Does this occur only when you insert images, or is the link insertion affected as well?

Oh, and if you don't mind, a test page would be nice, because I can't reproduce this issue myself.

Cheers!
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: Inserting Images

Postby Pezmc on Wed Mar 11, 2009 4:03 pm

I have an even major problem now. WYMeditor is just not running at all...
Test file here with latest jQuery and latest WYMeditor: http://www.m4mad.com/admin/test.htm
(As well as lots of other JS running in the BG)
Pezmc
 
Posts: 7
Joined: Fri Mar 06, 2009 6:23 pm

Re: Inserting Images

Postby mr_lundis on Wed Mar 11, 2009 4:42 pm

Just change the name of your wymeditor js file to jquery.wymeditor.js, or set the basePath and wymPath options. WYMeditor needs these paths to include some js in the pop-up dialogues, and when they're missing WYMeditor tries to guess them on it's own. This usually work fine - as long as you don't rename the WYMeditor files. ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: Inserting Images

Postby Pezmc on Wed Mar 11, 2009 5:29 pm

Have changed this and as far as I can see it's still not working!
PS Sorry I'm being such a pain!
Pezmc
 
Posts: 7
Joined: Fri Mar 06, 2009 6:23 pm

Re: Inserting Images

Postby mr_lundis on Wed Mar 11, 2009 6:32 pm

Pezmc wrote:Have changed this and as far as I can see it's still not working!

That's because the browser "classes" are not included. You'll need to build the WYM source (by running make in the top directory of the trunk) or include all the jquery.wymeditor.<browser>.js files.
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: Inserting Images

Postby wilhelm on Tue Mar 17, 2009 7:20 am

Hm. A fresh checkout makes closing the popups work, and makes link insertion work, but image insertion still produces gibberish. This is with both jQuery 1.3.1 and 1.3.2.
wilhelm
 
Posts: 5
Joined: Sun Jan 14, 2007 3:54 pm

Re: Inserting Images

Postby mr_lundis on Tue Mar 17, 2009 8:47 am

wilhelm wrote:Hm. A fresh checkout makes closing the popups work, and makes link insertion work, but image insertion still produces gibberish. This is with both jQuery 1.3.1 and 1.3.2.

Does this occur using the bundled version jQuery? (1.2.x)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Next

Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests