cloudcms-server 4.0.0-beta.2 → 4.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -5
- package/cloudcms-server.iml +1 -0
- package/index.js +58 -32
- package/middleware/authentication/authentication.js +40 -12
- package/middleware/authentication/providers/saml.js +8 -4
- package/middleware/awareness/awareness.js +8 -7
- package/middleware/awareness/plugins/api_event.js +105 -0
- package/middleware/awareness/plugins/editorial.js +54 -3
- package/middleware/awareness/plugins/resources.js +13 -5
- package/middleware/config/adapter.js +0 -44
- package/middleware/deployment/deployment.js +22 -24
- package/middleware/driver/driver.js +24 -1
- package/middleware/driver-config/driver-config.js +0 -6
- package/middleware/modules/modules.js +11 -5
- package/middleware/perf/perf.js +3 -2
- package/middleware/registration/registration.js +0 -5
- package/middleware/stores/engines/empty.js +0 -4
- package/middleware/stores/engines/fs-caching-adapter.js +0 -5
- package/middleware/stores/engines/fs.js +0 -9
- package/middleware/stores/engines/s3.js +0 -5
- package/middleware/stores/engines/s3fs.js +0 -5
- package/middleware/stores/multistore.js +0 -29
- package/middleware/stores/store.js +0 -10
- package/middleware/stores/stores.js +2 -2
- package/middleware/virtual-config/virtual-config.js +253 -206
- package/middleware/virtual-files/virtual-files.js +0 -3
- package/middleware/welcome/welcome.js +0 -3
- package/notifications/notifications.js +72 -10
- package/notifications/providers/kafka.js +182 -0
- package/notifications/providers/stomp.js +4 -0
- package/package.json +40 -56
- package/server/index.js +216 -123
- package/server/standalone.js +1 -6
- package/util/auth.js +10 -4
- package/util/cloudcms.js +77 -35
- package/util/loaders.js +113 -0
- package/util/proxy-factory.js +143 -168
- package/util/request.js +6 -2
- package/util/workqueue.js +111 -0
- package/.last_command +0 -7
- package/duster/helpers/core/cloudcms/associations.js +0 -34
- package/duster/helpers/core/cloudcms/beta/markdown.js +0 -46
- package/duster/helpers/core/cloudcms/beta/nodeAttachmentText.js +0 -46
- package/duster/helpers/core/cloudcms/beta/params.js +0 -33
- package/duster/helpers/core/cloudcms/beta/processTemplate.js +0 -82
- package/duster/helpers/core/cloudcms/content.js +0 -34
- package/duster/helpers/core/cloudcms/expand.js +0 -38
- package/duster/helpers/core/cloudcms/form.js +0 -34
- package/duster/helpers/core/cloudcms/query.js +0 -34
- package/duster/helpers/core/cloudcms/queryOne.js +0 -34
- package/duster/helpers/core/cloudcms/relatives.js +0 -34
- package/duster/helpers/core/cloudcms/search.js +0 -34
- package/duster/helpers/core/cloudcms/searchOne.js +0 -34
- package/duster/helpers/core/cloudcms/wcm/dependency.js +0 -83
- package/duster/helpers/core/cloudcms/wcm/fragment.js +0 -34
- package/duster/helpers/core/dev/debug.js +0 -42
- package/duster/helpers/core/dom/block.js +0 -49
- package/duster/helpers/core/dom/include.js +0 -38
- package/duster/helpers/core/dom/layout.js +0 -49
- package/duster/helpers/core/dom/link.js +0 -81
- package/duster/helpers/core/dom/resource.js +0 -77
- package/duster/helpers/core/engine.js +0 -1580
- package/duster/helpers/core/ice/value.js +0 -65
- package/duster/helpers/core/index.js +0 -49
- package/duster/helpers/core/operators/if.js +0 -64
- package/duster/helpers/core/operators/iter.js +0 -45
- package/duster/helpers/core/operators/iterate.js +0 -129
- package/duster/helpers/sample/nyt.js +0 -114
- package/duster/index.js +0 -319
- package/duster/support.js +0 -436
- package/duster/tracker.js +0 -262
- package/middleware/authentication/providers/cas.js +0 -73
- package/middleware/authentication/providers/facebook.js +0 -120
- package/middleware/authentication/providers/github.js +0 -88
- package/middleware/authentication/providers/linkedin.js +0 -112
- package/middleware/authentication/providers/twitter.js +0 -120
- package/middleware/server-tags/server-tags.js +0 -113
- package/middleware/wcm/wcm.js +0 -1437
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @params
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
/**
|
|
11
|
-
* Allows parameters to be passed into blocks or partials
|
|
12
|
-
*/
|
|
13
|
-
dust.helpers.params = function( chunk, context, bodies, params ){
|
|
14
|
-
|
|
15
|
-
var partial = {};
|
|
16
|
-
if( params)
|
|
17
|
-
{
|
|
18
|
-
for (var key in params)
|
|
19
|
-
{
|
|
20
|
-
partial[key] = params[key];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// render
|
|
25
|
-
var newContext = context.push(partial);
|
|
26
|
-
|
|
27
|
-
//return bodies.block(chunk, dust.makeBase(partial))
|
|
28
|
-
return bodies.block(chunk, newContext);
|
|
29
|
-
};
|
|
30
|
-
dust.helpers.parameters = dust.helpers.params;
|
|
31
|
-
|
|
32
|
-
callback();
|
|
33
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @processTemplate
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../../engine")(app, dust);
|
|
11
|
-
|
|
12
|
-
var map = engine.map;
|
|
13
|
-
var end = engine.end;
|
|
14
|
-
|
|
15
|
-
dust.helpers.processTemplate = function(chunk, context, bodies, params)
|
|
16
|
-
{
|
|
17
|
-
params = params || {};
|
|
18
|
-
|
|
19
|
-
var nodeId = context.resolve(params.node);
|
|
20
|
-
var attachmentId = context.resolve(params.attachment);
|
|
21
|
-
if (!attachmentId)
|
|
22
|
-
{
|
|
23
|
-
attachmentId = "default";
|
|
24
|
-
}
|
|
25
|
-
var propertyId = context.resolve(params.property);
|
|
26
|
-
var locale = context.resolve(params.locale);
|
|
27
|
-
|
|
28
|
-
return map(chunk, function(chunk) {
|
|
29
|
-
|
|
30
|
-
if (locale)
|
|
31
|
-
{
|
|
32
|
-
var gitana = context.get("gitana");
|
|
33
|
-
gitana.getDriver().setLocale(locale);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (propertyId)
|
|
37
|
-
{
|
|
38
|
-
var req = context.get("req");
|
|
39
|
-
req.branch(function(err, branch) {
|
|
40
|
-
|
|
41
|
-
if (err) {
|
|
42
|
-
return end(chunk, context);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
branch.readNode(nodeId).then(function() {
|
|
46
|
-
|
|
47
|
-
resolveVariables([this[propertyId]], context, function (err, resolutions) {
|
|
48
|
-
|
|
49
|
-
chunk.write(resolutions[0]);
|
|
50
|
-
|
|
51
|
-
end(chunk, context);
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
else
|
|
58
|
-
{
|
|
59
|
-
var req = context.get("req");
|
|
60
|
-
req.branch(function(err, branch) {
|
|
61
|
-
|
|
62
|
-
if (err) {
|
|
63
|
-
return end(chunk, context);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
branch.readNode(nodeId).attachment(attachmentId).download(function (text) {
|
|
67
|
-
|
|
68
|
-
resolveVariables([text], context, function (err, resolutions) {
|
|
69
|
-
|
|
70
|
-
chunk.write(resolutions[0]);
|
|
71
|
-
|
|
72
|
-
end(chunk, context);
|
|
73
|
-
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
callback();
|
|
82
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @content
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../engine")(app, dust);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* CONTENT
|
|
14
|
-
*
|
|
15
|
-
* Selects a single content item.
|
|
16
|
-
*
|
|
17
|
-
* Syntax:
|
|
18
|
-
*
|
|
19
|
-
* {@content id="GUID" path="/a/b/c" as=""}
|
|
20
|
-
* {+templateIdentifier/}
|
|
21
|
-
* {/content}
|
|
22
|
-
*
|
|
23
|
-
* @param chunk
|
|
24
|
-
* @param context
|
|
25
|
-
* @param bodies
|
|
26
|
-
* @param params
|
|
27
|
-
*/
|
|
28
|
-
dust.helpers.content = function(chunk, context, bodies, params)
|
|
29
|
-
{
|
|
30
|
-
return engine.handleContent(chunk, context, bodies, params);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
callback();
|
|
34
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @expand
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../engine")(app, dust);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* EXPAND
|
|
14
|
-
*
|
|
15
|
-
* Query for a list of nodes by their id (._doc).
|
|
16
|
-
* The list of id values can be supplied as an array of id values in
|
|
17
|
-
* the 'list' arg or as an array of node records in the 'list' arg
|
|
18
|
-
* along with a the name of a common key within each node that holds
|
|
19
|
-
* the id.
|
|
20
|
-
*
|
|
21
|
-
* Syntax:
|
|
22
|
-
* ex. 1
|
|
23
|
-
* {@expand list="components" key="editorialpage.components" as="components"}
|
|
24
|
-
* {+templateIdentifier/}
|
|
25
|
-
* {/expand}
|
|
26
|
-
*
|
|
27
|
-
* @param chunk
|
|
28
|
-
* @param context
|
|
29
|
-
* @param bodies
|
|
30
|
-
* @param params
|
|
31
|
-
*/
|
|
32
|
-
dust.helpers.expand = function(chunk, context, bodies, params)
|
|
33
|
-
{
|
|
34
|
-
return engine.handleExpand(chunk, context, bodies, params);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
callback();
|
|
38
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @form
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../engine")(app, dust);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* FORM
|
|
14
|
-
*
|
|
15
|
-
* Renders a form.
|
|
16
|
-
*
|
|
17
|
-
* Syntax:
|
|
18
|
-
*
|
|
19
|
-
* {@form definition="custom:type" form="formKey" list="listKeyOrId" successUrl="" errorUrl=""}
|
|
20
|
-
* {+templateIdentifier/}
|
|
21
|
-
* {/form}
|
|
22
|
-
*
|
|
23
|
-
* @param chunk
|
|
24
|
-
* @param context
|
|
25
|
-
* @param bodies
|
|
26
|
-
* @param params
|
|
27
|
-
*/
|
|
28
|
-
dust.helpers.form = function(chunk, context, bodies, params)
|
|
29
|
-
{
|
|
30
|
-
return engine.handleForm(chunk, context, bodies, params);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
callback();
|
|
34
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @query
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../engine")(app, dust);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* QUERY
|
|
14
|
-
*
|
|
15
|
-
* Queries for content from the content repository and renders.
|
|
16
|
-
*
|
|
17
|
-
* Syntax:
|
|
18
|
-
*
|
|
19
|
-
* {@query sort="title" scope="page" type="custom:type" limit="" skip="" as=""}
|
|
20
|
-
* {+templateIdentifier/}
|
|
21
|
-
* {/query}
|
|
22
|
-
*
|
|
23
|
-
* @param chunk
|
|
24
|
-
* @param context
|
|
25
|
-
* @param bodies
|
|
26
|
-
* @param params
|
|
27
|
-
*/
|
|
28
|
-
dust.helpers.query = function(chunk, context, bodies, params)
|
|
29
|
-
{
|
|
30
|
-
return engine.handleQuery(chunk, context, bodies, params, false);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
callback();
|
|
34
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @queryOne
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../engine")(app, dust);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* QUERY AND KEEP ONE
|
|
14
|
-
*
|
|
15
|
-
* Queries for content from the content repository and renders.
|
|
16
|
-
*
|
|
17
|
-
* Syntax:
|
|
18
|
-
*
|
|
19
|
-
* {@queryOne sort="title" scope="page" type="custom:type" limit="" skip="" as=""}
|
|
20
|
-
* {+templateIdentifier/}
|
|
21
|
-
* {/queryOne}
|
|
22
|
-
*
|
|
23
|
-
* @param chunk
|
|
24
|
-
* @param context
|
|
25
|
-
* @param bodies
|
|
26
|
-
* @param params
|
|
27
|
-
*/
|
|
28
|
-
dust.helpers.queryOne = function(chunk, context, bodies, params)
|
|
29
|
-
{
|
|
30
|
-
return engine.handleQuery(chunk, context, bodies, params, true);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
callback();
|
|
34
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @relatives
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../engine")(app, dust);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* RELATIVES
|
|
14
|
-
*
|
|
15
|
-
* Finds relatives around a node.
|
|
16
|
-
*
|
|
17
|
-
* Syntax:
|
|
18
|
-
*
|
|
19
|
-
* {@relatives node="<nodeId>" associationType="<association_type>" limit="" skip="" as=""}
|
|
20
|
-
* {+templateIdentifier/}
|
|
21
|
-
* {/relatives}
|
|
22
|
-
*
|
|
23
|
-
* @param chunk
|
|
24
|
-
* @param context
|
|
25
|
-
* @param bodies
|
|
26
|
-
* @param params
|
|
27
|
-
*/
|
|
28
|
-
dust.helpers.relatives = function(chunk, context, bodies, params)
|
|
29
|
-
{
|
|
30
|
-
return engine.handleRelatives(chunk, context, bodies, params);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
callback();
|
|
34
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @search
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../engine")(app, dust);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* SEARCH
|
|
14
|
-
*
|
|
15
|
-
* Runs a search and passes the rows to a rendering template.
|
|
16
|
-
*
|
|
17
|
-
* Syntax:
|
|
18
|
-
*
|
|
19
|
-
* {@search sort="title" scope="page" text="something" limit="" skip="" as=""}
|
|
20
|
-
* {+templateIdentifier/}
|
|
21
|
-
* {/search}
|
|
22
|
-
*
|
|
23
|
-
* @param chunk
|
|
24
|
-
* @param context
|
|
25
|
-
* @param bodies
|
|
26
|
-
* @param params
|
|
27
|
-
*/
|
|
28
|
-
dust.helpers.search = function(chunk, context, bodies, params)
|
|
29
|
-
{
|
|
30
|
-
return engine.handleSearch(chunk, context, bodies, params, false);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
callback();
|
|
34
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @searchOne
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../engine")(app, dust);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* SEARCH
|
|
14
|
-
*
|
|
15
|
-
* Runs a search and keeps one of the result items. Passes the result to the rendering template.
|
|
16
|
-
*
|
|
17
|
-
* Syntax:
|
|
18
|
-
*
|
|
19
|
-
* {@searchOne sort="title" scope="page" text="something" limit="" skip="" as=""}
|
|
20
|
-
* {+templateIdentifier/}
|
|
21
|
-
* {/searchOne}
|
|
22
|
-
*
|
|
23
|
-
* @param chunk
|
|
24
|
-
* @param context
|
|
25
|
-
* @param bodies
|
|
26
|
-
* @param params
|
|
27
|
-
*/
|
|
28
|
-
dust.helpers.searchOne = function(chunk, context, bodies, params)
|
|
29
|
-
{
|
|
30
|
-
return engine.handleSearch(chunk, context, bodies, params, true);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
callback();
|
|
34
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
var tracker = require("../../../../tracker");
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @dependency
|
|
5
|
-
*
|
|
6
|
-
* @param app
|
|
7
|
-
* @param dust
|
|
8
|
-
* @param callback
|
|
9
|
-
*/
|
|
10
|
-
module.exports = function(app, dust, callback)
|
|
11
|
-
{
|
|
12
|
-
var support = require("../../../../support")(dust);
|
|
13
|
-
var map = support.map;
|
|
14
|
-
var end = support.end;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Flags a dependency for a page.
|
|
18
|
-
*
|
|
19
|
-
* There are two types of dependencies - "produces" and "requires".
|
|
20
|
-
*
|
|
21
|
-
* "Produces" means that the HTML output of the page contains data from one or more dependencies. These dependencies
|
|
22
|
-
* are identified by IDs and are usually Node IDs. If the page shows an attachment from a Node, it should be flagged
|
|
23
|
-
* as having a "produces" dependency with that Node's ID. If it shows article text in any way, the article's Node
|
|
24
|
-
* ID should be marked as a "produces" dependency.
|
|
25
|
-
*
|
|
26
|
-
* "Requires" means that the cached HTML can only be served if the requirement is met. The "requires" dependencies
|
|
27
|
-
* may only consist of request-time state that is known *before* the Dust processor begins to run. That way, the
|
|
28
|
-
* Dust processor can elect to use the cache state instead of executing the page. The "requires" dependencies
|
|
29
|
-
* are usually request information (url, parameters, locale) or user information (user's name, id) but may also
|
|
30
|
-
* consist of information that is acquired by Express middleware that runs ahead of WCM (which usually runs toward
|
|
31
|
-
* the end).
|
|
32
|
-
*
|
|
33
|
-
* If "type" is not specified, it is assumed to be "produces".
|
|
34
|
-
*
|
|
35
|
-
* Syntax:
|
|
36
|
-
*
|
|
37
|
-
* {@dependency type="produces" key="{key}" value="{value}"}
|
|
38
|
-
* {+templateIdentifier/}
|
|
39
|
-
* {/dependency}
|
|
40
|
-
*
|
|
41
|
-
* {@dependency type="requires" key="{key}" value="{value}"}
|
|
42
|
-
* {+templateIdentifier/}
|
|
43
|
-
* {/dependency}
|
|
44
|
-
*
|
|
45
|
-
* @param chunk
|
|
46
|
-
* @param context
|
|
47
|
-
* @param bodies
|
|
48
|
-
* @param params
|
|
49
|
-
*/
|
|
50
|
-
dust.helpers.dependency = function(chunk, context, bodies, params)
|
|
51
|
-
{
|
|
52
|
-
var type = context.resolve(params.type);
|
|
53
|
-
var key = context.resolve(params.key);
|
|
54
|
-
var value = context.resolve(params.value);
|
|
55
|
-
|
|
56
|
-
return map(chunk, function(chunk2) {
|
|
57
|
-
|
|
58
|
-
// TRACKER: START
|
|
59
|
-
tracker.start(context);
|
|
60
|
-
|
|
61
|
-
if (!type || type === "produces" || type === "produce" || type === "p") {
|
|
62
|
-
|
|
63
|
-
// TRACKER - PRODUCES "key" = "value"
|
|
64
|
-
tracker.produces(context, key, value);
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
else if (type === "requires" || type === "require" || type === "r") {
|
|
68
|
-
|
|
69
|
-
// TRACKER - REQUIRES "key" = "value"
|
|
70
|
-
tracker.requires(context, key, value);
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
console.log("Unknown type for @dependency tag: " + type);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// render whatever is inside the tag and keep going
|
|
78
|
-
return chunk2.render( bodies.block, context );
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
callback();
|
|
83
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fragment
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../../engine")(app, dust);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* FRAGMENT
|
|
14
|
-
*
|
|
15
|
-
* Declares a cacheable fragment.
|
|
16
|
-
*
|
|
17
|
-
* Syntax:
|
|
18
|
-
*
|
|
19
|
-
* {@fragment}
|
|
20
|
-
* ...inner body
|
|
21
|
-
* {/fragment}
|
|
22
|
-
*
|
|
23
|
-
* @param chunk
|
|
24
|
-
* @param context
|
|
25
|
-
* @param bodies
|
|
26
|
-
* @param params
|
|
27
|
-
*/
|
|
28
|
-
dust.helpers.fragment = function(chunk, context, bodies, params)
|
|
29
|
-
{
|
|
30
|
-
return engine.handleFragment(chunk, context, bodies, params);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
callback();
|
|
34
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @debug
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../engine")(app, dust);
|
|
11
|
-
var map = engine.map;
|
|
12
|
-
var end = engine.end;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Shows debug information about the current context
|
|
16
|
-
*
|
|
17
|
-
* Syntax:
|
|
18
|
-
*
|
|
19
|
-
* {@debug/}
|
|
20
|
-
*
|
|
21
|
-
* @param chunk
|
|
22
|
-
* @param context
|
|
23
|
-
* @param bodies
|
|
24
|
-
* @param params
|
|
25
|
-
*/
|
|
26
|
-
dust.helpers.debug = function(chunk, context, bodies, params)
|
|
27
|
-
{
|
|
28
|
-
//params = params || {};
|
|
29
|
-
|
|
30
|
-
return map(chunk, function(chunk) {
|
|
31
|
-
|
|
32
|
-
var json = JSON.stringify(context.stack.head, null, " ");
|
|
33
|
-
var html = "<textarea>" + json + "</textarea>";
|
|
34
|
-
chunk.write(html);
|
|
35
|
-
|
|
36
|
-
end(chunk, context);
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
callback();
|
|
42
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var path = require("path");
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @layout
|
|
5
|
-
*
|
|
6
|
-
* @param app
|
|
7
|
-
* @param dust
|
|
8
|
-
* @param callback
|
|
9
|
-
*/
|
|
10
|
-
module.exports = function(app, dust, callback)
|
|
11
|
-
{
|
|
12
|
-
var engine = require("../engine")(app, dust);
|
|
13
|
-
var map = engine.map;
|
|
14
|
-
var end = engine.end;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* INCLUDE BLOCK
|
|
18
|
-
*
|
|
19
|
-
* Includes a block dust template into this one and passes any context forward.
|
|
20
|
-
*
|
|
21
|
-
* Syntax:
|
|
22
|
-
*
|
|
23
|
-
* {@block path="path" ...args/}
|
|
24
|
-
*
|
|
25
|
-
* @param chunk
|
|
26
|
-
* @param context
|
|
27
|
-
* @param bodies
|
|
28
|
-
* @param params
|
|
29
|
-
*/
|
|
30
|
-
dust.helpers.block = function(chunk, context, bodies, params)
|
|
31
|
-
{
|
|
32
|
-
params = params || {};
|
|
33
|
-
|
|
34
|
-
var targetPath = context.resolve(params.path);
|
|
35
|
-
|
|
36
|
-
if (targetPath.indexOf("/blocks") === 0)
|
|
37
|
-
{
|
|
38
|
-
// we're ok
|
|
39
|
-
}
|
|
40
|
-
else
|
|
41
|
-
{
|
|
42
|
-
targetPath = path.join("/blocks", targetPath);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return engine.handleInclude(chunk, context, bodies, params, targetPath);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
callback();
|
|
49
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @include
|
|
3
|
-
*
|
|
4
|
-
* @param app
|
|
5
|
-
* @param dust
|
|
6
|
-
* @param callback
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(app, dust, callback)
|
|
9
|
-
{
|
|
10
|
-
var engine = require("../engine")(app, dust);
|
|
11
|
-
var map = engine.map;
|
|
12
|
-
var end = engine.end;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* INCLUDE
|
|
16
|
-
*
|
|
17
|
-
* Includes another dust template into this one and passes any context forward.
|
|
18
|
-
*
|
|
19
|
-
* Syntax:
|
|
20
|
-
*
|
|
21
|
-
* {@include path="../template.html" ...args/}
|
|
22
|
-
*
|
|
23
|
-
* @param chunk
|
|
24
|
-
* @param context
|
|
25
|
-
* @param bodies
|
|
26
|
-
* @param params
|
|
27
|
-
*/
|
|
28
|
-
dust.helpers.include = function(chunk, context, bodies, params)
|
|
29
|
-
{
|
|
30
|
-
params = params || {};
|
|
31
|
-
|
|
32
|
-
var targetPath = context.resolve(params.path);
|
|
33
|
-
|
|
34
|
-
return engine.handleInclude(chunk, context, bodies, params, targetPath);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
callback();
|
|
38
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var path = require("path");
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @layout
|
|
5
|
-
*
|
|
6
|
-
* @param app
|
|
7
|
-
* @param dust
|
|
8
|
-
* @param callback
|
|
9
|
-
*/
|
|
10
|
-
module.exports = function(app, dust, callback)
|
|
11
|
-
{
|
|
12
|
-
var engine = require("../engine")(app, dust);
|
|
13
|
-
var map = engine.map;
|
|
14
|
-
var end = engine.end;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* INCLUDE LAYOUT
|
|
18
|
-
*
|
|
19
|
-
* Includes a layout dust template into this one and passes any context forward.
|
|
20
|
-
*
|
|
21
|
-
* Syntax:
|
|
22
|
-
*
|
|
23
|
-
* {@layout path="path" ...args/}
|
|
24
|
-
*
|
|
25
|
-
* @param chunk
|
|
26
|
-
* @param context
|
|
27
|
-
* @param bodies
|
|
28
|
-
* @param params
|
|
29
|
-
*/
|
|
30
|
-
dust.helpers.layout = function(chunk, context, bodies, params)
|
|
31
|
-
{
|
|
32
|
-
params = params || {};
|
|
33
|
-
|
|
34
|
-
var targetPath = context.resolve(params.path);
|
|
35
|
-
|
|
36
|
-
if (targetPath.indexOf("/layouts") === 0)
|
|
37
|
-
{
|
|
38
|
-
// we're ok
|
|
39
|
-
}
|
|
40
|
-
else
|
|
41
|
-
{
|
|
42
|
-
targetPath = path.join("/layouts", targetPath);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return engine.handleInclude(chunk, context, bodies, params, targetPath);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
callback();
|
|
49
|
-
};
|