From 34b93885b0f8401e4d3835b492dd676cd1d43112 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 27 Sep 2016 15:49:22 +0300 Subject: [PATCH] cleaned up redundant complexity... Signed-off-by: Alex A. Naanou --- pwiki.js | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/pwiki.js b/pwiki.js index f27c234..4d63f54 100755 --- a/pwiki.js +++ b/pwiki.js @@ -500,7 +500,16 @@ module.pWikiBase = actions.Actions({ }], // content shorthands... - // XXX raw/text/checked/... + raw: ['Page/', + function(value){ + return arguments.length == 0 ? + (this.attr('text') || '') + : this.attr('text', value) }], + checked: ['Page/', + function(value){ + return arguments.length == 0 ? + !!this.attr('checked') + : this.attr('checked', value || undefined) }], exists: ['Page/Check if path explicitly exists.', function(path){ @@ -946,31 +955,10 @@ module.pWikiBase = actions.Actions({ }) -// Basic data sort-hands... -// -var pWikiContent = -module.pWikiContent = actions.Actions(pWikiBase, { - config: { - }, - - raw: ['Page/', - function(value){ - return arguments.length == 0 ? - (this.attr('text') || '') - : this.attr('text', value) }], - - checked: ['Page/', - function(value){ - return arguments.length == 0 ? - !!this.attr('checked') - : this.attr('checked', value || undefined) }], -}) - - // Data processing and macros... // var pWikiMacros = -module.pWikiMacros = actions.Actions(pWikiContent, { +module.pWikiMacros = actions.Actions(pWikiBase, { __macro_parser__: macro, config: { @@ -1024,7 +1012,6 @@ module.pWikiPage = object.makeConstructor('pWikiPage', // XXX not sure if we need this here... //actions.MetaActions, pWikiBase, - pWikiContent, pWikiMacros))