Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » upm_img_popper

#577 2006-06-16 20:38:54

ollieclubb
Member
From: Stadtsteinach, Germany
Registered: 2006-01-03
Posts: 10
Website

Re: upm_img_popper

Howdy

thanks for both of your replies

So taking both of your inputs and going the most simple (and inelegant) route

I could use a specific link in jmc_event_managerlike

?event=upm_img_popper&bm=true&target=event_image

to open the pop up .

Then in upm_img_popper I’ve used
<code>
if(isset($_GET[‘target’])){
var current = ‘OtherInfo’;//the name of text area in jmc
}else{
var current = ‘Body’;//the name of main textarea in the TXP write form}
</code>

Which should enter the the result from append or replace into the “OtherInfo” textarea.

But it doesnt. Where am I going wrong??? Do I also need to update the inserTag() function?

Thnx

Last edited by ollieclubb (2006-06-16 20:40:28)

Offline

#578 2006-06-16 20:49:09

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

Re: upm_img_popper

var current is set in the opening window. So you probably have to set it using

window.opener.current = "OtherInfo";

Remember that you have to have the setting be visible to javascript since current is set by javascript. So you probably want to do.

bc..
if(isset($_GET[‘target’])){ $js = ‘<script type=“text/javascript”>’; $js .= ‘window.opener.current = “OtherInfo”;//the name of text area in jmc’; $js .= ‘</script>’; echo $js;
}

you don’t really need the else since if target is not in $_GET[] current just won’t change.

Last edited by hakjoon (2006-06-16 21:22:57)


Shoving is the answer – pusher robot

Offline

#579 2006-06-16 21:53:54

ollieclubb
Member
From: Stadtsteinach, Germany
Registered: 2006-01-03
Posts: 10
Website

Re: upm_img_popper

Thanx 4 your help but its still not working :-/

Opening window is the window that is being opened ie upm_img_popper rrright?

Thought about using something like this js code from upm_img_popper

<code>
if (document.article.Excerpt)
{ document.article.Body.setAttribute(‘onclick’, “current = ‘Body’;”); document.article.Excerpt.setAttribute(‘onclick’, “current = ‘Excerpt’;”);
}
</code>

which is used to change the insertion target from the body to the Excerpt field. So it might be easier to write something like this

<code>
if (window.opener.document.OtherInfo){
document.OtherInfo.setAttribute(‘onclick’, “current = ‘OtherInfo’;”);
}
</code>

its just that dont really have enough js knowledge to write the ifs or the set statement – I’m sure I’m not referencing the right DOM object/item. Its like knowing the needle is in the upper left corner of the haystack but not being able to quite put your finger on it…

Last edited by ollieclubb (2006-06-16 22:02:45)

Offline

#580 2006-06-16 22:11:42

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

Re: upm_img_popper

Ok I think stuff might not be where it needs to be.

To do the previous method you need to add the directive to function upm_img_popper_list(). Change:

bc..
pagetop(upm_img_popper_gTxt(‘image_selector’), $message);

to

bc..
pagetop(upm_img_popper_gTxt(‘image_selector’), $message);
if(isset($_GET[‘target’])){ $js = ‘<script type=“text/javascript”>’; $js .= ‘window.opener.current = “OtherInfo”;//the name of text area in jmc’; $js .= ‘</script>’; echo $js;
}

and it should work. To do the onclick you want to do the following in the same function that does the excerpt one that you pointed out above.

bc..
if (document.jmc_event_form.OtherInfo){
document.jmc_event_form.OtherInfo.setAttribute(‘onclick’, “current = ‘OtherInfo’;”);
}

replace jmc_event_form with the name of the form that jmc_event_manager uses (I don’t know if it’s still article or not), however this method requires that the user click on Otherinfo for current to change.

Last edited by hakjoon (2006-06-16 22:13:49)


Shoving is the answer – pusher robot

Offline

#581 2006-06-17 00:58:57

ollieclubb
Member
From: Stadtsteinach, Germany
Registered: 2006-01-03
Posts: 10
Website

Re: upm_img_popper

Hello again

I ultimately settled for the easiest option and heres what worked for me:

at line 464 of jmc_event_manager give the events forrm a name of ‘jmc_article’
echo '<form name="jmc_article" id="jmc_article" action="index.php" method="post">';

Then I simply copied the functions already in insertTag() function at line 590 and adapted them based on the form name and fields which are only present in the jmc_event_manager events form:

<code>
if (window.opener.document.jmc_article){ //if the document contains a form called “jmc_article” if (type 'append-article-image'){ if (window.opener.document.jmc_article.OtherInfo.value ‘’) { window.opener.document.jmc_article.OtherInfo.value = insert; //Update the jmc_event_manager field OtherInfo success(); }
}}
// etc etc etc
</code>

many thanks to hakjoon for helping to blow enough fog out of my brain to find the needle!

Offline

#582 2006-08-17 01:49:10

mistersugar
Member
From: North Carolina
Registered: 2004-04-13
Posts: 141
Website

Re: upm_img_popper

I can’t find the needle in the haystack: how can I align a thumbnail image with the popper? I tried adding align=“left” to the tag, but didn’t work.

Offline

#583 2006-08-17 02:36:37

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: upm_img_popper

The plugin comes with help documentation, laying out all the attributes the tags accept. You need to use a class.

Offline

#584 2006-08-19 00:00:29

mistersugar
Member
From: North Carolina
Registered: 2004-04-13
Posts: 141
Website

Re: upm_img_popper

Ah, got it. Thanks. And now I remember doing just that on another of my Txp sites.

Offline

#585 2006-09-12 01:58:27

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: upm_img_popper

Mary,
Any chance that you’ve got a working version of this for the latest SVN?
I don’t get the “insert image” link on revision Textpattern version: 4.0.3 (r1788)
(this is the most recent “test” release that Sencer let go in the forum)

:)


Offline

#586 2006-09-12 12:54:02

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: upm_img_popper

Not that I care to release (I support the latest stable version of Textpattern for all my plugins). But yes, I know it needs to be updated when 4.0.4 arrives. :)

Offline

#587 2006-09-12 21:52:30

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: upm_img_popper

Mary wrote:

Not that I care to release

Lol! That’s just funny. Fairplay :) just checkin.


Offline

#588 2006-10-17 15:48:15

patbiker
Member
From: Montpellier
Registered: 2006-10-09
Posts: 51

Re: upm_img_popper

Hi,

I’ve just installed TextPattern 4.0.4 and upm_img_popper do not work anymore. I’am using the french version of TextPattern. Don’t know if it is important or not.

I’m using your plugin all the time, and I’m really missing it.

And by the way, ce plugin est vraiment cool.

Patrick


Patrick

Offline

  1. Index
  2. » Archives
  3. » upm_img_popper

Board footer

Powered by FluxBB