From b07c6ffabee638f5c1d91ce57eb3d975d1836bd0 Mon Sep 17 00:00:00 2001 From: otrok7 <50595291+otrok7@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:40:33 +0100 Subject: [PATCH] bug fixes --- crouton.php | 3 +-- croutonjs/src/js/crouton-core.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crouton.php b/crouton.php index f653c27..c1c37c6 100644 --- a/crouton.php +++ b/crouton.php @@ -253,7 +253,6 @@ public function enqueueBackendFiles($hook) public function enqueueFrontendFiles() { if ($this->hasShortcode()) { - $jsfilename = (isset($_GET['croutonjsdebug']) ? "crouton-core.js" : ""); wp_enqueue_style("croutoncss", plugin_dir_url(__FILE__) . "croutonjs/dist/crouton-core.min.css", false, filemtime(plugin_dir_path(__FILE__) . "croutonjs/dist/crouton-core.min.css"), false); if (isset($_GET['croutonjsdebug'])) { wp_enqueue_script("croutonnocorejs", plugin_dir_url(__FILE__) . "croutonjs/dist/crouton-nocore.js", array('jquery'), filemtime(plugin_dir_path(__FILE__) . "croutonjs/dist/crouton-nocore.js"), true); @@ -371,7 +370,7 @@ public function meetingMap($atts, $content = null) private function getMapInitialization($mapConfig) { $className = $this->meetingMapController->className(); - if ($this->hasMap) { + if ($this->hasMap || $this->options['show_map']) { return "window.croutonMap = new $className($mapConfig);"; } return ""; diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js index fff0adb..e193690 100644 --- a/croutonjs/src/js/crouton-core.js +++ b/croutonjs/src/js/crouton-core.js @@ -651,7 +651,7 @@ function Crouton(config) { var formats = meetingData[m]['formats'].split(","); var formats_expanded = []; - let formatRootServer = self.formatsData.filter((f)=>f['root_server_id'] == meetingData[m]['root_server_id']); + let formatRootServer = self.formatsData.filter((f)=>f['root_server_uri'] == meetingData[m]['root_server_uri']); for (var f = 0; f < formats.length; f++) { for (var g = 0; g < formatRootServer.length; g++) { if (formats[f] === formatRootServer[g]['key_string']) { @@ -1180,7 +1180,7 @@ Crouton.prototype.render = function(doMeetingMap = false) { {placeholder: self.localization.getWord('languages'), pointer: 'Formats', elementId: "filter-dropdown-languages", uniqueData: (meetings) => getUniqueFormatsOfType(meetings, 'LANG').filter((f)=>f.key!==self.config.native_lang), objectPointer: (f) => convertToPunyCode(f.name), optionName: (f)=>f.name}); - if (self.config.has_languages) self.dropdownData.push( + if (self.config.has_common_needs) self.dropdownData.push( {placeholder: self.localization.getWord('common_needs'), pointer: 'Formats', elementId: "filter-dropdown-commonneeds", uniqueData: (meetings) => getUniqueFormatsOfType(meetings, 'FC3'), objectPointer: (f) => convertToPunyCode(f.name), optionName: (f)=>f.name});