<?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>The One with the Thoughts of Frans &#187; Scripting</title>
	<atom:link href="http://fransdejonge.com/category/internet/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://fransdejonge.com</link>
	<description>Just a personal blog, sharing some thoughts and findings.</description>
	<lastBuildDate>Wed, 28 Jul 2010 12:34:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>SimplePie-based Feed Mashup</title>
		<link>http://fransdejonge.com/2010/02/14/simplepie-based-feed-mashup/</link>
		<comments>http://fransdejonge.com/2010/02/14/simplepie-based-feed-mashup/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 15:44:03 +0000</pubDate>
		<dc:creator>Frans</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://frans.lowter.us/?p=1583</guid>
		<description><![CDATA[I wrote a basic feed mashup tool in PHP. Get it here.]]></description>
			<content:encoded><![CDATA[<p class="update">This tool is now named <strong>Tubes</strong> and is <a href="http://bitbucket.org/frenzie/tubes/">hosted on Bitbucket</a>.</p>
<p>As I wrote a few months ago, <a href="http://frans.lowter.us/2009/12/04/fun-with-yahoo-pipes-and-podcasts/">Yahoo Pipes is a nice tool</a>. Nonetheless, it has a few shortcomings which annoyed me because I could neither fix nor work around them. Therefore, I decided to write my own mashup tool. For the impatient, you can <a href="http://frans.lowter.us/wp-content/uploads/2010/02/opera-feeds.zip">download the file right now</a> before reading anything else.</p>
<p>Since SimplePie seems to be the feed aggregation library of choice for many projects, I decided to go with it. I ran into a few minor issues, but nothing I couldn&#8217;t handle easily. The code I wrote is based on the multifeeds.php demo file and SimplePie 1.1.3, because in 1.2 it didn&#8217;t work (the multifeeds demo, that is — by extension I suppose this file won&#8217;t either). It&#8217;s a little rough around the edges, and SimplePie is clearly meant for HTML output rather than XML (although its HTML isn&#8217;t quite decent either, even if the input feed is), so I decided to fix the whole thing up with Tidy, which takes care of low quality input material as well. Hopefully that makes this whole thing more robust than it would otherwise be. The code is based around bringing various Opera feeds I read together in one big feed, but this can very easily be changed.</p>
<p>So now that I&#8217;ve got the basics of output into a feed taken care of, I can easily duplicate other functionality of Yahoo Pipes if I want. Much better.</p>
]]></content:encoded>
			<wfw:commentRss>http://fransdejonge.com/2010/02/14/simplepie-based-feed-mashup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unobtrusive Input Value Modifier</title>
		<link>http://fransdejonge.com/2010/01/17/unobtrusive-input-value-modifier/</link>
		<comments>http://fransdejonge.com/2010/01/17/unobtrusive-input-value-modifier/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 17:46:38 +0000</pubDate>
		<dc:creator>Frans</dc:creator>
				<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://frans.lowter.us/?p=1432</guid>
		<description><![CDATA[Inputs that say "search here" are generally messed up. Here's how to do it properly.]]></description>
			<content:encoded><![CDATA[<p>Inputs that say things like &#8220;search here&#8221; are generally messed up. In this post I will first explain why and then I will show you how to do it properly.</p>
<p>The WordPress theme I&#8217;m modifying for my wife had the following HTML in it:</p>
<pre><code>&lt;input type="text" value="Search this site" onfocus="if (this.value == 'Search this site') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this site...';}" name="s" id="searchbox" /></code></pre>
<p>There are three main problems with this.</p>
<ol>
<li>It prefills the search box with &#8220;Search this site.&#8221; This is incredibly annoying and obnoxious behavior for people with Javascript disabled. <em>If</em> you must add such text, add it through Javascript.</li>
<li>The values don&#8217;t even match up, so if you focus on the <code>INPUT</code>, deselect it and select it again the text stays there. Even for users with Javascript enabled. Errors of this type could easily be avoided if the text value were stored in a variable.</li>
<li>Which brings me to the third problem. The script should be external so it can be cached. That would save bandwidth for both you and your visitors and if there are people with Javascript disabled, they won&#8217;t even have to load the <del datetime="2010-01-17T17:23:45+00:00">junk</del><ins datetime="2010-01-17T17:23:45+00:00">script</ins> once.</li>
</ol>
<p>Because just about every such box I have ever encountered is complete and utter crap (this is actually one of the better ones), I decided to reproduce its functionality in an unobtrusive manner, eliminating all of the mistakes I outlined above.</p>
<p>The HTML is now reduced to this:</p>
<pre><code>&lt;input name="s" id="searchbox"/&gt;</code></pre>
<p>You could remove the trailing slash if you&#8217;re writing HTML, or put a space in between if that&#8217;s the way you write XHTML, but that&#8217;s of no consequence otherwise. The <code>type="text"</code> is not essential because it&#8217;s the default, but it shouldn&#8217;t hurt to leave it in. Also see Anne van Kesteren&#8217;s <a href="http://annevankesteren.nl/2010/01/optimizing-html">Optimizing Optimizing HTML</a> for some tips on going somewhat over the top with minimalism.</p>
<p>The Javascript that changes the text to &#8220;Search this site&#8230;&#8221; is now in an external file:</p>
<pre><code>(function() {
	function searchbox_text_change() {
		var s = document.getElementById('searchbox');
		var s_text = 'Search this site...'
		if (s.value == '') s.value = s_text;
		else if (s.value == s_text) s.value = '';
	}
	document.addEventListener('DOMContentLoaded',
	function(){
		var s = document.getElementById('searchbox');
		searchbox_text_change();
		s.addEventListener('focus', searchbox_text_change, false);
		s.addEventListener('blur', searchbox_text_change, false);
	},
	false);
})();</code></pre>
<p>All of this took me about five minutes. There&#8217;s a tiny bit of redundancy going on, but I can&#8217;t be bothered to fix that. It&#8217;s superior to just about any stupid such script I ever encountered and likely to most of the same type that I will encounter in the future. Use this script as much as you please. You don&#8217;t even have to link back to me, since I just want those bloody things to work in a way that doesn&#8217;t make me cringe.</p>
<p>The same kind of principle applies to autofocus junk. Never ever do any such thing if I started typing something. I&#8217;d rather you never did it at all, but if you really feel that you <em>must</em> do it for some masochistic reason, at the very least check if the value is still empty with <code>if (s.value=='')</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fransdejonge.com/2010/01/17/unobtrusive-input-value-modifier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taking Sidenotes to 2010</title>
		<link>http://fransdejonge.com/2010/01/14/taking-sidenotes-to-2010/</link>
		<comments>http://fransdejonge.com/2010/01/14/taking-sidenotes-to-2010/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 16:06:33 +0000</pubDate>
		<dc:creator>Frans</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Site]]></category>

		<guid isPermaLink="false">http://frans.lowter.us/?p=1266</guid>
		<description><![CDATA[An overview of the improvements made to my sidenotes over the years.]]></description>
			<content:encoded><![CDATA[<p>Five years ago there were lots of posts dealing with people&#8217;s visions of the least-bad method to include sidenotes — or footnotes — to HTML, and like any self-respecting HTML-geek I created <a href='http://frans.lowter.us/wp-content/uploads/2010/01/sidenotes.html'>my own take on the matter</a>. As might be expected from five year old writings it is now outdated, and I&#8217;m glad it is. It means the cruft can be retired, and media queries can be used to their full glory — except in IE8, that is.</p>
<p>The script I wrote to supply non-Opera browsers with faux-media-query functionality assumes that any browser not Opera should have the script applied to it, because at the time Opera 7+ was the only browser that supported media queries. I knew this wasn&#8217;t exactly the proper way to write scripts, but it was meant to be updated to use some more intelligent detection at some point. As such things go, however, it never was. In my defense, the worst the script did was duplicate some functionality that was already provided by media queries, so I rather doubt anybody noticed any adverse effects. Heck, they might have noticed positive effects, since as I wrote at the time, &#8220;For now, it might even be the best solution to apply the Javascript to Opera as well, because Opera does not reapply media queries on resize yet (and it does fire the <code>onresize</code> event as every browser does).&#8221; For good measure I&#8217;m also including <a href='http://frans.lowter.us/wp-content/uploads/2010/01/sidenotes-2006.js'>the script as I used it on my website since 2006</a>. It has this nifty little added feature that it doesn&#8217;t actually do anything if there are no sidenotes present, which is something media queries cannot do. I think I considered writing a more intelligent check based on style features that would be set by the media query back in early &#8217;06, but I can&#8217;t recall why I never did. For those interested in hacking the old script, the way I set it up it should be possible to determine whether media queries are supported very easily by combining a test for at least medium width with the <code>marginRight</code> style property on the sidenotes. If set, media queries are working; if not, go ahead and do some scripting magic.</p>
<p>Now, on to the updated sidenotes. I abandoned absolute positioning in favor of going completely for float. I believe I wanted to do this originally, but there were too many float bugs in all kinds of browsers to make it viable (that means everything not Presto or KHTML). Since these appear to be fixed, there is no reason not to take full advantage of floats, which most important means using <code>clear</code> so that sidenotes will not overlap. <small class="sidenote">Previously I had to seriously consider the placement and frequency of sidenotes.</small> <small class="sidenote">Now I can just add them whenever I want.</small> I still think my original reasoning is quite valid, however, which means I don&#8217;t think sidenotes should be inserted lightly or contain overly long texts.</p>
<blockquote><p>Let&#8217;s start out. How do we markup a sidenote? Well, as HTML contains no way whatsoever to markup a foot- or sidenote, the logical choice is <code>small</code>. Why <code>small</code>? Well, it means that the content of <code>small</code> is less important. A footnote should not be a footnote at all if it&#8217;s as important, or more important than the text itself, right? Thus, the markup of the sidenote is as follows:</p>
<pre><code>&lt;small class=&quot;sidenote&quot;&gt;A sidenote&lt;/small&gt;</code></pre>
</blockquote>
<p>This is still what I use, but <code>ASIDE</code> would be more appropriate in HTML 5.</p>
<blockquote><p>The sidenote as I created it is meant to be put at the end of a sentence, inside a paragraph. Therefore it would be displayed at its original position in the text if author CSS was disabled, or read at its intended location on screenreaders. If it wouldn&#8217;t be put as a separate sentence, it would look strange if not displayed the intended way. The sidenote is placed inside the paragraph with the other text, for if it would require multiple paragraphs, should it be a sidenote?</p>
</blockquote>
<div class="sidenote">
<h3>Were Sidenotes Always Compatible With Any Element?</h3>
<p>You could always apply the <code>sidenote</code> class to any element, such as <code>P</code> or <code>DIV</code>.</p>
</div>
<p>There is one issue I didn&#8217;t take into account five years ago. For example, including two paragraphs or so of background information on a country or city in a sidenote would be an appropriate use of sidenotes since it&#8217;s not really a part of the text. My original stance (although not explicitly written) was that this should be solved with hyperlinks, but I have somewhat revised this stance. The markup would then become something like:</p>
<pre><code>&lt;div class="sidenote"&gt;
	&lt;h3&gt;Were Sidenotes Always Compatible With Any Element?&lt;/h3&gt;
	&lt;p&gt;You could always apply the &lt;code&gt;sidenote&lt;/code&gt; class to any element, such as &lt;code&gt;P&lt;/code&gt; or &lt;code&gt;DIV&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;</code></pre>
<p>Or in HTML 5:</p>
<pre><code>&lt;aside&gt;
	&lt;h3&gt;Were Sidenotes Always Compatible With Any Element?&lt;/h3&gt;
	&lt;p&gt;You could always apply the &lt;code&gt;sidenote&lt;/code&gt; class to any element, such as &lt;code&gt;P&lt;/code&gt; or &lt;code&gt;DIV&lt;/code&gt;.&lt;/p&gt;
&lt;/aside&gt;</code></pre>
<p>The main sidenote CSS is still very similar to what it was in 2005.</p>
<pre><code>.sidenote {
	background: #efd;
	display: block;
	float: right;
	clear: right;
	width: 200px;
	border: 1px solid #eee;
	border-right: 0;
	margin: 2px;
	margin-right: -20px;
	padding: 3px;
	text-indent: 0;
	cursor: help;
}
.sidenote:before { content: '\2190' ' '; }
.sidenote:hover {
	background: #ff0;
}
/* enable usage of code in sidenotes without the layout breaking  */
.sidenote code {
	white-space: normal;
}</code></pre>
<p>There are a few minor differences, but other than the addition of the <code>.sidenote code</code> line nothing worth mentioning. Only a few weeks ago I noticed that adding a line of code to a sidenote somewhat broke my layout because it stretched beyond the viewport. A few more global ways to accomplish normal white space in sidenotes come to mind (such as <code>!important</code> in the main class or <code>.sidenote *</code>), but from what I understand using such methods increases parsing time, if only ever so slightly.</p>
<p>The media queries performing the sidenote magic were significantly slimmed down, and a low-resolution in-line display was added:</p>
<pre><code>@media all and (max-width: 350px) {
	.sidenote {
		display: inline;
		float: none;
		border: 0;
		margin: 0;
	}
	.sidenote:before {content:"";}
}
@media all and (min-width: 750px) {
	#wrapper{margin-right:207px}
	.sidenote {
		border-right:1px;
		margin: 0;
		margin-right:-228px;
	}
}
@media all and (min-width: 980px) {
	#wrapper{margin-right:auto}
}</code></pre>
<p><small class="sidenote"><code>#wrapper</code> is just in there to keep IE from embarrassing itself; if I were creating my blog&#8217;s design today I&#8217;d just go with <code>body</code>.</small> Switching completely to float makes it possible to keep the overrides to a minimum, but that&#8217;s not the important change here. I switched to simple media queries for two reasons.</p>
<ol>
<li>It&#8217;s much easier to maintain and change. No more duplication.</li>
<li>I don&#8217;t think most <a href="http://www.w3.org/TR/CSS21/media.html#media-types">media types</a> are as relevant anymore as I did back then. Specifically, in regard to such things as handheld devices what I want to do is offer different layouts based on screen size, not on whether they consider themselves to be <code>handheld</code>, <code>screen</code>, or some other fancy media type. Safari on the iPhone considers itself a big browser, for instance, but should it really get the &#8220;big&#8221; layout? None of this is especially relevant for my sidenotes, but it does reflect my opinion on it. Additionally, specifically overriding for certain media types rather than being specifically inclusive makes sure that no one is left out. In other words, this is future-safe. If the media type <code>magazine</code> ever emerges (they already did a magazine with an eInk cover, didn&#8217;t they?), my media query is ready for it now. And for those who care about such things, it also avoids an IE bug or two.</li>
</ol>
<p>That&#8217;s it. My sidenotes are ready for the nearby future. They&#8217;re <em>so</em> 2010. Feel free to use or expand on my ideas, but please add a link back to me somewhere if you do.</p>
]]></content:encoded>
			<wfw:commentRss>http://fransdejonge.com/2010/01/14/taking-sidenotes-to-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Show or Hide Deleted Text Button</title>
		<link>http://fransdejonge.com/2009/12/14/add-show-or-hide-deleted-text-button/</link>
		<comments>http://fransdejonge.com/2009/12/14/add-show-or-hide-deleted-text-button/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 12:12:41 +0000</pubDate>
		<dc:creator>Frans</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Site]]></category>

		<guid isPermaLink="false">http://frans.lowter.us/?p=835</guid>
		<description><![CDATA[A little tutorial based on a simple script I wrote to enhance my weblog.]]></description>
			<content:encoded><![CDATA[<p>For an upcoming post, I used the <code>DEL</code> element quite extensively. I figured that, while potentially interesting, it would help readability to be able to temporarily remove them from display, so I wrote this little script. Incidentally, it was the first time in about three years—meaning the first time since I finished the layout and scripts when I started this blog—that I added any new scripts, or even edited the file containing them. While I am probably far from the most suitable person for this job, I decided to write a little tutorial, explaining what I used and why I used it.</p>
<p>I&#8217;ll start by dropping a major bomb. Here is the script.</p>
<pre><code>// Checks if there is deleted text in post entries. Adds a Show or hide deleted text button if there is.
// Copyright © Frans de jonge 2009. Licensed under a Creative Commons Atrribution 2.0 license.
function AddShowHideDeletedTextButton() {
	var postEntries = document.getElementsByClassName('postentry');
	var postEntry = postEntries[0];
	if ( postEntries.length == 1 &#038;&#038; postEntry.getElementsByTagName('del').length > 0 ) {
		var hideText = 'Hide deleted text', showText = 'Show deleted text';
		var button = document.createElement('input');
		button.setAttribute('type', 'button');
		button.setAttribute('value', hideText);
		button.addEventListener('click',
		function () {
			var e = postEntry.getElementsByTagName('del');
			for ( var i = 0; i&lt;e.length; i++ ) {
				if (e[i].style.display == 'none') {
					e[i].style.display = 'inline';
					this.setAttribute('value', hideText);
				}
				else {
					e[i].style.display = 'none';
					this.setAttribute('value', showText);
				}
			}
		}
		,false);
		postEntry.insertBefore(button,postEntry.firstChild);
	}
}</code></pre>
<p>I&#8217;m going to assume that you have at least a basic understanding of functions and variables, but may not be completely aware of DOM methods and how to use them. A very valuable resource is the <a href="https://developer.mozilla.org/en/The_DOM_and_JavaScript">Mozilla Developer Center</a>, or MDC. It provides information on much more than just JavaScript and the DOM, but while I find the CSS and even HTML specifications fairly easy to get around in, the DOM specifications, with their language neutral, very extensive descriptions are quite hard in comparison. They are exactly the way they ought to be, but this makes it somewhat hard to find relevant information about actual usage and how to use it. That&#8217;s where the MDC comes in. It typically comes with a clear, concise summary at the top of the page, and if you don&#8217;t understand that, it usually comes with more extensive code samples as well.</p>
<pre><code>	var postEntries = document.getElementsByClassName('postentry');
	var postEntry = postEntries[0];
	if ( postEntries.length == 1 &#038;&#038; postEntry.getElementsByTagName('del').length > 0 ) {</code></pre>
<p>DOM methods used:</p>
<ul>
<li><a href="https://developer.mozilla.org/en/DOM/document.getElementsByClassName">document.getElementsByClassName(className)</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/element.getElementsByTagName">element.getElementsByTagName(tagName)</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/element.length">nodeList.length</a></li>
</ul>
<p>In my blog, I have marked up all of the contents of my posts with a <code>DIV</code> element, with, as you might have guessed, a class <code>postentry</code>. This particular bit of code is meant to make sure that we are on the individual page of the post (i.e. not in some kind of overview) and that there are actually deleted elements around. Adding a button on an overview page would result in all kinds of problems—if you add only one it may not be anywhere near where it is needed, so you&#8217;d have to add multiple buttons, check if the post where it will be added has deleted elements, etc.—which are easy to avoid by keeping it restricted to one post.</p>
<pre><code>		var button = document.createElement('input');
		button.setAttribute('type', 'button');
		button.setAttribute('value', hideText);</code></pre>
<p>DOM methods used:</p>
<ul>
<li><a href="https://developer.mozilla.org/en/DOM/document.createElement">document.createElement</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/element.setAttribute">element.setAttribute(attribute, value)</a></li>
</ul>
<p>Here we see the proper way to create an element through the DOM. First we create an element, in this case input, and then we set a few attributes to the values we want. Note that I defined <code>hideText</code> earlier, with the value <q>Hide deleted text</q>.</p>
<pre><code>		button.addEventListener('click',
		function () {
			var e = postEntry.getElementsByTagName('del');
			for ( var i = 0; i&lt;e.length; i++ ) {
				if (e[i].style.display == 'none') {
					e[i].style.display = 'inline';
					this.setAttribute('value', hideText);
				}
				else {
					e[i].style.display = 'none';
					this.setAttribute('value', showText);
				}
			}</code></pre>
<p>DOM methods used:</p>
<ul>
<li><a href="https://developer.mozilla.org/en/DOM/element.addEventListener">element.addEventListener</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/element.style">element.style</a></li>
</ul>
<p>Here we definitely have one of the more interesting parts of the code. Had I written this script about 8 years ago, I would have used something like <code>var button = '&lt;input type="button" value='+hideText+'>'</code> and consequently added an eventListener like <code>button.onclick = someFunction;</code>, where <code>someFunction</code> would be separately defined. I am using the proper DOM method instead. This may cause problems in IE, for which there are <a href="http://ejohn.org/blog/flexible-javascript-events">fixes available</a>, but since this blog is strictly personal I decided not to care about that. Notice how I did not define the function separately, but included it as an anonymous function. Since the function is not intended to be used anywhere else, it&#8217;s easier, and, ideally, it will be completely removed from memory if the button were to be removed.</p>
<p>The <code>element.style</code> property allows you to access and change style properties on an element. As the MDC says, <q>It is generally better to use the <code>style</code> property than to use <code>elt.setAttribute('style', '...')</code>, since use of the <code>style</code> property will not overwrite other CSS properties that may be specified in the <code>style</code> attribute.</q> I may not be defining any other styles on <code>DEL</code> elements yet, but this way the script won&#8217;t break my site if I do add some more style to it in the future, or if someone else wishes to adapt it for use on their own page.</p>
<pre><code>		postEntry.insertBefore(button,postEntry.firstChild);</code></pre>
<p>DOM methods used:</p>
<ul>
<li><a href="https://developer.mozilla.org/En/DOM/Node.insertBefore">parentElement.insertBefore(newElement, referenceElement)</a></li>
<li><a href="https://developer.mozilla.org/En/DOM/Node.firstChild">node.firstChild</a></li>
</ul>
<p>To finish it off, we&#8217;ve got the <code>insertBefore</code> construct. It inserts a node as a child of the node to which it is applied, before a specified other child of this parent node. When I first came across it a few years ago, I thought it was somewhat confusing at first. It should be noted that <em>node</em> means much more than <em>element</em>, but in these specific examples it shouldn&#8217;t matter, so I didn&#8217;t go into it. If you wish to learn more, I recommend you try the MDC or a search engine.</p>
<p>In conclusion, I hope this helped someone out there a bit. I thought it was interesting to reminisce about how I would have written this script if it were 2003.</p>
]]></content:encoded>
			<wfw:commentRss>http://fransdejonge.com/2009/12/14/add-show-or-hide-deleted-text-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extend Opera</title>
		<link>http://fransdejonge.com/2009/11/23/extend-opera/</link>
		<comments>http://fransdejonge.com/2009/11/23/extend-opera/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 17:38:58 +0000</pubDate>
		<dc:creator>Frans</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Sites]]></category>

		<guid isPermaLink="false">http://frans.lowter.us/?p=320</guid>
		<description><![CDATA[ExtendOpera.org was launched a few days ago. It&#8217;s a user initiative, aimed at bringing those aspects of Opera customization that Opera software has somewhat abandoned together.]]></description>
			<content:encoded><![CDATA[<p><a href="http://extendopera.org">ExtendOpera.org</a> was launched a few days ago. It&#8217;s a user initiative, aimed at bringing those aspects of Opera customization that Opera software has somewhat abandoned together.</p>
]]></content:encoded>
			<wfw:commentRss>http://fransdejonge.com/2009/11/23/extend-opera/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google in English</title>
		<link>http://fransdejonge.com/2009/10/18/google-in-english/</link>
		<comments>http://fransdejonge.com/2009/10/18/google-in-english/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 13:38:20 +0000</pubDate>
		<dc:creator>Frans</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Sites]]></category>

		<guid isPermaLink="false">http://frans.lowter.us/?p=277</guid>
		<description><![CDATA[Google apparently thinks that it knows what I want better than I do. I have clearly specified &#8220;en-US&#8221; as my preferred language, &#8220;en&#8221; if that&#8217;s not available, and &#8220;nl&#8221; if that&#8217;s not available. I tried removing the &#8220;nl&#8221; in an attempt to get Google to speak English to me, but it won&#8217;t comply. I finally [...]]]></description>
			<content:encoded><![CDATA[<p>Google apparently thinks that it knows what I want better than I do. I have clearly specified &#8220;en-US&#8221; as my preferred language, &#8220;en&#8221; if that&#8217;s not available, and &#8220;nl&#8221; if that&#8217;s not available. I tried removing the &#8220;nl&#8221; in an attempt to get Google to speak English to me, but it won&#8217;t comply. I finally got annoyed enough to write this little script to fix it. It would be easy to adjust for other preferred languages.</p>
<p><a href='http://frans.lowter.us/wp-content/uploads/2009/10/google-in-english.user.js'>Install Google in English user script</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fransdejonge.com/2009/10/18/google-in-english/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geeks, code can be sexy</title>
		<link>http://fransdejonge.com/2007/01/16/geeks-code-can-be-sexy/</link>
		<comments>http://fransdejonge.com/2007/01/16/geeks-code-can-be-sexy/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 01:20:19 +0000</pubDate>
		<dc:creator>Frans</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://frans.lowter.us/archives/2007/01/16/geeks-code-can-be-sexy/</guid>
		<description><![CDATA[I was reading entries on my old weblog from 2005 on the Wayback Machine, as I realised I hadn&#8217;t posted something on my current one in ages. So hereby. UDKM is Daniel. (&#124; !!UDKM &#124;&#8221; U Don&#8217;t Know Me &#8220;) says (2:02): Dude, words can&#8217;t express how much I love PHP designer 2007 Frenzie says [...]]]></description>
			<content:encoded><![CDATA[<p>I was reading entries on my old weblog from 2005 on the Wayback Machine, as I realised I hadn&#8217;t posted something on my current one in ages. So hereby. UDKM is Daniel.</p>
<blockquote><p><b>(| !!UDKM |&#8221; U Don&#8217;t Know Me &#8220;) says (2:02):</b><br />
Dude, words can&#8217;t express how much I love PHP designer 2007</p>
<p><b>Frenzie says (2:03):</b><br />
lol</p>
<p><b>(| !!UDKM |&#8221; U Don&#8217;t Know Me &#8220;) says (2:03):</b><br />
And my panties get&#8217;s wet of highlighted PHP code.</p>
<p><b>Frenzie says (2:04):</b><br />
lol!</p>
<p><b>(| !!UDKM |&#8221; U Don&#8217;t Know Me &#8220;) says (2:04):</b><br />
dude, highlighted PHP code is TEH SEX!</p>
<p><b>Frenzie says (2:05):</b><br />
I know man</p>
<p><b>(| !!UDKM |&#8221; U Don&#8217;t Know Me &#8220;) says (2:07):</b><br />
Highlited HTML is semi-sex.</p>
<p><b>Frenzie says (2:07):</b><br />
lol</p>
<p><b>Frenzie says (2:07):</b><br />
Highlighted CSS is a girl with a tight ass and nice titties.</p>
<p><b>(| !!UDKM |&#8221; U Don&#8217;t Know Me &#8220;) says (2:12):</b><br />
Oh yeah, it&#8217;s an ugly font thought. Atleast in PHP designer 2007</p>
<p><b>Frenzie says (2:13):</b><br />
lololol</p>
<p><b>(| !!UDKM |&#8221; U Don&#8217;t Know Me &#8220;) says (2:13):</b><br />
So it&#8217;s a nice ass with nice titties but a fucked face.</p>
<p><b>Frenzie says (2:13):</b><br />
Yeah, pretty much.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://fransdejonge.com/2007/01/16/geeks-code-can-be-sexy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Opera User JS and GreaseMonkey interoperability</title>
		<link>http://fransdejonge.com/2006/07/13/opera-user-js-and-greasemonkey-interoperability/</link>
		<comments>http://fransdejonge.com/2006/07/13/opera-user-js-and-greasemonkey-interoperability/#comments</comments>
		<pubDate>Thu, 13 Jul 2006 08:12:40 +0000</pubDate>
		<dc:creator>Frans</dc:creator>
				<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://frans.lowter.us/archives/2006/07/13/opera-user-js-and-greasemonkey-interoperability/</guid>
		<description><![CDATA[I&#8217;ve written a User JS with enhancements for AvidGamers. However, GreaseMonkey automatically wraps the entire script in an anonymous function. To create functions in your User JS, which are accessible in the page itself (by elements you inserted), you need to attach it to the window object. All of that would be great, but it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a User JS with <a href="http://www.avidgamers.com/board.php?type=pub&#038;area=18829&#038;id=65745606&#038;lastval=1152746153">enhancements</a> for <a href="http://www.avidgamers.com">AvidGamers</a>. However, GreaseMonkey automatically wraps the entire script in an anonymous function. To create functions in your User JS, which are accessible in the page itself (by elements you inserted), you need to attach it to the <a href="http://diveintogreasemonkey.org/helloworld/code.html">window</a> object.</p>
<p>All of that would be great, but it didn&#8217;t work. Digging through the GreaseMonkey website I eventually discovered that this had to do with some kind of security bug (the link to Mark Pilgrims guide as <em>the</em> way to learn about GreaseMonkey didn&#8217;t help much).</p>
<p>To make a long story short, I used the following to create Opera User JS and Greasemonkey interoperability.</p>
<pre><code>// for GreaseMonkey compatibility
if (typeof unsafeWindow != 'undefined') window = unsafeWindow;

// how to add variables
window['some_variable'] = 'Some text';

// how to add functions
window.some_function = function (var1, var2) {
	// do something
}</code></pre>
<p>To keep your code clean it&#8217;s a good idea to add in some extra variables for reference inside your code.</p>
<pre><code>var some_variable = window[some_variable];</code></pre>
<p>Regardless of security issues which removed direct access to the window object, it seems a tad weird to me to always wrap the code in an anonymous function. Should that not be up to me, the script author, to decide? Opera&#8217;s implementation appears to be just perfect&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://fransdejonge.com/2006/07/13/opera-user-js-and-greasemonkey-interoperability/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->