<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>WordPress &#8250; Support Topic: [Plugin: jQuery Lightbox] Encoding js options using  wp_enqueue_script</title>
<link>http://wordpress.org/support/</link>
<description>WordPress &#8250; Support Topic: [Plugin: jQuery Lightbox] Encoding js options using  wp_enqueue_script</description>
<language>en</language>
<pubDate>Thu, 26 Nov 2009 15:26:45 +0000</pubDate>

<item>
<title>zkorwin on "[Plugin: jQuery Lightbox] Encoding js options using  wp_enqueue_script"</title>
<link>http://wordpress.org/support/topic/227745#post-996051</link>
<pubDate>Tue, 24 Feb 2009 00:03:58 +0000</pubDate>
<dc:creator>zkorwin</dc:creator>
<guid isPermaLink="false">996051@http://wordpress.org/support/</guid>
<description>&#60;p&#62;If you're still interested in an answer to this, I think I happened upon one when I was trying to fix another problem I ran into with this plugin.&#60;/p&#62;
&#60;p&#62;You can change the options you're trying to change in the jquery.lightbox.js file, which look like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// Options

		constructed:		false,

		src:				null,		// the source location of our js file
		baseurl:			null,

		files: {
			// If you are doing a repack with packer (&#60;a href=&#34;http://dean.edwards.name/packer/&#34; rel=&#34;nofollow&#34;&#62;http://dean.edwards.name/packer/&#60;/a&#62;) then append &#38;quot;.packed&#38;quot; onto the js and css files before you pack it.
			js: {
				lightbox:	&#38;#39;js/jquery.lightbox.js&#38;#39;,
				colorBlend:	&#38;#39;js/jquery.color.js&#38;#39;
			},
			css: {
				lightbox:	&#38;#39;css/jquery.lightbox.css&#38;#39;
			},
			images: {
				prev:		&#38;#39;images/prev.gif&#38;#39;,
				next:		&#38;#39;images/next.gif&#38;#39;,
				blank:		&#38;#39;images/blank.gif&#38;#39;,
				loading:	&#38;#39;images/loading.gif&#38;#39;
			}
		},

		text: {
			// For translating
			image:		&#38;#39;Image&#38;#39;,
			of:			&#38;#39;of&#38;#39;,
			close:		&#38;#39;Close X&#38;#39;,
			closeInfo:	&#38;#39;You can also click anywhere outside the image to close.&#38;#39;,
			download:	&#38;#39;Direct link to download the image.&#38;#39;,
			help: {
				close:		&#38;#39;Click to close&#38;#39;,
				interact:	&#38;#39;Hover to interact&#38;#39;
			},
			about: {
				text: 	&#38;#39;jQuery Lightbox Plugin (balupton edition)&#38;#39;,
				title:	&#38;#39;Licenced under the GNU Affero General Public License.&#38;#39;,
				link:	&#38;#39;http://jquery.com/plugins/project/jquerylightbox_bal&#38;#39;
			}
		},

		keys: {
			close:	&#38;#39;c&#38;#39;,
			prev:	&#38;#39;p&#38;#39;,
			next:	&#38;#39;n&#38;#39;
		},

		handlers: {
			// For custom actions
			show:	null
		},

		opacity:		0.9,
		padding:		null,		// if null - autodetect

		speed:			400,		// Duration of effect, milliseconds

		rel:			&#38;#39;lightbox&#38;#39;,	// What to look for in the rels

		auto_relify:	true,		// should we automaticly do the rels?

		auto_scroll:	&#38;#39;follow&#38;#39;,	// should the lightbox scroll with the page? follow, disabled, ignore
		auto_resize:	true,		// true or false

		ie6:			null,		// are we ie6?
		ie6_support:	true,		// have ie6 support
		ie6_upgrade:	true,		// show ie6 upgrade message

		colorBlend:		null,		// null - auto-detect, true - force, false - no

		download_link:	true,		// Display the download link

		show_linkback:		true,	// true, false
		show_info:			&#38;#39;auto&#38;#39;,	// auto - automaticly handle, true - force
		show_extended_info:	&#38;#39;auto&#38;#39;,	// auto - automaticly handle, true - force	

		// names of the options that can be modified
		options:	[&#38;#39;auto_scroll&#38;#39;, &#38;#39;auto_resize&#38;#39;, &#38;#39;download_link&#38;#39;, &#38;#39;show_info&#38;#39;, &#38;#39;show_extended_info&#38;#39;, &#38;#39;ie6_support&#38;#39;, &#38;#39;ie6_upgrade&#38;#39;, &#38;#39;colorBlend&#38;#39;, &#38;#39;baseurl&#38;#39;, &#38;#39;files&#38;#39;, &#38;#39;text&#38;#39;, &#38;#39;show_linkback&#38;#39;, &#38;#39;keys&#38;#39;, &#38;#39;opacity&#38;#39;, &#38;#39;padding&#38;#39;, &#38;#39;speed&#38;#39;, &#38;#39;rel&#38;#39;, &#38;#39;auto_relify&#38;#39;],&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;In order to make the changes to the jquery.lightbox.js file appear on your site, however, you first have to open up the jquery-lightbox.php file and change:&#60;br /&#62;
&#60;code&#62;wp_enqueue_script(&#38;#39;jquerylightbox&#38;#39;, $path.&#38;#39;/jquery.lightbox.packed.js&#38;#39;, array(&#38;#39;jquery&#38;#39;), &#38;#39;1.3.5&#38;#39;);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;to:&#60;br /&#62;
&#60;code&#62;wp_enqueue_script(&#38;#39;jquerylightbox&#38;#39;, $path.&#38;#39;/jquery.lightbox.js&#38;#39;, array(&#38;#39;jquery&#38;#39;), &#38;#39;1.3.5&#38;#39;);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;and the changes should be reflected.
&#60;/p&#62;</description>
</item>
<item>
<title>ctree on "[Plugin: jQuery Lightbox] Encoding js options using  wp_enqueue_script"</title>
<link>http://wordpress.org/support/topic/227745#post-933397</link>
<pubDate>Mon, 22 Dec 2008 03:19:01 +0000</pubDate>
<dc:creator>ctree</dc:creator>
<guid isPermaLink="false">933397@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I have an interesting url encoding issue using 'wp_enqueue_script' to apply options to the current version (1.3.5) of the jquery lightbox plugin:&#60;/p&#62;
&#60;p&#62;this code&#60;/p&#62;
&#60;p&#62;&#60;code&#62;wp_enqueue_script(&#38;#39;jquerylightbox&#38;#39;, $path.&#38;#39;/jquery.lightbox.packed.js?download_link=false&#38;#38;show_linkback=false&#38;#38;text.info=Photo&#38;#38;text.closeInfo=Click anywhere outside image to close&#38;#39;, array(&#38;#39;jquery&#38;#39;), &#38;#39;1.3.5&#38;#39;);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;translates into this on the page:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#38;lt;script type=&#38;#39;text/javascript&#38;#39; src=&#38;#39;[...]/wp-content/plugins/jquery-lightbox-balupton-edition/js/jquery.lightbox.packed.js?download_link=false&#38;#38;show_linkback=false&#38;#38;text_info=Photo&#38;#38;text_closeInfo=Click+anywhere+outside+image+to+close&#38;#38;ver=1.3.5&#38;#39;&#38;gt;&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;'wp_enqueue_script' is doing some url encoding of its own - although you can't see it in this example because the forum is eating the ampersand conversions, the ampersands are in fact converted to &#34;&#38;#38; # 3 8 ; &#34; and spaces become &#34;+&#34; (as you can see). Unfortunately, it also converts the dots between 'text.info' and 'text.closeInfo' to underscores. Strangely, it leaves alone the dots in the file path at the beginning and in the version info at the end of the string - it just eats the ones in the options part. I need the dots to apply the options to the page - how can I make sure they stay dots and won't be converted to underscores?&#60;/p&#62;
&#60;p&#62;Is this a problem with my code, or with wp_enqueue_script, or with the jquery plugin?&#60;/p&#62;
&#60;p&#62;Note: The jquery plugin options are explained here:&#60;br /&#62;
&#60;a href=&#34;http://www.balupton.com/sandbox/jquery_lightbox/jquery_lightbox/readme.txt&#34; rel=&#34;nofollow&#34;&#62;http://www.balupton.com/sandbox/jquery_lightbox/jquery_lightbox/readme.txt&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;P.S. This forum is eating the encodings too :-) I've added some spaces to illustrate my point.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
