From 134468983f0411cb013d6adfd3cc051fe35b0439 Mon Sep 17 00:00:00 2001 From: Zimo Date: Thu, 7 Mar 2019 15:37:03 +0100 Subject: [PATCH] Added random image card placeholder illustrations no refs. - three random illustrations loop as image placeholder illustrations - increased padding of clickable area for better happy-go-clicky --- ghost/admin/app/styles/spirit/_koenig.css | 2 +- .../lib/koenig-editor/addon/components/koenig-card-image.js | 3 +++ .../addon/templates/components/koenig-card-image.hbs | 4 ++-- ghost/admin/public/assets/icons/mountains.svg | 1 + ghost/admin/public/assets/icons/summer.svg | 2 +- ghost/admin/public/assets/icons/ufo-attack.svg | 1 + 6 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 ghost/admin/public/assets/icons/mountains.svg create mode 100644 ghost/admin/public/assets/icons/ufo-attack.svg diff --git a/ghost/admin/app/styles/spirit/_koenig.css b/ghost/admin/app/styles/spirit/_koenig.css index becf037280..1409c5f76e 100644 --- a/ghost/admin/app/styles/spirit/_koenig.css +++ b/ghost/admin/app/styles/spirit/_koenig.css @@ -649,7 +649,7 @@ opacity: 1.0; } -.kg-placeholder-image-summer { +.kg-placeholder-image { width: 152px; height: 122px; } diff --git a/ghost/admin/lib/koenig-editor/addon/components/koenig-card-image.js b/ghost/admin/lib/koenig-editor/addon/components/koenig-card-image.js index 7a4596c19f..8f9e97e658 100644 --- a/ghost/admin/lib/koenig-editor/addon/components/koenig-card-image.js +++ b/ghost/admin/lib/koenig-editor/addon/components/koenig-card-image.js @@ -131,6 +131,9 @@ export default Component.extend({ didReceiveAttrs() { this._super(...arguments); + let placeholders = ['summer', 'mountains', 'ufo-attack']; + this.placeholder = placeholders[Math.floor(Math.random() * placeholders.length)]; + // `payload.files` can be set if we have an externaly set image that // should be uploaded. Typical example would be from a paste or drag/drop if (!isEmpty(this.payload.files)) { diff --git a/ghost/admin/lib/koenig-editor/addon/templates/components/koenig-card-image.hbs b/ghost/admin/lib/koenig-editor/addon/templates/components/koenig-card-image.hbs index 648cee3fb0..d50105b73b 100644 --- a/ghost/admin/lib/koenig-editor/addon/templates/components/koenig-card-image.hbs +++ b/ghost/admin/lib/koenig-editor/addon/templates/components/koenig-card-image.hbs @@ -50,8 +50,8 @@ {{else if uploader.isUploading}} {{uploader.progressBar}} {{else if (not previewSrc payload.src)}} - {{/if}} diff --git a/ghost/admin/public/assets/icons/mountains.svg b/ghost/admin/public/assets/icons/mountains.svg new file mode 100644 index 0000000000..98af5d7f08 --- /dev/null +++ b/ghost/admin/public/assets/icons/mountains.svg @@ -0,0 +1 @@ +Group 173 \ No newline at end of file diff --git a/ghost/admin/public/assets/icons/summer.svg b/ghost/admin/public/assets/icons/summer.svg index 884c467735..bbb795ff59 100644 --- a/ghost/admin/public/assets/icons/summer.svg +++ b/ghost/admin/public/assets/icons/summer.svg @@ -1 +1 @@ -Group \ No newline at end of file +Group \ No newline at end of file diff --git a/ghost/admin/public/assets/icons/ufo-attack.svg b/ghost/admin/public/assets/icons/ufo-attack.svg new file mode 100644 index 0000000000..82d0d75e76 --- /dev/null +++ b/ghost/admin/public/assets/icons/ufo-attack.svg @@ -0,0 +1 @@ +Group 129 Copy \ No newline at end of file