<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>tag:www.local-guru.net,2005:/blog/tag/javascript</id>
  <link type="text/html" href="http://www.local-guru.net" rel="alternate"/>
  <link type="application/atom+xml" href="http://www.local-guru.net/blog/tag/javascript.atom" rel="self"/>
  <title>GuruBlog : Articles about javascript</title>
  <subtitle>local-guru.net</subtitle>
  <updated>2011-07-08T07:30:35+02:00</updated>
  <generator>GuruBlog engine</generator>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/449</id>
    <published>2011-07-08T07:30:35+02:00</published>
    <updated>2011-07-08T07:30:35+02:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2011/7/8/lightbox-effekt-for-processing-sketches" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">Lightbox-Effekt for Processing-Sketches</title>
    <category term="processing" scheme="http://www.local-guru.net/blog/tag/processing"/>
    <category term="javascript" scheme="http://www.local-guru.net/blog/tag/javascript"/>
    <category term="jquery" scheme="http://www.local-guru.net/blog/tag/jquery"/>
    <content type="html">&lt;p&gt;In my &lt;a href="http://www.local-guru.net/blog/pages/processing-sketches"&gt;Processing Sketch gallery&lt;/a&gt; I wanted to run processing sketches inline using a lightbox effekt.
With the help of &lt;a href="http://jquery.org"&gt;jquery&lt;/a&gt; and some ajax-blackmagic I generated a script that loads the &lt;em&gt;index.html&lt;/em&gt; of the
processing export and runs the applet in a lightbox.&lt;/p&gt;

&lt;p&gt;If javascript is enabled the original index.html is opened.&lt;/p&gt;

&lt;p&gt;to integrate it in a page simply include jquery, the &lt;a href="http://www.local-guru.net/projects/p5lightbox/processing.js"&gt;processing.js&lt;/a&gt; script and &lt;a href="http://www.local-guru.net/projects/p5lightbox/processing.css"&gt;processing.css&lt;/a&gt; in
a html page. The script also need the deployJava.js from java.com that is also used in the &lt;em&gt;index.html&lt;/em&gt; files
of an processing applet-export.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;script type="text/javascript" src="http://www.java.com/js/deployJava.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="jquery.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="processing.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;link rel="stylesheet" type="text/css" href="processing.css"/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then simply link the processing sketch and mark the link with &lt;code&gt;class="processing"&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;a class="processing" href="http://yourserver/processing/sketchfolder/"&amp;gt;My processing sketch&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To see it running click on this
&lt;a class="processing" href="http://www.local-guru.net/processing/plopp/"&gt;Example Link&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/321</id>
    <published>2010-10-29T03:20:00+02:00</published>
    <updated>2010-10-29T03:20:00+02:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2010/10/29/table-column-highlighting-with-jquery" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">Table column highlighting with jquery</title>
    <category term="javascript" scheme="http://www.local-guru.net/blog/tag/javascript"/>
    <category term="jquery" scheme="http://www.local-guru.net/blog/tag/jquery"/>
    <content type="html">&lt;p&gt;in one of my recent projects i needed to highlight a table row and column of a
html table on mouseover.&lt;/p&gt;

&lt;p&gt;i found out that it's quite simple to do in jquery - even without a plugin.&lt;/p&gt;

&lt;p&gt;first you have to find out in which column your mouse pointer currently is.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var idx = $(this).parent().children('td,th').index( $(this))+1;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and then you mark all the td's and th's in the table with the same column index&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$('td:nth-child('+idx+')').addClass( 'hover' );
$('th:nth-child('+idx+')').addClass( 'hover' );
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://www.local-guru.net/projects/colhl.zip"&gt;click here&lt;/a&gt; to download a simple example project.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.local-guru.net/img/guru/table_sc.png" alt="column and row heighlighting" /&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/229</id>
    <published>2010-01-24T16:44:00+01:00</published>
    <updated>2010-01-24T16:44:00+01:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2010/1/24/calling-webservices-from-mootools-jquery-or-dojo" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">calling webservices from mootools, jquery or dojo</title>
    <category term="javascript" scheme="http://www.local-guru.net/blog/tag/javascript"/>
    <category term="webservice" scheme="http://www.local-guru.net/blog/tag/webservice"/>
    <category term="xml" scheme="http://www.local-guru.net/blog/tag/xml"/>
    <category term="mootools" scheme="http://www.local-guru.net/blog/tag/mootools"/>
    <category term="jquery" scheme="http://www.local-guru.net/blog/tag/jquery"/>
    <category term="dojo" scheme="http://www.local-guru.net/blog/tag/dojo"/>
    <content type="html">&lt;p&gt;I wrote a small webservie using java6 and jax-ws. Then i wrote clients for the webservice
using some some popular javascript frameworks. I used &lt;a href="http://mootools.net/"&gt;mootools&lt;/a&gt;,
&lt;a href="http://jquery.com/"&gt;jquery&lt;/a&gt; and &lt;a href="http://dojotoolkit.org/"&gt;dojo&lt;/a&gt; for writing the clients.&lt;/p&gt;

