|
1 | 1 | /* |
2 | | - * patternlab-node - v0.10.1 - 2015 |
| 2 | + * patternlab-node - v0.11.0 - 2015 |
3 | 3 | * |
4 | 4 | * Brian Muenzenmeyer, and the web community. |
5 | 5 | * Licensed under the MIT license. |
|
31 | 31 |
|
32 | 32 | //find the boundaries of the block |
33 | 33 | var loopNumberString = liMatch.split('.')[1].split('}')[0].trim(); |
34 | | - |
35 | | - //find the boundaries of the block |
36 | 34 | var end = liMatch.replace('#', '/'); |
37 | 35 | var patternBlock = pattern.template.substring(pattern.template.indexOf(liMatch) + liMatch.length, pattern.template.indexOf(end)).trim(); |
38 | 36 |
|
|
43 | 41 | repeatedBlockTemplate.push(patternBlock); |
44 | 42 | } |
45 | 43 |
|
| 44 | + //check for a local listitems.json file |
| 45 | + var listData = JSON.parse(JSON.stringify(patternlab.listitems)); |
| 46 | + listData = pattern_assembler.merge_data(listData, pattern.patternSpecificListJson); |
| 47 | + |
46 | 48 | //iterate over each copied block, rendering its contents along with pattenlab.listitems[i] |
47 | 49 | for(var i = 0; i < repeatedBlockTemplate.length; i++){ |
48 | 50 |
|
49 | 51 | var thisBlockTemplate = repeatedBlockTemplate[i]; |
50 | 52 | var thisBlockHTML = ""; |
51 | 53 |
|
52 | | - //check for a local listitems.json file |
53 | | - // var patternSpecificListJson = {}; |
54 | | - // try { |
55 | | - // patternSpecificListJson = abspath.substr(0, abspath.lastIndexOf(".")) + "listitems.json"; |
56 | | - // currentPattern.jsonFileData = fs.readJSONSync(jsonFilename); |
57 | | - // } |
58 | | - // catch(e) { |
59 | | - // } |
60 | | - |
61 | 54 | //combine listItem data with pattern data with global data |
62 | | - var itemData = patternlab.listitems['' + items.indexOf(loopNumberString)]; //this is a property |
| 55 | + var itemData = listData['' + items.indexOf(loopNumberString)]; //this is a property like "2" |
63 | 56 | var globalData = JSON.parse(JSON.stringify(patternlab.data)); |
64 | 57 | var localData = JSON.parse(JSON.stringify(pattern.jsonFileData)); |
65 | 58 |
|
|
0 commit comments