From 0b817e51e0d6108b4d1062be8d45b281fa473240 Mon Sep 17 00:00:00 2001 From: Cameron Lowe Date: Thu, 9 Jul 2015 16:19:52 -0500 Subject: [PATCH 1/2] Add filter support --- build/editor-main.css | 10 +++++++++- build/onion-editor.js | 12 ++++++++++-- src/less/editor/toolbar.less | 11 +++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/build/editor-main.css b/build/editor-main.css index 4f9d988..f704e77 100644 --- a/build/editor-main.css +++ b/build/editor-main.css @@ -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; @@ -355,7 +363,7 @@ body { background-color: #ccc; } .toolbar button:hover.active { - display: block; + display: inline-block; background-color: #333; color: #f1f1f1; } diff --git a/build/onion-editor.js b/build/onion-editor.js index 3612a26..b8ecf46 100644 --- a/build/onion-editor.js +++ b/build/onion-editor.js @@ -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'; @@ -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) { @@ -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 { diff --git a/src/less/editor/toolbar.less b/src/less/editor/toolbar.less index c69abe6..89d7db7 100644 --- a/src/less/editor/toolbar.less +++ b/src/less/editor/toolbar.less @@ -79,7 +79,7 @@ .toolbar button.active { - display:block; + display:inline-block; background-color: #ddd; } @@ -93,7 +93,6 @@ color:#f1f1f1; } - .toolbar .btn-label { display:none; } @@ -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; From 6dd19672a4bafa381888ad7142ccd966589d6677 Mon Sep 17 00:00:00 2001 From: Cameron Lowe Date: Thu, 9 Jul 2015 16:21:06 -0500 Subject: [PATCH 2/2] version 0.2.40 --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index f52c87c..4acf62b 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "onion-editor", - "version": "0.2.39", + "version": "0.2.40", "homepage": "https://github.com/theonion/editor", "authors": [ "Mike Wnuk " diff --git a/package.json b/package.json index 0dac7bb..07a651e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "onion-editor", - "version": "0.2.39", + "version": "0.2.40", "author": { "name": "Mike Wnuk", "email": "mwnuk@theonion.com"