From: Anthony Talarico Date: Mon, 19 Feb 2018 20:44:02 +0000 (-0500) Subject: adding js check for image type for front end submission form X-Git-Tag: v1.6.77^2~7 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=77c0979be7557c210674744da325a88bee1390d7;p=WP-Plugins%2Fglm-member-db-events.git adding js check for image type for front end submission form adding js check for image type and optimal image message on the front end submission form --- diff --git a/css/front.css b/css/front.css index 13b9c13..aacd7fd 100644 --- a/css/front.css +++ b/css/front.css @@ -501,3 +501,10 @@ label.date-toggle-label{ #glmRealEmail { display: none; } +.glm-front-event-image-text{ + line-height: 1; + font-size: 14px; +} +#glm-front-event-image{ + margin: 20px 0; +} \ No newline at end of file diff --git a/views/front/events/frontAdd.html b/views/front/events/frontAdd.html index 257bdef..f60a4d7 100644 --- a/views/front/events/frontAdd.html +++ b/views/front/events/frontAdd.html @@ -256,9 +256,11 @@ {if $event.fieldFail.descr}

{$event.fieldFail.descr}

{/if} -
+
+
+ {if $event.fieldData.image}
@@ -271,11 +273,14 @@ Delete Image
{$event.fieldData.image}
+ {/if} -
New image:
+
New image:
+

Best image size to provide is between 800 and 1000 pixels wide and stored as a JPG or JPEG file. Also try to supply images that have a reasonable aspect ratio (not too tall, not too wide). Files provided like this should have a file size of 100 to 250 KB. Images will be automatically resized for use in the Web site. Images that are too large will be rejected

+
{if $memberOnly}
@@ -484,7 +489,21 @@ jQuery(document).ready(function($) { $('#' + msgArea).html('Characters remaining: ' + rem); } } - + + // check image upload type + $(".glm-event-front-end-image").change(function () { + var ext = this.value.match(/\.(.+)$/)[1]; + switch (ext) { + case 'jpg': + case 'jpeg': + case 'png': + case 'gif': + break; + default: + alert('This is not an allowed file type'); + this.value = ''; + } + }); }); {if $settings.use_venue_locations}