[Lazarus] Please test this page

Anthony Walter sysrpl at gmail.com
Tue Nov 17 10:20:42 CET 2015


Michael, regarding the Konqueror rendering, I posted this on the Lazaurs
forums:

`I can only do so much given the source material of "table tbody tr td td
td p span code &nbsp span p td td td tr tr td td td &nbsp p ... "`So yeah,
table layout is bad but I'll deal with it the best I can.

Regarding the search, I have my own framework for websites that's been in
github for a while. It's C# but I think it's really great. In a nutshell ...

http://pastebin.com/sjFCNpxb

Everything is pretty much optional, you can have:

[DefaultPage("home.html")] class HomePage : PageHandler {}

And that loads home.html. You can add programability with methods:

[MethodPage("hello")] public void Hello() { Write("Hello World"); }

And if you load http://yoursite.com/?method=hello, then the result is
"Hello World". In reality you would use MethodPage for ajax calls, or stuff
invoked dynamically on your webpage from javascript.

In this case I have a codesearch method, or in javascript ajax with jquery
... $.ajax('/?method=codesearch'). See
http://docs.getlazarus.org/scripts/home.js, in particular execute() and
searchExecute().

Then there are templates, which look like this:

http://pastebin.com/vy1eKWbu

The magic there is the anonymous type built from SQL result rows and
columns. Because it's an actual type, it can be used with my template
system:

SearchItems = TemplateString.FormatObject(searchItems);

Where template string is simply:

<a class="searchResult" href="{Source}" target="main"
onclick="searchSelect('{Path}')">
<span class="resultPath">{Bolden}</span>
<span class="resultKind">{Kind}</span>
<span class="resultDescription">{Description}</span>
</a>

And you can nest templates (causes the above inserted as a child):

<div id="searchResults">{SearchItems}</div>

Further, you can add format specifiers in my template engine. i.e.
{Bolden:10} to pad with spaces. You can use any type and any format
specifiers, as long as they work with the actual type in C# (you can add
your own format specifiers to C#).

Soon I'll post the whole project online and if anyone want to make
improvements they can have at it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151117/51da0322/attachment-0003.html>


More information about the Lazarus mailing list