<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Xilinus  - English</title>
  <id>tag:blog.xilinus.com,2008:mephisto/english</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://blog.xilinus.com/feed/english/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.xilinus.com/english" rel="alternate" type="text/html"/>
  <updated>2008-05-29T09:13:45Z</updated>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2008-05-27:301</id>
    <published>2008-05-27T07:38:00Z</published>
    <updated>2008-05-29T09:13:45Z</updated>
    <category term="English"/>
    <link href="http://blog.xilinus.com/2008/5/27/funny-comic" rel="alternate" type="text/html"/>
    <title>Funny comic</title>
<content type="html">
            &lt;p&gt;I just saw this little comic on a blog, I really like it!
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;
&lt;img src=&quot;http://blog.xilinus.com/assets/2008/5/27/comic.jpg&quot; /&gt;
&lt;/p&gt;
&lt;br /&gt;
But this kids should learn ruby instead of C, it will be easier and shorter to write :). 
It could be something like this:
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt;  &lt;span class=&quot;Constant&quot;&gt;500&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;times&lt;/span&gt; { puts &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;I will not throw paper airplanes in class&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt; }
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2008-05-15:294</id>
    <published>2008-05-15T08:07:00Z</published>
    <updated>2008-05-15T08:07:13Z</updated>
    <category term="English"/>
    <link href="http://blog.xilinus.com/2008/5/15/first-railscamp-in-paris" rel="alternate" type="text/html"/>
    <title>First RailsCamp in Paris</title>
<content type="html">
            &lt;p&gt;I will be at the first &lt;a href=&quot;http://barcamp.org/RailsCampParis&quot;&gt;RailsCamps&lt;/a&gt; in Paris organized by Jean-François Tran and the &lt;a href=&quot;http://www.rubyfrance.org/&quot;&gt;French Ruby comunity&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;This is a great event to meet people working with rails and to learn some great stuffs around Ruby frameworks.&lt;/p&gt;


	&lt;p&gt;I will do a session about google maps and rails. I will try to create a application from scratch!&lt;/p&gt;


	&lt;p&gt;And may be a talk about Merb and DataMapper.&lt;/p&gt;


	&lt;p&gt;See you there :)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2008-05-15:292</id>
    <published>2008-05-15T08:06:00Z</published>
    <updated>2008-05-15T08:06:51Z</updated>
    <category term="English"/>
    <link href="http://blog.xilinus.com/2008/5/15/new-design" rel="alternate" type="text/html"/>
    <title>New Design </title>
<content type="html">
            &lt;p&gt;Xilinus is changing, design too :)&lt;/p&gt;


	&lt;p&gt;Xilinus is now a company in web application development based on Ruby frameworks (Ruby On Rails, Merb).&lt;/p&gt;


	&lt;p&gt;This explains the new design, xilinus.com will be updated soon too.&lt;/p&gt;


	&lt;p&gt;If you have a project of web application feel free to  &lt;a href=&quot;mailto:contact@xilinus.com&quot;&gt;contact us&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2008-02-22:281</id>
    <published>2008-02-22T14:53:00Z</published>
    <updated>2008-05-05T16:42:22Z</updated>
    <category term="English"/>
    <category term="Javascript"/>
    <category term="Prototype UI"/>
    <link href="http://blog.xilinus.com/2008/2/22/new-component-auto_complete-in-prototype-ui" rel="alternate" type="text/html"/>
    <title>New component (auto_complete) in prototype UI</title>
<content type="html">
            &lt;p&gt;I have added a new component in &lt;a href=&quot;http://www.prototype-ui.com&quot;&gt;Prototype UI&lt;/a&gt;  after having seeing this auto_complete from &lt;a href=&quot;http://www.interiders.com/2008/02/11/prototextboxlist-meets-autocompletion/&quot;&gt;InteRiders&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;First of all, I want to thanks those guys and also &lt;a href=&quot;http://devthought.com/textboxlist-meets-autocompletion/&quot;&gt;Guillermo Rauch&lt;/a&gt; for the first version based on mootools.&lt;/p&gt;


	&lt;p&gt;For a customer, I needed an component based on prototype butn with content set by Ajax request and with some other features. I decided to port this component in prototype UI.&lt;/p&gt;


The main advantage of  being part of Prototype UI is I can use some great functionnalities of this frame work without adding complicated code like:
	&lt;ul&gt;
	&lt;li&gt;Shadowing system for a better look and feel and better user experience. It does not look like a &#8220;flat&#8221; div under the input field&lt;/li&gt;
		&lt;li&gt;IFrameShim to avoid the bug of having select box over the completion&lt;/li&gt;
		&lt;li&gt;packr version&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The component is fully unobtrusive, all &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; code needed for displaying completion is built by the script.
As always, I try to make component skinnable. You can see below a &#8220;facebook&#8221; style as the original version and a more Apple like look and feel.&lt;/p&gt;


	&lt;p&gt;&lt;small&gt;Facebook style&lt;/small&gt;&lt;br /&gt;
&lt;img src=&quot;http://blog.xilinus.com/assets/2008/2/22/Picture_6.png&quot; /&gt;&lt;br /&gt;
&lt;small&gt;Apple style&lt;/small&gt;&lt;br /&gt;
&lt;img src=&quot;http://blog.xilinus.com/assets/2008/2/22/Picture_7.png&quot; /&gt;
&lt;br /&gt;&lt;/p&gt;


	&lt;p&gt;It&#8217;s only available in trunk version right now but it will be included in the next release candidate planned for March.&lt;/p&gt;


	&lt;p&gt;If you really want to use it :), you can &lt;a href=&quot;http://prototype-ui.com/auto_complete.zip&quot;&gt;dowload a zip file&lt;/a&gt; with functionnal tests included.&lt;/p&gt;


	&lt;p&gt;I will add some features like serialization or a way to hand automatically hidden fields for an easier submit process. I have also to work on unit tests and documentation before the release.&lt;/p&gt;


	&lt;p&gt;If you want to try it, check those two functional tests: &lt;a href=&quot;http://prototype-ui.com/current/test/functional/auto_complete/test_auto_complete.html&quot;&gt;non ajax&lt;/a&gt; and &lt;a href=&quot;http://prototype-ui.com/current/test/functional/auto_complete/test_auto_complete_ajax.html&quot;&gt;ajax fill&lt;/a&gt;  (be aware that it&#8217;s faking an ajax request, some browser do not like it :)).&lt;/p&gt;


	&lt;p&gt;PS: I will be away from my computer for a week, so I won&#8217;t reply to any comments before March.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2008-02-06:278</id>
    <published>2008-02-06T20:02:00Z</published>
    <updated>2008-05-05T16:43:01Z</updated>
    <category term="English"/>
    <category term="Javascript"/>
    <link href="http://blog.xilinus.com/2008/2/6/first-release-candidate-of-prototype-ui" rel="alternate" type="text/html"/>
    <title>First Release Candidate of Prototype UI</title>
