Skip to content

Commit

Permalink
[K6.3] Follow setting of localstorage in template to retrieve data
Browse files Browse the repository at this point in the history
  • Loading branch information
xillibit committed Jan 6, 2025
1 parent 6d34a5c commit 413bc97
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
14 changes: 8 additions & 6 deletions src/site/template/aurelia/assets/js/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,14 @@ function dataFeed(opts, callback) {

},
mode: function (evt) {
const cat = localStorage.getItem('copyKunenaeditor');

if (cat) {
evt.editor.setData(cat);
localStorage.removeItem('copyKunenaeditor');
}
if (Joomla.getOptions('com_kunena.localstorage')) {
const cat = localStorage.getItem('copyKunenaeditor');

if (cat) {
evt.editor.setData(cat);
localStorage.removeItem('copyKunenaeditor');
}
}

evt.editor.getCommand('polls').disable();
}
Expand Down
12 changes: 7 additions & 5 deletions src/site/template/aurelia/assets/js/sceditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,11 +737,13 @@ jQuery(document).ready(function ($) {
{
$('#form_submit_button').removeAttr("disabled");
} else {
const cat = localStorage.getItem('copyKunenaeditor');

if (cat) {
sceditor.instance(textarea).val(cat);
localStorage.removeItem('copyKunenaeditor');
if (Joomla.getOptions('com_kunena.localstorage')) {
const cat = localStorage.getItem('copyKunenaeditor');

if (cat) {
sceditor.instance(textarea).val(cat);
localStorage.removeItem('copyKunenaeditor');
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
$this->doc->addScriptOptions('com_kunena.ckeditor_buttons_configuration', $this->template->params->get('editorButtons'));
$this->doc->addScriptOptions('com_kunena.ckeditor_subfolder', Uri::root(true));
$this->doc->addScriptOptions('com_kunena.ckeditor_skiname', $this->template->params->get('nameskinckeditor'));
$this->doc->addScriptOptions('com_kunena.localstorage', $this->template->params->get('localstorage'));

$user = Factory::getApplication()->getIdentity();
$userLanguage = $user->getParam('language', 'default');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

$topictemplate = !$this->config->pickup_category;
$this->doc->addScriptOptions('com_kunena.ckeditor_emoticons', json_encode(KunenaParser::getEmoticons(0, 1, 0)));
$this->doc->addScriptOptions('com_kunena.localstorage', $this->template->params->get('localstorage'));
?>
<script>
function localstorage() {
Expand Down

0 comments on commit 413bc97

Please sign in to comment.