Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 5e4dca3

Browse files
committed
Merge branch 'dev'
2 parents 4841e7e + e810a2c commit 5e4dca3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+4535
-807
lines changed

CHANGELOG

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.
22

3+
PL-v0.7.5
4+
- ADD: a quick pattern search using typeahead
5+
- ADD: keyboard shortcuts for a bunch of features using jwerty
6+
- ADD: using cmd+a/ctrl+a when in code view selects the contents of the currently active tab
7+
- ADD: code and annotation views can be opened automatically on load via query string params
8+
- ADD: can use the config to remove items from pattern nav
9+
- ADD: check for json support now that certain flavors of PHP 5.5.3 don't come with it
10+
- ADD: can use boolean vars to enable/disable sections via pattern parameters
11+
- ADD: pattern states for tracking progress on individual patterns
12+
- FIX: updated icomoon icons
13+
- FIX: code view has tabs
14+
- FIX: code view shows mustache versions of a pattern
15+
- FIX: patterns are properly sorted in style guide and view all views
16+
- FIX: pattern lab-specific JS & CSS is only loaded when in the iframe
17+
- FIX: classlist polyfill for better IE9 support
18+
- FIX: stringified the postmessage messages for better IE9 support
19+
- FIX: make sure history is only used by browsers that support it (e.g. IE9 doesn't)
20+
- FIX: using watcher-launched auto-reload server now works on Windows
21+
- FIX: various bugs with lineage
22+
- FIX: vendored third-party JS and CSS
23+
- FIX: infinite refresh bug squashed
24+
- THX: thanks to @joshrcook for some styling fixes and hitting on the cause of the start-up issues on ubuntu
25+
- THX: thanks to @tylersticka for lots of ideas: pattern states, cmd+a, boolean pattern parameters and the feedback on the watcher
26+
- THX: thanks to @nikvm for the fix for properly sorting the styleguide view
27+
328
PL-v0.7.2
429
- FIX: proper support for Windows with the changes that happened in v0.7.0
530
- THX: thanks to @chriskevin and @MattKohnen for reporting the issue

core/builder.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
*
2828
*/
2929

30+
// check to see if json_decode exists. might be disabled in installs of PHP 5.5
31+
if (!function_exists("json_decode")) {
32+
print "Please check that your version of PHP includes the JSON extension. It's required for Pattern Lab to run. Aborting.\n";
33+
exit;
34+
}
35+
3036
// auto-load classes
3137
require(__DIR__."/lib/SplClassLoader.php");
3238

core/config/config.ini.default

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* If config.ini doesn't exist Pattern Lab will try to create a new version
44
*/
55

6-
v = "0.7.2"
6+
v = "0.7.5"
77

88
// file extensions to ignore when building or watching the source dir, separate with a comma
99
ie = "scss,DS_Store,less"
@@ -20,3 +20,9 @@ cleanPublic = "true"
2020

2121
// pattern lab's xip host if you have it configured
2222
xipHostname = "http://patternlab.*.xip.io"
23+
24+
// which, if any, controls to hide in the nav
25+
ishControlsHide = ""
26+
27+
// the order of pattern states
28+
patternStates = "inprogress,inreview,complete"

core/lib/Mustache/Loader/PatternLoader.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public function load($name)
8989
}
9090
}
9191

92-
return $this->templates[$name];
92+
return (isset($this->templates[$name])) ? $this->templates[$name] : false;
93+
9394
}
9495

9596
/**
@@ -243,8 +244,16 @@ protected function getPartialInfo($partial)
243244
*/
244245
private function findReplaceParameters($fileData, $parameters)
245246
{
246-
foreach ($parameters as $k => $v) {
247-
$fileData = preg_replace('/{{([\s]*'.$k .'[\s]*)}}/', $v, $fileData);
247+
foreach ($parameters as $k => $v) {
248+
if ($v == "true") {
249+
$fileData = preg_replace('/{{\#([\s]*'.$k .'[\s]*)}}(.*?){{\/([\s]*'.$k .'[\s]*)}}/s','$2',$fileData); // {{# asdf }}STUFF{{/ asdf}}
250+
$fileData = preg_replace('/{{\^([\s]*'.$k .'[\s]*)}}(.*?){{\/([\s]*'.$k .'[\s]*)}}/s','',$fileData); // {{^ asdf }}STUFF{{/ asdf}}
251+
} else if ($v == "false") {
252+
$fileData = preg_replace('/{{\^([\s]*'.$k .'[\s]*)}}(.*?){{\/([\s]*'.$k .'[\s]*)}}/s','$2',$fileData); // {{# asdf }}STUFF{{/ asdf}}
253+
$fileData = preg_replace('/{{\#([\s]*'.$k .'[\s]*)}}(.*?){{\/([\s]*'.$k .'[\s]*)}}/s','',$fileData); // {{^ asdf }}STUFF{{/ asdf}}
254+
} else {
255+
$fileData = preg_replace('/{{([\s]*'.$k .'[\s]*)}}/', $v, $fileData); // {{ asdf }}
256+
}
248257
}
249258
return $fileData;
250259
}

0 commit comments

Comments
 (0)