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

Commit 2002a5c

Browse files
author
benghaziboy
committed
Merge pull request #35 from theonion/filtering
Filtering
2 parents da793e0 + 6dd1967 commit 2002a5c

5 files changed

Lines changed: 30 additions & 7 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "onion-editor",
3-
"version": "0.2.39",
3+
"version": "0.2.40",
44
"homepage": "https://github.com/theonion/editor",
55
"authors": [
66
"Mike Wnuk <mwnuk@theonion.com>"

build/editor-main.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ div[data-picture] img {
161161
font-size: 11px;
162162
text-transform: uppercase;
163163
}
164+
.toolbar.link-tools .toggle-filter {
165+
background: rgb(200, 200, 200);
166+
display: inline-block;
167+
margin: 9px 5px;
168+
}
169+
.toolbar.link-tools .toggle-filter.active {
170+
background: rgb(150, 150, 150);
171+
}
164172
.link-tools input {
165173
padding: 8px;
166174
margin-top: 4px;
@@ -355,7 +363,7 @@ body {
355363
background-color: #ccc;
356364
}
357365
.toolbar button:hover.active {
358-
display: block;
366+
display: inline-block;
359367
background-color: #333;
360368
color: #f1f1f1;
361369
}

build/onion-editor.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6752,9 +6752,10 @@ define('scribe-plugin-link-ui',[],function () {
67526752
$input = $('.link-tools input', editorEl),
67536753
placeHolder = '#replaceme';
67546754
var $results = $('.search-results', $linkTools);
6755+
var $filters = $('.filters', $linkTools);
67556756

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

67596760
linkPromptCommand.nodeName = 'A';
67606761

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

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

6779+
$filters.click(function(e) {
6780+
var buttonElement = $(e.target).closest('button');
6781+
if (buttonElement.length === 1) {
6782+
buttonElement.toggleClass('active');
6783+
}
6784+
});
6785+
67786786
$results.click(function(e) {
67796787
var linkElement = $(e.target).closest('a');
67806788
if (linkElement.length === 1) {
@@ -6809,7 +6817,7 @@ define('scribe-plugin-link-ui',[],function () {
68096817
var v = $input.val();
68106818
if (isSearchTerm(v)) {
68116819
clearTimeout(searchTimeout);
6812-
searchTimeout = setTimeout(searchHandler, 200, v, $results);
6820+
searchTimeout = setTimeout(searchHandler, 200, v, $results, $filters);
68136821
$results.show();
68146822
}
68156823
else {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "onion-editor",
3-
"version": "0.2.39",
3+
"version": "0.2.40",
44
"author": {
55
"name": "Mike Wnuk",
66
"email": "mwnuk@theonion.com"

src/less/editor/toolbar.less

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979

8080

8181
.toolbar button.active {
82-
display:block;
82+
display:inline-block;
8383
background-color: #ddd;
8484
}
8585

@@ -93,7 +93,6 @@
9393
color:#f1f1f1;
9494
}
9595

96-
9796
.toolbar .btn-label {
9897
display:none;
9998
}
@@ -105,7 +104,15 @@
105104
line-height: 16px;
106105
}
107106

107+
.toolbar.link-tools .toggle-filter {
108+
background: rgb(200, 200, 200);
109+
display: inline-block;
110+
margin: 9px 5px;
111+
}
108112

113+
.toolbar.link-tools .toggle-filter.active {
114+
background: rgb(150, 150, 150);
115+
}
109116

110117
.document-tools>.toolbar-contents {
111118
top: 100px;

0 commit comments

Comments
 (0)