Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#457 2005-12-03 14:06:34
- andersms
- New Member
- Registered: 2005-09-20
- Posts: 7
Re: upm_img_popper
I assume so, I downloaded and installed in Wednesday from this thread.
EDIT: further clarification
Last edited by andersms (2005-12-03 14:07:07)
Offline
#458 2005-12-09 09:57:19
- estelle
- New Member
- Registered: 2005-10-06
- Posts: 4
Re: upm_img_popper
Hi,
I’m sorry but I am a total newbie at textpattern. All i am trying to do is insert a thumbnail into an article and have it link to the fullsize image.
I have installed this plugin but I do not have a new link above “Textile Help” when I am in Content -> Write.
Can anyone provide me with clues as to what I have missed? I can setup a new admin account if necessary…
Thanks heaps,
Estelle.
Offline
#459 2005-12-09 10:02:49
- estelle
- New Member
- Registered: 2005-10-06
- Posts: 4
Re: upm_img_popper
Okay, just found a post somewhere else that said i have to activate it…. (Such a newbie i am!!)
Offline
#460 2005-12-09 16:49:42
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: upm_img_popper
andersms: I knew I was forgetting something, sorry ‘bout that.
I just re-read your post. When the image is a popup, the caption is added as a title attribute to the a(nchor) tag. So, if that’s what you’re getting, that’s what it has been written to do. Otherwise, if you’re still having problems, please let me know. I’ll try and be quicker to answer, I promise. :)
That said, I’m finding a couple more bugs in the plugin, which I’m fixing right now and will be posting an update shortly.
Last edited by Mary (2005-12-09 16:49:54)
Offline
#461 2005-12-12 06:24:36
Re: upm_img_popper
Mary,
I’ve finally equipped myself with a copy of Microsofts Script Debugger and hunted down the cause for those string constant not delimited properly errors in IE while inserting an image in the “content > write” tab.
Basically, this happens when an image’s title or alternative text contains a quote. The image chooser then contains markup like that:
[...]
<li><a href="#" onclick="return insertTag('custom', '33');">custom</a></li>
<li><a href="#" onclick="return insertTag('xhtml', '33', '.jpg', '100', '160',
'alttext with "quotes" and <brackets>', 'caption with "quotes" and <brackets>');">XHTML</a></li>
[...]
<a href="#" onclick="return makeWin('Alternate text for “a-sample.jpg”',
'alttext with "quotes" and <brackets>');">Alt text</a></li>
<li><a href="#" onclick="return makeWin('Caption for “a-sample.jpg”',
'caption with "quotes" and <brackets>');">Caption</a></li>
Would you kindly escape quotes (and brackets, just in case) before you build the image chooser? escape_title()
might suit perfectly, but requires 4.0.2.
Thank you.
Robert
Last edited by wet (2005-12-12 06:26:43)
Offline
#462 2005-12-12 15:02:20
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: upm_img_popper
Posted source is definitely more helpful. I thought the image preview popup also had problems?
Offline
#463 2005-12-12 15:43:40
Re: upm_img_popper
No script errors on the public side by now. These would occur only with poups, wouldnt’ they? Maybe you are referring my quote from this post:
Two remarks regarding the admin side:
[…]
2. My installation of IE6/WinXP throws two JS error indications claiming that string constants are not closeed properly.
Both appear after the controls (Search, include width, include height, include alt text, include caption, assign class, Custom form) are painted but before the actual image list is drawn.
Offline
#464 2005-12-12 16:02:40
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: upm_img_popper
No, I do mean admin-side still. redpen said: “When I try to preview image, alt, or caption…” So I’m wondering if the preview image was just mentioned because it only appeared all the popups weren’t working, or if that is still an issue.
I still can’t get the previews at all in IE. I need a “tearing-out-my-hair” smilie.
Offline
#465 2005-12-12 17:30:43
Re: upm_img_popper
Sorry, I obviously was in “post-before-read” mode.
When clicking on the admin side “preview > image”, the script halts on this line (quote this post for real code):
var fastWin = window.open('', 'upm-img-preview', 'top = '+t+', left = '+l+', width = '+ww+', height = '+wh+', toolbar = no, location = no, directories = no, status = yes, menubar = no, scrollbars = yes, copyhistory = no, resizable = yes');
Error message is:
Error: 49. Invalid argument.
MSDN says this:
sName Optional. String that specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an a element.
_blank The sURL is loaded into a new, unnamed window.
_media The sURL is loaded into the HTML content area of the Media Bar. Available in Internet Explorer 6 or later.
[…]
And they also say this on window.name:
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5.
That given, I think Internet Explorer tries to evaluate ‘upm minus img minus preview’, which fails. Netscape defines the range of valid characters for windowName. They say:
windowName can contain only alphanumeric or underscore (_) characters.
No arithmetic symbols.
This fails:
javascript:window.open('','upm-img-preview', 'top = 445,left = 650,width = 100,height = 160,toolbar = no,location = no,directories = no,status = yes,menubar = no,scrollbars = yes,copyhistory = no,resizable = yes');
while this succeeds:
javascript:window.open('','_blank', 'top = 445,left = 650,width = 100,height = 160,toolbar = no,location = no,directories = no,status = yes,menubar = no,scrollbars = yes,copyhistory = no,resizable = yes');
So I’ve made these changes to your script and had a working plugin for both FF and IE:
line #452: var fastWin = window.open('', '_blank', 'top = '+t+', left = '+l+', width = '+ww+', height = '+wh+', toolbar = no, location = no, directories = no, status = yes, menubar = no, scrollbars = yes, copyhistory = no, resizable = yes');
line #1068: $insert .= n.'<li><a href="#" onclick="return insertTag(\'xhtml\', '.chr(39).$id.chr(39).', '.chr(39).$ext.chr(39).', '.chr(39).$w.chr(39).', '.chr(39).$h.chr(39).', '.chr(39).htmlentities($alt).chr(39).', '.chr(39).htmlentities($caption).chr(39).');">XHTML</a></li>';
line #1078: $preview .= n.'<a href="#" onclick="return makeWin('.chr(39).upm_img_popper_gTxt('alt_text_for').sp.'“'.$name.'”'.chr(39).', '.chr(39).htmlentities($alt).chr(39).');">'.gTxt('alt_text').'</a></li>';
line #1083: $preview .= n.'<li><a href="#" onclick="return makeWin('.chr(39).upm_img_popper_gTxt('caption_for').sp.'“'.$name.'”'.chr(39).', '.chr(39).htmlentities($caption).chr(39).');">'.gTxt('caption').'</a></li>';
// god I hate javascript in php
How true…
You might give it a spin as I just hit the spots which obviously broke into the script debugger and do not know anything else about the inner workings of your marvellous plugin’s other segments which weren’t covered by this quick & dirty fix.
It found htmlentities() to be suitable for escaping quotes and brackets. I have not checked with non-latin characters, though.
cheers, Robert
Last edited by wet (2005-12-12 19:53:33)
Offline
#466 2005-12-12 23:54:09
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: upm_img_popper
Okay, thanks Robert. I’ve got a couple other fixes to put in, so I’ll put it together and release later tonight.
Offline
#467 2005-12-16 23:54:34
Re: upm_img_popper
Mary, I just wanted to say thanks, again, for a great plug-in that helps me immensely.
Search is your friend… Think before writing…
Offline
#468 2005-12-17 00:42:13
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: upm_img_popper
Sorry I didn’t post the release four days ago, I was hoping to hear back on a little problem here, but I haven’t. I’ll just post the update as it is, and hopefully there will soon be a solution for this remaining quirk.
Offline