This is a layered version of the original Block Server. The **live-server** is being created as a Livecode Component. As such it has a number of distinct scriptonly stacks that provide it with functionailty.
We use the following behavior hierarchy to separate functionailty into optional layers:
LiveServer.livecode => behavior_DaemonMiddleware => behavior_DaemonRouter => behavior_DaemonServer => behavior_DaemonLog
# Behavior Based
This server is based on behaviours and before and after handlers for customisation. For now we migrate them:
module.exports = { createPage: createPage, doInternalLink: doInternalLink, showPage: showPage, showResult: showResult };
showPage(slug, site, title);
showPage = function showPage(name, loc) { var title = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; return createPage(name, loc, title).appendTo('.main').each(function (_i, e) { return refresh.cycle($(e)); }); };
doInternalLink = function doInternalLink(title, $page) { var site = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; var slug; slug = asSlug(title); if ($page != null) { $($page).nextAll().remove(); } if ($page != null) { lineup.removeAllAfterKey($($page).data('key')); } showPage(slug, site, title); return active.set($('.page').last()); };
<section class='main'> {{#pages}} div class='page' id='{{page}}' tabindex="-1" {{{origin}}} {{{generated}}}> <div class='paper'> {{{story}}} </div> </div> {{/pages}} </section>
{{#pages}} <div class='page' id='{{page}}' tabindex="-1" {{{origin}}} {{{generated}}}> <div class='paper'> {{{story}}} </div> </div> {{/pages}}