<content type="html">
            &lt;p&gt;I am very proud to announce First Release Candidate of &lt;a href=&quot;http://www.prototype-ui.com&quot;&gt;Prototype UI&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;This release only includes Window and Carousel. In trunk version you will find also Context Menu and an experimental Dock.
Really soon, we will add Tooltips, Calendar (from Min), Accordion and more&lt;/p&gt;


	&lt;p&gt;So stay tuned :)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2008-01-30:276</id>
    <published>2008-01-30T16:28:00Z</published>
    <updated>2008-05-05T16:43:23Z</updated>
    <category term="English"/>
    <link href="http://blog.xilinus.com/2008/1/30/easy-error-display-on-rails-ajax-form" rel="alternate" type="text/html"/>
    <title>Easy error display on rails ajax form</title>
<content type="html">
            &lt;p&gt;I have never found a easy way to handle errors in rails with ajax form. Here is my implementation.&lt;/p&gt;


	&lt;p&gt;You have nothing to change in your view and in your controller, just few line of Javascript.&lt;/p&gt;


	&lt;p&gt;Here is how it works:&lt;/p&gt;


	&lt;h3&gt;The form&lt;/h3&gt;


Let&#8217;s imagine we have a contact form 3 required fields, name, email and message like this
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span class=&quot;Keyword&quot;&gt;-&lt;/span&gt; form_remote_for &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;contact&lt;/span&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;html&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;class&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;contact&lt;/span&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;id&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;contact_form&lt;/span&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;Variable&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;-%&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt;   &lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;label&lt;/span&gt; &lt;span class=&quot;MetaTagInline&quot;&gt;for&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;name&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Name *&lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt;   &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&amp;lt;%=&lt;/span&gt; f&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Entity&quot;&gt;text_field&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;class&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;text&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt;   &lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;br&lt;/span&gt;/&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   6 &lt;/span&gt;   
&lt;span class=&quot;line-numbers&quot;&gt;   7 &lt;/span&gt;   &lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;label&lt;/span&gt; &lt;span class=&quot;MetaTagInline&quot;&gt;for&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;email&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Email *&lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   8 &lt;/span&gt;   &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&amp;lt;%=&lt;/span&gt; f&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Entity&quot;&gt;text_field&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;email&lt;/span&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;class&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;text&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   9 &lt;/span&gt;   &lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;br&lt;/span&gt;/&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  10 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  11 &lt;/span&gt;   &lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;label&lt;/span&gt; &lt;span class=&quot;MetaTagInline&quot;&gt;for&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;message&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Message *&lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  12 &lt;/span&gt;   &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&amp;lt;%=&lt;/span&gt; f&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Entity&quot;&gt;text_area&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;message&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;class&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;text&lt;/span&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  13 &lt;/span&gt;   &lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;br&lt;/span&gt;/&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;   
&lt;span class=&quot;line-numbers&quot;&gt;  14 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  15 &lt;/span&gt;   &lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;label&lt;/span&gt; &lt;span class=&quot;MetaTagInline&quot;&gt;for&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;submit&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;&amp;amp;&lt;/span&gt;nbsp&lt;span class=&quot;Constant&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  16 &lt;/span&gt;   &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&amp;lt;%=&lt;/span&gt; submit_tag &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Submit&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  17 &lt;/span&gt;   &lt;span class=&quot;MetaTagInline&quot;&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagInline&quot;&gt;br&lt;/span&gt;/&lt;span class=&quot;MetaTagInline&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;        
&lt;span class=&quot;line-numbers&quot;&gt;  18 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&lt;span class=&quot;EmbeddedSourceBright&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span class=&quot;Keyword&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;-%&amp;gt;&lt;/span&gt;&lt;/span&gt;      
&lt;/pre&gt;

	&lt;p&gt;We use form_remote_for for ajax post and we set an id to the form for later use.
It should look like this&lt;/p&gt;


	&lt;p&gt;&lt;img src=&quot;http://blog.xilinus.com/assets/2008/1/30/Picture_11.png&quot;&gt;&lt;/p&gt;


	&lt;h3&gt;The model&lt;/h3&gt;


Contact model just have some validations
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;JEntityNameType&quot;&gt;Contact&lt;span class=&quot;EntityInheritedClass&quot;&gt; &lt;span class=&quot;EntityInheritedClass&quot;&gt;&amp;lt;&lt;/span&gt; ActiveRecord::Base&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt;   validates_presence_of &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;name&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;email&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;message&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;

	&lt;h3&gt;The controller&lt;/h3&gt;


The controller is a classic &lt;span class=&quot;caps&quot;&gt;REST&lt;/span&gt; action create. In this example I just handle Ajax post but you can add code for &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; or &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; request.
The only thing we need to do is to return an &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; response.
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt;   &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;create&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;contact&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Contact&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(params[&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;contact&lt;/span&gt;])
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt;     respond_to &lt;span class=&quot;Keyword&quot;&gt;do &lt;/span&gt;|&lt;span class=&quot;Variable&quot;&gt;format&lt;/span&gt;|
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt;       format.&lt;span class=&quot;Entity&quot;&gt;js&lt;/span&gt; {
&lt;span class=&quot;line-numbers&quot;&gt;   6 &lt;/span&gt;         &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;contact&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;save&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   7 &lt;/span&gt;           render &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;json&lt;/span&gt; =&amp;gt; {&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;object&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;contact&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;success&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;true&lt;/span&gt;}
&lt;span class=&quot;line-numbers&quot;&gt;   8 &lt;/span&gt;         &lt;span class=&quot;Keyword&quot;&gt;else&lt;/span&gt;    
&lt;span class=&quot;line-numbers&quot;&gt;   9 &lt;/span&gt;           render &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;json&lt;/span&gt; =&amp;gt; {&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;object&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;contact&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;success&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;false&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;errors&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;contact&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;errors&lt;/span&gt;}
&lt;span class=&quot;line-numbers&quot;&gt;  10 &lt;/span&gt;         &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;    
&lt;span class=&quot;line-numbers&quot;&gt;  11 &lt;/span&gt;       }
&lt;span class=&quot;line-numbers&quot;&gt;  12 &lt;/span&gt;     &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  13 &lt;/span&gt;   &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;

	&lt;h3&gt;Javascript&lt;/h3&gt;


	&lt;p&gt;So how our code will handle this &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; response. The view is a classic remote_form, the model just have validation and our controller returns a &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; string.
It&#8217;s pretty easy.&lt;/p&gt;


