diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000000000..370d7f377 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,4 @@ +{ + "esversion": 8, + "asi": true +} diff --git a/Code/Module/Settings/Channel.php b/Code/Module/Settings/Channel.php index 5288a1edb..4337fed89 100644 --- a/Code/Module/Settings/Channel.php +++ b/Code/Module/Settings/Channel.php @@ -112,6 +112,9 @@ class Channel PConfig::Set(local_channel(),'system', 'set_location', $lat . ',' . $lon); } } + else { + PConfig::Set(local_channel(),'system', 'set_location', ''); + } $pageflags = $channel['channel_pageflags']; $existing_adult = (($pageflags & PAGE_ADULT) ? 1 : 0); diff --git a/view/js/main.js b/view/js/main.js index 0477c5c91..441bed20b 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1666,8 +1666,12 @@ function loadText(textRegion,data) { function addeditortext(data) { if(plaintext == 'none') { - let currentText = $("#profile-jot-text").val(); - $("#profile-jot-text").val(currentText + data); + let textarea = document.getElementById('profile-jot-text'); + if (textarea) { + textarea.value = currentText + data + let evt = new CustomEvent('input'); + textarea.dispatchEvent(evt); + } } } diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 0e81f6643..84b8b2ca9 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -183,13 +183,15 @@ let postSaveTimer = null; $("#profile-jot-text").addClass('jot-expanded'); $("#profile-jot-summary").addClass('jot-expanded'); - // let bodytextarea = document.querySelector('#profile-jot-text'); - // if (typeof bodytextarea != "undefined") { - // bodytextarea.addEventListener('input', function handlechange(event) { - // imagewatcher(event) - // }); - // } - + /* + let bodytextarea = document.querySelector('#profile-jot-text'); + if (typeof bodytextarea != "undefined") { + bodytextarea.addEventListener('input', function handlechange(event) { + imagewatcher(event) + }); + } + */ + {{if $bbco_autocomplete}} $("#profile-jot-text").bbco_autocomplete('{{$bbco_autocomplete}}'); // autocomplete bbcode $("#profile-jot-summary").bbco_autocomplete('{{$bbco_autocomplete}}'); // autocomplete bbcode @@ -217,7 +219,8 @@ let postSaveTimer = null; } function imagewatcher(event) { - console.log(event.target.value); + let imgfind = /\[[iz]mg.*?alt="(.*?)".*?](.*?)\[/.exec(event.target.value) + console.log(imgfind); } function enableOnUser(){ if(editor)