[pmwiki-users] GUI edit freezes time?

Johnny Ernst Nielsen j_e_n_pub at yahoo.dk
Mon Oct 15 15:13:27 CDT 2007


> On Sun, Oct 14, 2007 at 09:25:48PM +0200, Johnny Ernst Nielsen 
wrote:
> > My question is then; is it somehow possible to make an editing
> > gui button capable of inserting the current time that the button
> > is pressed?
> > So that if it is pressed with an interval of two seconds, it will
> > insert two different times, two seconds apart?

Mandag 15 oktober 2007 21:14 kvad Patrick R. Michaud:
> It's possible, but this would require creating some Javascript
> that can be executed from the browser that calculates the time
> at the point where the button is pressed and inserts it into
> the text.
>
> In other words, it's not something that is a PHP-only solution.

Thank you for your answer and your time.

I needed it to generate unique bookmarks.
At the time they were generated from $AuthId + time
Seeing that I misunderstood PmWiki's functionality, I have managed to 
make an other solution.

The current solution is to have the gui button insert a special 
markup.
In my case (:bookmark:)
Then, when the Save button is pressed, an extra edit function goes 
through $new['text'] and replaces each occurrence of the bookmark 
markup with $AuthId+time+serial

I will put this up as a recipe.

Best regards :o)

Johnny :o)



More information about the pmwiki-users mailing list