Skip to content

Commit

Permalink
Fixed highlight regex. Optimization on the directory search class.
Browse files Browse the repository at this point in the history
  • Loading branch information
exygyscott committed Mar 21, 2014
1 parent 22c0d7d commit 29bfb01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion theme/js/typeahead.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@
if (!o.node || !o.pattern) {
return;
}
o.pattern = _.isArray(o.pattern) ? o.pattern : o.pattern.replace(/^\s+|\s+$/, '').split(' ');
o.pattern = _.isArray(o.pattern) ? o.pattern : o.pattern.replace(/(^\s+|\s+$|(\s)\s+)/g, '$2').split(' ');
regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly);
traverse(o.node, hightlightTextNode);
function hightlightTextNode(textNode) {
Expand Down
3 changes: 2 additions & 1 deletion theme/lib/directory_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ function get_directories($path, $depth) {

foreach ($di as $fileinfo) {
if ($fileinfo->isDir() && !$fileinfo->isDot() && strpos($fileinfo->getFilename(), '.') === false) {

$relative_path = preg_replace('~^' . preg_quote($this->root) . '[\/\\\]?~', '', $fileinfo->getPathName());

$relative_path = str_replace($this->root . DIRECTORY_SEPARATOR, '', $fileinfo->getPathName());

$dirs[] = str_replace('\\', '/', $relative_path) . '/';

if ($depth) {
Expand Down

0 comments on commit 29bfb01

Please sign in to comment.