-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from RRZE-Webteam/dev
1.2.0
- Loading branch information
Showing
16 changed files
with
199 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array(), 'version' => 'aa4bcb2bed50fbfceca9'); | ||
<?php return array('dependencies' => array(), 'version' => '4215db89d846e18af242'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array(), 'version' => '8bbb717a528fa92d1bab'); | ||
<?php return array('dependencies' => array(), 'version' => 'e9bff0d4310710d7800b'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array(), 'version' => '8bbb717a528fa92d1bab'); | ||
<?php return array('dependencies' => array(), 'version' => 'e9bff0d4310710d7800b'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace RRZE\HelloLenny; | ||
|
||
defined('ABSPATH') || exit; | ||
|
||
class Config | ||
{ | ||
protected $pluginFile; | ||
|
||
public function __construct($pluginFile) | ||
{ | ||
$this->pluginFile = $pluginFile; | ||
} | ||
|
||
public static function getDefaultAttributes() | ||
{ | ||
return [ | ||
'css_classes' => '', | ||
'background_color' => '#ffffff', | ||
'border_color' => '#000000', | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,108 @@ | ||
(function (blocks, element) { | ||
(function (blocks, element, blockEditor, components, i18n) { | ||
var el = element.createElement; | ||
var registerBlockType = blocks.registerBlockType; | ||
var InspectorControls = blockEditor.InspectorControls; | ||
var PanelBody = components.PanelBody; | ||
var TextControl = components.TextControl; | ||
var ColorPicker = components.ColorPicker; | ||
var __ = i18n.__; | ||
|
||
registerBlockType("lenny/quote-block", { | ||
title: wp.i18n.__("Lenny Quote", "rrze-hello-lenny"), | ||
title: __("Lenny Quote", "rrze-hello-lenny"), | ||
icon: "format-quote", | ||
category: "widgets", | ||
edit: function () { | ||
return el( | ||
"blockquote", | ||
{ className: "rrze-hello-lenny shortcode", lang: "de" }, | ||
attributes: { | ||
cssClasses: { | ||
type: "string", | ||
default: "" | ||
}, | ||
backgroundColor: { | ||
type: "string", | ||
default: "#ffffff" | ||
}, | ||
borderColor: { | ||
type: "string", | ||
default: "#000000" | ||
} | ||
}, | ||
edit: function (props) { | ||
var attributes = props.attributes; | ||
var setAttributes = props.setAttributes; | ||
|
||
return [ | ||
el( | ||
"p", | ||
{}, | ||
el( | ||
"span", | ||
{ className: "wouf-ucfirst" }, | ||
wp.i18n.__("Wuff!", "rrze-hello-lenny") | ||
), | ||
" ", | ||
InspectorControls, | ||
{ key: "inspector" }, | ||
el( | ||
"span", | ||
{ className: "wouf-ucfirst wouf-uppercase" }, | ||
wp.i18n.__("Wuff!", "rrze-hello-lenny") | ||
PanelBody, | ||
{ title: __("Block Settings", "rrze-hello-lenny"), initialOpen: true }, | ||
el(TextControl, { | ||
label: __("CSS Classes", "rrze-hello-lenny"), | ||
value: attributes.cssClasses, | ||
onChange: function (newVal) { | ||
setAttributes({ cssClasses: newVal }); | ||
} | ||
}), | ||
el("div", { style: { marginBottom: "20px" } }, | ||
el(ColorPicker, { | ||
label: __("Background Color", "rrze-hello-lenny"), | ||
color: attributes.backgroundColor, | ||
onChangeComplete: function (newColor) { | ||
setAttributes({ backgroundColor: newColor.hex }); | ||
}, | ||
disableAlpha: true | ||
}) | ||
), | ||
el("div", { style: { marginBottom: "20px" } }, | ||
el(ColorPicker, { | ||
label: __("Border Color", "rrze-hello-lenny"), | ||
color: attributes.borderColor, | ||
onChangeComplete: function (newColor) { | ||
setAttributes({ borderColor: newColor.hex }); | ||
}, | ||
disableAlpha: true | ||
}) | ||
) | ||
) | ||
), | ||
el("cite", {}, "🐶 Lenny") | ||
); | ||
el( | ||
"blockquote", | ||
{ | ||
className: "rrze-hello-lenny " + attributes.cssClasses, | ||
style: { | ||
backgroundColor: attributes.backgroundColor, | ||
borderColor: attributes.borderColor, | ||
borderStyle: "solid" | ||
}, | ||
lang: "de" | ||
}, | ||
el( | ||
"p", | ||
{}, | ||
el( | ||
"span", | ||
{ className: "wouf-ucfirst" }, | ||
__("Wuff!", "rrze-hello-lenny") | ||
), | ||
" ", | ||
el( | ||
"span", | ||
{ className: "wouf-ucfirst wouf-uppercase" }, | ||
__("Wuff!", "rrze-hello-lenny") | ||
) | ||
), | ||
el("cite", {}, "🐶 Lenny") | ||
) | ||
]; | ||
}, | ||
save: function () { | ||
return null; // Rendered in PHP on the frontend | ||
}, | ||
} | ||
}); | ||
})(window.wp.blocks, window.wp.element); | ||
})( | ||
window.wp.blocks, | ||
window.wp.element, | ||
window.wp.blockEditor, | ||
window.wp.components, | ||
window.wp.i18n | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters