Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy committed Dec 11, 2019
1 parent 9926f89 commit 55790a0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@
$modifier = $params->get('fullScreenMod', array()) ? implode(' + ', $params->get('fullScreenMod', array())) . ' + ' : '';
$basePath = $params->get('basePath', 'media/vendor/codemirror/');
$modePath = $params->get('modePath', 'media/vendor/codemirror/mode/%N/%N');
$modPath = ' mod-path="' . Uri::root() . $modePath . $extJS . '"';
$modPath = 'mod-path="' . Uri::root() . $modePath . $extJS . '"';
$fskeys = $params->get('fullScreenMod', array());
$fskeys[] = $params->get('fullScreen', 'F10');
$fullScreenCombo = implode('-', $fskeys);
$fsCombo = ' fs-combo=' . json_encode($fullScreenCombo);
$option = ' options=\'' . json_encode($options) . '\'';
$fsCombo = 'fs-combo=' . json_encode($fullScreenCombo);
$option = 'options=\'' . json_encode($options) . '\'';
$editor = 'editor="' . ltrim(HTMLHelper::_('script', $basePath . 'lib/codemirror' . $extJS, ['version' => 'auto', 'pathOnly' => true]), '/') . '"';
$addons = ' addons="' . ltrim(HTMLHelper::_('script', $basePath . 'lib/addons' . $extJS, ['version' => 'auto', 'pathOnly' => true]), '/') . '"';
$addons = 'addons="' . ltrim(HTMLHelper::_('script', $basePath . 'lib/addons' . $extJS, ['version' => 'auto', 'pathOnly' => true]), '/') . '"';

HTMLHelper::_('stylesheet', $basePath . 'lib/codemirror' . $extCSS, array('version' => 'auto'));
HTMLHelper::_('stylesheet', $basePath . 'lib/addons' . $extCSS, array('version' => 'auto'));
HTMLHelper::_('webcomponent', 'plg_editors_codemirror/joomla-editor-codemirror.min.js', array('version' => 'auto', 'relative' => true));

?>
<joomla-editor-codemirror <?php echo $editor, $addons, $modPath, $fsCombo, $option; ?>>
<joomla-editor-codemirror <?php echo $editor . ' ' . $addons . ' ' . $modPath . ' ' . $fsCombo . ' ' . $option; ?>>
<?php echo '<textarea name="', $name, '" id="', $id, '" cols="', $cols, '" rows="', $rows, '">', $content, '</textarea>'; ?>
</joomla-editor-codemirror>
<?php echo $displayData->buttons; ?>

0 comments on commit 55790a0

Please sign in to comment.