<div>Hi all.</div><div><br></div><div>Three months ago I started an seaside application, with jquery themes support, which should be easy to use on any PC, for example taking it on a pendrive, without installation of other software such as apache, and without need a internet conection. When attempting to load the jquery themes in a file library and realized it did not work because the images of themes are in the subfolder &quot;images&quot;, and on the other hand was tedious to load each one of the issues at hand. At the time unaware that the seaside team was working on it, so I made my own attempt. Of course this solution does not solve almost any major problems silver here [1] but still share what I did in case someone finds it useful.</div>
<div><br>[1] <a href="http://code.google.com/p/seaside/issues/detail?id=267">http://code.google.com/p/seaside/issues/detail?id=267</a></div><div><br></div><div><br><br>NOTE: tested only in Seaside 3.0.6 in Pharo.<br><br>FOR THE IMPATIENT<br>
¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬<br><br>Simply load the lastest release of Webtalk-Libraries-Core and Webtalk-Libraries-Themes packages, that at write this is:<br>
<br>Gofer new<br>   url: &#39;<a href="http://ss3.gemstone.com/ss/tongadall" target="_blank">http://ss3.gemstone.com/ss/tongadall</a>&#39;;<br>   version: &#39;Webtalk-Libraries-Core-GastonDallOglio.3&#39;;<br>   version: &#39;Webtalk-Libraries-Themes-GastonDallOglio.1&#39;;<br>

   load.<br><br>Now, you may use the file libraries JQBaseThemeDevelopment and their subclasses to get jQuery themes resources, served directly from the pharo image and without need a internet conection.<br><br>For example go to:<br>

<br><a href="http://localhost:8080/files/JQBlackTieThemeDevelopment/jqueryuitheme.css" target="_blank">http://localhost:8080/files/JQBlackTieThemeDevelopment/jqueryuitheme.css</a><br><a href="http://localhost:8080/files/JQBlackTieThemeImages/ui-icons_222222_256x240.png" target="_blank">http://localhost:8080/files/JQBlackTieThemeImages/ui-icons_222222_256x240.png</a><br>

<a href="http://localhost:8080/files/JQBlackTieThemeDevelopment/images/ui-icons_222222_256x240.png" target="_blank">http://localhost:8080/files/JQBlackTieThemeDevelopment/images/ui-icons_222222_256x240.png</a><br><br>Modify the following to use the examples jQuery ui of seaside with these libraries:<br>

<br>JQUiAllFunctionalTests&gt;&gt;initialize<br>   super initialize.<br>   themes := (JQBaseThemeDevelopment withAllSubclasses<br>              collect: [ :each | each default ])<br>                  asSortedCollection: [ :a :b | a themeName &lt; b themeName ].<br>

   theme := JQBaseThemeDevelopment default<br><br>For try, disconnect internet, open new session and go to:<br><a href="http://localhost:8080/javascript/jquery-ui/accordionwidget/" target="_blank">http://localhost:8080/javascript/jquery-ui/accordionwidget/</a><br>

<br>FOR NORMAL PEOPLE :)<br>¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬<br><br>In jqueryuitheme.css, below &quot;/* states and images */&quot; is located this line:<br>.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }<br>

<br>Becouse &quot;images/ui-icons_222222_256x240.png&quot; is a relative path, browser traduce it in &quot;<a href="http://localhost:8080/files/JQBlackTieThemeDevelopment/images/ui-icons_222222_256x240.png" target="_blank">http://localhost:8080/files/JQBlackTieThemeDevelopment/images/ui-icons_222222_256x240.png</a>&quot;<br>

<br>For that, &quot;images/ui-icons_222222_256x240.png&quot; is searched in JQBlackTieThemeDevelopment file library, and with the WAFileLibrary&#39;s implementation a notFound error is returned to the browser.<br><br>For manage this, I have inherited WAFileLibrary and override #handle, like this:<br>

