|
1 | 1 | /* |
2 | | - * patternlab-node - v0.14.0 - 2015 |
| 2 | + * patternlab-node - v0.15.1 - 2015 |
3 | 3 | * |
4 | 4 | * Brian Muenzenmeyer, and the web community. |
5 | 5 | * Licensed under the MIT license. |
|
19 | 19 |
|
20 | 20 | // oPattern properties |
21 | 21 |
|
22 | | - var oPattern = function(abspath, subdir, filename, data){ |
| 22 | + var oPattern = function(abspath, subdir, filename, data) { |
23 | 23 | if (config.debug) { |
24 | 24 | console.log('=== NEW OPATTERN.', '\nabsPath:', abspath, '\nsubdir:', subdir, '\nfilename:', filename, '\ndata:\n', data); |
25 | 25 | } |
|
50 | 50 |
|
51 | 51 | // oPattern methods |
52 | 52 |
|
53 | | - // render method on oPatterns; this acts as a proxy for the PatternEngine's |
54 | | - // render function |
55 | | - oPattern.prototype.render = function (data, partials) { |
56 | | - if (config.debug && this.isPseudoPattern) { |
57 | | - console.log('===', this.name + ' IS A PSEUDO-PATTERN ==='); |
| 53 | + oPattern.prototype = { |
| 54 | + |
| 55 | + // render method on oPatterns; this acts as a proxy for the PatternEngine's |
| 56 | + // render function |
| 57 | + render: function (data, partials) { |
| 58 | + if (config.debug && this.isPseudoPattern) { |
| 59 | + console.log('===', this.name + ' IS A PSEUDO-PATTERN ==='); |
| 60 | + } |
| 61 | + return this.engine.renderPattern(this.extendedTemplate, data, partials); |
| 62 | + }, |
| 63 | + |
| 64 | + // the finders all delegate to the PatternEngine, which also encapsulates all |
| 65 | + // appropriate regexes |
| 66 | + findPartials: function () { |
| 67 | + return this.engine.findPartials(this); |
| 68 | + }, |
| 69 | + |
| 70 | + findPartialsWithStyleModifiers: function () { |
| 71 | + return this.engine.findPartialsWithStyleModifiers(this); |
| 72 | + }, |
| 73 | + |
| 74 | + findPartialsWithPatternParameters: function () { |
| 75 | + return this.engine.findPartialsWithPatternParameters(this); |
| 76 | + }, |
| 77 | + |
| 78 | + findListItems: function () { |
| 79 | + return this.engine.findListItems(this); |
| 80 | + }, |
| 81 | + |
| 82 | + getPartialKey: function (partialString) { |
| 83 | + return this.engine.getPartialKey(this, partialString); |
58 | 84 | } |
59 | | - return this.engine.renderPattern(this.extendedTemplate, data, partials); |
60 | | - }; |
61 | | - // the finders all delegate to the PatternEngine, which also encapsulates all |
62 | | - // appropriate regexes |
63 | | - oPattern.prototype.findPartials = function () { |
64 | | - return this.engine.findPartials(this); |
65 | | - }; |
66 | | - oPattern.prototype.findPartialsWithStyleModifiers = function () { |
67 | | - return this.engine.findPartialsWithStyleModifiers(this); |
68 | | - }; |
69 | | - oPattern.prototype.findPartialsWithPatternParameters = function () { |
70 | | - return this.engine.findPartialsWithPatternParameters(this); |
71 | | - }; |
72 | | - oPattern.prototype.findListItems = function () { |
73 | | - return this.engine.findListItems(this); |
74 | 85 | }; |
75 | 86 |
|
76 | 87 | // oPattern static methods |
|
0 commit comments