Hi Lukas,
Having images in methods are simple, but you must be aware, that images
are loaded separately from main page with parallel requests and separate
urls. So you need to do:
- first, put image in some method code,
- make an "virtual" resource which will actually call above method
- put url of that resurce to your main code.
In Aida I implemented that in above way and results are just fine -
having all your pictures in code solves problem of version control and
also simplify installation of your app.
If you are interested I can prepare some snipets from Aida code, but dor
start read
http://wiki.eranova.si/aida/Method+Images and
http://wiki.eranova.si/aida/Method+Resources.
Best regards
Janko
Lukas Renggli pravi:
Hi David,
some comments about your code:
- I don't know if we want to do this again in SmallWiki 2. It caused
some confusion in SmallWiki 1:
InternalLink>>accept: aVisitor
self isBroken
ifFalse: [ aVisitor visitInternalLink: self ]
ifTrue: [ aVisitor visitInternalLinkBroken: self ]
- Mhh, I'm not quite happy with your extensions to the smiley-class. I
do want to keep the Model free of any HTTP dependent stuff and you
define the smilies using URLs pointing to the university server. I would
prefer to have the images within the code and serve them using Seaside.
A lot of people complained about being dependent of the university server.
- A previously running test fails.
- You added a space into the tree component before the label. This is
the responsibility of the CSS-Stylesheet. No layout information in the
Smalltalk code. Not even a single space :) It is much more consistant to
put a ".label { margin-left: 10px }" into the style-sheet. Hey Frederic,
could you have a look at the generated XHTML code and create some funky
CSS? This would be really cool!
TreeComponent>>renderNodeLabel: aModel on: html
html spanClass: #label with: [
html anchorWithAction: [ self select: aModel ] do: ' ' ,
aModel title ].
- For your code in the subclasses of RelatedComponent: You start your
search in the root of the wiki, but I think the default should be to
start in the current structure. Maybe we want to add a property to let
the user specify where to start.
- I suspect you didn't understand the idea of RelatedComponent. Why do
you have for all your subclasses two almost identical method-bodies like
#structures and #search...? Why do you customize the rendering for each
subclass? The only thing you need to do is to override the method
#structures and everything else should be handled by the abstract
parent. The strings you define in your rendering methods (e.g. 'There
are no external links in the wiki' or 'In ... these links are
outgoing:') shouldn't be there, this is the responsibility of the
CSS-Stylesheet as this is a property of the layout. Generally every
component should consist only of a configurable title-string (provided
by BodyComponent) and all the necessary information within div, span,
ul, li, etc tags.
Of course I'm open for your opinions, I just tried to explain how I
intended to implement the new generation of SmallWiki.
Cheers,
Lukas
--
Janko Mivsek
Systems Architect
EraNova d.o.o.
Ljubljana, Slovenia
http://www.eranova.si