<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>Bram.us &#187; javascript</title>
	<atom:link href="http://www.bram.us/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bram.us</link>
	<description>A rather geeky/technical weblog by Bram(us) Van Damme</description>
	<lastBuildDate>Sat, 04 Feb 2012 11:59:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>RE: Rounded corners on images, CSS-only</title>
		<link>http://www.bram.us/2010/04/03/re-rounded-corners-on-images-css-only/</link>
		<comments>http://www.bram.us/2010/04/03/re-rounded-corners-on-images-css-only/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 22:31:56 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[javascript]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=2401</guid>
		<description><![CDATA[Rounded corners are hot. They have been for a long time and still are. Recently things got a whole lot easier due to the fact that lots of browsers started supporting (their vendor specific prefixed version of) border-radius. One of &#8230; <a href="http://www.bram.us/2010/04/03/re-rounded-corners-on-images-css-only/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bram.us/wordpress/wp-content/uploads/2010/04/cssrounded.jpg"><img src="http://www.bram.us/wordpress/wp-content/uploads/2010/04/cssrounded.jpg" alt="" title="cssrounded" width="80" height="80" class="alignnone size-full wp-image-2402" style="float: left; margin: 0 10px 10px 0;" /></a>Rounded corners are hot. They have been for a long time and still are. Recently things got a whole lot easier due to the fact that lots of browsers started supporting (their vendor specific prefixed version of) <code>border-radius</code>. One of the problems with it is that <code>border-radius</code> cannot be used on images. <a href="http://maxvoltar.com/">Tim Van Damme</a> recently went over the possibilities to using rounded corners with images and <a href="http://maxvoltar.com/archive/rounded-corners-on-images-css-only">developed a nice CSS solution</a> for it. Javascript geek as I am, I took the liberty of making a tad bit more dynamic by creating <a href="http://www.bram.us/sandbox/roundedcorners/">a javascript enhanced version of his solution</a>.<br style="clear: both;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2010/04/03/re-rounded-corners-on-images-css-only/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The lazy programmer at work: _eoo and your Javascript Objects</title>
		<link>http://www.bram.us/2009/02/22/the-lazy-programmer-at-work-_eoo-and-your-javascript-objects/</link>
		<comments>http://www.bram.us/2009/02/22/the-lazy-programmer-at-work-_eoo-and-your-javascript-objects/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 17:41:19 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=1925</guid>
		<description><![CDATA[I admit: I&#8217;m a lazy programmer. If there&#8217;s anything I can do to reduce code, I&#8217;m in. Above that: if there&#8217;s anything I can do to avoid mistakes and errors, I&#8217;m in too. In order to have less errors/mistakes whilst &#8230; <a href="http://www.bram.us/2009/02/22/the-lazy-programmer-at-work-_eoo-and-your-javascript-objects/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bram.us/wordpress/wp-content/uploads/2009/02/lazy.gif" alt="" title="lazy" width="80" height="80" style="display: block; float: left; margin: 0 10px 10px 0;" />I admit: I&#8217;m a lazy programmer. If there&#8217;s anything I can do to reduce code, I&#8217;m in. Above that: if there&#8217;s anything I can do to avoid mistakes and errors, I&#8217;m in too. In order to have less errors/mistakes  whilst whipping up some Javascript Objects I&#8217;ve created a little trick: the use of the <code>_eeo</code> datamember.<br style="clear: both;" /></p>
<p><span id="more-1925"></span></p>
<h2>Objects in Javascript</h2>
<div class="BramusBlock">
<p>Whenever you create an object in JS, you do somehting like this (<em>at least that&#8217;s how I do it</em>):</p>
<pre class="brush: jscript; title: ; notranslate">// A Javascript Object
var MyJsObject = {
	param1: true,
	param2: false,
	func1 : function() {
		// my code here
	}
}</pre>
<p>Whenever you expand that object, one would add a new function/param to the object, separated by a comma:</p>
<pre class="brush: jscript; title: ; notranslate">// Expanding the Object
var MyJsObject = {
	param1: true,
	param2: false,
	param3: &quot;Yes we can&quot;,
	func1 : function() {
		// my code here
	},
	func2 : function() {
		// my code here
	}
}</pre>
<p>Now, I myself have noticed that sometimes I forget to add a comma, like so:</p>
<pre class="brush: jscript; title: ; notranslate">// This will fail
var MyJsObject = {
	param1: true,
	param2: false,
	param3: &quot;Yes we can&quot;
	func1 : function() {
		// my code here
	},
	func2 : function() {
		// my code here
	}
}</pre>
<p>The above of course won&#8217;t go undetected, as <strong>it will produce an error</strong>. Using Firebug you&#8217;ll get this lovely error, pointing you immediately towards the errorous file:</p>
<p><img src="http://www.bram.us/wordpress/wp-content/uploads/2009/02/picture-3.png" alt="" title="Error!" width="499" height="120" class="alignnone size-full wp-image-1926" /></p>
<p>Another mistake one can make is to have an extra comma after your very last function. This &#8211; for example &#8211; can happen when you delete a function from the object:</p>
<pre class="brush: jscript; title: ; notranslate">// This will fail, will it?
var MyJsObject = {
	param1: true,
	param2: false,
	param3: &quot;Yes we can&quot;,
	func1 : function() {
		// my code here
	},
}</pre>
<p>The problem with the above is that <strong>it won&#8217;t give an error in Firefox</strong> (<em>my weapon of choice</em>), allowing to code along without even knowing I&#8217;ve left a lost comma at the very end of my JS file!</p>
</div>
<h2>The real problem here</h2>
<div class="BramusBlock">
<p>The real problem of the problem above is that it actually will give an error in &#8211; <em>yeah, you&#8217;ve guessed it</em> &#8211; Internet Explorer.</p>
<p>As many webdevelopers I test sites in IE not that often: I first get my stuff straight in Firefox, and then test IE and start fixing the errors.</p>
<p>Now, there&#8217;s a problem with &ldquo;the problem of the problem&rdquo;: IE gives an error, but &#8211; <em>again, you&#8217;ve guessed it right</em> &#8211; it totally isn&#8217;t descriptive; You get something like: &ldquo;<code>Line: 10; Char: 1; Error: Expected identifier, string or number; Code: 0; File: yourpage.html</code>&rdquo;</p>
<p>The error given is worthless as neither the correct file nor the correct line-number is mentioned in the error! Finding the file that&#8217;s causing the error can take quite some time if you have lots of JS files.</p>
</div>
<h2>Introducing <code>_eeo</code></h2>
<div class="BramusBlock">
<p>In order to <em>never ever</em> mistakenly produce such an error I use this little trick: the very last datamember/property/whatever-you-like-to-call-it of every Object I write is a dummy parameter <code>_eeo</code>, which is short for <code>End Of Object</code>. This <code>_eeo</code> <strong>always</strong> is the last datamember of the Object, as seen below:</p>
<pre class="brush: jscript; title: ; notranslate">// &quot;Bramus! The lazy programmer&quot; at work
var MyJsObject = {
	param1: true,
	param2: false,
	param3: &quot;Yes we can&quot;,
	func1 : function() {
		// my code here
	},
	_eeo: true
}</pre>
<p>Using the <code>_eeo</code> trick, one can never &#8211; mistakenly &#8211; have a lost comma at the end and one must always add a comma when adding new functions/datamembers (which you do before the <code>_eoo</code> param). This reduces mistakes, as there&#8217;s no doubt anymore <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Turns out that this little trick is <em>that</em> good, that my former colleagues at <a href="http://www.netlash.com/">Netlash</a> and <a href="http://en.netlog.com/go/developer">Netlog</a> are <a href="http://twitter.com/oemebamo/statuses/1102193849">using</a> this trick too nowadays <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2009/02/22/the-lazy-programmer-at-work-_eoo-and-your-javascript-objects/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Accessing data saved in the class property of DOM-elements with jQuery</title>
		<link>http://www.bram.us/2009/02/09/accessing-data-saved-in-the-class-property-of-dom-elements-with-jquery/</link>
		<comments>http://www.bram.us/2009/02/09/accessing-data-saved-in-the-class-property-of-dom-elements-with-jquery/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 20:01:56 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=1914</guid>
		<description><![CDATA[A few weeks ago former colleague Jurriaan wrote a PrototypeJS extension to accessing data stored within classes of HTML elements. Basically it comes down to assigning extra classes (classes such as gender_male for example, which represent a property and a &#8230; <a href="http://www.bram.us/2009/02/09/accessing-data-saved-in-the-class-property-of-dom-elements-with-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="/wordpress/wp-content/uploads/2008/10/jquery.gif" style="display: block; float: left; margin: 0 10px 10px 0;" alt="" title="" />A few weeks ago former colleague <a href="http://www.jurriaanpersyn.com/">Jurriaan</a> wrote <a href="http://www.jurriaanpersyn.com/archives/2009/01/21/accessing-data-saved-in-the-class-property-of-dom-elements-with-prototype/">a PrototypeJS extension to accessing data stored within classes of HTML elements</a>. Basically it comes down to assigning extra classes (<em>classes such as <code>gender_male</code> for example, which represent a property and a value</em>) on an element, which you then read/write via Jurriaan&#8217;s extension. As this way of assigning data is a technique I&#8217;ve been using too, I took the liberty of writing a jQuery blend of his script.</p>
<p><span id="more-1914"></span></p>
<h2>Ow ow, what is this all about?</h2>
<div class="BramusBlock">
<p>I suggest you read <a href="http://www.jurriaanpersyn.com/archives/2009/01/21/accessing-data-saved-in-the-class-property-of-dom-elements-with-prototype/">Jurriaan&#8217;s excellent post on the subject</a> if you&#8217;re not acquainted with the subject. It situates the problem and explains the necessity of this plugin.</div>
<h2>Cool, any demo?</h2>
<div class="BramusBlock">
<p>Elementary my dear Watson, elementary:</p>
<p style="text-align: center;"><a href="http://www.bram.us/demo/projects/jquery_classdata/" title="jQuery ClassData Demo"><img src="http://www.bram.us/wordpress/wp-content/uploads/2009/02/jquery-classdata-demo.gif" alt="" title="jQuery ClassData Demo" width="500" height="132" class="alignnone size-full wp-image-1919" /></a></p>
</div>
<h2>Gimme gimme gimme (Download)!</h2>
<div class="BramusBlock">
<p><a href="https://github.com/bramus/jquery_classdata/">Find the source on GitHub</a> (click on the Download button)</p>
</div>
<h2>Okay I downloaded it: How to I use this thing / Any differences between yours and Jurriaan&#8217;s version?</h2>
<div class="BramusBlock">
<p>Usage is simple: include the script after you&#8217;ve included jQuery. From then on you can use the <code>classData()</code> function on a jQuery Object:</p>
<pre class="brush: jscript; title: ; notranslate">// Set data - this will set the class 'extradata_yes' on the elements that match the selector (note that the plugin does not break chaining)
$('.mySelector').classData('extradata','yes').css('backgroundColor','lime');
// Get data - alerts the extradata value of the elements that match the selector
alert($('.mySelector').classData('extradata'));
</pre>
<p>Please note that the setting of data does not break jQuery&#8217;s chaining.</p>
<p>As you might have noticed the getter and setter functions are non-existent: there&#8217;s one function to handle both the mutation and accessing of the data (this differs from Jurriaan&#8217;s approach: he has two functions)</p>
<p>Now, you might have noticed that there&#8217;s no way to set the glue (which defaults to an underscore) used in the call itself. Therefor an extra function comes in handy: <code>classDataGlue()</code>. Via that function you can set glue before getting and/or setting data.</p>
<pre class="brush: jscript; title: ; notranslate">// Set data with custom glue - this will set the class 'extradata-yes' on the elements that match the selector (note that the plugin does not break chaining)
$('.mySelector').classDataGlue('-').classData('extradata','yes').css('backgroundColor','lime');
// Alert current glue (note that we need to have a jQuery object for this)
alert($('').classDataGlue());
// Get data (note that the glue is still known to the plugin) - alerts the extradata value of the elements that match the selector
alert($('.mySelector').classData('extradata'));
// Get data that uses % as glue:
alert($('.mySelector').classDataGlue('%').classData('otherdata'));
</pre>
<p>Again note that the setting of the <code>classDataGlue</code> does not break jQuery&#8217;s chaining. Also note that when you set the glue, the calls that happen after it will still use that glue (<em>viz: once the glue is set, it keeps using that glue. Make an extra call to <code>classDataGlue()</code> to set it to an other value</em>).</p>
</div>
<h2 id="donate" style="margin-top: 25px;">Thanks a bunch, how can I thank you?</h2>
<div class="BramusBlock">
<p>You may always leave a comment below and/or &#8211; <em>it certainly is no obligation but it would most certainly put a smile on my face</em> &#8211; make a donation.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" style="border: 0;" name="submit" alt="Make a donation" /><img alt="" style="border: 0;" src="https://www.paypal.com/nl_NL/i/scr/pixel.gif" width="1" height="1" /><br />
<input type="hidden" name="cmd" value="_xclick" style="display: none;" />
<input type="hidden" name="business" value="paypal@bram.us" style="display: none;" />
<input type="hidden" name="item_name" value="Bram Van Damme (Bram.us)" style="display: none;" />
<input type="hidden" name="no_shipping" value="0" style="display: none;" />
<input type="hidden" name="no_note" value="1" style="display: none;" />
<input type="hidden" name="currency_code" value="EUR" style="display: none;" />
<input type="hidden" name="tax" value="0" style="display: none;" />
<input type="hidden" name="lc" value="BE" style="display: none;" />
<input type="hidden" name="bn" value="PP-DonationsBF" style="display: none;" /></form>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2009/02/09/accessing-data-saved-in-the-class-property-of-dom-elements-with-jquery/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Learning Ext JS</title>
		<link>http://www.bram.us/2009/01/21/learning-ext-js/</link>
		<comments>http://www.bram.us/2009/01/21/learning-ext-js/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 16:38:28 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[ext js]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=1888</guid>
		<description><![CDATA[A week ago I was contacted by Packt Publishing to review their new book Learning Ext JS. Having worked with Ext JS a few times (Mainly whilst helping develop Fork CMS), I&#8217;ve only scraped the surface of the possibilities so &#8230; <a href="http://www.bram.us/2009/01/21/learning-ext-js/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bram.us/wordpress/wp-content/uploads/2009/01/learningextjs.gif" alt="" title="Learning Ext JS" width="80" height="80" style="float: left; display: block; width: 80px; height: 80px; margin: 0 10px 10px 0;" /> A week ago I was contacted by <a href="http://www.packtpub.com/">Packt Publishing</a> to review their new book <a href="http://www.packtpub.com/learning-ext-js/book">Learning Ext JS</a>. Having worked with <a href="http://www.extjs.com/">Ext JS</a> a few times (<em>Mainly whilst helping develop <a href="http://www.fork-cms.be/">Fork CMS</a></em>), I&#8217;ve only scraped the surface of the possibilities so far and therefore am looking forward to receiving the book in my mailbox. In the mean time &#8211; <em>the book is expected to be delivered within three weeks</em> &#8211; both you and me can read the sample chapter, covering layouts: <em><a href="http://www.packtpub.com/files/learning-extjs-sample-chapter-7-layouts.pdf">7. In an AJAX World, You Need a Good Layout</a></em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2009/01/21/learning-ext-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PS_BRAMUS.TextConvert: PSD2TXT and TXT2PSD for the masses!</title>
		<link>http://www.bram.us/2008/10/30/ps_bramustextconvert-psd2txt-and-txt2psd-for-the-masses/</link>
		<comments>http://www.bram.us/2008/10/30/ps_bramustextconvert-psd2txt-and-txt2psd-for-the-masses/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 17:40:47 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[psd2txt]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[txt2psd]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=1821</guid>
		<description><![CDATA[What if you could extract all text strings from a PSD file into a TXT file? Sure, it&#8217;s possible, thanks to PS_BRAMUS.TextExport, the PSD2TXT script I wrote a few months ago. Now, what if you wanted to do that in &#8230; <a href="http://www.bram.us/2008/10/30/ps_bramustextconvert-psd2txt-and-txt2psd-for-the-masses/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img alt="JSX" title="JSX" id="image240b" style="margin: 0px 10px 5px 0px; display: block; float: left" src="http://www.bram.us/wordpress/wp-content/uploads/2006/08/jsxfile1.gif" />What if you could extract all text strings from a PSD file into a TXT file? Sure, it&#8217;s possible, thanks to <code><a href="http://www.bram.us/2008/03/16/ps_bramustextexport-13-automatically-export-all-text-layers-from-photoshop-psd-to-a-text-file/">PS_BRAMUS.TextExport</a></code>, the PSD2TXT script I wrote a few months ago. Now, what if you wanted to do that in the opposite direction and import strings from a TXT file into a PSD file (viz. TXT2PSD)? Look no further, <code>PS_BRAMUS.TextConvert</code> is here, and does both!<br style="clear: both;" /></p>
<p><span id="more-1821"></span></p>
<h2 style="margin-top: 25px;">What is <code>PS_BRAMUS.TextConvert</code></h2>
<div class="BramusBlock">
<p class="alert">Don&#8217;t like reading? Member of the lazyweb? Savvy enough? You might as well just <a href="#example">skip to the example</a> then <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><code>PS_BRAMUS.TextConvert</code> is the successor of <code>PS_BRAMUS.TextExport</code> and consists out of two scripts:</p>
<ol>
<li><code>PS_BRAMUS.TextConvert.Export</code> (PSD2TXT)</li>
<li><code>PS_BRAMUS.TextConvert.Import</code> (TXT2PSD)</li>
</ol>
<p>The first script is a modded version of <code>PS_BRAMUS.TextExport</code> which scans your PSD file for text strings. After retrieving all text, the output is saved into a TXT file in your Documents folder.</p>
<p>The second script is the counterpart: it reads in TXT files (which you first exported via the first script) and replaces all text layers with the new content in your PSD file.</p>
</div>
<h2 style="margin-top: 25px;">Is <code>PS_BRAMUS.TextConvert</code> something for me?</h2>
<div class="BramusBlock">
<p><code>PS_BRAMUS.TextConvert</code> is ideal for agencies/companies who need to translate Photoshop mockups: Export all text layers via <code>PS_BRAMUS.TextConvert.Export</code> to a text file, send that text file to the translation agency and let them do the translation, then import the translated file via <code>PS_BRAMUS.TextConvert.Import</code> into the PSD file.</p>
<p><img src="http://farm4.static.flickr.com/3253/2986296259_94f1b5934a_o.gif" alt="PS_BRAMUS.TextConvert" title="PS_BRAMUS.TextConvert"/></p>
<p>Of course its usage is not limited to the example above. The <code>Export</code> part of <code>PS_BRAMUS.TextConvert</code> can be used for (speed)slicing for example</p>
</div>
<h2 style="margin-top: 25px;">Requirements</h2>
<div class="BramusBlock">
<ul>
<li>Photoshop CS2 or newer is required</li>
<li><code>PS_BRAMUS.TextConvert</code> has been tested and verified working with Photoshop CS2 and CS3 (<em>CS4 untested but should work. Can anyone verify?</em>)</li>
</ul>
</div>
<h2 id="download" style="margin-top: 25px;">Download / License</h2>
<div class="BramusBlock">
<p><code>PS_BRAMUS.TextConvert</code> released under a <a href="http://creativecommons.org/licenses/by-sa/2.5/">creative commons Attribution-ShareAlike 2.5 license</a>. Should you use the script within a commercial context, or for any other reason you fancy, please consider <a href="#donate">clicking the PayPal donate button</a>.</p>
<p style="text-align: center;"><a href="http://www.bram.us/wordpress/wp-content/uploads/2008/10/ps_bramustextconvert-10.zip" class="button button-big"><strong>&#9660;</strong> Download PS_BRAMUS.TextConvert 1.0</a></p>
<p><small>Note: <code>PS_BRAMUS.TextConvert</code> was made possible by means of <a href="http://www.lexiapark.com/">lexia:park</a>, Barcelona, Spain.</small></p>
</div>
<h2 style="margin-top: 25px;">Installation</h2>
<div class="BramusBlock">
<ul>
<li>Download <code>PS_BRAMUS.TextConvert</code> from the link above</li>
<li>Extract it to the <em>Presets/Scripts</em> folder of your Photoshop installation folder (<em>defaults to <code>C:\Program Files\Adobe\Adobe Photoshop CS3\Presets\Scripts</code> on Windows</em>)</li>
<li>Restart Photoshop if it was already running (<strong>important!</strong>)</li>
</ul>
</div>
<h2 style="margin-top: 25px;">How to use <code>PS_BRAMUS.TextConvert</code></h2>
<div class="BramusBlock">
<p>Once installed, usage is simple:</p>
<h3>1. Exporting text (PSD2TXT)</h3>
<p><a href='http://farm4.static.flickr.com/3217/2987196938_c0e86a4351_o.jpg' title='PS_BRAMUS.TextConvert.Export' style='display: block; margin: 0 0 12px 12px; float: right;' rel='lightbox[textconvert1]'><img src='http://farm4.static.flickr.com/3217/2987196938_0e7de52fd2_m.jpg' alt='PS_BRAMUS.TextConvert.Export' style='display: block;  margin: 0 auto 0;' /></a></p>
<ul>
<li>In Photoshop go to <em>File</em> &gt; <em>Scripts</em> and select <code>PS_BRAMUS.TextConvert.Export-1.0</code> from the list to export all text.</li>
<li>Per open PSD file, a <em><code>TextConvert-[NAME_OF_YOUR_PSD_FILE].txt</code></em> file will appear in your Documents folder<br />(<em>if multiple files are open, you can choose to only run <code>PS_BRAMUS.TextConvert.Export</code> on the currently active file or on all files</em>)</li>
<li>After the export was done, you&#8217;ll get a little notification of this<br />(<em>if  <code>PS_BRAMUS.TextConvert.Export</code> ran with a single file, the .txt file will open instead)</em></li>
</ul>
<h3>2. Reworking text</h3>
<ul>
<li>Locate the exported .txt file in your Documents folder and open it with your favorite text editor</li>
<li>Translate the strings you find in there, but make sure that you leave the <code>[BEGIN /XXXX ]</code> and <code>[END /XXXX ]</code> lines untouched! (<em>If changed importing will fail</em>)</li>
<li>Save the text file with the same name in the same location.</li>
</ul>
<h3>3. Importing text (TXT2PSD)</h3>
<p><a href='http://farm4.static.flickr.com/3047/2986340185_4876c7eed5_o.jpg' title='PS_BRAMUS.TextConvert.Import' style='display: block; margin: 0 0 12px 12px; float: right;' rel='lightbox[textconvert1]'><img src='http://farm4.static.flickr.com/3047/2986340185_f83f4bcce9_m.jpg' alt='PS_BRAMUS.TextConvert.Import' style='display: block;  margin: 0 auto 0;' /></a></p>
<ul>
<li>In Photoshop go to <em>File</em> &gt; <em>Scripts</em> and select <code>PS_BRAMUS.TextConvert.Import-1.0</code> from the list to import all text.</li>
<li>Per open PSD file, the script will look if the <em><code>TextConvert-[NAME_OF_YOUR_PSD_FILE].txt</code></em> file exists in your Documents folder, read it in (if it exists) and update the text layers of your PSD file<br />(<em>if multiple files are open, you can choose to only run <code>PS_BRAMUS.TextConvert.Import</code> on the currently active file or on all files</em>)</li>
<li>After the import was done, you&#8217;ll get a little notification of the number of files updated<br /><em>(if no txt files were found, then it will state that 0 files where changed)</em></li>
</ul>
<h3>Warning!</h3>
<ul>
<li>Please note that <code>PS_BRAMUS.TextConvert.Import</code> is not compatible with any version <code>PS_BRAMUS.TextExport</code>!</li>
<li>Please note that in between the running of the Export and Import <strong>NO CHANGES TO THE PSD FILE</strong> can be done!</li>
</ul>
</div>
<h2 id="example" style="margin-top: 25px;">Example</h2>
<div class="BramusBlock">
<p>Given the fact that the image pictured on the left is a normal Photoshop file (<em>viz. background layer, image elements on different layers, text layers, layer groups, etc</em>) I&#8217;m quite sure the figure below explains it all:</p>
<p><a href="http://farm4.static.flickr.com/3293/2986442779_3990e5b069_o.jpg" title="PS_BRAMUS.TextConvert.Example" rel="lightbox[textconvert1]"><img src="http://farm4.static.flickr.com/3293/2986442779_f250edfd2a.jpg?v=1225387823" alt="PS_BRAMUS.TextConvert.Example" /></a></p>
<p>Now, did you <a href="#download">download</a> <code>PS_BRAMUS.TextConvert</code> already?</p>
</div>
<h2 id="donate" style="margin-top: 25px;">Make a donation</h2>
<div class="BramusBlock">
<p>It certainly is no obligation but it would most certainly put a smile on my face <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" style="border: 0;" name="submit" alt="Make a donation" /><img alt="" style="border: 0;" src="https://www.paypal.com/nl_NL/i/scr/pixel.gif" width="1" height="1" /><br />
<input type="hidden" name="cmd" value="_xclick" style="display: none;" />
<input type="hidden" name="business" value="paypal@bram.us" style="display: none;" />
<input type="hidden" name="item_name" value="Bram Van Damme (Bram.us)" style="display: none;" />
<input type="hidden" name="no_shipping" value="0" style="display: none;" />
<input type="hidden" name="no_note" value="1" style="display: none;" />
<input type="hidden" name="currency_code" value="EUR" style="display: none;" />
<input type="hidden" name="tax" value="0" style="display: none;" />
<input type="hidden" name="lc" value="BE" style="display: none;" />
<input type="hidden" name="bn" value="PP-DonationsBF" style="display: none;" /></form>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2008/10/30/ps_bramustextconvert-psd2txt-and-txt2psd-for-the-masses/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>jQuery.serializeAnything : Serialize anything (and not just forms!)</title>
		<link>http://www.bram.us/2008/10/27/jqueryserializeanything-serialize-anything-and-not-just-forms/</link>
		<comments>http://www.bram.us/2008/10/27/jqueryserializeanything-serialize-anything-and-not-just-forms/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 16:39:51 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[serialize]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=1703</guid>
		<description><![CDATA[Code snippet I found somewhere in my archive: jQuery.serializeAnything() is a jQuery Extension that serializes any element you specify, in contrast to jQuery&#8217;s builtin serialize() function which is limited to serializing form elements only. Usage is simple: place the contents &#8230; <a href="http://www.bram.us/2008/10/27/jqueryserializeanything-serialize-anything-and-not-just-forms/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="/wordpress/wp-content/uploads/2008/10/jquery.gif" style="display: block; float: left; margin: 0 10px 10px 0;" alt="" title="" />Code snippet I found somewhere in my archive: <code>jQuery.serializeAnything()</code> is a jQuery Extension that serializes any element you specify, in contrast to jQuery&#8217;s builtin <code><a href="http://docs.jquery.com/Ajax/serialize">serialize()</a></code> function which is limited to serializing <code>form</code> elements only.<br style="clear: both;" /></p>
<p><span id="more-1703"></span></p>
<pre class="brush: jscript; title: ; notranslate">/* @projectDescription jQuery Serialize Anything - Serialize anything (and not just forms!)
 * @author Bramus! (Bram Van Damme)
 * @version 1.0
 * @website: http://www.bram.us/
 * @license : BSD
*/
(function($) {
	$.fn.serializeAnything = function() {
		var toReturn	= [];
		var els 		= $(this).find(':input').get();
		$.each(els, function() {
			if (this.name &amp;&amp; !this.disabled &amp;&amp; (this.checked || /select|textarea/i.test(this.nodeName) || /text|hidden|password/i.test(this.type))) {
				var val = $(this).val();
				toReturn.push( encodeURIComponent(this.name) + &quot;=&quot; + encodeURIComponent( val ) );
			}
		});
		return toReturn.join(&quot;&amp;&quot;).replace(/%20/g, &quot;+&quot;);
	}
})(jQuery);</pre>
<p>Usage is simple: place the contents above in a .js file (<code>jquery.serializeanything.js</code> for example), refer to that file from your head element AFTER you referenced the <code>jquery.js</code> file, and use it just as you would call the <code>serialize()</code> function in your code: <code>$('#myElement').serializeAnything()</code>.</p>
<p>Hf!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2008/10/27/jqueryserializeanything-serialize-anything-and-not-just-forms/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>GM_BRAMUS.in.spire.us, v2 &#8211; Preview thumbnails for Delicious!</title>
		<link>http://www.bram.us/2008/10/15/gm_bramusinspireus-v2-preview-thumbnails-for-delicious/</link>
		<comments>http://www.bram.us/2008/10/15/gm_bramusinspireus-v2-preview-thumbnails-for-delicious/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 21:25:14 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[delicious]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[preview]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=1814</guid>
		<description><![CDATA[For all you GreaseMonkey lovers out there: GM_BRAMUS.in.spire.us got updated to work with the *new* Delicious! Head over to http://userscripts.org/scripts/show/8020 to install this new version]]></description>
			<content:encoded><![CDATA[<p><img id="image430" src="http://www.bram.us/wordpress/wp-content/uploads/2007/03/gm_bramus.gif" alt="GM_BRAMUS" title="GM_BRAMUS" style="margin: 0px 10px 5px 0px; display: block; float: left" />For all you <a href="http://www.greasespot.net/" title="GreaseMonkey">GreaseMonkey</a> lovers out there: <a href="http://www.bram.us/2007/03/20/gm_bramusinspireus/">GM_BRAMUS.in.spire.us</a> got updated to work with the *<a href="http://blog.delicious.com/blog/2008/07/oh-happy-day.html">new</a>* <a href="http://delicious.com/">Delicious</a>! Head over to <a href="http://userscripts.org/scripts/show/8020" title="GM_BRAMUS.in.spire.us">http://userscripts.org/scripts/show/8020</a> to install this new version <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2008/10/15/gm_bramusinspireus-v2-preview-thumbnails-for-delicious/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barcamp Ghent</title>
		<link>http://www.bram.us/2008/10/09/barcamp-ghent/</link>
		<comments>http://www.bram.us/2008/10/09/barcamp-ghent/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 12:12:36 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[barcamp]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=1813</guid>
		<description><![CDATA[On November 29 I&#8217;ll be one of the 100 attendees at Barcamp Ghent 2. As one might expect, I&#8217;ll be doing a javascript related presentation, however I&#8217;m not quite sure what you guys want to hear me talking about. Hereby &#8230; <a href="http://www.bram.us/2008/10/09/barcamp-ghent/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bram.us/wordpress/wp-content/uploads/2008/10/barcampghent.jpg" alt="" title="barcampghent" width="80" height="68" style="margin: 6px 10px 16px 0; float: left; display: block;" />On November 29 I&#8217;ll be one of the 100 attendees at <a href="http://en.wikipedia.org/wiki/BarCamp">Barcamp</a> <a href="http://barcampgent2.wikispaces.com/">Ghent 2</a>. As one might expect, I&#8217;ll be doing a javascript related presentation, however I&#8217;m not quite sure what you guys want to hear me talking about.<br style="clear: both;" /></p>
<p><span id="more-1813"></span></p>
<p>Hereby a small list of topics I <strong>could</strong> talk about (<em>titles are knocked up quickly, will most likely change</em>):</p>
<ul>
<li>TinyMCE hacks &#8216;n tweaks</li>
<li>Your first TinyMCE plugin</li>
<li>jQuery UI Widgets: Who, what, where and &#8211; most importantly &#8211; how (to write your own)?</li>
<li>From Prototype to jQuery (aka backdropping jQuery functionality into Prototype)<br />(<em>yes, in addition to <a href="http://www.bram.us/2008/08/11/backdropping-jquery-functions-into-prototypejs/">this article</a>, but then a bit more in depth and extensive</em>)</li>
<li>&#8230;</li>
</ul</p>
<p style="text-align: center;"><img src='http://farm3.static.flickr.com/2334/2372729440_ace035ece8.jpg?v=0' alt='' /><br /><em>Barcamp Ghent 1 (<a href="http://flickr.com/photos/bartclaeys/2372729440/">#</a>)</em></p>
<p>I myself prefer one of the last two; Which one(s) do you prefer? Or do you want me to talk about something else (&ldquo;<em>Planning your holiday, web 2.0 style</em>&rdquo; for example could be a subject to talk about)?</p>
<p>Ooh, it must be noted that the slides (not the talk) will be in English, as I&#8217;ll be posting them here too &#8230; so even if you&#8217;re not going or don&#8217;t understand Dutch, feel free to cast your vote <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Thanks,<br />B!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2008/10/09/barcamp-ghent/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Firebug 1.2 vs Firefox 2 : Fixing the &#039;console is not defined&#039; error</title>
		<link>http://www.bram.us/2008/08/29/firebug-12-vs-firefox-2-fixing-the-console-is-not-defined-error/</link>
		<comments>http://www.bram.us/2008/08/29/firebug-12-vs-firefox-2-fixing-the-console-is-not-defined-error/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 08:38:41 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Discovery Of The Day]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=1787</guid>
		<description><![CDATA[Getting some &#8216;console is not defined&#8216; errors in Firefox 2 with Firebug 1.2.0? Don&#8217;t worry, as it turns out that&#8217;s by design. The trick is to issue a window.loadFirebugConsole(); in your Javascript before using the console. Thanks for mentioning it &#8230; <a href="http://www.bram.us/2008/08/29/firebug-12-vs-firefox-2-fixing-the-console-is-not-defined-error/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bram.us/wordpress/wp-content/uploads/2008/08/firebug.jpg" alt="" title="firebug" width="80" height="80" class="alignnone size-full wp-image-1788" style="display: block; float: left; margin: 0 10px 10px 0;" />Getting some &#8216;<code>console is not defined</code>&#8216; errors in Firefox 2 with Firebug 1.2.0? Don&#8217;t worry, as it turns out that&#8217;s <em>by design</em>. The trick is to issue a <code>window.loadFirebugConsole();</code> in your Javascript before using the console. Thanks for mentioning it on the list, <a href="http://groups.google.com/group/firebug/browse_thread/thread/d7734e0142ce4b4c?hl=en">John</a>! <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br style="clear: both;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2008/08/29/firebug-12-vs-firefox-2-fixing-the-console-is-not-defined-error/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Backdropping jQuery functions into PrototypeJS</title>
		<link>http://www.bram.us/2008/08/11/backdropping-jquery-functions-into-prototypejs/</link>
		<comments>http://www.bram.us/2008/08/11/backdropping-jquery-functions-into-prototypejs/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 10:47:47 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Bramus!]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=1731</guid>
		<description><![CDATA[One of the functions I use quite regularly when working with jQuery is .attr(). Right now &#8211; at work &#8211; I&#8217;m fiddling around in Prototype, and noticed I kept on writing .attr() which &#8211; quite evidently &#8211; doesn&#8217;t exist. Okay, &#8230; <a href="http://www.bram.us/2008/08/11/backdropping-jquery-functions-into-prototypejs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bram.us/wordpress/wp-content/uploads/2008/08/img-168-96x96.png" alt="" title="Prototype" width="80" height="80" style="display: block; float: left; margin: 0 10px 10px 0;" /> One of the functions I use quite regularly when working with <a href="http://jquery.com/">jQuery</a> is <code><a href="http://docs.jquery.com/Attributes">.attr()</a></code>. Right now &#8211; at <a href="http://www.netlog.com/">work</a> &#8211; I&#8217;m fiddling around in <a href="http://www.prototypejs.org/">Prototype</a>, and noticed I kept on writing <code>.attr()</code> which &#8211; <em>quite evidently</em> &#8211; doesn&#8217;t exist. Okay, I can use Prototype&#8217;s <code><a href="http://www.prototypejs.org/api/element/readAttribute">.readAttribute()</a></code> and <a href="http://www.prototypejs.org/api/element/writeAttribute">.writeAttribute()</a> but that&#8217;s quite a hassle: I want one function to set and get attributes, just as jQuery offers. Time to extend Prototype with some jQuery functionality <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> <br style="clear: both;" /></p>
<p><span id="more-1731"></span></p>
<p>As provided by the Prototype API, use <code><a href="http://www.prototypejs.org/api/element/addMethods">Element.addMethods()</a></code> to extend <code><a href="http://www.prototypejs.org/api/element">Element</a></code>. Five minutes later, this implementation came out:</p>
<pre class="brush: jscript; title: ; notranslate">// Bramus jQuery backdrops
Element.addMethods({
  	// Get/Set attribute from/on element
  	attr: function(element, attrName, attrValue)
  	{
  		if (attrValue != undefined)
  			element.writeAttribute(attrName,attrValue);
  		else
  			return element.readAttribute(attrName);
  		return element;
  	}
});</pre>
<p class="alert">Updated: added <code>return element;</code> to enable chaining <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I know the implementation isn&#8217;t as extended as it is in Prototype and jQuery but it&#8217;s a good start of course <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>And ooh, if you&#8217;re looking to mimic jQuery&#8217;s chaining functionality in Prototype, use <code><a href="http://www.prototypejs.org/api/enumerable/invoke" name="chaining">.invoke()</a></code> <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre class="brush: jscript; title: ; notranslate">// jQuery - add classname and rel 'bramus' on all h3's inside the #myDiv div
$('div#myDiv').find('h3').addClass('bramus').attr('rel','bramus'); // I know, this can be written as $('div#myDiv h3'). ...
// Prototype - add classname and rel 'bramus' on all h3's inside the #myDiv div
$('myDiv').select('h3').invoke('addClassName', 'bramus').invoke('attr', 'rel', 'bramus'); // I know, this can be written as $$('div#myDiv h3'). ...
</pre>
<p>Happy coding!</p>
<p><em>Note: If you&#8217;re wondering why I&#8217;m sticking to Prototype and not moving to jQuery: the whole site has quite a few (not to say: a lot) Prototype based scripts that are interlinked. Switching isn&#8217;t possible right now <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2008/08/11/backdropping-jquery-functions-into-prototypejs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

