From 4285cd5dc78f26cbcaab470215240f3300de2e66 Mon Sep 17 00:00:00 2001 From: rabuzarus Date: Sat, 21 Apr 2018 14:05:40 +0200 Subject: [PATCH 1/2] frio - fix image upload for prv messages --- view/theme/frio/js/filebrowser.js | 1 - view/theme/frio/js/modal.js | 1 + view/theme/frio/js/theme.js | 12 ++++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/view/theme/frio/js/filebrowser.js b/view/theme/frio/js/filebrowser.js index 92f1412911..270172072d 100644 --- a/view/theme/frio/js/filebrowser.js +++ b/view/theme/frio/js/filebrowser.js @@ -231,7 +231,6 @@ var FileBrowser = { $(".fbrowser .fbswitcher [data-mode=" + FileBrowser.type + "]").addClass("active"); // We need to add the AjaxUpload to the button FileBrowser.uploadButtons(); - }, // Load new content (e.g. change photo album) diff --git a/view/theme/frio/js/modal.js b/view/theme/frio/js/modal.js index 2b60049f1d..56df75d7b6 100644 --- a/view/theme/frio/js/modal.js +++ b/view/theme/frio/js/modal.js @@ -152,6 +152,7 @@ Dialog._load = function(url) { var jsbrowser = function() { FileBrowser.init(nickname, type, hash); }; + loadScript("view/js/ajaxupload.js"); loadScript("view/theme/frio/js/filebrowser.js", jsbrowser); }; diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index a8787a6eb5..859df01613 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -446,8 +446,16 @@ function justifyPhotosAjax() { $('#photo-album-contents').justifiedGallery('norewind').on('jg.complete', function(e){ justifiedGalleryActive = false; }); } +// Load a js script to the html head. function loadScript(url, callback) { - // Adding the script tag to the head as suggested before + // Check if the script is already in the html head. + var oscript = $('head script[src="' + url + '"]'); + + // Delete the old script from head. + if (oscript.length > 0) { + oscript.remove(); + } + // Adding the script tag to the head as suggested before. var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; @@ -458,7 +466,7 @@ function loadScript(url, callback) { script.onreadystatechange = callback; script.onload = callback; - // Fire the loading + // Fire the loading. head.appendChild(script); } From 54c3efccabd8e3902fa1cc799b4bb983de13c2a2 Mon Sep 17 00:00:00 2001 From: rabuzarus Date: Sat, 21 Apr 2018 14:27:57 +0200 Subject: [PATCH 2/2] frio - don't show the "insert image" button in modals (because it doesn't work at the current state) --- view/theme/frio/css/style.css | 5 ++++- view/theme/frio/templates/comment_item.tpl | 2 +- view/theme/frio/templates/event_form.tpl | 4 ++-- view/theme/frio/templates/prv_message.tpl | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index 6f2a71ca44..4295ecec62 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -2409,10 +2409,13 @@ ul li:hover .contact-wrapper .contact-action-link:hover { height: 48px; width: 48px; } - #prvmail-end { clear:both; } +#modal #prvmail-text-edit-bb .bb-img { + display: none; +} + /* photos */ .photo-album-actions { margin-bottom: 10px; diff --git a/view/theme/frio/templates/comment_item.tpl b/view/theme/frio/templates/comment_item.tpl index 8729f487f0..8d90394d58 100644 --- a/view/theme/frio/templates/comment_item.tpl +++ b/view/theme/frio/templates/comment_item.tpl @@ -33,7 +33,7 @@ {{/if}}