Skip to content

Commit

Permalink
v6.8 fix color picker icons that weren't showing, fix positioning of …
Browse files Browse the repository at this point in the history
…search button next to search input on first load of gutenberg block
  • Loading branch information
Lwangaman authored and Lwangaman committed Jul 10, 2020
1 parent 7040d3c commit a5263af
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 10 deletions.
4 changes: 2 additions & 2 deletions bibleget-io.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
* Plugin Name: BibleGet I/O
* Version: 6.7
* Version: 6.8
* Plugin URI: https://www.bibleget.io/
* Description: Easily insert Bible quotes from a choice of Bible versions into your articles or pages with the "Bible quote" block or with the shortcode [bibleget].
* Author: John Romano D'Orazio
Expand All @@ -28,7 +28,7 @@
*/


define("BIBLEGETPLUGINVERSION", "v6_7");
define("BIBLEGETPLUGINVERSION", "v6_8");

if (!defined('ABSPATH')) {
header('Status: 403 Forbidden');
Expand Down
50 changes: 44 additions & 6 deletions js/gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ const BGET = BibleGetGlobal.BGETConstants;
const { InspectorControls } = editor; //Block inspector wrapper
const { TextControl, SelectControl, RangeControl, ToggleControl, PanelBody, PanelRow, Button, ButtonGroup, BaseControl, ColorPicker } = components; //WordPress form inputs and server-side renderer


const colorizeIco = createElement('svg', {
'aria-hidden': 'true',
focusable: 'false',
width: '20',
height: '20',
role: 'img',
'viewBox': '0 0 22 22',
xmlns: "http://www.w3.org/2000/svg"
}, createElement('path', {
d: "M0 0h24v24H0V0z",
fill: "none"
} ), createElement('path', {
d: "M17.66 5.41l.92.92-2.69 2.69-.92-.92 2.69-2.69M17.67 3c-.26 0-.51.1-.71.29l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c.4-.4.4-1.03.01-1.42l-2.34-2.34c-.2-.19-.45-.29-.7-.29zM6.92 19L5 17.08l8.06-8.06 1.92 1.92L6.92 19z"
}) );

registerBlockType('bibleget/bible-quote', {
title: __('Bible quote', 'bibleget-io'), // Block title.
category: 'widgets',
Expand Down Expand Up @@ -1352,14 +1368,14 @@ const BGET = BibleGetGlobal.BGETConstants;
* Any change to the source ENUMS in PHP will be reflected here automatically, no manual intervention required
*/
}),
createElement(PanelBody, { title: __('Border color','bibleget-io'), initialOpen: false, icon: 'color-picker' },
createElement(PanelBody, { title: __('Border color','bibleget-io'), initialOpen: false, icon: colorizeIco },
createElement(ColorPicker, {
color: attributes.PARAGRAPHSTYLES_BORDERCOLOR,
disableAlpha: false,
onChangeComplete: changeParagraphStyleBorderColor
})
),
createElement(PanelBody, { title: __('Background color','bibleget-io'), initialOpen: false, icon: 'color-picker' },
createElement(PanelBody, { title: __('Background color','bibleget-io'), initialOpen: false, icon: colorizeIco },
createElement(ColorPicker, {
color: attributes.PARAGRAPHSTYLES_BACKGROUNDCOLOR,
disableAlpha: false,
Expand Down Expand Up @@ -1488,7 +1504,7 @@ const BGET = BibleGetGlobal.BGETConstants;
onChange: changeBibleVersionFontSizeUnit,
help: __('When set to "inherit" the font size will be according to the theme settings. When set to "em" the font size will be the above value / 10 (i.e. 12 will be 1.2em)','bibleget-io')
}),
createElement(PanelBody, { title: __('Font color','bibleget-io'), initialOpen: false, icon: 'color-picker' },
createElement(PanelBody, { title: __('Font color','bibleget-io'), initialOpen: false, icon: colorizeIco },
createElement(ColorPicker, {
color: attributes.VERSIONSTYLES_TEXTCOLOR,
disableAlpha: false,
Expand Down Expand Up @@ -1556,7 +1572,7 @@ const BGET = BibleGetGlobal.BGETConstants;
onChange: changeBookChapterFontSizeUnit,
help: __('When set to "inherit" the font size will be according to the theme settings. When set to "em" the font size will be the above value / 10 (i.e. 12 will be 1.2em)','bibleget-io')
}),
createElement(PanelBody, { title: __('Font color','bibleget-io'), initialOpen: false, icon: 'color-picker' },
createElement(PanelBody, { title: __('Font color','bibleget-io'), initialOpen: false, icon: colorizeIco },
createElement(ColorPicker, {
color: attributes.BOOKCHAPTERSTYLES_TEXTCOLOR,
disableAlpha: false,
Expand Down Expand Up @@ -1650,7 +1666,7 @@ const BGET = BibleGetGlobal.BGETConstants;
onChange: changeVerseNumberFontSizeUnit,
help: __('When set to "inherit" the font size will be according to the theme settings. When set to "em" the font size will be the above value / 10 (i.e. 12 will be 1.2em)','bibleget-io')
}),
createElement(PanelBody, { title: __('Font color','bibleget-io'), initialOpen: false, icon: 'color-picker' },
createElement(PanelBody, { title: __('Font color','bibleget-io'), initialOpen: false, icon: colorizeIco },
createElement(ColorPicker, {
color: attributes.VERSENUMBERSTYLES_TEXTCOLOR,
disableAlpha: false,
Expand Down Expand Up @@ -1718,7 +1734,7 @@ const BGET = BibleGetGlobal.BGETConstants;
onChange: changeVerseTextFontSizeUnit,
help: __('When set to "inherit" the font size will be according to the theme settings. When set to "em" the font size will be the above value / 10 (i.e. 12 will be 1.2em)','bibleget-io')
}),
createElement(PanelBody, { title: __('Font color','bibleget-io'), initialOpen: false, icon: 'color-picker' },
createElement(PanelBody, { title: __('Font color','bibleget-io'), initialOpen: false, icon: colorizeIco },
createElement(ColorPicker, {
color: attributes.VERSETEXTSTYLES_TEXTCOLOR,
disableAlpha: false,
Expand Down Expand Up @@ -1852,3 +1868,25 @@ const getInnerContent = function (tag, content) {
return result[1];
};

let searchBoxRendered = setInterval(
function(){
if( jQuery('.bibleGetSearchBtn').length > 0 ){
clearInterval(searchBoxRendered);
//if we find a bibleGetSearchBtn element
//and it's still an immediate sibling of a ".bibleGetSearch" element
//rather than it's input child, then we move it
if (jQuery('.bibleGetSearchBtn').length > 0 && jQuery('.bibleGetSearchBtn').prev().hasClass('bibleGetSearch') ){
jQuery('.bibleGetSearchBtn').insertAfter('.bibleGetSearch input');
jQuery('.bibleGetSearch input').outerHeight(jQuery('.bibleGetSearchBtn').outerHeight());
//console.log('we moved the bibleGetSearchBtn');
}
jQuery('.bibleGetSearch input').on('focus',function(){
jQuery('.bibleGetSearchBtn').css({ "border-color": "#007cba", "box-shadow": "0 0 0 1px #007cba", "outline": "2px solid transparent" });
});
jQuery('.bibleGetSearch input').on('blur', function () {
jQuery('.bibleGetSearchBtn').css({ "outline": 0, "box-shadow": "none", "border-color":"#006395" });
});
}
},
10
);
11 changes: 9 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: bible,shortcode,quote,citation,verses,bibbia,citazione,versetti,biblia,cit
Requires at least: 5.0
Tested up to: 5.4.1
Requires PHP: 5.6
Stable tag: 6.7
Stable tag: 6.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -111,8 +111,12 @@ There was recently an update to the BibleGet service endpoint which slightly cha

== Changelog ==

= 6.8 =
* Fix color picker icons that weren't showing
* Fix positioning of search button next to search input field on first load of gutenberg block

= 6.7 =
* Fix search results for Bible versions to work with the latest updates to the BibleGet search endpoint
* Fix search for Bible verses to work with the latest updates to the BibleGet search endpoint
* Add filter and order functionality to the search results window
* Add possibility of inserting Bible verses from the search results into the Gutenberg block directly from the search results window

Expand Down Expand Up @@ -320,6 +324,9 @@ There was recently an update to the BibleGet service endpoint which slightly cha

== Upgrade Notice ==

= 6.8 =
Aesthetic fixes for icons and buttons. Versions prior to 6.7 must update in order to maintain compatibility with the BibleGet search endpoint

= 6.7 =
Must update in order to maintain compatibility with the BibleGet search endpoint

Expand Down

0 comments on commit a5263af

Please sign in to comment.