Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Merge pull request #35 from theonion/filtering
Browse files Browse the repository at this point in the history
Filtering
  • Loading branch information
benghaziboy committed Jul 9, 2015
2 parents da793e0 + 6dd1967 commit 2002a5c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onion-editor",
"version": "0.2.39",
"version": "0.2.40",
"homepage": "https://github.com/theonion/editor",
"authors": [
"Mike Wnuk <mwnuk@theonion.com>"
Expand Down
10 changes: 9 additions & 1 deletion build/editor-main.css
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ div[data-picture] img {
font-size: 11px;
text-transform: uppercase;
}
.toolbar.link-tools .toggle-filter {
background: rgb(200, 200, 200);
display: inline-block;
margin: 9px 5px;
}
.toolbar.link-tools .toggle-filter.active {
background: rgb(150, 150, 150);
}
.link-tools input {
padding: 8px;
margin-top: 4px;
Expand Down Expand Up @@ -355,7 +363,7 @@ body {
background-color: #ccc;
}
.toolbar button:hover.active {
display: block;
display: inline-block;
background-color: #333;
color: #f1f1f1;
}
Expand Down
12 changes: 10 additions & 2 deletions build/onion-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6752,9 +6752,10 @@ define('scribe-plugin-link-ui',[],function () {
$input = $('.link-tools input', editorEl),
placeHolder = '#replaceme';
var $results = $('.search-results', $linkTools);
var $filters = $('.filters', $linkTools);

// this provides a way to externally udpate the results element.
var searchHandler = config.searchHandler || function(term, resultsElement) { };
var searchHandler = config.searchHandler || function(term, resultsElement, filtersElement) { };

linkPromptCommand.nodeName = 'A';

Expand All @@ -6775,6 +6776,13 @@ define('scribe-plugin-link-ui',[],function () {

$('.ok', $linkTools).click(confirmInput);

$filters.click(function(e) {
var buttonElement = $(e.target).closest('button');
if (buttonElement.length === 1) {
buttonElement.toggleClass('active');
}
});

$results.click(function(e) {
var linkElement = $(e.target).closest('a');
if (linkElement.length === 1) {
Expand Down Expand Up @@ -6809,7 +6817,7 @@ define('scribe-plugin-link-ui',[],function () {
var v = $input.val();
if (isSearchTerm(v)) {
clearTimeout(searchTimeout);
searchTimeout = setTimeout(searchHandler, 200, v, $results);
searchTimeout = setTimeout(searchHandler, 200, v, $results, $filters);
$results.show();
}
else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onion-editor",
"version": "0.2.39",
"version": "0.2.40",
"author": {
"name": "Mike Wnuk",
"email": "mwnuk@theonion.com"
Expand Down
11 changes: 9 additions & 2 deletions src/less/editor/toolbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@


.toolbar button.active {
display:block;
display:inline-block;
background-color: #ddd;
}

Expand All @@ -93,7 +93,6 @@
color:#f1f1f1;
}


.toolbar .btn-label {
display:none;
}
Expand All @@ -105,7 +104,15 @@
line-height: 16px;
}

.toolbar.link-tools .toggle-filter {
background: rgb(200, 200, 200);
display: inline-block;
margin: 9px 5px;
}

.toolbar.link-tools .toggle-filter.active {
background: rgb(150, 150, 150);
}

.document-tools>.toolbar-contents {
top: 100px;
Expand Down

0 comments on commit 2002a5c

Please sign in to comment.