From 5f94d230002d25cab906a27ae0705953c7d0d9d8 Mon Sep 17 00:00:00 2001 From: mightycoco Date: Mon, 25 Jun 2012 17:23:26 +0200 Subject: [PATCH] ENHANCEMENT: Ntfcatn. image embedding(trac #7438) Adding an additional warning / notification message, when author embedds an external image. --- css/AssetUploadField.css | 1 + forms/HtmlEditorField.php | 4 ++++ lang/en.yml | 1 + lang/en_GB.yml | 1 + oembed/Oembed.php | 1 + scss/AssetUploadField.scss | 7 +++++++ templates/Includes/HtmlEditorField_viewfile.ss | 14 ++++++++------ 7 files changed, 23 insertions(+), 6 deletions(-) diff --git a/css/AssetUploadField.css b/css/AssetUploadField.css index a0c7dc4a2..6bea44ff6 100644 --- a/css/AssetUploadField.css +++ b/css/AssetUploadField.css @@ -22,6 +22,7 @@ body.cms.ss-uploadfield-edit-iframe .fieldholder-small label, .composite.ss-asse .ss-assetuploadfield .ss-uploadfield-files .ss-uploadfield-item-preview { position: absolute; height: 30px; width: 40px; overflow: hidden; z-index: 1; } .ss-assetuploadfield .ss-uploadfield-files .ss-uploadfield-item-preview .no-preview { display: block; height: 100%; width: 100%; background: url("../images/icons/document.png") 2px 0px no-repeat; } .ss-assetuploadfield .ss-uploadfield-files .ss-uploadfield-item-info { position: relative; height: 30px; overflow: hidden; background-color: #5db4df; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5db4df), color-stop(8%, #5db1dd), color-stop(50%, #439bcb), color-stop(54%, #3f99cd), color-stop(96%, #207db6), color-stop(100%, #1e7cba)); background-image: -webkit-linear-gradient(top, #5db4df 0%, #5db1dd 8%, #439bcb 50%, #3f99cd 54%, #207db6 96%, #1e7cba 100%); background-image: -moz-linear-gradient(top, #5db4df 0%, #5db1dd 8%, #439bcb 50%, #3f99cd 54%, #207db6 96%, #1e7cba 100%); background-image: -o-linear-gradient(top, #5db4df 0%, #5db1dd 8%, #439bcb 50%, #3f99cd 54%, #207db6 96%, #1e7cba 100%); background-image: -ms-linear-gradient(top, #5db4df 0%, #5db1dd 8%, #439bcb 50%, #3f99cd 54%, #207db6 96%, #1e7cba 100%); background-image: linear-gradient(top, #5db4df 0%, #5db1dd 8%, #439bcb 50%, #3f99cd 54%, #207db6 96%, #1e7cba 100%); } +.ss-assetuploadfield .ss-uploadfield-files .ss-uploadfield-item .info { position: relative; padding: 7px; overflow: hidden; background-color: #FFBE66; border: 1px solid #FF9300; } .ss-assetuploadfield .ss-uploadfield-files .ui-state-error .ss-uploadfield-item-info { background-color: #c11f1d; padding-right: 130px; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #c11f1d), color-stop(4%, #bf1d1b), color-stop(8%, #b71b1c), color-stop(15%, #b61e1d), color-stop(27%, #b11d1d), color-stop(31%, #ab1d1c), color-stop(42%, #a51b1b), color-stop(46%, #9f1b19), color-stop(50%, #9f1b19), color-stop(54%, #991c1a), color-stop(58%, #971a18), color-stop(62%, #911b1b), color-stop(65%, #911b1b), color-stop(88%, #7e1816), color-stop(92%, #771919), color-stop(100%, #731817)); background-image: -webkit-linear-gradient(top, #c11f1d 0%, #bf1d1b 4%, #b71b1c 8%, #b61e1d 15%, #b11d1d 27%, #ab1d1c 31%, #a51b1b 42%, #9f1b19 46%, #9f1b19 50%, #991c1a 54%, #971a18 58%, #911b1b 62%, #911b1b 65%, #7e1816 88%, #771919 92%, #731817 100%); background-image: -moz-linear-gradient(top, #c11f1d 0%, #bf1d1b 4%, #b71b1c 8%, #b61e1d 15%, #b11d1d 27%, #ab1d1c 31%, #a51b1b 42%, #9f1b19 46%, #9f1b19 50%, #991c1a 54%, #971a18 58%, #911b1b 62%, #911b1b 65%, #7e1816 88%, #771919 92%, #731817 100%); background-image: -o-linear-gradient(top, #c11f1d 0%, #bf1d1b 4%, #b71b1c 8%, #b61e1d 15%, #b11d1d 27%, #ab1d1c 31%, #a51b1b 42%, #9f1b19 46%, #9f1b19 50%, #991c1a 54%, #971a18 58%, #911b1b 62%, #911b1b 65%, #7e1816 88%, #771919 92%, #731817 100%); background-image: -ms-linear-gradient(top, #c11f1d 0%, #bf1d1b 4%, #b71b1c 8%, #b61e1d 15%, #b11d1d 27%, #ab1d1c 31%, #a51b1b 42%, #9f1b19 46%, #9f1b19 50%, #991c1a 54%, #971a18 58%, #911b1b 62%, #911b1b 65%, #7e1816 88%, #771919 92%, #731817 100%); background-image: linear-gradient(top, #c11f1d 0%, #bf1d1b 4%, #b71b1c 8%, #b61e1d 15%, #b11d1d 27%, #ab1d1c 31%, #a51b1b 42%, #9f1b19 46%, #9f1b19 50%, #991c1a 54%, #971a18 58%, #911b1b 62%, #911b1b 65%, #7e1816 88%, #771919 92%, #731817 100%); } .ss-assetuploadfield .ss-uploadfield-files .ui-state-error .ss-uploadfield-item-info .ss-uploadfield-item-name { width: 100%; cursor: default; background: #bcb9b9; background: rgba(201, 198, 198, 0.9); } .ss-assetuploadfield .ss-uploadfield-files .ui-state-error .ss-uploadfield-item-info .ss-uploadfield-item-name .name { text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.7); } diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index d30176139..7cf12dab2 100644 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -896,6 +896,10 @@ class HtmlEditorField_Embed extends HtmlEditorField_File { public function appCategory() { return 'embed'; } + + public function getInfo() { + return $this->oembed->info; + } } class HtmlEditorField_Image extends HtmlEditorField_File { diff --git a/lang/en.yml b/lang/en.yml index 50fa74471..e3bceaf36 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -548,5 +548,6 @@ en: STARTALL: 'Start all' STARTALLINFO: 'Start all uploads' Saved: Saved + HOTLINKINFO: Info: This image will be hotlinked. Please ensure you have permissions from the original site creator to do so. Versioned: has_many_Versions: Versions diff --git a/lang/en_GB.yml b/lang/en_GB.yml index 23107e680..09b317536 100644 --- a/lang/en_GB.yml +++ b/lang/en_GB.yml @@ -513,5 +513,6 @@ en_GB: STARTALL: 'Start all' STARTALLINFO: 'Start all uploads' Saved: Saved + HOTLINKINFO: Info: This image will be hotlinked. Please ensure you have permissions from the original site creator to do so. Versioned: has_many_Versions: Versions diff --git a/oembed/Oembed.php b/oembed/Oembed.php index bdca6ac50..6ce546b1b 100644 --- a/oembed/Oembed.php +++ b/oembed/Oembed.php @@ -253,6 +253,7 @@ class Oembed_Result extends ViewableData { $data['provider_url'] = $protocoll.$host; $data['width'] = imagesx($image); $data['height'] = imagesy($image); + $data['info'] = _t('UploadField.HOTLINKINFO', 'Info: This image will be hotlinked. Please ensure you have permissions from the original site creator to do so.'); } } diff --git a/scss/AssetUploadField.scss b/scss/AssetUploadField.scss index 4c8495027..dbf402057 100644 --- a/scss/AssetUploadField.scss +++ b/scss/AssetUploadField.scss @@ -88,6 +88,13 @@ body.cms.ss-uploadfield-edit-iframe, .composite.ss-assetuploadfield .details fie padding: 0; overflow: hidden; position: relative; + .info { + position: relative; + padding: 7px; + overflow: hidden; + background-color: #FFBE66; + border: 1px solid #FF9300; + } } .ss-uploadfield-item-preview { position: absolute; diff --git a/templates/Includes/HtmlEditorField_viewfile.ss b/templates/Includes/HtmlEditorField_viewfile.ss index 6be73849b..d2ed97a8d 100644 --- a/templates/Includes/HtmlEditorField_viewfile.ss +++ b/templates/Includes/HtmlEditorField_viewfile.ss @@ -38,11 +38,13 @@ -
-
- <% loop Fields %> - $FieldHolder - <% end_loop %> -
+ <% if Info %>
$Info
<% end_if %> +
+
+ <% loop Fields %> + $FieldHolder + <% end_loop %> +
+