<br>WTLinkableFileLibrary&gt;&gt;handle: aRequestContext<br>        &quot;Depending on the size of a path requested, find a WAFileLibrary linked to first element to ask handle remaining path, or directly handle this request in super method. If a WAFileLibrary is not found return self, for that a notFound error is response to the client.&quot;<br>

        <br>   aRequestContext consumer peekToEnd size &gt; 1<br>              ifTrue: [ | linkedLibrary |<br>                          linkedLibrary := self links at: aRequestContext consumer next<br>                                       ifAbsent: [  ^ self ].<br>                <br>

                           linkedLibrary handle: aRequestContext        ]<br>              ifFalse: [<br>                          super handle: aRequestContext  ].<br><br>Then, you can link a file library with another one, using the string present in the path, for example:<br>

<br>JQBlackTieThemeDevelopment default links at: &#39;images&#39; put: JQBlackTieThemeImages default.<br><br>FOR DEVELOPERS<br>¬¬¬¬¬¬¬¬¬¬¬¬¬¬<br><br>Instead the load the package Webtalk-Libraries-Themes within a given version of jQuery themes, you can load another using WTJQueryThemesManager. I made a very rudimentary first version of WTJQueryThemesManager because I needed it for a job first of all, but now I will continue develop this to learn and fun :)<br>

<br>Well, put jQuery themes in the image folder, for example download one package from <a href="http://blog.jqueryui.com/" target="_blank">http://blog.jqueryui.com/</a>. I used &quot;<a href="http://jquery-ui.googlecode.com/files/jquery-ui-themes-1.8.16.zip" target="_blank">http://jquery-ui.googlecode.com/files/jquery-ui-themes-1.8.16.zip</a>&quot; for made Webtalk-Libraries-Themes-GastonDallOglio.1.<br>

<br>image-folder<br>   L  jquery-ui-themes-1.8.16<br>           L  themes<br>                    L  base<br>                    L  black-tie<br>                    L  blitzer<br>       ...<br><br>Next, load only core package:<br>
<br>
Gofer new<br>    url: &#39;<a href="http://ss3.gemstone.com/ss/tongadall" target="_blank">http://ss3.gemstone.com/ss/tongadall</a>&#39;;<br>    version: &#39;Webtalk-Libraries-Core-GastonDallOglio.3&#39;;<br>    load.<br>
<br>Then, create the file library classes for the themes and load the resources in them, using WTJQueryThemesManager:<br>
<br>WTJQueryThemesManager <br>    addAllThemes: &#39;1.8.16&#39; <br>    resourcesDir: &#39;&#39; <br>    sufixClass: &#39;Development&#39;.<br>        <br>WTJQueryThemesManager <br>    addAllThemes: &#39;1.8.16&#39; <br>    resourcesDir: &#39;minified&#39; <br>

    sufixClass: &#39;Deployment&#39;.<br>                <br>WTJQueryThemesManager  <br>    addAllThemes: &#39;1.8.16&#39; <br>    resourcesDir: &#39;images&#39; <br>    sufixClass: &#39;Images&#39;.<br><br>And now, link the libraries:<br>

<br>WTJQueryThemesManager  <br>    linkAllThemes: JQBaseThemeDevelopment<br>    link: &#39;images&#39; <br>    resources: JQBaseThemeImages.<br><br>This is sufficient to use the themes. <br><br>In parallel, you can load another version of jQuery themes:<br>

<br>JQBaseThemeDeployment duplicateClassWithNewName: #JQBaseThemeDeployment1818.<br>        <br>WTJQueryThemesManager <br>    addAllThemes: &#39;1.8.18&#39; <br>    resourcesDir: &#39;&#39; <br>    sufixClass: &#39;Development1818&#39;.<br>

<br>JQBaseThemeImages duplicateClassWithNewName: #JQBaseThemeImages1818.<br><br>...        </div><div><br><br>That&#39;s all folks :)<br></div><div><br></div><div>Any feedback is welcome, Regards.</div>