Plugin Author
Matt
(@sksmatt)
Hi Noixdarec,
It shouldn’t be a problem to use JavaScript. Would be great to see the code you are trying to insert, please send the link and I’ll check.
Kind Regards!
Thanks sksmatt, it feels always so good when you get the author’s direct reply.
I tasted it by embedding the Google Earth widget using javascript. If I don’t use attributes then it works like a charm, see here. Otherwise it gives me that error message after clicking the custom insert button. (in this case I have no url to show you because I can’t insert anything to the post).
My settings are:
Behavior: Insert custom code
Attributes: checked
[attibutes: kmlurl, mapwidth, mapheight, upviewmode, upearthsphere, upmapsdefaulttype, shownavcontrols]
Language: HTML
Code:
<p>%%content%%</p>
<script src="http://www.gmodules.com/ig/ifr?url=http://code.google.com/apis/kml/embed/embedkmlgadget.xml
&up_kml_url=%%kmlurl%%
&up_view_mode=%%upviewmode%%
&up_earth_2d_fallback=1
&up_earth_fly_from_space=1
&up_earth_show_nav_controls=1
&up_earth_show_buildings=1
&up_earth_show_terrain=1
&up_earth_show_roads=1
&up_earth_show_borders=1
&up_earth_sphere=%%upearthsphere%%
&up_maps_zoom_out=0
&up_maps_default_type=%%upmapsdefaulttype%%
&synd=open
&w=%%mapwidth%%
&h=%%mapheight%%
&title=Google+Earth+Embed+using+Shortcode+Pro
&border=%23ffffff%7C3px%2C1px+solid+%23999999
&output=js"></script>
Enable: checked
Prevent: unchecked
I also tested with only one attribute and it stops to work. Maybe I missed something.
By the way the “&” signs in the original javascrip were “&”, they are decoded by the plugin after I click save (anyways it works when I don’t use attributes).
Best regards,
C. Y. PAN
Plugin Author
Matt
(@sksmatt)
Hi Noixdarec,
It might be a escaping problem then. You should try returning this code with PHP:
$out ='<p>'.$content.'</p>
<script src="http://www.gmodules.com/ig/ifr?url=http://code.google.com/apis/kml/embed/embedkmlgadget.xml
&up_kml_url='.$atts['kmlurl'].'
&up_view_mode='.$atts['upviewmode'].'
&up_earth_2d_fallback=1
&up_earth_fly_from_space=1
&up_earth_show_nav_controls=1
&up_earth_show_buildings=1
&up_earth_show_terrain=1
&up_earth_show_roads=1
&up_earth_show_borders=1
&up_earth_sphere='.$atts['upearthsphere'].'
&up_maps_zoom_out=0
&up_maps_default_type='.$atts['upmapsdefaulttype'].'
&synd=open
&w='.$atts['mapwidth'].'
&h='.$atts['mapheight'].'
&title=Google+Earth+Embed+using+Shortcode+Pro
&border=%23ffffff%7C3px%2C1px+solid+%23999999
&output=js"></script>';
return $out;
Let me know if that helps,
Kind Regards!