<?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>Aurlog &#187; javascript</title>
	<atom:link href="http://www.aurochs.org/aurlog/tags/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aurochs.org/aurlog</link>
	<description>Cows and stuff</description>
	<lastBuildDate>Sun, 08 Jan 2012 22:41:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Cataloguing coding</title>
		<link>http://www.aurochs.org/aurlog/2012/01/08/cataloguing-coding/</link>
		<comments>http://www.aurochs.org/aurlog/2012/01/08/cataloguing-coding/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 16:50:00 +0000</pubDate>
		<dc:creator>Orangeaurochs</dc:creator>
				<category><![CDATA[cataloguing]]></category>
		<category><![CDATA[catcode]]></category>
		<category><![CDATA[codeyear]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.aurochs.org/aurlog/?p=708</guid>
		<description><![CDATA[<p>I am not a trained programmer, coding is not part of my job description, and I have little direct access to cataloguing and metadata databases at work outside of normal catalogue editing and talking to the systems team, but I thought it might be worth making the point of how useful programming can be in [...]]]></description>
			<content:encoded><![CDATA[<p>I am not a trained programmer, coding is not part of my job description, and I have little direct access to cataloguing and metadata databases at work outside of normal catalogue editing and talking to the systems team, but I thought it might be worth making the point of how useful programming can be in all sorts of little ways. Of course, the most useful way is in gaining an awareness of how computers work, appreciating why some things might be more tricky than others for the systems team to implement, seeing why MARC21 is a bastard to do anything with even if editing it in a cataloguing module is not really that bad, and how the new world of FRDABRDF is going to be glued together. However, some more practical examples that I managed to cobble together include:</p>
<ul>
<li><strong><a href="http://www.aurochs.org/aurlog/2011/06/24/customizing-classification-web-with-greasemonkey/">Customizing Classification Web with Greasemonkey</a></strong>. This is a couple of short scripts using Javascript, which is what the default <a href="http://www.codecademy.com/">Codeacademy</a> lessons use. Javascript is designed for browers and is a good one to start with as you can do something powerful very quickly with a short script or even a couple of lines (think of all the 90s image rollovers). It&#8217;s also easy to have a go if you don&#8217;t have your own server, or even if you&#8217;re confined to your own PC.</li>
<li><strong>Aleph-formatted country and language codes</strong>. I wrote a small PHP script to read the XML files for the MARC21 <a href="http://www.loc.gov/standards/codelists/languages.xml">language</a> and <a href="http://www.loc.gov/standards/codelists/countries.xml">country</a> codes and convert them into an up to date list of preferred codes in a format that Aleph can read, basically a text file which needs line breaks and spaces in the right places. It is easy to tweak or run again in the event of any minor changes. I don&#8217;t have this publicly available anywhere though. PHP is not the most elegant language but is relatively easy to dip into if you ever want to go beyond Javascript and do more fancy things, although it can be harder to get access to a server running PHP.</li>
<li><strong><a href="http://www.aurochs.org/mrc_viewer/mrc_viewer.php">MARC21 .mrc file viewer</a></strong>. I occasionally need to quickly look at raw .mrc files to assess their quality and to figure out what batch changes we want to make before importing them into our catalogue. This is an attempt to create something that I could copy and paste snippets of .mrc files into for a quick look. It is written in PHP and is still under construction. There are other better tools for doing much the same thing to be honest, but coding this myself has had the advantages of forcing me to see how a MARC21 file is put together and realising how fiddly it can be. Try this with an .mrc which has some large 520 or 505 fields in it (there are some zipped ones <a href="http://www.rsc.org/Publishing/eBooks/marc21records.asp">here</a>, to pick at random) and watch the indicators mysteriously degrade thereafter. I <em>will</em> get to the bottom of this&#8230;</li>
</ul>
<p>The following examples are less useful for my own practical purposes but have been invaluable for learning about metadata and cataloguing, in particular, RDF/linked data. I was very interested in LD when I first heard about it. Being able to actually try something out with it (even if the results are not mind-blowing) rather than just read about it, has been very useful. Both are written in PHP and further details are available from the links:</p>
<ul>
<li><strong><a href="http://www.aurochs.org/aurlog/2011/07/31/lodopac-simple-linked-open-data-opac/">Lodopac: Linked Open Data OPAC</a></strong>. My entry for the UK Discovery <a href="http://discovery.ac.uk/developers/competition/">Developer Competition</a>.</li>
<li><a title="Permanent Link to In Our Time booklist" rel="bookmark" href="../2011/02/16/in-our-time-booklist/"><strong>In Our Time booklist</strong>.</a> A forerunner to Lodopac, written in response to an idea raised by <a href="http://ideas.okfn.org/users/23/psychemedia/">psychemedia</a> for the <a href="http://openbiblio.net/challenge/">Open Bibliographic Data Challenge</a>: the <a href="http://ideas.okfn.org/ideas/27/bbc-in-our-time-reading-list">BBC “In Our Time” Reading List</a>. Sadly it no longer works as the BNB service it relies upon was taken down.</li>
</ul>
<p>Nothing to do with cataloguing, but what I am most proud of is this, written in Javascript: <a href="http://www.aurochs.org/games/cowthello/">Cowthello</a>. Let me know if you beat it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aurochs.org/aurlog/2012/01/08/cataloguing-coding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tom&#8217;s Excellent Website Snow (using Greasemonkey)</title>
		<link>http://www.aurochs.org/aurlog/2011/12/04/toms-excellent-website-snow-using-greasemonkey/</link>
		<comments>http://www.aurochs.org/aurlog/2011/12/04/toms-excellent-website-snow-using-greasemonkey/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 22:03:44 +0000</pubDate>
		<dc:creator>Orangeaurochs</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dhtml]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[snow]]></category>

		<guid isPermaLink="false">http://www.aurochs.org/aurlog/?p=702</guid>
		<description><![CDATA[<p>Behold: a version of Tom&#8217;s Excellent Javascript Snow (unobtrusive and customisable javascript snow for web pages using no images) that works on all websites you open on your browser (provided your browser is Firefox or something else that can run Greasemonkey scripts)!</p>
<p>To install it:</p>

Install Greasemonkey add-on for Firefox: https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
Make sure the monkey (probably at the [...]]]></description>
			<content:encoded><![CDATA[<p>Behold: a version of <a href="http://www.aurochs.org/aurlog/2008/12/12/toms-excellent-javascript-snow/">Tom&#8217;s Excellent Javascript Snow</a> (unobtrusive and customisable javascript snow for web pages using no images) that works on all websites you open on your browser (provided your browser is Firefox or something else that can run Greasemonkey scripts)!</p>
<p>To install it:</p>
<ol>
<li>Install Greasemonkey add-on for Firefox: <a href="https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/">https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/</a></li>
<li>Make sure the monkey (probably at the top-right) is happy and colourful. Click on it if not.</li>
<li>Install the <strong>tomsnow</strong> script by going to <a href="http://www.aurochs.org/zlib/js/userjs/tomsnow.user.js">http://www.aurochs.org/zlib/js/userjs/tomsnow.user.js</a> then</li>
<li>Click on the Install button.</li>
<li>Go and look at a new web page or reload one.</li>
</ol>
<p>If you want to turn Greasemonkey off altogether, click on the monkey so  he’s grey. If you want to stop individual scripts, click  on the monkey, click on <em>Manage User Scripts</em>, and click on <em>Disable</em> next to the script.</p>
<p>These instructions were tested on Firefox 3.6.24 on Linux although I imagine they  would be fine on any recent version of Firefox. I would be interested to  hear anything confirming or undermining that assertion.</p>
<p>If you’re happy to play around, the snow is very customisable: you can easily alter the amount, speed, and  style of snow, and so forth:</p>
<ol>
<li>Click on the monkey</li>
<li>Click on <em>Manage User Scripts</em></li>
<li>Select <em>tomsnow</em> from the list</li>
<li>Click on <em>Options</em></li>
<li>Click on <em>Edit this user script</em> (you will probably have to select a text editor at this point)</li>
<li>Look for the section under the line of asterisks where more instructions can be found on how to make customisations.</li>
<li>Save the file and reload any pages to see changes.</li>
</ol>
<p>The Greasemonkey version of the script uses slightly different default settings to the previous version, in particular using a lower density of flakes as a huge blizzard of snow is not likely to be welcome if used on all sites one browses.</p>
<p>I haven&#8217;t found any particular problems and it doesn&#8217;t seem to stop any sites working although sites that are already very script heavy are obviously less happy about running more, e.g. Twitter which is fine but can get sticky, although Gmail seems curiously OK. My cPanel was the only one which was really not happy. When you manage a Greasemonkey script, you will see a box where you can specify websites that you don&#8217;t want it to work on. For example, put <em>https://twitter.com/*</em> and it will stop tomsnow working on that URL with anything after it.</p>
<div style="position: absolute; top: 0px; height: 170.5px; z-index: 100;">
<p style="position: absolute; left: 289.589px; font-size: 112px; top: -112px; color: #ddeeee; font-family: times new roman; padding: 0px; border: 0px none; margin: 0px; opacity: 0.7;">*</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.aurochs.org/aurlog/2011/12/04/toms-excellent-website-snow-using-greasemonkey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing Classification Web with Greasemonkey</title>
		<link>http://www.aurochs.org/aurlog/2011/06/24/customizing-classification-web-with-greasemonkey/</link>
		<comments>http://www.aurochs.org/aurlog/2011/06/24/customizing-classification-web-with-greasemonkey/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 10:51:39 +0000</pubDate>
		<dc:creator>Orangeaurochs</dc:creator>
				<category><![CDATA[cataloguing]]></category>
		<category><![CDATA[classification web]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[libraries]]></category>

		<guid isPermaLink="false">http://www.aurochs.org/aurlog/?p=668</guid>
		<description><![CDATA[<p>Classification Web is ace, but there are a couple of things about the interface that annoy me and, in one colleague&#8217;s case, seriously put him off using it, in particular:</p>

The opening of a new tab/window when you click on the MARC view for a subject or name.
The confusing menu. We don&#8217;t use LCC or DDC, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://classificationweb.net/">Classification Web</a> is ace, but there are a couple of things about the interface that annoy me and, in one colleague&#8217;s case, seriously put him off using it, in particular:</p>
<ul>
<li>The opening of a new tab/window when you click on the MARC view for a subject or name.</li>
<li>The confusing menu. We don&#8217;t use LCC or DDC, and the browse options don&#8217;t really add much, so we only really need two options: <em>Search LC Subject Headings</em> and <em>Search LC Name Headings</em>.</li>
</ul>
<p>I managed to work out a simple way of modifying how Classification Web works on Firefox using the <a href="https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/">Greasemonkey</a> add-on and a couple of simple scripts, all of which is quick and easy to install:</p>
<ol>
<li>Install Greasemonkey: <a href="https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/">https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/</a></li>
<li>Make sure the monkey in the bottom-right corner is happy and colourful. Click on it if not.</li>
<li>If you want to prevent the MARC view opening a new window, install the <strong>classweb_no_new_ window</strong> script by going to <a href="http://www.aurochs.org/zlib/js/userjs/classweb_no_new_window.user.js">http://www.aurochs.org/zlib/js/userjs/classweb_no_new_window.user.js</a> then</li>
<li>Click on the Install button</li>
<li>If you want to reduce the main menu, install <strong>classweb_prune_menu</strong> script by going to <a href="http://www.aurochs.org/zlib/js/userjs/classweb_prune_menu.user.js">http://www.aurochs.org/zlib/js/userjs/classweb_prune_menu.user.js</a> then</li>
<li>Click on Install button</li>
<li>Reload/refresh Classweb if it&#8217;s still open and it should work.</li>
</ol>
<p>If you want to turn Greasemonkey off altogether, click on the monkey so he&#8217;s sad and grey. If you want to stop individual scripts, right click on the monkey, click on <em>Manage User Scripts</em>, select a script from the list, and un-tick the <em>Enabled</em> box in the lower left corner.</p>
<p>These instructions were tested on Firefox 3.5.3 although I imagine they would be fine on any recent version of Firefox. I would be interested to hear anything confirming or undermining that assertion.</p>
<p>If you&#8217;re happy to play around, these scripts can be further altered. In particular, you can choose which menu items appear in the pruned menu script:</p>
<ol>
<li>Right click on the monkey</li>
<li>Click on <em>Manage User Scripts</em></li>
<li>Select <em>classweb_prune_menu</em> from the list</li>
<li>Click on <em>Edit</em> (you will probably have to select a text editor at this point)</li>
<li>Edit the list of pages under the line <strong>var menu_items_to_keep = Array (</strong>. Enter each page you want to appear on the menu on a separate line in quotes, with a comma at the end of each line <strong>except</strong> the last line. The menu item must appear exactly as it does on the Classification Web menu, including capitals. E.g., the default set up looks like this:<br />
<blockquote>
<pre>var menu_items_to_keep = Array ( // end each line with a comma except the last line
  "Search LC Subject Headings",
  "Search LC Name Headings"
);</pre>
</blockquote>
</li>
<li>Save the file, and reload Classification Web.</li>
</ol>
<p>If anyone else finds this useful or can think of more customizations let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aurochs.org/aurlog/2011/06/24/customizing-classification-web-with-greasemonkey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tom&#8217;s Excellent Javascript Snow</title>
		<link>http://www.aurochs.org/aurlog/2008/12/12/toms-excellent-javascript-snow/</link>
		<comments>http://www.aurochs.org/aurlog/2008/12/12/toms-excellent-javascript-snow/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 00:40:00 +0000</pubDate>
		<dc:creator>Orangeaurochs</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dhtml]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[snow]]></category>

		<guid isPermaLink="false">http://www.aurochs.org/aurlog/internet/javascript/tomsnow.html</guid>
		<description><![CDATA[<p>Behold: Tom&#8217;s Excellent Javascript Snow: unobtrusive and customisable javascript snow for web pages using no images! If you&#8217;re looking at this directly, rather than through an RSS aggregator, you should see it falling now. Unless, that is, you&#8217;re watching this on Dave, in which case it will be some time past Christmas and I might [...]]]></description>
			<content:encoded><![CDATA[<p>Behold: Tom&#8217;s Excellent Javascript Snow: unobtrusive and customisable javascript snow for web pages using no images! If you&#8217;re looking at this directly, rather than through an RSS aggregator, you should see it falling now. Unless, that is, you&#8217;re watching this on Dave, in which case it will be some time past Christmas and I might have taken the snow away again. However, it always snowing at <a href="http://www.aurochs.org/tomsnow/">Tom&#8217;s Excellent Javascript Snow</a> page!</p>
<p>I&#8217;ve been meaning to write this since last year when my attempts were full of fail. The idea was to create simple unobstrusive javascript snow that could be added to any page and that didn&#8217;t require any images. I think Tom&#8217;s Excellent Javascript Snow fulfills these criteria and is therefore full of win. Furthermore, it is very customisable, so you can easily alter the amount, speed, and style of snow, and so forth. Incidentally, it uses the asterisk character (*) by default. There is in fact a Unicode <a href="http://www.fileformat.info/info/unicode/char/2745/index.htm">Tight Trifoliate Snowflake character</a>, but it is only available in a few fonts by the looks of it and I haven&#8217;t tried it. The script depends on the DOM and kind of uses CSS, but it is all defined through the Javascript: so many of the properties are different for individual snowflakes or change while the script is running, that it is not worth having a general style. It also means you only need one file to do everything.</p>
<p>To use it, copy <a href="http://www.aurochs.org/tomsnow/tomsnow_v1.js">tomsnow_v1.js</a> to a directory on your web-server, and add the following code to the head of any pages on which you would like snow:</p>
<blockquote>
<p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;http://www.yourdomain.com/path/tomsnow_v1.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
function init () {<br />
snow();<br />
}<br />
window.onload=init;<br />
&lt;/script&gt;</p></blockquote>
<p>I&#8217;m sure <a href="http://www.kryogenix.org/days/">Stuart</a> will tell me there&#8217;s a better way of doing it&#8230;</p>
<p>I know this works on Firefox 2 and Internet Explorer 6 on Windows as well as Firefox 3 on Linux.</p>
<p>In the unlikely event you do use this, do let me know for the sake of my own vanity. Any comments generally are welcome. I do have some ideas for version 2, maybe for next year, mostly around wind effects such as better horizontal drifting, prevailing winds, and gusts. Ideally, I would like to make the snow lay in some way, as in the snow at <a href="http://www.stpancras.com/">St Pancras</a> (you might have to wait for it to kick in), but that is quite unlikely given the trouble I had with page heights as it was.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aurochs.org/aurlog/2008/12/12/toms-excellent-javascript-snow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

