Merge 743a88c29bf51fe554229ac3b14da1f6f58afb1e into dc553bae2f8c4c552d74f406e8e374a6cc7a2883

This commit is contained in:
Hakim Zulkufli 2017-04-30 11:50:44 +00:00 committed by GitHub
commit d8eebb8676
7 changed files with 82 additions and 48 deletions

View File

@ -29,13 +29,16 @@ echo '<div class="bl-publish-view uk-width-8-10">';
'placeholder'=>$L->g('Title') 'placeholder'=>$L->g('Title')
)); ));
echo '<div style="padding-top: 10px"></div>';
// Content input // Content input
HTML::formTextarea(array( // HTML::formTextarea(array(
'name'=>'content', // 'name'=>'content',
'value'=>$_Page->contentRaw(false), // 'value'=>$_Post->contentRaw(false),
'class'=>'uk-width-1-1 uk-form-large', // 'class'=>'uk-width-1-1 uk-form-large',
'placeholder'=>'' // 'placeholder'=>''
)); // ));
echo '<div id="jscontent" name="content" class="uk-width-1-1 uk-form-large" placeholder="" value="'.$_Post->contentRaw(false).'" style="margin-bottom: 10px"></div>';
// Form buttons // Form buttons
echo '<div class="uk-form-row uk-margin-bottom">'; echo '<div class="uk-form-row uk-margin-bottom">';

View File

@ -29,13 +29,16 @@ echo '<div class="bl-publish-view uk-width-8-10">';
'placeholder'=>$L->g('Title') 'placeholder'=>$L->g('Title')
)); ));
echo '<div style="padding-top: 10px"></div>';
// Content input // Content input
HTML::formTextarea(array( // HTML::formTextarea(array(
'name'=>'content', // 'name'=>'content',
'value'=>$_Post->contentRaw(false), // 'value'=>$_Post->contentRaw(false),
'class'=>'uk-width-1-1 uk-form-large', // 'class'=>'uk-width-1-1 uk-form-large',
'placeholder'=>'' // 'placeholder'=>''
)); // ));
echo '<div id="jscontent" name="content" class="uk-width-1-1 uk-form-large" placeholder="" value="'.$_Post->contentRaw(false).'" style="margin-bottom: 10px"></div>';
// Form buttons // Form buttons
echo '<div class="uk-form-row uk-margin-bottom"> echo '<div class="uk-form-row uk-margin-bottom">

View File

@ -23,13 +23,16 @@ echo '<div class="bl-publish-view uk-width-8-10">';
'placeholder'=>$L->g('Title') 'placeholder'=>$L->g('Title')
)); ));
echo '<div style="padding-top: 10px"></div>';
// Content input // Content input
HTML::formTextarea(array( // HTML::formTextarea(array(
'name'=>'content', // 'name'=>'content',
'value'=>'', // 'value'=>'',
'class'=>'uk-width-1-1 uk-form-large', // 'class'=>'uk-width-1-1 uk-form-large',
'placeholder'=>'' // 'placeholder'=>''
)); // ));
echo '<div id="jscontent" name="content" class="uk-width-1-1 uk-form-large" placeholder="" style="margin-bottom: 10px"></div>';
// Form buttons // Form buttons
echo '<div class="uk-form-row uk-margin-bottom"> echo '<div class="uk-form-row uk-margin-bottom">

View File

@ -23,13 +23,16 @@ echo '<div class="bl-publish-view uk-width-8-10">';
'placeholder'=>$L->g('Title') 'placeholder'=>$L->g('Title')
)); ));
echo '<div style="padding-top: 10px"></div>';
// Content input // Content input
HTML::formTextarea(array( // HTML::formTextarea(array(
'name'=>'content', // 'name'=>'content',
'value'=>'', // 'value'=>'',
'class'=>'uk-width-1-1 uk-form-large', // 'class'=>'uk-width-1-1 uk-form-large',
'placeholder'=>'' // 'placeholder'=>''
)); // ));
echo '<div id="jscontent" name="content" class="uk-width-1-1 uk-form-large" placeholder="" style="margin-bottom: 10px"></div>';
// Form buttons // Form buttons
echo '<div class="uk-form-row uk-margin-bottom"> echo '<div class="uk-form-row uk-margin-bottom">

View File

@ -108,6 +108,8 @@ class Image {
// *** Resample - create image canvas of x, y size // *** Resample - create image canvas of x, y size
$this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight); $this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);
imagealphablending($this->imageResized, false);
imagesavealpha($this->imageResized, true);
imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height); imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);
@ -230,6 +232,8 @@ class Image {
// *** Now crop from center to exact requested size // *** Now crop from center to exact requested size
$this->imageResized = imagecreatetruecolor($newWidth , $newHeight); $this->imageResized = imagecreatetruecolor($newWidth , $newHeight);
imagealphablending($this->imageResized, false);
imagesavealpha($this->imageResized, true);
imagecopyresampled($this->imageResized, $crop , 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight , $newWidth, $newHeight); imagecopyresampled($this->imageResized, $crop , 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight , $newWidth, $newHeight);
} }
} }

View File

@ -2,6 +2,6 @@
"plugin-data": "plugin-data":
{ {
"name": "Quill", "name": "Quill",
"description": "" "description": "Quill is a free, open source WYSIWYG editor built for the modern web. With its modular architecture and expressive API, it is completely customizable to fit any need."
} }
} }

View File

@ -72,21 +72,39 @@ class pluginQuill extends Plugin {
global $Language; global $Language;
$html = ''; $html = '';
if( $this->enabled() ) { // Load CSS and JS only on Controllers in array.
if(in_array($layout['controller'], $this->loadWhenController))
{
$html .= ' $html .= '
<script> <script>
var quill = new Quill("#editor-container", { var toolbarOptions = [
["bold", "italic", "underline", "strike"], // toggled buttons
["blockquote", "code-block"],
[{ "header": 1 }, { "header": 2 }], // custom button values
[{ "list": "ordered"}, { "list": "bullet" }],
[{ "script": "sub"}, { "script": "super" }], // superscript/subscript
[{ "indent": "-1"}, { "indent": "+1" }], // outdent/indent
[{ "direction": "rtl" }], // text direction
[{ "size": ["small", false, "large", "huge"] }], // custom dropdown
[{ "header": [1, 2, 3, 4, 5, 6, false] }],
[{ "color": [] }, { "background": [] }], // dropdown with defaults from theme
[{ "font": [] }],
[{ "align": [] }],
["clean"] // remove formatting button
];
var quill = new Quill("#jscontent", {
modules: { modules: {
toolbar: [ toolbar: toolbarOptions
[{ header: [1, 2, false] }],
["bold", "italic", "underline"],
["image"]
]
}, },
placeholder: "asd", placeholder: "Compose an epic...",
theme: "snow" theme: "snow"
}); });
</script> </script>
'; ';
} }