Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active (javascript) content in the info window #255

Closed
GoogleCodeExporter opened this issue Apr 4, 2015 · 9 comments
Closed

Active (javascript) content in the info window #255

GoogleCodeExporter opened this issue Apr 4, 2015 · 9 comments

Comments

@GoogleCodeExporter
Copy link

Error reported in a comment on issue 74 with flash content in the input
window with Geo Mashup 1.2.6 and WP 2.8.4.

What was the error message? Is the default info window template in use, or
a custom template?

Original issue reported on code.google.com by dylankk...@gmail.com on 24 Aug 2009 at 4:09

@GoogleCodeExporter
Copy link
Author

The way audio player (http://wpaudioplayer.com/) works is it uses javascript to 
replace the content of an html 
element with the flash player.  The "error message" was the content of said 
html element which told me to 
install/upgrade Flash Player -- not really helpful given the context.

So I hacked the audio player plugin by inserting the audioplayer object as the 
content of said html element, and 
this is now displayed on the site 
(http://www.klapt.net/category/klapt/kazakhstan/)

Original comment by hotel.i...@gmail.com on 26 Aug 2009 at 7:14

@GoogleCodeExporter
Copy link
Author

I'm pretty sure this is a javascript issue. Flash by itself works fine in the 
info
window, but any content that requires javascript to render properly may find the
required scripts aren't loaded.

I thought maybe I could do a quick fix by letting WP print scripts in the map 
iframe.
This is part of the solution, and hopefully won't cause other problems or slow 
things
down much, but then I realized there is a bigger problem.

These days most scripts use some variation of a document ready event to attach
behaviors to their content. But info window content is not yet present when the 
map
document is ready, it gets loaded via an AJAX request when the info window is 
opened.
When that happens, the content is loaded without its intended javascript 
behaviors,
long after document ready.

If the plugin author has been proactive enough to use jQuery live events or 
something
equivalent, then it will work, but I don't think that's a common practice yet.

This is enough of a stumbling block that I think I'll have to change it to an
enhancement for javascript content in the info window.

Original comment by dylankk...@gmail.com on 24 Sep 2009 at 4:41

  • Changed title: Active (javascript) content in the info window
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

This will definitely be improved in Geo Mashup 1.4, but the problem I note 
above may still be present.

Some behaviors could be added in Geo Mashup 1.3.x by letting WordPress print 
scripts after the <title> tag in render-map.php with this code:

<?php wp_print_scripts(); ?>

Original comment by dylankk...@gmail.com on 7 Jul 2010 at 8:32

  • Added labels: Milestone-1.4

@GoogleCodeExporter
Copy link
Author

This issue was updated by revision r815.

There is now an API providing a way to fully control scripts and stylesheets 
that are loaded in map frames. The problems noted previously will probably 
still prevent scripted content from working out of the box in the info window,
but now it will at least be possible to trigger active content via custom 
javascript, 
most likely using the 'selecteMarker' action.

Original comment by dylankk...@gmail.com on 17 Dec 2010 at 11:16

  • Changed state: Implemented

@GoogleCodeExporter
Copy link
Author

Original comment by dylankk...@gmail.com on 12 Jul 2011 at 1:46

  • Changed state: Released

@GoogleCodeExporter
Copy link
Author

WP 3.2.1, Geo Mashup 1.4.1, default info window template

I have tried several flash-based players, I've also tried adding 
GeoMashupRenderMap::enqueue_script('audio-player') and wp_head() and not work 

http://www.m2sonido.net/mapa

Original comment by mlas...@addsensor.com on 3 Aug 2011 at 12:01

@GoogleCodeExporter
Copy link
Author

@mlas...: Your info window suffers from the problem I outlined in comment 2, I 
think. The code that loads the player runs at page load time, but probably 
needs to be run again whenever an info window is opened. This can probably be 
done with some custom javascript code specific to your site and player.

Original comment by dylankk...@gmail.com on 9 Aug 2011 at 10:10

@GoogleCodeExporter
Copy link
Author


Hello, 

Do you have an idea of the code to write in custom info-window.php or anywhere 
else ?
I'm using WP audio player plugin (and tried many others media plugins). This 
plugin can automatically detect mp3 links to embed them in audio player. That's 
why I have chosen it. It's working correctly on details page. But not in 
infowindow (flash message alert).

In fact, if I copy the rendered source code of the player and put it "hard 
coded way" into the article, it's working. Flash is displayed in infowindow. 
It's not displayed.

The details page : http://cartes-sonores.acoucite.org/test-2/
The map page : http://cartes-sonores.acoucite.org/ (the most northerly icon 
contains the sample described)

So, is it really a javascript based problem ?

Thanks by advance for any advice.

Original comment by matthieu...@gmail.com on 20 Sep 2012 at 9:26

@GoogleCodeExporter
Copy link
Author

@matthieu It's a good guess that's a javascript problem, but it takes some work 
to figure out which scripts need to be loaded in the map frame and what 
javascript needs to run when the info window is loaded.

Original comment by dylankk...@gmail.com on 21 Sep 2012 at 4:53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant