Skip to content

Commit

Permalink
added beta software notice to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiDittrich committed Aug 22, 2018
1 parent 56759a0 commit d3e23bc
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 6 deletions.
13 changes: 13 additions & 0 deletions css/codeblock.less
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,16 @@ div[data-type="enlighter/codeblock"] {
.enlighter-dropdownmenu{
max-height: 500px;
}

// beta software notice
.enlighter-panel-betarelease{
background-color: #edeff0;

.enlighter-panel-betarelease-text{
color: #a15b00;
}

button, .components-panel__icon{
color: #a10000 !important;
}
}
4 changes: 2 additions & 2 deletions dist/enlighterjs.gutenberg.min.css

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

34 changes: 31 additions & 3 deletions dist/enlighterjs.gutenberg.min.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! EnlighterJS Syntax Highlighter Gutenberg Plugin 0.2.0 | Mozilla Public License 2.0 | https://enlighterjs.org */
/*! EnlighterJS Syntax Highlighter Gutenberg Plugin 0.3.0 | Mozilla Public License 2.0 | https://enlighterjs.org */
var EnlighterJS_Gutenberg = (function (exports) {
'use strict';

Expand Down Expand Up @@ -172,6 +172,8 @@ var EnlighterJS_Gutenberg = (function (exports) {
setAttributes = _ref.setAttributes;


console.log(attributes);

// use standard Gutenberg PlainText View with custom styles
return wp.element.createElement(
Element.Fragment,
Expand Down Expand Up @@ -228,6 +230,32 @@ var EnlighterJS_Gutenberg = (function (exports) {
wp.element.createElement(
Editor.InspectorControls,
null,
wp.element.createElement(
Components.PanelBody,
{ title: 'BETA Version', icon: 'megaphone', className: 'enlighter-panel-betarelease' },
wp.element.createElement(
'p',
null,
'Please keep in mind that this version of Enlighter Plugin.Gutenberg is still ',
wp.element.createElement(
'strong',
null,
'BETA software'
),
' and may have some serious bugs!'
),
wp.element.createElement(
'p',
null,
'In case you found a bug, please ',
wp.element.createElement(
'a',
{ href: 'https://github.com/EnlighterJS/Plugin.Gutenberg/issues', target: '_new' },
'report it on GitHub'
),
'.'
)
),
wp.element.createElement(
Components.PanelBody,
{ title: 'Appearance', icon: 'admin-appearance' },
Expand Down Expand Up @@ -267,7 +295,7 @@ var EnlighterJS_Gutenberg = (function (exports) {
wp.element.createElement(Components.RadioControl, {
label: 'Linenumbers',
selected: attributes.linenumbers,
options: [{ label: 'Global settings', value: 'x' }, { label: 'Show', value: 'true' }, { label: 'Hide', value: 'false' }],
options: [{ label: 'Global settings', value: '' }, { label: 'Show', value: 'true' }, { label: 'Hide', value: 'false' }],
onChange: function onChange(linenumbers) {
return setAttributes({ linenumbers: linenumbers });
}
Expand Down Expand Up @@ -509,7 +537,7 @@ var EnlighterJS_Gutenberg = (function (exports) {
Blocks.registerBlockType('enlighter/codeblock', _codeblock);

// static properties
var version = '0.2.0';
var version = '0.3.0';

exports.version = version;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "enlighterjs-gutenberg",
"description": "an open source syntax highlighter written in pure javascript",
"version": "0.2.0",
"version": "0.3.0",
"homepage": "https://enlighterjs.org",
"author": {
"name": "Andi Dittrich",
Expand Down
5 changes: 5 additions & 0 deletions src/blocks/codeblock/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export default function edit({attributes, setAttributes}){
</div>

<Editor.InspectorControls>
<Components.PanelBody title="BETA Version" icon="megaphone" className="enlighter-panel-betarelease">
<p>Please keep in mind that this version of Enlighter Plugin.Gutenberg is still <strong>BETA software</strong> and may have some serious bugs!</p>
<p>In case you found a bug, please <a href="https://github.com/EnlighterJS/Plugin.Gutenberg/issues" target="_new">report it on GitHub</a>.</p>
</Components.PanelBody>

<Components.PanelBody title="Appearance" icon="admin-appearance">
<p>Override the global plugin settings of the current block.</p>
<_LanguageSelect
Expand Down

0 comments on commit d3e23bc

Please sign in to comment.