Revert "Quill plugin fix."

This reverts commit 84aa89a861.
This commit is contained in:
Hakim Zulkufli 2017-04-30 20:10:34 +08:00
parent f793a5acbd
commit a720b7ea5c
1 changed files with 14 additions and 32 deletions

View File

@ -56,7 +56,7 @@ class pluginQuill extends Plugin {
$html .= '<input name="autosave" id="jsautosave" type="checkbox" value="1" '.($this->getDbField('autosave')?'checked':'').'>'; $html .= '<input name="autosave" id="jsautosave" type="checkbox" value="1" '.($this->getDbField('autosave')?'checked':'').'>';
$html .= '<label class="forCheckbox" for="jsautosave">'.$Language->get('Autosave').'</label>'; $html .= '<label class="forCheckbox" for="jsautosave">'.$Language->get('Autosave').'</label>';
$html .= '</div>'; $html .= '</div>';
$html .= '<div>'; $html .= '<div>';
$html .= '<input type="hidden" name="spellChecker" value="0">'; $html .= '<input type="hidden" name="spellChecker" value="0">';
$html .= '<input name="spellChecker" id="jsspellChecker" type="checkbox" value="1" '.($this->getDbField('spellChecker')?'checked':'').'>'; $html .= '<input name="spellChecker" id="jsspellChecker" type="checkbox" value="1" '.($this->getDbField('spellChecker')?'checked':'').'>';
@ -72,43 +72,25 @@ class pluginQuill extends Plugin {
global $Language; global $Language;
$html = ''; $html = '';
// Load CSS and JS only on Controllers in array. if( $this->enabled() ) {
if(in_array($layout['controller'], $this->loadWhenController))
{
$html .= ' $html .= '
<script> <script>
var toolbarOptions = [ var quill = new Quill("#editor-container", {
["bold", "italic", "underline", "strike"], // toggled buttons modules: {
["blockquote", "code-block"], toolbar: [
[{ header: [1, 2, false] }],
[{ "header": 1 }, { "header": 2 }], // custom button values ["bold", "italic", "underline"],
[{ "list": "ordered"}, { "list": "bullet" }], ["image"]
[{ "script": "sub"}, { "script": "super" }], // superscript/subscript ]
[{ "indent": "-1"}, { "indent": "+1" }], // outdent/indent },
[{ "direction": "rtl" }], // text direction placeholder: "asd",
theme: "snow"
[{ "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: {
toolbar: toolbarOptions
},
placeholder: "Compose an epic...",
theme: "snow"
});
</script> </script>
'; ';
} }
return $html; return $html;
} }
} }