With Prototype, you can register function on Ajax callback, here comes the magic:
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; Ajax.Responders.register({
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt;   &lt;span class=&quot;Entity&quot;&gt;onComplete&lt;/span&gt;: &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;responder, request&lt;/span&gt;){  
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt;     &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt; response &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; (request.&lt;span class=&quot;SupportConstant&quot;&gt;responseText&lt;/span&gt;.evalJSON(&lt;span class=&quot;Constant&quot;&gt;true&lt;/span&gt;)); 
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt;     &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; (response.&lt;span class=&quot;SupportConstant&quot;&gt;object&lt;/span&gt;)  {
&lt;span class=&quot;line-numbers&quot;&gt;   6 &lt;/span&gt;       &lt;span class=&quot;Comment&quot;&gt;&lt;span class=&quot;Comment&quot;&gt;//&lt;/span&gt; Remove old erroes&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   7 &lt;/span&gt;       &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(response.&lt;span class=&quot;SupportConstant&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;_form&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).&lt;span class=&quot;SupportFunction&quot;&gt;select&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;.error&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).invoke(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;removeClassName&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;error&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;   8 &lt;/span&gt;       &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(response.&lt;span class=&quot;SupportConstant&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;_form&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).&lt;span class=&quot;SupportFunction&quot;&gt;select&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;.error_message&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).invoke(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;remove&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;   9 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  10 &lt;/span&gt;       &lt;span class=&quot;Comment&quot;&gt;&lt;span class=&quot;Comment&quot;&gt;//&lt;/span&gt; Success: clear all input with text&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  11 &lt;/span&gt;       &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; (response.success) {
&lt;span class=&quot;line-numbers&quot;&gt;  12 &lt;/span&gt;         &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt; form &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(response.&lt;span class=&quot;SupportConstant&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;_form&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  13 &lt;/span&gt;         form.&lt;span class=&quot;SupportFunction&quot;&gt;select&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;.text&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).each(&lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;(element) {element.&lt;span class=&quot;SupportConstant&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;});
&lt;span class=&quot;line-numbers&quot;&gt;  14 &lt;/span&gt;       }
&lt;span class=&quot;line-numbers&quot;&gt;  15 &lt;/span&gt;       &lt;span class=&quot;Comment&quot;&gt;&lt;span class=&quot;Comment&quot;&gt;//&lt;/span&gt; Else add error by creating a div with error message&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  16 &lt;/span&gt;       &lt;span class=&quot;Keyword&quot;&gt;else&lt;/span&gt; {
&lt;span class=&quot;line-numbers&quot;&gt;  17 &lt;/span&gt;         response.errors.each(&lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;(error) {     
&lt;span class=&quot;line-numbers&quot;&gt;  18 &lt;/span&gt;           &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt; element &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(response.&lt;span class=&quot;SupportConstant&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;_&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;+&lt;/span&gt; error[&lt;span class=&quot;Constant&quot;&gt;0&lt;/span&gt;]);
&lt;span class=&quot;line-numbers&quot;&gt;  19 &lt;/span&gt;           &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; (element) {
&lt;span class=&quot;line-numbers&quot;&gt;  20 &lt;/span&gt;             element.addClassName(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;error&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  21 &lt;/span&gt;             element.insert({after: &lt;span class=&quot;Keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;JEntityNameType&quot;&gt;Element&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;div&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, {className: &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;error_message&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}).update(error[&lt;span class=&quot;Constant&quot;&gt;1&lt;/span&gt;])});
&lt;span class=&quot;line-numbers&quot;&gt;  22 &lt;/span&gt;           }
&lt;span class=&quot;line-numbers&quot;&gt;  23 &lt;/span&gt;         })
&lt;span class=&quot;line-numbers&quot;&gt;  24 &lt;/span&gt;       }
&lt;span class=&quot;line-numbers&quot;&gt;  25 &lt;/span&gt;     }
&lt;span class=&quot;line-numbers&quot;&gt;  26 &lt;/span&gt;   }
&lt;span class=&quot;line-numbers&quot;&gt;  27 &lt;/span&gt; });       
&lt;/pre&gt;
The result will be like this:

	&lt;p&gt;&lt;img src=&quot;http://blog.xilinus.com/assets/2008/1/30/Picture_12.png&quot; /&gt;&lt;/p&gt;


	&lt;h3&gt;Explanation&lt;/h3&gt;


	&lt;p&gt;If fact everything is &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; data, it contains object name, and errors.&lt;/p&gt;


	&lt;p&gt;The JS just create divs after any field with error with error message and add an error class to the input. 
You just need to set some &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; attributes.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2007-11-04:247</id>
    <published>2007-11-04T15:28:00Z</published>
    <updated>2008-05-05T16:43:46Z</updated>
    <category term="English"/>
    <category term="Javascript"/>
    <category term="javascript"/>
    <category term="prototype 1.6"/>
    <link href="http://blog.xilinus.com/2007/11/4/prototype-ui-beta-version-pwc-reloaded" rel="alternate" type="text/html"/>
    <title>Prototype UI beta version (PWC reloaded)</title>
<content type="html">
            &lt;p&gt;I am very happy and proud to announce &lt;a href=&quot;http://www.prototype-ui.com&quot;&gt;prototype UI&lt;/a&gt; is officially open today.&lt;/p&gt;


	&lt;p&gt;At the beginning of the project, it was only a full rewrite of &lt;a href=&quot;http://prototype-window.xilinus.com/&quot;&gt;Prototype Window&lt;/a&gt; but it became quickly a UI library based on &lt;a href=&quot;http://prototypejs.org/&quot;&gt;Prototype 1.6&lt;/a&gt; and &lt;a href=&quot;http://script.aculo.us/&quot;&gt;script.aculo.us 1.8&lt;/a&gt; to include all my previous components like &lt;a href=&quot;http://prototype-carousel.xilinus.com/&quot;&gt;Prototype Carousel&lt;/a&gt; ....&lt;/p&gt;


	&lt;p&gt;This library is developed by &lt;a href=&quot;http://i.gotfresh.info/&quot;&gt;Samuel Lebeau&lt;/a&gt; and myself. Sam worked hard on the core classes and the object design. It&#8217;s also done with help of  &lt;a href=&quot;http://thinkweb2.com/projects/prototype/&quot; title=&quot;kangax&quot;&gt;Juriy Zaytsev&lt;/a&gt; and &lt;a href=&quot;http://www.webalys.com/&quot;&gt;Vincent Le Moign&lt;/a&gt; for the design.&lt;/p&gt;


	&lt;p&gt;And I want to thank &lt;a href=&quot;http://www.mila76.it/&quot;&gt;Emanuel &#8216;Mila76&#8217;&lt;/a&gt; for his help on IE (BIG &lt;span class=&quot;caps&quot;&gt;HELP&lt;/span&gt;) and for his div version of &lt;span class=&quot;caps&quot;&gt;PWC&lt;/span&gt; (the new window system is based on it).&lt;/p&gt;


	&lt;p&gt;This version is only for developer and early adopters. You can only download it with subversion. The final release will be done when prototype 1.6 will be stable and of course when prototype UI too :).&lt;/p&gt;


	&lt;p&gt;You will be able to download a JS per component, a JS file with the full library and a build page will allow you to create your own JS file with UI components you need.&lt;/p&gt;


	&lt;p&gt;This goal is to build to best free UI library (under &lt;span class=&quot;caps&quot;&gt;MIT&lt;/span&gt; licence) based on Prototype.&lt;/p&gt;