&lt;p&gt;I tried to use the same simple form for all the three clients to make them comparable. I also used no
libraries besides the core framework classes.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.local-guru.net/projects/webservice.zip"&gt;click here&lt;/a&gt; to download the sourcecode of the clients and the java-service&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/149</id>
    <published>2009-04-07T05:45:00+02:00</published>
    <updated>2009-04-07T05:45:00+02:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2009/4/7/processing-js-in-dashboard-widget" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">processing.js in dashboard widget</title>
    <category term="processing" scheme="http://www.local-guru.net/blog/tag/processing"/>
    <category term="javascript" scheme="http://www.local-guru.net/blog/tag/javascript"/>
    <category term="dashboard" scheme="http://www.local-guru.net/blog/tag/dashboard"/>
    <content type="html">&lt;p&gt;I managed to get &lt;a href="http://ejohn.org/blog/processingjs/"&gt;processing.js&lt;/a&gt; - a javascript based processing clone - to run in an apple dashboard
widget.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.local-guru.net/img/guru/processingjs-dashboard_sc.png" alt="processing.js widget" /&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/145</id>
    <published>2009-03-29T12:39:00+02:00</published>
    <updated>2009-03-29T12:39:00+02:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2009/3/29/javascript-caldav-frontend" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">JavaScript CalDAV-Frontend</title>
    <category term="javascript" scheme="http://www.local-guru.net/blog/tag/javascript"/>
    <category term="caldav" scheme="http://www.local-guru.net/blog/tag/caldav"/>
    <content type="html">&lt;p&gt;I just wrote a realy simple and small frontend for caldav calender (~700 lines of code including html) using the &lt;a href="http://mootools.net/"&gt;mootools framework&lt;/a&gt;
it supports multiple calendar and displays a read-only week-view.&lt;/p&gt;

&lt;p&gt;i'm using it with a &lt;a href="http://rscds.sourceforge.net/"&gt;DAViCal server&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;to install it, simply &lt;a href="http://www.local-guru.net/projects/jscalendar/calendar-0.1.tar.gz"&gt;download the package&lt;/a&gt;,  unpack it on your caldav server and enter the caldav urls of your calender in the config.js file.&lt;/p&gt;

&lt;p&gt;thats it&lt;/p&gt;

&lt;p&gt;have fun :-)&lt;/p&gt;

&lt;p&gt;UPDATE: the code is released under the &lt;a href="http://www.opensource.org/licenses/mit-license.php"&gt;MIT License&lt;/a&gt;, but it would be nice if you link to my blog if you include
it in your project :-)&lt;/p&gt;

&lt;p&gt;&amp;lt;typo:lightbox src="/img/guru/calendar_sc.png" thumbsrc="/img/guru/calendar_sc-small.png"/&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/82</id>
    <published>2008-10-20T19:47:00+02:00</published>
    <updated>2008-10-20T19:47:00+02:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2008/10/20/linedemo-in-processing-js" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">Linedemo in processing.js</title>
    <category term="processing" scheme="http://www.local-guru.net/blog/tag/processing"/>
    <category term="javascript" scheme="http://www.local-guru.net/blog/tag/javascript"/>
    <content type="html">&lt;p&gt;Todays usless processing-sketch is written in a processing dialect
&lt;a href="http://ejohn.org/blog/processingjs/"&gt;written in java-script&lt;/a&gt;.
The demo shows &lt;a href="http://www.local-guru.net/processing-js/linedemo.html"&gt;a rotating line&lt;/a&gt;
and uses the canvas element. So if you can't see anything try another browser.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.local-guru.net,2005:Article/12</id>
    <published>2007-11-03T15:43:00+01:00</published>
    <updated>2007-11-03T15:43:00+01:00</updated>
    <link type="text/html" href="http://www.local-guru.net//blog/2007/11/3/automatic-proxy-configuration-in-firefox" rel="alternate"/>
    <author>
      <name>Nikolaus Gradwohl</name>
    </author>
    <title type="html">automatic proxy configuration in firefox</title>
    <category term="javascript" scheme="http://www.local-guru.net/blog/tag/javascript"/>
    <category term="firefox" scheme="http://www.local-guru.net/blog/tag/firefox"/>
    <category term="proxy" scheme="http://www.local-guru.net/blog/tag/proxy"/>
    <content type="html">&lt;p&gt;In an erlier article i describe how to switch between the network environments i am
using, but there was one programm i could not convince to let me change the proxy
settings via apple script - firefox.&lt;/p&gt;

&lt;p&gt;i still needet to switch the firefox settings per hand - something i didnt like at all.&lt;/p&gt;

&lt;p&gt;one day the little "fetch proxy settings for url" dialog part from the
firefox proxysettigns made me courious and i found out, that firefox
expects a javascript file on this url, which tells firefox what proxy to use.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function FindProxyForURL(url, host) {
    if ( dnsResolve( host ) == "127.0.0.1" ) {
        return "DIRECT";
    } else {
        return "PROXY proxyhost:8080";
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;this script can use some predefined functions like "isInNet" or "dnsResolve" to
determine which network Im in and use the appropriate proxy. the file doesnt
even have to live on a http server, a file:// url is sufficient.&lt;/p&gt;

&lt;p&gt;e voila - no more manual proxy switching&lt;/p&gt;
</content>
  </entry>
</feed>

