Skip to content

Commit

Permalink
2.19.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-D committed Sep 3, 2019
1 parent f4b1bb0 commit 01f7213
Show file tree
Hide file tree
Showing 32 changed files with 114 additions and 76 deletions.
2 changes: 1 addition & 1 deletion dist/plugins/colors/ui/sass/trumbowyg.colors.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.19.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.19.1 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor plugin
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/colors/ui/trumbowyg.colors.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.19.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.19.1 - A lightweight WYSIWYG editor
* Trumbowyg plugin stylesheet
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/colors/ui/trumbowyg.colors.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.19.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.19.1 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor plugin
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/emoji/ui/trumbowyg.emoji.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.19.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.19.1 - A lightweight WYSIWYG editor
* Trumbowyg plugin stylesheet
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/emoji/ui/trumbowyg.emoji.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 21 additions & 11 deletions dist/plugins/giphy/trumbowyg.giphy.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,23 @@
trumbowyg.o.plugins.giphy || {}
);

if (trumbowyg.o.plugins.giphy.apiKey === null) {
throw new Error('You must set a Giphy API Key');
}

trumbowyg.addBtnDef('giphy', {
fn: function() {
var BASE_URL = 'https://api.giphy.com/v1/gifs/search?api_key=' + trumbowyg.o.plugins.giphy.apiKey;
var DEFAULT_URL = BASE_URL.replace('/search', '/trending');
if (trumbowyg.o.plugins.giphy.apiKey === null) {
throw new Error('You must set a Giphy API Key');
}

var BASE_URL = 'https://api.giphy.com/v1/gifs/search?api_key=' + trumbowyg.o.plugins.giphy.apiKey + '&rating=' + trumbowyg.o.plugins.giphy.rating,
DEFAULT_URL = BASE_URL.replace('/search', '/trending');
var previousAjaxCall = {abort: function () {}};
var prefix = trumbowyg.o.prefix;

// Create and open the modal
var searchInput = '<input name="" class="' + trumbowyg.o.prefix + 'giphy-search" placeholder="Search a GIF" autofocus="autofocus">';
var poweredByGiphy = '<div class="' + trumbowyg.o.prefix + 'powered-by-giphy"><span>Powered by</span>' + giphyLogo + '</div>';
var giphyModalHtml = searchInput + poweredByGiphy + '<div class="' + trumbowyg.o.prefix + 'giphy-modal-scroll"><div class="' + trumbowyg.o.prefix + 'giphy-modal"></div></div>';
var searchInput = '<input name="" class="' + prefix + 'giphy-search" placeholder="Search a GIF" autofocus="autofocus">',
closeButton = '<button class="' + prefix + 'giphy-close" title="' + trumbowyg.lang.close + '"><svg><use xlink:href="' + trumbowyg.svgPath + '#' + prefix + 'close"/></svg></button>',
poweredByGiphy = '<div class="' + prefix + 'powered-by-giphy"><span>Powered by</span>' + giphyLogo + '</div>',
giphyModalHtml = searchInput + closeButton + poweredByGiphy + '<div class="' + prefix + 'giphy-modal-scroll"><div class="' + prefix + 'giphy-modal"></div></div>';

trumbowyg
.openModal(null, giphyModalHtml, false)
.one(CANCEL_EVENT, function () {
Expand All @@ -109,8 +112,10 @@

trumbowyg.closeModal();
});
var $giphyInput = $('.' + trumbowyg.o.prefix + 'giphy-search');
var $giphyModal = $('.' + trumbowyg.o.prefix + 'giphy-modal');

var $giphyInput = $('.' + trumbowyg.o.prefix + 'giphy-search'),
$giphyClose = $('.' + trumbowyg.o.prefix + 'giphy-close'),
$giphyModal = $('.' + trumbowyg.o.prefix + 'giphy-modal');

// Load trending gifs as default
$.ajax({
Expand Down Expand Up @@ -139,6 +144,11 @@
var throttledInputRequest = trumbowygThrottle(searchGifsOnInput, 300);

$giphyInput.on('input', throttledInputRequest);
$giphyInput.focus();

$giphyClose.one('click', function() {
$giphyModal.trigger(CANCEL_EVENT);
});
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/giphy/trumbowyg.giphy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 30 additions & 10 deletions dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.19.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.19.1 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor plugin
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand All @@ -13,10 +13,37 @@
transform: scale(1.22);
}

.trumbowyg-giphy-search {
display: block;
width: 80%;
margin: 5%;
padding-left: 10px;
padding-right: 150px;
}

.trumbowyg-giphy-close {
position: absolute;
top: calc(5% + 8px);
right: calc(5% - 2px);
width: 30px;
height: 30px;
background: none;
border: 1px solid transparent;

&:hover,
&:focus {
outline: none;
background: #ecf0f1;
}
&:focus {
border-color: rgba(0, 0, 0, 0.3);
}
}

.trumbowyg-powered-by-giphy {
position: absolute;
top: calc(5% + 12px);
right: calc(5% + 10px);
right: calc(15% + 10px);
pointer-events: none;
user-select: none;

Expand All @@ -29,20 +56,13 @@

svg {
width: 66px;
height: auto;
height: 15px;
vertical-align: bottom;
margin-left: 6px;
opacity: 0.45;
}
}

.trumbowyg-giphy-search {
width: 90%;
margin: 5%;
padding-left: 10px;
padding-right: 150px;
}

.trumbowyg-giphy-modal-scroll {
overflow: auto;
overflow-x: hidden;
Expand Down
33 changes: 24 additions & 9 deletions dist/plugins/giphy/ui/trumbowyg.giphy.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.19.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.19.1 - A lightweight WYSIWYG editor
* Trumbowyg plugin stylesheet
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand All @@ -12,10 +12,31 @@
.trumbowyg-giphy-button svg {
transform: scale(1.22); }

.trumbowyg-giphy-search {
display: block;
width: 80%;
margin: 5%;
padding-left: 10px;
padding-right: 150px; }

.trumbowyg-giphy-close {
position: absolute;
top: calc(5% + 8px);
right: calc(5% - 2px);
width: 30px;
height: 30px;
background: none;
border: 1px solid transparent; }
.trumbowyg-giphy-close:hover, .trumbowyg-giphy-close:focus {
outline: none;
background: #ecf0f1; }
.trumbowyg-giphy-close:focus {
border-color: rgba(0, 0, 0, 0.3); }

.trumbowyg-powered-by-giphy {
position: absolute;
top: calc(5% + 12px);
right: calc(5% + 10px);
right: calc(15% + 10px);
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
Expand All @@ -28,17 +49,11 @@
opacity: 0.6; }
.trumbowyg-powered-by-giphy svg {
width: 66px;
height: auto;
height: 15px;
vertical-align: bottom;
margin-left: 6px;
opacity: 0.45; }

.trumbowyg-giphy-search {
width: 90%;
margin: 5%;
padding-left: 10px;
padding-right: 150px; }

.trumbowyg-giphy-modal-scroll {
overflow: auto;
overflow-x: hidden;
Expand Down
Loading

0 comments on commit 01f7213

Please sign in to comment.