In the current version you have
	&lt;ul&gt;
	&lt;li&gt;window
	&lt;ul&gt;
	&lt;li&gt;skinnable&lt;/li&gt;
		&lt;li&gt;shadowing system independent from window and skinnable&lt;/li&gt;
		&lt;li&gt;div based&lt;/li&gt;
		&lt;li&gt;resizable from all borders and corners&lt;/li&gt;
		&lt;li&gt;custom buttons&lt;/li&gt;
		&lt;li&gt;Dialogs (like it&#8217;s done in &lt;span class=&quot;caps&quot;&gt;PWC&lt;/span&gt;) are not yet implemented but will be done soon&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;carousel: only &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; content (no Ajax content)&lt;/li&gt;
		&lt;li&gt;dock (experimental)&lt;/li&gt;
		&lt;li&gt;shadow: a simple class to add shadow on any element with a absolute position.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Stay tuned ;) and long life to prototype UI.&lt;/p&gt;


	&lt;p&gt;Here is a &lt;a href=&quot;http://blog.xilinus.com/prototype-ui/test/functional/window/test_expose.html&quot;&gt;sample test&lt;/a&gt; to see the new window system (from functional tests included in the distrib)&lt;/p&gt;


	&lt;p&gt;PS: Any feedback is really appreciated (bugs, documentation, patches, &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; &#8230;)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2007-10-03:208</id>
    <published>2007-10-03T20:07:00Z</published>
    <updated>2008-05-05T16:44:10Z</updated>
    <category term="English"/>
    <category term="Javascript"/>
    <category term="layout"/>
    <category term="prototype 1.6"/>
    <link href="http://blog.xilinus.com/2007/10/3/simple-layout-manager-with-prototype-1-6" rel="alternate" type="text/html"/>
    <title>Simple Layout Manager with Prototype 1.6</title>
<content type="html">
            &lt;p&gt;Aaron (Aaron @ ennerchi)  ask me to develop a simple layout manager for a web application. First of all, I want to thanks him for accepting to release this layout manager in open source under &lt;span class=&quot;caps&quot;&gt;MIT&lt;/span&gt;-license.&lt;/p&gt;


	&lt;p&gt;This class is inspired by  &lt;a href=&quot;http://www.ruzee.com/blog/ruzeelayoutmanager/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;RUZEE&lt;/span&gt;.LayoutManager&lt;/a&gt; but based on &lt;a href=&quot;http://prototypejs.org/2007/8/15/prototype-1-6-0-release-candidate&quot;&gt;prototype 1.6&lt;/a&gt;. &lt;span class=&quot;caps&quot;&gt;RUZEE&lt;/span&gt; version was to slow on complex layout.&lt;/p&gt;


	&lt;p&gt;It&#8217;s an unobtrusive script based on &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; classes. This picture shows what &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; class to use.&lt;/p&gt;


	&lt;p&gt;&lt;img src=&quot;http://blog.xilinus.com/assets/2007/9/30/layout2&quot; /&gt;&lt;br /&gt;&lt;/p&gt;


	&lt;p&gt;Inside a &lt;em&gt;lm_container&lt;/em&gt; you can add:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;lm_top&lt;/em&gt; / &lt;em&gt;lm_bottom&lt;/em&gt; for top/bottom rows with fixed height and resizable width, you can add as many rows as you want,&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;lm_left&lt;/em&gt; / &lt;em&gt;lm_right&lt;/em&gt; for left/right columns with fixed width and resizable height, you can add as many columns as you want,&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;lm_center&lt;/em&gt;, middle content with resizable width and height, you can have only one per container.&lt;/li&gt;
	&lt;/ul&gt;


Here is a sample &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; code to show how it works:
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_container&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;    
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_top&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_left&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   6 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_center&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;   7 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   8 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_right&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;   9 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  10 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_bottom&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  11 &lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;

And just included layoutmanager.js in your head section
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;type&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;text/javascript&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;src&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;prototype.js&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;type&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;text/javascript&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;src&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;layout_manager.js&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;

	&lt;p&gt;You can see it in this &lt;a href=&quot;http://blog.xilinus.com/layoutmanager/samples/simple.html&quot;&gt;simple example&lt;/a&gt;&lt;/p&gt;


Of course layout can be nested like this:
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_container&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;    
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_top&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_left&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   6 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_center&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   7 &lt;/span&gt;     &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_container&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;    
&lt;span class=&quot;line-numbers&quot;&gt;   8 &lt;/span&gt;       &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_top&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   9 &lt;/span&gt;       &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_left&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  10 &lt;/span&gt;       &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_center&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  11 &lt;/span&gt;       &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_right&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  12 &lt;/span&gt;       &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_bottom&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  13 &lt;/span&gt;     &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  14 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  15 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  16 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_right&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  17 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  18 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;lm_bottom&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  19 &lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;

	&lt;p&gt;You can see it in this &lt;a href=&quot;http://blog.xilinus.com/layoutmanager/samples/embed.html&quot;&gt;embedded example&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;If you work with ajax request and want to add dynamically content, you just need to call&lt;/p&gt;


&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; layoutManager.&lt;span class=&quot;SupportFunction&quot;&gt;add&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;your_element_id&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);
&lt;/pre&gt;

	&lt;p&gt;because you have a global variable: &lt;em&gt;layoutManager&lt;/em&gt;. This zip file contains a sample with an Ajax Request.&lt;/p&gt;


	&lt;p&gt;So &lt;a href=&quot;http://blog.xilinus.com/layoutmanager.zip&quot;&gt;download&lt;/a&gt; it and focus on your web application :)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2007-09-30:210</id>
    <published>2007-09-30T12:34:00Z</published>
    <updated>2008-05-05T16:44:36Z</updated>
    <category term="English"/>
    <category term="Ruby"/>
    <category term="pastie"/>
    <category term="pastis"/>
    <category term="ruby"/>
    <link href="http://blog.xilinus.com/2007/9/30/a-pastis-for-pastie" rel="alternate" type="text/html"/>
    <title>A pastis for pastie</title>
<content type="html">
            &lt;p&gt;If you use &lt;a href=&quot;http://pastie.caboo.se/&quot;&gt;pastie&lt;/a&gt;  service to share code (or may be you are already addicted to it), &lt;a href=&quot;http://i.gotfresh.info&quot;&gt;Samuel Lebeau&lt;/a&gt; has released a perfect ruby gems to pastie anything in one command line.&lt;/p&gt;


	&lt;p&gt;It&#8217;s called &lt;a href=&quot;http://pastis.rubyforge.org/&quot;&gt;pastis&lt;/a&gt; (if you are French you know what a Pastis:&#8221;http://en.wikipedia.org/wiki/Pastis&#8221; is :), it&#8217;s a great alcohol from south of France).&lt;/p&gt;


	&lt;p&gt;You can get details on his &lt;a href=&quot;http://i.gotfresh.info/2007/9/12/un-pastis-oui-un-pastiche-non&quot;&gt;blog&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;The best is you can add a command on TextMate to pastie selected text. When you workk remotely and you want to share code with co-workers it&#8217;s a great time saver.&lt;/p&gt;


	&lt;p&gt;Here is the command taken from his article:&lt;/p&gt;


&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; &lt;span class=&quot;Comment&quot;&gt;&lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt;!/usr/bin/env ruby&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;rubygems&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;pastis&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   6 &lt;/span&gt; input &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;ENV&lt;/span&gt;[&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;TM_SELECTED_TEXT&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;] &lt;span class=&quot;Keyword&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;File&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;read&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;ENV&lt;/span&gt;[&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;TM_FILEPATH&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;])
&lt;span class=&quot;line-numbers&quot;&gt;   7 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   8 &lt;/span&gt; languages &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; {
&lt;span class=&quot;line-numbers&quot;&gt;   9 &lt;/span&gt;   &lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;source&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\.&lt;/span&gt;ruby&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;ruby&lt;/span&gt;,
&lt;span class=&quot;line-numbers&quot;&gt;  10 &lt;/span&gt;   &lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;text&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\.&lt;/span&gt;html&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\.&lt;/span&gt;basic&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;html&lt;/span&gt;,
&lt;span class=&quot;line-numbers&quot;&gt;  11 &lt;/span&gt;   &lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;text&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\.&lt;/span&gt;html&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\.&lt;/span&gt;ruby&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;rhtml&lt;/span&gt;,
&lt;span class=&quot;line-numbers&quot;&gt;  12 &lt;/span&gt;   &lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;source&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\.&lt;/span&gt;js&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;javascript&lt;/span&gt;,
&lt;span class=&quot;line-numbers&quot;&gt;  13 &lt;/span&gt;   &lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;source&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;(&lt;/span&gt;c|c&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\+&lt;/span&gt;&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\+&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;c&lt;/span&gt;,
&lt;span class=&quot;line-numbers&quot;&gt;  14 &lt;/span&gt;   &lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;source&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\.&lt;/span&gt;sql&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;sql&lt;/span&gt;,
&lt;span class=&quot;line-numbers&quot;&gt;  15 &lt;/span&gt;   &lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;source&lt;span class=&quot;StringRegexpSpecial&quot;&gt;\.&lt;/span&gt;diff&lt;/span&gt;&lt;span class=&quot;StringRegexp&quot;&gt;&lt;span class=&quot;StringRegexp&quot;&gt;/&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;diff&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  16 &lt;/span&gt; }
&lt;span class=&quot;line-numbers&quot;&gt;  17 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  18 &lt;/span&gt; language &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; languages[languages.&lt;span class=&quot;Entity&quot;&gt;keys&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;find&lt;/span&gt; { |&lt;span class=&quot;Variable&quot;&gt;pattern&lt;/span&gt;| &lt;span class=&quot;Variable&quot;&gt;ENV&lt;/span&gt;[&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;TM_SCOPE&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;] &lt;span class=&quot;Keyword&quot;&gt;=~&lt;/span&gt; pattern }] &lt;span class=&quot;Keyword&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;plaintext&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  19 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  20 &lt;/span&gt; paste &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Pastis&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;paste&lt;/span&gt;(input, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;language&lt;/span&gt; =&amp;gt; language)
&lt;span class=&quot;line-numbers&quot;&gt;  21 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  22 &lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;`&lt;/span&gt;open &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;#{&lt;/span&gt;paste&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Entity&quot;&gt;url&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  23 &lt;/span&gt; 
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2007-09-04:141</id>
    <published>2007-09-04T20:38:00Z</published>
    <updated>2008-05-05T16:44:52Z</updated>
    <category term="English"/>
    <category term="Javascript"/>
    <link href="http://blog.xilinus.com/2007/9/4/prototype-portal-class-2" rel="alternate" type="text/html"/>
    <title>Prototype Portal Class #2</title>
<content type="html">
            &lt;p&gt;I have added a new option to prototype portal window class to be able to have multiple portals on the same page.
The new option is &lt;em&gt;accept&lt;/em&gt;, based on accept option of Droppable. So you can do something like this;&lt;/p&gt;


&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt;  portal &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;JEntityNameType&quot;&gt;Xilinus.Portal&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;#page2 div&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, { accept:&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;portal1&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;});
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt;  portal &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;JEntityNameType&quot;&gt;Xilinus.Portal&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;#page2 div&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, { accept:&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;portal2&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;});
&lt;/pre&gt;
for having to portal in the same window. With a new &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; file:
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;page1&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt;       &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;widget_col_0&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt;       &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;widget_col_1&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt;       &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;widget_col_2&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt;  &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;       
&lt;span class=&quot;line-numbers&quot;&gt;   6 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;page2&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   7 &lt;/span&gt;       &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;widget_col_3&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   8 &lt;/span&gt;       &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;widget_col_4&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   9 &lt;/span&gt;  &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;    
&lt;/pre&gt;

I have added a new &lt;a href=&quot;/prototype-portal/test/multi_portal.html&quot;&gt;sample file&lt;/a&gt;. you can give it a try.
I have updated &lt;a href=&quot;/prototype-portal/src/portal.js&quot;&gt;widget.js&lt;/a&gt; javascript file or check out code from svn:
&lt;code&gt;
svn co http://svn.itseb.com/public/prototype-portal/trunk prototype-portal
&lt;/code&gt;
&lt;br /&gt;&lt;br /&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2007-08-26:113</id>
    <published>2007-08-26T12:54:00Z</published>
    <updated>2008-05-05T16:45:16Z</updated>
    <category term="English"/>
    <category term="Javascript"/>
    <link href="http://blog.xilinus.com/2007/8/26/prototype-portal-class" rel="alternate" type="text/html"/>
    <title>Prototype Portal Class</title>
<content type="html">
            &lt;p&gt;I have always wanted to create a Class to handle in a easy way portal page like netvibes. After having tried to used Sortable of script.aculo.us, I decided to write my own Class. I really like Sortable Class but it was too tricky to use it for a portal behavior. But I use Draggable and Droppable of course!&lt;/p&gt;


	&lt;p&gt;This article talks about the first version I made. It has been tested on Safari, Firefox, Opera and &lt;span class=&quot;caps&quot;&gt;IE 6&lt;/span&gt;/7. The first version is based on Prototype 1.5.1.1 because I could not use 1.6. but the next version will be based on 1.6.&lt;/p&gt;


	&lt;p&gt;Here is how it works.&lt;/p&gt;


	&lt;p&gt;1) &lt;strong&gt;Create an &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; page&lt;/strong&gt; with as many columns you need. Columns width can be fixed or variable, and with different size.&lt;/p&gt;


Here is a &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; sample with 3 columns
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;widget_col_0&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;widget_col_1&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt;   &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;widget_col_2&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt; &lt;span class=&quot;MetaTagAll&quot;&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;MetaTagAll&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
And the &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; file 
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; #page &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;  margin: 10px auto;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt; #widget_col_0 &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;{ &lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   6 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;  float:left;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   7 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;  width: 30%;  &lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   8 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   9 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  10 &lt;/span&gt; #widget_col_1 &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  11 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;  width: 50%;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  12 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;  float:left;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  13 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;}&lt;/span&gt;   
&lt;span class=&quot;line-numbers&quot;&gt;  14 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  15 &lt;/span&gt; #widget_col_2 &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;{ &lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  16 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;  float:left;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  17 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;  width: 20%;  &lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  18 &lt;/span&gt; &lt;span class=&quot;EmbeddedSourceBright&quot;&gt;}&lt;/span&gt; 
&lt;/pre&gt;
Pretty easy!&lt;br /&gt;&lt;br /&gt;

2) You need to &lt;strong&gt;instanciate a Portal class&lt;/strong&gt; with those columns:
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt;  portal &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;JEntityNameType&quot;&gt;Xilinus.Portal&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;#page div&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)
&lt;/pre&gt;

3) &lt;strong&gt;Add widgets&lt;/strong&gt; to this portal. There is a Widget class, fully &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; skinnable (there is a default theme), just create a new Widget instance and add it to the portal by specifying the column index. For example:
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; portal.&lt;span class=&quot;SupportFunction&quot;&gt;add&lt;/span&gt;(&lt;span class=&quot;Keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;JEntityNameType&quot;&gt;Xilinus.Widget&lt;/span&gt;(), &lt;span class=&quot;Constant&quot;&gt;0&lt;/span&gt;)
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt; &lt;span class=&quot;Comment&quot;&gt;&lt;span class=&quot;Comment&quot;&gt;//&lt;/span&gt; Or with title and content&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt; portal.&lt;span class=&quot;SupportFunction&quot;&gt;add&lt;/span&gt;(&lt;span class=&quot;Keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;JEntityNameType&quot;&gt;Xilinus.Widget&lt;/span&gt;().setTitle(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Widget Title&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).setContent(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;bla bla bla&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;), &lt;span class=&quot;Constant&quot;&gt;1&lt;/span&gt;);
&lt;/pre&gt;

And that&#8217;s it!!
There are also some options when you create the portal:
	&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;url&lt;/em&gt;: Url called by Ajax.Request after a drop (default null, no requests)&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;onOverWidget&lt;/em&gt;: Called when the mouse goes over a widget (default null)&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;onOutWidget&lt;/em&gt;:  Called when the mouse goes out of a widget (default null)                                         &lt;/li&gt;
		&lt;li&gt;&lt;em&gt;onChange&lt;/em&gt;: Called a widget has been move during drag and drop (default null)&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;onUpdate&lt;/em&gt;:  Called a widget has been move after drag and drop (default null)&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;removeEffect&lt;/em&gt;: Remove effect (by default no effects), you can set it to Effect.SwitchOff for example&lt;/li&gt;
	&lt;/ul&gt;


And main functions are:
	&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;add(widget, columnIndex)&lt;/em&gt;: add a new widget .&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;remove(widget)&lt;/em&gt;: remove a new widget.&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;serialize()&lt;/em&gt;: returns a parameters string for Ajax.Request&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;You could a see a &lt;a href=&quot;/prototype-portal/test/index.html&quot;&gt;live example here&lt;/a&gt;. I have used onOverWidget/onOutWidget to add edit/delete buttons on widget and I added a remove effect to show how to use it with advanced features.&lt;/p&gt;


You can download the &lt;a href=&quot;/prototype-portal/src/portal.js&quot;&gt;widget.js&lt;/a&gt; javascript file or check out code from svn:
&lt;code&gt;
svn co http://svn.itseb.com/public/prototype-portal/trunk prototype-portal
&lt;/code&gt;

	&lt;p&gt;Next I will create a full website for this class with documentation and &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; details (it&#8217;s based on sliding doors technique), port it to prototype 1.6 with new Element class (I will remove builder.js) and the new class model. Prototype rocks!!&lt;/p&gt;


	&lt;p&gt;The 1.6 version will also include unit tests.&lt;/p&gt;


	&lt;p&gt;One more thing, it&#8217;s under &lt;span class=&quot;caps&quot;&gt;MIT&lt;/span&gt; license, as Prototype and script.aculo.us, so feel free to use it.&lt;/p&gt;


	&lt;p&gt;PS: Thanks to &lt;a href=&quot;http://seb.box.re&quot;&gt;Seb&lt;/a&gt; for testing and debugging!
&lt;br /&gt;
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2007-05-10:94</id>
    <published>2007-05-10T08:20:00Z</published>
    <updated>2008-05-05T16:45:39Z</updated>
    <category term="English"/>
    <category term="PGF"/>
    <link href="http://blog.xilinus.com/2007/5/10/news-of-pgf" rel="alternate" type="text/html"/>
    <title>News of PGF</title>
<content type="html">
            &lt;p&gt;It&#8217;s been a while without anything on this blog but not in &lt;span class=&quot;caps&quot;&gt;PGF&lt;/span&gt; trunk.&lt;/p&gt;


	&lt;p&gt;Now you have polylines and lines. (&lt;a href=&quot;http://prototype-graphic.xilinus.com/samples/shape.html&quot;&gt;sample&lt;/a&gt;)
As you can see on the sample you can change renderer on the page, if you use Firefox you can switch from &lt;span class=&quot;caps&quot;&gt;SVG&lt;/span&gt; to Canvas, same code, same look.&lt;/p&gt;


	&lt;p&gt;For fun and for showing how &lt;span class=&quot;caps&quot;&gt;PGF&lt;/span&gt; is simple, I have created a sample for mouse drawing, you can &lt;a href=&quot;http://prototype-graphic.xilinus.com/samples/drawing.html&quot;&gt;give it a try&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Here is the full code of the drawing tool:&lt;/p&gt;


&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; Graphic.DrawingTool &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; Class.create();
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Object&lt;/span&gt;.extend(Graphic.DrawingTool.&lt;span class=&quot;SupportConstant&quot;&gt;prototype&lt;/span&gt;, Graphic.Tool.&lt;span class=&quot;SupportConstant&quot;&gt;prototype&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Object&lt;/span&gt;.extend(Graphic.DrawingTool.&lt;span class=&quot;SupportConstant&quot;&gt;prototype&lt;/span&gt;, {
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt;   &lt;span class=&quot;Entity&quot;&gt;initialize&lt;/span&gt;: &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;() {  
&lt;span class=&quot;line-numbers&quot;&gt;   6 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.renderer &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;null&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;   7 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;SupportConstant&quot;&gt;shape&lt;/span&gt;    &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;null&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;   8 &lt;/span&gt;   },
&lt;span class=&quot;line-numbers&quot;&gt;   9 &lt;/span&gt;   
&lt;span class=&quot;line-numbers&quot;&gt;  10 &lt;/span&gt;   &lt;span class=&quot;Entity&quot;&gt;activate&lt;/span&gt;: &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;manager&lt;/span&gt;) {
&lt;span class=&quot;line-numbers&quot;&gt;  11 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.renderer &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; manager.renderer;
&lt;span class=&quot;line-numbers&quot;&gt;  12 &lt;/span&gt;   },
&lt;span class=&quot;line-numbers&quot;&gt;  13 &lt;/span&gt;   
&lt;span class=&quot;line-numbers&quot;&gt;  14 &lt;/span&gt;   &lt;span class=&quot;Entity&quot;&gt;unactivate&lt;/span&gt;: &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;manager&lt;/span&gt;) {
&lt;span class=&quot;line-numbers&quot;&gt;  15 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.renderer &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;null&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  16 &lt;/span&gt;   }, 
&lt;span class=&quot;line-numbers&quot;&gt;  17 &lt;/span&gt;   
&lt;span class=&quot;line-numbers&quot;&gt;  18 &lt;/span&gt;   &lt;span class=&quot;Entity&quot;&gt;initDrag&lt;/span&gt;: &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;x, y, event&lt;/span&gt;) { 
&lt;span class=&quot;line-numbers&quot;&gt;  19 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.polyline &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;Keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;JEntityNameType&quot;&gt;Graphic.Polyline&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.renderer); 
&lt;span class=&quot;line-numbers&quot;&gt;  20 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.polyline.setStroke(&lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;._randomStroke());
&lt;span class=&quot;line-numbers&quot;&gt;  21 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.polyline.addPoint(x, y); 
&lt;span class=&quot;line-numbers&quot;&gt;  22 &lt;/span&gt;     
&lt;span class=&quot;line-numbers&quot;&gt;  23 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.renderer.&lt;span class=&quot;SupportFunction&quot;&gt;add&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.polyline)
&lt;span class=&quot;line-numbers&quot;&gt;  24 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.renderer.draw();
&lt;span class=&quot;line-numbers&quot;&gt;  25 &lt;/span&gt;   },
&lt;span class=&quot;line-numbers&quot;&gt;  26 &lt;/span&gt;   
&lt;span class=&quot;line-numbers&quot;&gt;  27 &lt;/span&gt;   &lt;span class=&quot;Entity&quot;&gt;drag&lt;/span&gt;: &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;x, y, dx, dy, ddx, ddy, event&lt;/span&gt;) {    
&lt;span class=&quot;line-numbers&quot;&gt;  28 &lt;/span&gt;     &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.polyline) {           
&lt;span class=&quot;line-numbers&quot;&gt;  29 &lt;/span&gt;       &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.polyline.addPoint(x, y); 
&lt;span class=&quot;line-numbers&quot;&gt;  30 &lt;/span&gt;       &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.renderer.draw();
&lt;span class=&quot;line-numbers&quot;&gt;  31 &lt;/span&gt;     }
&lt;span class=&quot;line-numbers&quot;&gt;  32 &lt;/span&gt;   },
&lt;span class=&quot;line-numbers&quot;&gt;  33 &lt;/span&gt;   
&lt;span class=&quot;line-numbers&quot;&gt;  34 &lt;/span&gt;   &lt;span class=&quot;Entity&quot;&gt;endDrag&lt;/span&gt;: &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;x, y, event&lt;/span&gt;) {
&lt;span class=&quot;line-numbers&quot;&gt;  35 &lt;/span&gt;     &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.polyline) {
&lt;span class=&quot;line-numbers&quot;&gt;  36 &lt;/span&gt;       &lt;span class=&quot;Variable&quot;&gt;this&lt;/span&gt;.polyline &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;null&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  37 &lt;/span&gt;     }
&lt;span class=&quot;line-numbers&quot;&gt;  38 &lt;/span&gt;   },
&lt;span class=&quot;line-numbers&quot;&gt;  39 &lt;/span&gt;   
&lt;span class=&quot;line-numbers&quot;&gt;  40 &lt;/span&gt;   &lt;span class=&quot;Entity&quot;&gt;mouseMove&lt;/span&gt;: &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;x, y, event&lt;/span&gt;) {
&lt;span class=&quot;line-numbers&quot;&gt;  41 &lt;/span&gt;   },
&lt;span class=&quot;line-numbers&quot;&gt;  42 &lt;/span&gt;   
&lt;span class=&quot;line-numbers&quot;&gt;  43 &lt;/span&gt;   &lt;span class=&quot;Entity&quot;&gt;_randomStroke&lt;/span&gt;: &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;() {
&lt;span class=&quot;line-numbers&quot;&gt;  44 &lt;/span&gt;     &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt; r &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Math&lt;/span&gt;.&lt;span class=&quot;SupportFunction&quot;&gt;floor&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;255&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Math&lt;/span&gt;.&lt;span class=&quot;SupportFunction&quot;&gt;random&lt;/span&gt;());
&lt;span class=&quot;line-numbers&quot;&gt;  45 &lt;/span&gt;     &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt; g &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Math&lt;/span&gt;.&lt;span class=&quot;SupportFunction&quot;&gt;floor&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;255&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Math&lt;/span&gt;.&lt;span class=&quot;SupportFunction&quot;&gt;random&lt;/span&gt;());
&lt;span class=&quot;line-numbers&quot;&gt;  46 &lt;/span&gt;     &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt; b &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Math&lt;/span&gt;.&lt;span class=&quot;SupportFunction&quot;&gt;floor&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;255&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Math&lt;/span&gt;.&lt;span class=&quot;SupportFunction&quot;&gt;random&lt;/span&gt;());
&lt;span class=&quot;line-numbers&quot;&gt;  47 &lt;/span&gt;     &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt; a &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;128&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Math&lt;/span&gt;.&lt;span class=&quot;SupportFunction&quot;&gt;floor&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;128&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Math&lt;/span&gt;.&lt;span class=&quot;SupportFunction&quot;&gt;random&lt;/span&gt;()); 
&lt;span class=&quot;line-numbers&quot;&gt;  48 &lt;/span&gt;     &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt; w &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;5&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Math&lt;/span&gt;.&lt;span class=&quot;SupportFunction&quot;&gt;floor&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;5&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Math&lt;/span&gt;.&lt;span class=&quot;SupportFunction&quot;&gt;random&lt;/span&gt;());
&lt;span class=&quot;line-numbers&quot;&gt;  49 &lt;/span&gt;     &lt;span class=&quot;Keyword&quot;&gt;return&lt;/span&gt;  {r: r, g: g, b: b, a: a, w: w}
&lt;span class=&quot;line-numbers&quot;&gt;  50 &lt;/span&gt;   }
&lt;span class=&quot;line-numbers&quot;&gt;  51 &lt;/span&gt; });
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2007-04-24:56</id>
    <published>2007-04-24T12:57:00Z</published>
    <updated>2008-05-05T16:46:08Z</updated>
    <category term="English"/>
    <category term="Javascript"/>
    <category term="PWC"/>
    <link href="http://blog.xilinus.com/2007/4/24/pwc-1-3" rel="alternate" type="text/html"/>
    <title>Prototype Windows (PWC) version 1.3</title>
<content type="html">
            &lt;p&gt;After a while without any new versions (as &lt;a href=&quot;http://prototype-window.xilinus.com/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PWC&lt;/span&gt;&lt;/a&gt;)  becomes complete and pretty stable) here comes 1.3.&lt;/p&gt;


	&lt;p&gt;The main features are blur/focus events with possibility of having 2 themes to make the focused window looks different.
And a new theme by &lt;a href=&quot;http://www.mila76.it/&quot;&gt;Emanuel Mila&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Also a new example/tutorial, &lt;a href=&quot;http://prototype-window.xilinus.com/PWC-OS&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PWC&lt;/span&gt;-OS&lt;/a&gt;, a lightweight Web OS using &lt;span class=&quot;caps&quot;&gt;PWC&lt;/span&gt;.
It uses the focus/blur feature, of course.&lt;/p&gt;


&amp;lt;center&gt;&lt;img src=&quot;http://blog.xilinus.com/assets/2007/4/24/pwc_os.png&quot; /&gt;&amp;lt;/center&gt;

	&lt;p&gt;I have also added a &lt;span class=&quot;caps&quot;&gt;PWC&lt;/span&gt; section in this blog to post every new ideas/features.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2007-04-16:52</id>
    <published>2007-04-16T20:21:00Z</published>
    <updated>2008-05-05T16:46:27Z</updated>
    <category term="English"/>
    <category term="PGF"/>
    <category term="Canvas"/>
    <category term="canvas"/>
    <category term="Prototype"/>
    <category term="prototype"/>
    <category term="SVG"/>
    <category term="svg"/>
    <category term="VML"/>
    <category term="vml"/>
    <link href="http://blog.xilinus.com/2007/4/16/new-ctm-managment-in-pgf" rel="alternate" type="text/html"/>
    <title>New CTM managment in PGF</title>
<content type="html">
            &lt;p&gt;I have commited a new version with a new &lt;span class=&quot;caps&quot;&gt;CTM&lt;/span&gt; (current transformation matrix) managment for shapes.&lt;/p&gt;


	&lt;p&gt;Now shapes handles matrix and inverse matrix. So it&#8217;s really easy to convert points from shape to viewport and from viewport to shape coordinates.&lt;/p&gt;


	&lt;p&gt;With this, handling missing pick feature in canvas is much more easier. Check this canvas &lt;a href=&quot;http://prototype-graphic.xilinus.com/samples/select_canvas.html&quot;&gt;example&lt;/a&gt; (Firefox and Safari). You still can play with the &lt;a href=&quot;http://prototype-graphic.xilinus.com/samples/select.html&quot;&gt;&lt;span class=&quot;caps&quot;&gt;SVG&lt;/span&gt;/VML version&lt;/a&gt;  (IE/Firefox/Opera)&lt;/p&gt;


	&lt;p&gt;In NeoMeeting, I am able now to edit shapes graphically, here is a little screenshot:
&lt;img src=&quot;http://blog.xilinus.com/assets/2007/4/16/Picture_1.png&quot; /&gt;&lt;/p&gt;


	&lt;p&gt;Next I will add some shapes like lines and polylines and I will do the first official!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.xilinus.com/">
    <author>
      <name>seb</name>
    </author>
    <id>tag:blog.xilinus.com,2007-04-13:45</id>
    <published>2007-04-13T10:28:00Z</published>
    <updated>2008-05-05T16:47:04Z</updated>
    <category term="English"/>
    <category term="PGF"/>
    <link href="http://blog.xilinus.com/2007/4/13/first-tool-on-pgf" rel="alternate" type="text/html"/>
    <title>First tool on PGF</title>
<content type="html">
            &lt;p&gt;As promised, I have adding the first tool in &lt;span class=&quot;caps&quot;&gt;PGF&lt;/span&gt;. It&#8217;s a select/move tool. It&#8217;s easy as a pie to activate, only two lines of code. Just after renderer creation, add:&lt;/p&gt;


&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; &lt;span class=&quot;Storage&quot;&gt;var&lt;/span&gt; toolManager &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;JEntityNameType&quot;&gt;Graphic.ToolManager&lt;/span&gt;(renderer);
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt; toolManager.setTool(&lt;span class=&quot;Keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;JEntityNameType&quot;&gt;Graphic.SelectTool&lt;/span&gt;());
&lt;/pre&gt;

	&lt;p&gt;I use my &lt;a href=&quot;http://blog.xilinus.com/2007/4/13/simple-event-notifier-class&quot;&gt;EventNotifier&lt;/a&gt; class, so you can receive an event on each move. 
You can play with it &lt;a href=&quot;http://prototype-graphic.xilinus.com/samples/select.html&quot;&gt;here&lt;/a&gt;&lt;/p&gt;


Of course, you can do it without using toolManager by observing events on &lt;span class=&quot;caps&quot;&gt;DOM&lt;/span&gt; Element like this:
&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; Event.observe(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;rectangle_0&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;mouseover&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;() {&lt;span class=&quot;SupportFunction&quot;&gt;alert&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;over a rectangle&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)});   
&lt;/pre&gt;

	&lt;p&gt;But keep in mind it won&#8217;t work for canvas as canvas does use &lt;span class=&quot;caps&quot;&gt;DOM&lt;/span&gt; element for rendering. But, anyway, this version of &lt;span class=&quot;caps&quot;&gt;PGF&lt;/span&gt; doed not support selection in canvas.&lt;/p&gt;


	&lt;p&gt;A Group class has also been added to group shapes. Once grouped, you can apply transform on group, it will affect all included shapes. (Only &lt;span class=&quot;caps&quot;&gt;SVG&lt;/span&gt;/VML, canvas renderer will do it later).&lt;/p&gt;
          </content>  </entry>
</feed>
