Version Description
- Added: Metadata - Image Alt Text Helpful Tip
- Fix: Metadata - wp_editor too large for smaller screen resolutions
Download this release
Release Info
Developer | n7studios |
Plugin | Photo Gallery by Envira – Responsive Image Gallery for WordPress |
Version | 1.1.4 |
Comparing to | |
See all releases |
Code changes from version 1.1.5 to 1.1.4
- assets/js/metabox.js +26 -39
- assets/js/min/metabox-min.js +1 -1
- envira-gallery-lite.php +2 -2
- includes/admin/metaboxes.php +1 -1
- includes/global/shortcode.php +20 -3
- readme.txt +0 -4
assets/js/metabox.js
CHANGED
@@ -291,49 +291,36 @@
|
|
291 |
);
|
292 |
});
|
293 |
|
294 |
-
// Open up the media modal area for modifying gallery metadata
|
295 |
-
$('#envira-gallery').on('click', '.envira-gallery-modify-image', function(e){
|
296 |
e.preventDefault();
|
297 |
var attach_id = $(this).parent().data('envira-gallery-image'),
|
298 |
formfield = 'envira-gallery-meta-' + attach_id;
|
299 |
-
|
300 |
-
// Open modal
|
301 |
-
openModal(attach_id, formfield);
|
302 |
-
});
|
303 |
-
|
304 |
-
// Open modal
|
305 |
-
var modal;
|
306 |
-
var openModal = function(attach_id, formfield) {
|
307 |
-
|
308 |
// Show the modal.
|
309 |
-
|
310 |
-
$(
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
// Close modal
|
334 |
-
$('#' + formfield).appendTo('#' + attach_id).hide();
|
335 |
-
}
|
336 |
-
|
337 |
// Save the gallery metadata.
|
338 |
$(document).on('click', '.envira-gallery-meta-submit', function(e){
|
339 |
e.preventDefault();
|
291 |
);
|
292 |
});
|
293 |
|
294 |
+
// Open up the media modal area for modifying gallery metadata.
|
295 |
+
$('#envira-gallery').on('click.enviraModify', '.envira-gallery-modify-image', function(e){
|
296 |
e.preventDefault();
|
297 |
var attach_id = $(this).parent().data('envira-gallery-image'),
|
298 |
formfield = 'envira-gallery-meta-' + attach_id;
|
299 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
// Show the modal.
|
301 |
+
envira_main_frame = true;
|
302 |
+
$('#' + formfield).appendTo('body').show();
|
303 |
+
|
304 |
+
// Close the modal window on user action
|
305 |
+
var append_and_hide = function(e){
|
306 |
+
e.preventDefault();
|
307 |
+
$('#' + formfield).appendTo('#' + attach_id).hide();
|
308 |
+
envira_main_frame = false;
|
309 |
+
$(document).off('click.enviraLink');
|
310 |
+
};
|
311 |
+
$(document).on('click.enviraIframe', '.media-modal-close, .media-modal-backdrop', append_and_hide);
|
312 |
+
$(document).on('keydown.enviraIframe', function(e){
|
313 |
+
if ( 27 == e.keyCode && envira_main_frame ) {
|
314 |
+
append_and_hide(e);
|
315 |
+
}
|
316 |
+
});
|
317 |
+
$(document).on('click.enviraLink', '.ed_button', function(){
|
318 |
+
// Set custom z-index for link dialog box.
|
319 |
+
$('#wp-link-backdrop').css('zIndex', '170100');
|
320 |
+
$('#wp-link-wrap').css('zIndex', '171005' );
|
321 |
+
});
|
322 |
+
});
|
323 |
+
|
|
|
|
|
|
|
|
|
|
|
324 |
// Save the gallery metadata.
|
325 |
$(document).on('click', '.envira-gallery-meta-submit', function(e){
|
326 |
e.preventDefault();
|
assets/js/min/metabox-min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function($){$(function(){function e(){var e={action:"envira_gallery_refresh",post_id:envira_gallery_metabox.id,nonce:envira_gallery_metabox.refresh_nonce};$(".envira-media-library").after('<span class="spinner envira-gallery-spinner envira-gallery-spinner-refresh"></span>'),$(".envira-gallery-spinner-refresh").css({display:"inline-block","margin-top":"-3px"}),$.post(envira_gallery_metabox.ajax,e,function(e){e&&e.success&&($("#envira-gallery-output").html(e.success),$("#envira-gallery-output").find(".wp-editor-wrap").each(function(e,a){var r=$(a).find(".quicktags-toolbar");if(!(r.length>0)){var i=$(a).attr("id").split("-"),n=i.slice(4,-1).join("-");quicktags({id:"envira-gallery-caption-"+n,buttons:"strong,em,link,ul,ol,li,close"}),QTags._buttonsInit()}}),$("#envira-gallery-output").trigger({type:"enviraRefreshed",html:e.success,id:envira_gallery_metabox.id})),$(".envira-gallery-spinner-refresh").fadeOut(300,function(){$(this).remove()})},"json")}function a(){var e=$("#envira-config-crop"),a=$("#envira-config-mobile"),r=$("#envira-config-lightbox-toolbar");e.is(":checked")&&$("#envira-config-crop-size-box").fadeIn(300),e.on("change",function(){$(this).is(":checked")?$("#envira-config-crop-size-box").fadeIn(300):$("#envira-config-crop-size-box").fadeOut(300)}),a.is(":checked")&&$("#envira-config-mobile-size-box").fadeIn(300),a.on("change",function(){$(this).is(":checked")?$("#envira-config-mobile-size-box").fadeIn(300):$("#envira-config-mobile-size-box").fadeOut(300)}),r.is(":checked")&&$("#envira-config-lightbox-toolbar-position-box").fadeIn(300),r.on("change",function(){$(this).is(":checked")?$("#envira-config-lightbox-toolbar-position-box").fadeIn(300):$("#envira-config-lightbox-toolbar-position-box").fadeOut(300)})}function r(){$("#envira-gallery .drag-drop-inside").append('<div class="envira-progress-bar"><div></div></div>'),d=new plupload.Uploader(envira_gallery_metabox.plupload);var e=$("#envira-gallery .envira-progress-bar"),a=$("#envira-gallery .envira-progress-bar div"),r=$("#envira-gallery-output");d&&($("#envira-gallery .max-upload-size").append(' <a class="envira-media-library button button-primary" href="#" title="'+envira_gallery_metabox.gallery+'" style="vertical-align: baseline;">'+envira_gallery_metabox.gallery+"</a>"),d.bind("Init",function(e){var a=$("#envira-gallery-plupload-upload-ui");e.features.dragdrop&&!$(document.body).hasClass("mobile")?(a.addClass("drag-drop"),$("#envira-gallery-drag-drop-area").bind("dragover.wp-uploader",function(){a.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){a.removeClass("drag-over")})):(a.removeClass("drag-drop"),$("#envira-gallery-drag-drop-area").unbind(".wp-uploader")),"html4"==e.runtime&&$(".upload-flash-bypass").hide()}),d.init(),d.bind("FilesAdded",function(a,r){var n=104857600,l=parseInt(a.settings.max_file_size,10);$("#envira-gallery-upload-error").html(""),$(e).show().css("display","block"),plupload.each(r,function(e){l>n&&e.size>n&&"html5"!=a.runtime&&i(a,e,!0)}),a.refresh(),a.start()}),d.bind("UploadProgress",function(e,r){$(a).css("width",e.total.percent+"%")}),d.bind("FileUploaded",function(e,a,i){$.post(envira_gallery_metabox.ajax,{action:"envira_gallery_load_image",nonce:envira_gallery_metabox.load_image,id:i.response,post_id:envira_gallery_metabox.id},function(e){$(r).append(e),$(e).find(".wp-editor-container").each(function(e,a){var r=$(a).attr("id").split("-")[4];quicktags({id:"envira-gallery-caption-"+r,buttons:"strong,em,link,ul,ol,li,close"}),QTags._buttonsInit()})},"json")}),d.bind("UploadComplete",function(){$(e).hide().css("display","none"),$(a).removeAttr("style")}),d.bind("Error",function(e,a){var r=104857600,n=$("#envira-gallery-upload-error"),l;switch(a){case plupload.FAILED:case plupload.FILE_EXTENSION_ERROR:n.html('<p class="error">'+pluploadL10n.upload_failed+"</p>");break;case plupload.FILE_SIZE_ERROR:i(e,a.file);break;case plupload.IMAGE_FORMAT_ERROR:wpFileError(fileObj,pluploadL10n.not_an_image);break;case plupload.IMAGE_MEMORY_ERROR:wpFileError(fileObj,pluploadL10n.image_memory_exceeded);break;case plupload.IMAGE_DIMENSIONS_ERROR:wpFileError(fileObj,pluploadL10n.image_dimensions_exceeded);break;case plupload.GENERIC_ERROR:wpQueueError(pluploadL10n.upload_failed);break;case plupload.IO_ERROR:l=parseInt(uploader.settings.max_file_size,10),l>r&&fileObj.size>r?wpFileError(fileObj,pluploadL10n.big_upload_failed.replace("%1$s",'<a class="uploader-html" href="#">').replace("%2$s","</a>")):wpQueueError(pluploadL10n.io_error);break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:$(".media-upload-form").addClass("html-uploader");break;case plupload.SECURITY_ERROR:wpQueueError(pluploadL10n.security_error);break;default:wpFileError(fileObj,pluploadL10n.default_error)}e.refresh()}))}function i(e,a,r){var i;i=r?pluploadL10n.big_upload_queued.replace("%s",a.name)+" "+pluploadL10n.big_upload_failed.replace("%1$s",'<a class="uploader-html" href="#">').replace("%2$s","</a>"):pluploadL10n.file_exceeds_size_limit.replace("%s",a.name),$("#envira-gallery-upload-error").html('<p class="error">'+i+"</p>"),e.removeFile(a)}var n=$("#envira-tabs"),l=$("#envira-tabs-nav"),t=window.location.hash,o=window.location.hash.replace("!","");if(t&&t.indexOf("envira-tab-")>=0){$(".envira-active").removeClass("envira-active"),l.find('li a[href="'+o+'"]').parent().addClass("envira-active"),n.find(o).addClass("envira-active").show();var s=$("#post").attr("action");s&&(s=s.split("#")[0],$("#post").attr("action",s+t))}$(document).on("click","#envira-tabs-nav li a",function(e){e.preventDefault();var a=$(this);if(!a.parent().hasClass("envira-active")){window.location.hash=t=this.hash.split("#").join("#!");var r=l.find(".envira-active").removeClass("envira-active").find("a").attr("href");a.parent().addClass("envira-active"),n.find(r).removeClass("envira-active").hide(),n.find(a.attr("href")).addClass("envira-active").show();var i=$("#post").attr("action");i&&(i=i.split("#")[0],$("#post").attr("action",i+t))}});var d;r(),a(),0!==$(".envira-helper-needed").length&&$('<div class="envira-meta-helper-overlay" />').prependTo("#envira-gallery"),$(document).on("click",".envira-meta-icon",function(e){e.preventDefault();var a=$(this),r=a.parent(),i=a.next();i.is(":visible")?($(".envira-meta-helper-overlay").remove(),r.removeClass("envira-helper-active")):(0===$(".envira-meta-helper-overlay").length&&$('<div class="envira-meta-helper-overlay" />').prependTo("#envira-gallery"),r.addClass("envira-helper-active"))}),$(document).on("click",".envira-media-library",function(e){e.preventDefault(),m=!0,$("#envira-gallery-upload-ui").appendTo("body").show()}),$(".envira-gallery-gallery").on("click",".thumbnail, .check, .media-modal-icon",function(e){e.preventDefault(),$(this).parent().parent().hasClass("envira-gallery-in-gallery")||($(this).parent().parent().hasClass("selected")?$(this).parent().parent().removeClass("details selected"):$(this).parent().parent().addClass("details selected"))}),$(".envira-gallery-load-library").on("click",function(e){e.preventDefault();var a=$(this);a.next().css({display:"inline-block","margin-top":"14px","margin-left":"-5px"});var r={action:"envira_gallery_load_library",offset:parseInt(a.attr("data-envira-gallery-offset")),post_id:envira_gallery_metabox.id,nonce:envira_gallery_metabox.load_gallery};$.post(envira_gallery_metabox.ajax,r,function(e){a.attr("data-envira-gallery-offset",parseInt(a.attr("data-envira-gallery-offset"))+20),e&&e.html&&a.hasClass("has-search")?($(".envira-gallery-gallery").html(e.html),a.removeClass("has-search")):$(".envira-gallery-gallery").append(e.html),a.next().hide()},"json")}),$(document).on("keyup keydown","#envira-gallery-gallery-search",function(){var e=$(this);e.prev().css({display:"inline-block","margin-top":"1px","vertical-align":"middle","margin-right":"4px"});var a=$(this).val(),r={action:"envira_gallery_library_search",nonce:envira_gallery_metabox.library_search,post_id:envira_gallery_metabox.id,search:a};g(function(){$.post(envira_gallery_metabox.ajax,r,function(a){$(".envira-load-library").addClass("has-search").attr("data-envira-offset",parseInt(0)),a&&$(".envira-gallery-gallery").html(a.html),e.prev().hide()},"json")},"500")}),$(document).on("click",".envira-gallery-media-insert",function(e){e.preventDefault();var a=$(this),r=$(this).text(),i={action:"envira_gallery_insert_images",nonce:envira_gallery_metabox.insert_nonce,post_id:envira_gallery_metabox.id,images:{}},n=!1,l=e;a.text(envira_gallery_metabox.inserting),$(".envira-gallery-media-frame").find(".attachment.selected:not(.envira-gallery-in-gallery)").each(function(e,a){i.images[e]=$(a).attr("data-attachment-id"),n=!0}),$.post(envira_gallery_metabox.ajax,i,function(e){setTimeout(function(){f(l),a.text(r),n&&$(".envira-gallery-load-library").attr("data-envira-gallery-offset",0).addClass("has-search").trigger("click")},500)},"json")});var c=$("#envira-gallery-output");c.sortable({containment:"#envira-gallery-output",items:"li",cursor:"move",forcePlaceholderSize:!0,placeholder:"dropzone",update:function(e,a){var r={url:envira_gallery_metabox.ajax,type:"post",async:!0,cache:!1,dataType:"json",data:{action:"envira_gallery_sort_images",order:c.sortable("toArray").toString(),post_id:envira_gallery_metabox.id,nonce:envira_gallery_metabox.sort},success:function(e){},error:function(e,a,r){}};$.ajax(r)}}),$("#envira-gallery").on("click",".envira-gallery-remove-image",function(e){e.preventDefault();var a=confirm(envira_gallery_metabox.remove);if(a){var r=$(this).parent().attr("id"),i={action:"envira_gallery_remove_image",attachment_id:r,post_id:envira_gallery_metabox.id,nonce:envira_gallery_metabox.remove_nonce};$.post(envira_gallery_metabox.ajax,i,function(e){$("#"+r).fadeOut("normal",function(){$(this).remove(),$(".envira-gallery-load-library").attr("data-envira-gallery-offset",0).addClass("has-search").trigger("click")})},"json")}}),$("#envira-gallery").on("click",".envira-gallery-modify-image",function(e){e.preventDefault();var a=$(this).parent().data("envira-gallery-image"),r="envira-gallery-meta-"+a;v(a,r)});var p,v=function(e,a){p=$("#"+a).appendTo("body"),$(p).show(),$(document).on("click",".media-modal-close, .media-modal-backdrop",function(e){e.preventDefault(),u()}),$(document).on("keydown",function(e){27==e.keyCode&&u()})},u=function(){var e=$(p).attr("id"),a=e.split("-"),r=a[a.length-1];$("#"+e).appendTo("#"+r).hide()};$(document).on("click",".envira-gallery-meta-submit",function(e){e.preventDefault();var a=$(this),r=a.text(),i=a.data("envira-gallery-item"),n="envira-gallery-meta-"+i,l={};a.text(envira_gallery_metabox.saving),l.title=$("#envira-gallery-meta-table-"+i).find('textarea[name="_envira_gallery[meta_title]"]').val(),$("#envira-gallery-meta-table-"+i).find(":input").not(".ed_button").each(function(e,a){$(this).data("envira-meta")&&(l[$(this).data("envira-meta")]=$(this).val())});var t={action:"envira_gallery_save_meta",nonce:envira_gallery_metabox.save_nonce,attach_id:i,post_id:envira_gallery_metabox.id,meta:l};$.post(envira_gallery_metabox.ajax,t,function(e){setTimeout(function(){$("#"+n).appendTo("#"+i).hide(),a.text(r)},500)},"json")}),$("#envira-gallery-import-submit").on("click",function(e){$(this).next().css("display","inline-block"),0===$("#envira-config-import-gallery").val().length&&(e.preventDefault(),$(this).next().hide(),alert(envira_gallery_metabox["import"]))});var g=function(){var e=0;return function(a,r){clearTimeout(e),e=setTimeout(a,r)}}(),m=!1,f=function(a){a.preventDefault(),$("#envira-gallery-upload-ui").appendTo("#envira-gallery-upload-ui-wrapper").hide(),e(),m=!1};$(document).on("click","#envira-gallery-upload-ui .media-modal-close, #envira-gallery-upload-ui .media-modal-backdrop",f),$(document).on("keydown",function(e){27==e.keyCode&&m&&f(e)})})}(jQuery);
|
1 |
+
!function($){$(function(){function e(){var e={action:"envira_gallery_refresh",post_id:envira_gallery_metabox.id,nonce:envira_gallery_metabox.refresh_nonce};$(".envira-media-library").after('<span class="spinner envira-gallery-spinner envira-gallery-spinner-refresh"></span>'),$(".envira-gallery-spinner-refresh").css({display:"inline-block","margin-top":"-3px"}),$.post(envira_gallery_metabox.ajax,e,function(e){e&&e.success&&($("#envira-gallery-output").html(e.success),$("#envira-gallery-output").find(".wp-editor-wrap").each(function(e,a){var r=$(a).find(".quicktags-toolbar");if(!(r.length>0)){var i=$(a).attr("id").split("-"),n=i.slice(4,-1).join("-");quicktags({id:"envira-gallery-caption-"+n,buttons:"strong,em,link,ul,ol,li,close"}),QTags._buttonsInit()}}),$("#envira-gallery-output").trigger({type:"enviraRefreshed",html:e.success,id:envira_gallery_metabox.id})),$(".envira-gallery-spinner-refresh").fadeOut(300,function(){$(this).remove()})},"json")}function a(){var e=$("#envira-config-crop"),a=$("#envira-config-mobile"),r=$("#envira-config-lightbox-toolbar");e.is(":checked")&&$("#envira-config-crop-size-box").fadeIn(300),e.on("change",function(){$(this).is(":checked")?$("#envira-config-crop-size-box").fadeIn(300):$("#envira-config-crop-size-box").fadeOut(300)}),a.is(":checked")&&$("#envira-config-mobile-size-box").fadeIn(300),a.on("change",function(){$(this).is(":checked")?$("#envira-config-mobile-size-box").fadeIn(300):$("#envira-config-mobile-size-box").fadeOut(300)}),r.is(":checked")&&$("#envira-config-lightbox-toolbar-position-box").fadeIn(300),r.on("change",function(){$(this).is(":checked")?$("#envira-config-lightbox-toolbar-position-box").fadeIn(300):$("#envira-config-lightbox-toolbar-position-box").fadeOut(300)})}function r(){$("#envira-gallery .drag-drop-inside").append('<div class="envira-progress-bar"><div></div></div>'),d=new plupload.Uploader(envira_gallery_metabox.plupload);var e=$("#envira-gallery .envira-progress-bar"),a=$("#envira-gallery .envira-progress-bar div"),r=$("#envira-gallery-output");d&&($("#envira-gallery .max-upload-size").append(' <a class="envira-media-library button button-primary" href="#" title="'+envira_gallery_metabox.gallery+'" style="vertical-align: baseline;">'+envira_gallery_metabox.gallery+"</a>"),d.bind("Init",function(e){var a=$("#envira-gallery-plupload-upload-ui");e.features.dragdrop&&!$(document.body).hasClass("mobile")?(a.addClass("drag-drop"),$("#envira-gallery-drag-drop-area").bind("dragover.wp-uploader",function(){a.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){a.removeClass("drag-over")})):(a.removeClass("drag-drop"),$("#envira-gallery-drag-drop-area").unbind(".wp-uploader")),"html4"==e.runtime&&$(".upload-flash-bypass").hide()}),d.init(),d.bind("FilesAdded",function(a,r){var n=104857600,l=parseInt(a.settings.max_file_size,10);$("#envira-gallery-upload-error").html(""),$(e).show().css("display","block"),plupload.each(r,function(e){l>n&&e.size>n&&"html5"!=a.runtime&&i(a,e,!0)}),a.refresh(),a.start()}),d.bind("UploadProgress",function(e,r){$(a).css("width",e.total.percent+"%")}),d.bind("FileUploaded",function(e,a,i){$.post(envira_gallery_metabox.ajax,{action:"envira_gallery_load_image",nonce:envira_gallery_metabox.load_image,id:i.response,post_id:envira_gallery_metabox.id},function(e){$(r).append(e),$(e).find(".wp-editor-container").each(function(e,a){var r=$(a).attr("id").split("-")[4];quicktags({id:"envira-gallery-caption-"+r,buttons:"strong,em,link,ul,ol,li,close"}),QTags._buttonsInit()})},"json")}),d.bind("UploadComplete",function(){$(e).hide().css("display","none"),$(a).removeAttr("style")}),d.bind("Error",function(e,a){var r=104857600,n=$("#envira-gallery-upload-error"),l;switch(a){case plupload.FAILED:case plupload.FILE_EXTENSION_ERROR:n.html('<p class="error">'+pluploadL10n.upload_failed+"</p>");break;case plupload.FILE_SIZE_ERROR:i(e,a.file);break;case plupload.IMAGE_FORMAT_ERROR:wpFileError(fileObj,pluploadL10n.not_an_image);break;case plupload.IMAGE_MEMORY_ERROR:wpFileError(fileObj,pluploadL10n.image_memory_exceeded);break;case plupload.IMAGE_DIMENSIONS_ERROR:wpFileError(fileObj,pluploadL10n.image_dimensions_exceeded);break;case plupload.GENERIC_ERROR:wpQueueError(pluploadL10n.upload_failed);break;case plupload.IO_ERROR:l=parseInt(uploader.settings.max_file_size,10),l>r&&fileObj.size>r?wpFileError(fileObj,pluploadL10n.big_upload_failed.replace("%1$s",'<a class="uploader-html" href="#">').replace("%2$s","</a>")):wpQueueError(pluploadL10n.io_error);break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:$(".media-upload-form").addClass("html-uploader");break;case plupload.SECURITY_ERROR:wpQueueError(pluploadL10n.security_error);break;default:wpFileError(fileObj,pluploadL10n.default_error)}e.refresh()}))}function i(e,a,r){var i;i=r?pluploadL10n.big_upload_queued.replace("%s",a.name)+" "+pluploadL10n.big_upload_failed.replace("%1$s",'<a class="uploader-html" href="#">').replace("%2$s","</a>"):pluploadL10n.file_exceeds_size_limit.replace("%s",a.name),$("#envira-gallery-upload-error").html('<p class="error">'+i+"</p>"),e.removeFile(a)}var n=$("#envira-tabs"),l=$("#envira-tabs-nav"),t=window.location.hash,o=window.location.hash.replace("!","");if(t&&t.indexOf("envira-tab-")>=0){$(".envira-active").removeClass("envira-active"),l.find('li a[href="'+o+'"]').parent().addClass("envira-active"),n.find(o).addClass("envira-active").show();var s=$("#post").attr("action");s&&(s=s.split("#")[0],$("#post").attr("action",s+t))}$(document).on("click","#envira-tabs-nav li a",function(e){e.preventDefault();var a=$(this);if(!a.parent().hasClass("envira-active")){window.location.hash=t=this.hash.split("#").join("#!");var r=l.find(".envira-active").removeClass("envira-active").find("a").attr("href");a.parent().addClass("envira-active"),n.find(r).removeClass("envira-active").hide(),n.find(a.attr("href")).addClass("envira-active").show();var i=$("#post").attr("action");i&&(i=i.split("#")[0],$("#post").attr("action",i+t))}});var d;r(),a(),0!==$(".envira-helper-needed").length&&$('<div class="envira-meta-helper-overlay" />').prependTo("#envira-gallery"),$(document).on("click",".envira-meta-icon",function(e){e.preventDefault();var a=$(this),r=a.parent(),i=a.next();i.is(":visible")?($(".envira-meta-helper-overlay").remove(),r.removeClass("envira-helper-active")):(0===$(".envira-meta-helper-overlay").length&&$('<div class="envira-meta-helper-overlay" />').prependTo("#envira-gallery"),r.addClass("envira-helper-active"))}),$(document).on("click",".envira-media-library",function(e){e.preventDefault(),v=!0,$("#envira-gallery-upload-ui").appendTo("body").show()}),$(".envira-gallery-gallery").on("click",".thumbnail, .check, .media-modal-icon",function(e){e.preventDefault(),$(this).parent().parent().hasClass("envira-gallery-in-gallery")||($(this).parent().parent().hasClass("selected")?$(this).parent().parent().removeClass("details selected"):$(this).parent().parent().addClass("details selected"))}),$(".envira-gallery-load-library").on("click",function(e){e.preventDefault();var a=$(this);a.next().css({display:"inline-block","margin-top":"14px","margin-left":"-5px"});var r={action:"envira_gallery_load_library",offset:parseInt(a.attr("data-envira-gallery-offset")),post_id:envira_gallery_metabox.id,nonce:envira_gallery_metabox.load_gallery};$.post(envira_gallery_metabox.ajax,r,function(e){a.attr("data-envira-gallery-offset",parseInt(a.attr("data-envira-gallery-offset"))+20),e&&e.html&&a.hasClass("has-search")?($(".envira-gallery-gallery").html(e.html),a.removeClass("has-search")):$(".envira-gallery-gallery").append(e.html),a.next().hide()},"json")}),$(document).on("keyup keydown","#envira-gallery-gallery-search",function(){var e=$(this);e.prev().css({display:"inline-block","margin-top":"1px","vertical-align":"middle","margin-right":"4px"});var a=$(this).val(),r={action:"envira_gallery_library_search",nonce:envira_gallery_metabox.library_search,post_id:envira_gallery_metabox.id,search:a};p(function(){$.post(envira_gallery_metabox.ajax,r,function(a){$(".envira-load-library").addClass("has-search").attr("data-envira-offset",parseInt(0)),a&&$(".envira-gallery-gallery").html(a.html),e.prev().hide()},"json")},"500")}),$(document).on("click",".envira-gallery-media-insert",function(e){e.preventDefault();var a=$(this),r=$(this).text(),i={action:"envira_gallery_insert_images",nonce:envira_gallery_metabox.insert_nonce,post_id:envira_gallery_metabox.id,images:{}},n=!1,l=e;a.text(envira_gallery_metabox.inserting),$(".envira-gallery-media-frame").find(".attachment.selected:not(.envira-gallery-in-gallery)").each(function(e,a){i.images[e]=$(a).attr("data-attachment-id"),n=!0}),$.post(envira_gallery_metabox.ajax,i,function(e){setTimeout(function(){u(l),a.text(r),n&&$(".envira-gallery-load-library").attr("data-envira-gallery-offset",0).addClass("has-search").trigger("click")},500)},"json")});var c=$("#envira-gallery-output");c.sortable({containment:"#envira-gallery-output",items:"li",cursor:"move",forcePlaceholderSize:!0,placeholder:"dropzone",update:function(e,a){var r={url:envira_gallery_metabox.ajax,type:"post",async:!0,cache:!1,dataType:"json",data:{action:"envira_gallery_sort_images",order:c.sortable("toArray").toString(),post_id:envira_gallery_metabox.id,nonce:envira_gallery_metabox.sort},success:function(e){},error:function(e,a,r){}};$.ajax(r)}}),$("#envira-gallery").on("click",".envira-gallery-remove-image",function(e){e.preventDefault();var a=confirm(envira_gallery_metabox.remove);if(a){var r=$(this).parent().attr("id"),i={action:"envira_gallery_remove_image",attachment_id:r,post_id:envira_gallery_metabox.id,nonce:envira_gallery_metabox.remove_nonce};$.post(envira_gallery_metabox.ajax,i,function(e){$("#"+r).fadeOut("normal",function(){$(this).remove(),$(".envira-gallery-load-library").attr("data-envira-gallery-offset",0).addClass("has-search").trigger("click")})},"json")}}),$("#envira-gallery").on("click.enviraModify",".envira-gallery-modify-image",function(e){e.preventDefault();var a=$(this).parent().data("envira-gallery-image"),r="envira-gallery-meta-"+a;v=!0,$("#"+r).appendTo("body").show();var i=function(e){e.preventDefault(),$("#"+r).appendTo("#"+a).hide(),v=!1,$(document).off("click.enviraLink")};$(document).on("click.enviraIframe",".media-modal-close, .media-modal-backdrop",i),$(document).on("keydown.enviraIframe",function(e){27==e.keyCode&&v&&i(e)}),$(document).on("click.enviraLink",".ed_button",function(){$("#wp-link-backdrop").css("zIndex","170100"),$("#wp-link-wrap").css("zIndex","171005")})}),$(document).on("click",".envira-gallery-meta-submit",function(e){e.preventDefault();var a=$(this),r=a.text(),i=a.data("envira-gallery-item"),n="envira-gallery-meta-"+i,l={};a.text(envira_gallery_metabox.saving),l.title=$("#envira-gallery-meta-table-"+i).find('textarea[name="_envira_gallery[meta_title]"]').val(),$("#envira-gallery-meta-table-"+i).find(":input").not(".ed_button").each(function(e,a){$(this).data("envira-meta")&&(l[$(this).data("envira-meta")]=$(this).val())});var t={action:"envira_gallery_save_meta",nonce:envira_gallery_metabox.save_nonce,attach_id:i,post_id:envira_gallery_metabox.id,meta:l};$.post(envira_gallery_metabox.ajax,t,function(e){setTimeout(function(){$("#"+n).appendTo("#"+i).hide(),a.text(r)},500)},"json")}),$("#envira-gallery-import-submit").on("click",function(e){$(this).next().css("display","inline-block"),0===$("#envira-config-import-gallery").val().length&&(e.preventDefault(),$(this).next().hide(),alert(envira_gallery_metabox["import"]))});var p=function(){var e=0;return function(a,r){clearTimeout(e),e=setTimeout(a,r)}}(),v=!1,u=function(a){a.preventDefault(),$("#envira-gallery-upload-ui").appendTo("#envira-gallery-upload-ui-wrapper").hide(),e(),v=!1};$(document).on("click","#envira-gallery-upload-ui .media-modal-close, #envira-gallery-upload-ui .media-modal-backdrop",u),$(document).on("keydown",function(e){27==e.keyCode&&v&&u(e)})})}(jQuery);
|
envira-gallery-lite.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Envira Gallery is best responsive WordPress gallery plugin. This is the lite version.
|
6 |
* Author: Thomas Griffin
|
7 |
* Author URI: http://thomasgriffinmedia.com
|
8 |
-
* Version: 1.1.
|
9 |
* Text Domain: envira-gallery
|
10 |
* Domain Path: languages
|
11 |
*
|
@@ -54,7 +54,7 @@ class Envira_Gallery_Lite {
|
|
54 |
*
|
55 |
* @var string
|
56 |
*/
|
57 |
-
public $version = '1.1.
|
58 |
|
59 |
/**
|
60 |
* The name of the plugin.
|
5 |
* Description: Envira Gallery is best responsive WordPress gallery plugin. This is the lite version.
|
6 |
* Author: Thomas Griffin
|
7 |
* Author URI: http://thomasgriffinmedia.com
|
8 |
+
* Version: 1.1.4
|
9 |
* Text Domain: envira-gallery
|
10 |
* Domain Path: languages
|
11 |
*
|
54 |
*
|
55 |
* @var string
|
56 |
*/
|
57 |
+
public $version = '1.1.4';
|
58 |
|
59 |
/**
|
60 |
* The name of the plugin.
|
includes/admin/metaboxes.php
CHANGED
@@ -109,7 +109,7 @@ class Envira_Gallery_Metaboxes_Lite {
|
|
109 |
wp_enqueue_media( array( 'post' => $post_id ) );
|
110 |
|
111 |
// Load necessary metabox scripts.
|
112 |
-
wp_register_script( $this->base->plugin_slug . '-metabox-script', plugins_url( 'assets/js/
|
113 |
wp_enqueue_script( $this->base->plugin_slug . '-metabox-script' );
|
114 |
wp_localize_script(
|
115 |
$this->base->plugin_slug . '-metabox-script',
|
109 |
wp_enqueue_media( array( 'post' => $post_id ) );
|
110 |
|
111 |
// Load necessary metabox scripts.
|
112 |
+
wp_register_script( $this->base->plugin_slug . '-metabox-script', plugins_url( 'assets/js/metabox.js', $this->base->file ), array( 'jquery', 'plupload-handlers', 'quicktags', 'jquery-ui-sortable' ), $this->base->version, true );
|
113 |
wp_enqueue_script( $this->base->plugin_slug . '-metabox-script' );
|
114 |
wp_localize_script(
|
115 |
$this->base->plugin_slug . '-metabox-script',
|
includes/global/shortcode.php
CHANGED
@@ -225,7 +225,7 @@ class Envira_Gallery_Shortcode_Lite {
|
|
225 |
|
226 |
<?php
|
227 |
foreach ( $data['gallery'] as $imageID => $image ) {
|
228 |
-
$title =
|
229 |
?>
|
230 |
titles_<?php echo $data['id']; ?>.push('<?php echo $title; ?>');
|
231 |
<?php
|
@@ -465,6 +465,25 @@ class Envira_Gallery_Shortcode_Lite {
|
|
465 |
|
466 |
}
|
467 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
/**
|
469 |
* Helper method to minify a string of data.
|
470 |
*
|
@@ -474,8 +493,6 @@ class Envira_Gallery_Shortcode_Lite {
|
|
474 |
* @return string $string Minified string of data.
|
475 |
*/
|
476 |
public function minify( $string, $stripDoubleForwardslashes = true ) {
|
477 |
-
|
478 |
-
return $string;
|
479 |
|
480 |
// Added a switch for stripping double forwardslashes
|
481 |
// This can be disabled when using URLs in JS, to ensure http:// doesn't get removed
|
225 |
|
226 |
<?php
|
227 |
foreach ( $data['gallery'] as $imageID => $image ) {
|
228 |
+
$title = str_replace( "\n", "", nl2br( $image['title'] ) );
|
229 |
?>
|
230 |
titles_<?php echo $data['id']; ?>.push('<?php echo $title; ?>');
|
231 |
<?php
|
465 |
|
466 |
}
|
467 |
|
468 |
+
/**
|
469 |
+
* Helper method to minify a string of data.
|
470 |
+
*
|
471 |
+
* @since 1.0.4
|
472 |
+
*
|
473 |
+
* @param string $string String of data to minify.
|
474 |
+
* @return string $string Minified string of data.
|
475 |
+
|
476 |
+
public function minify( $string ) {
|
477 |
+
|
478 |
+
return $string;
|
479 |
+
|
480 |
+
$clean = preg_replace( '/((?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)|(?:\/\/.*))/', '', $string );
|
481 |
+
$clean = str_replace( array( "\r\n", "\r", "\t", "\n", ' ', ' ', ' ' ), '', $clean );
|
482 |
+
return apply_filters( 'envira_gallery_minified_string', $clean, $string );
|
483 |
+
|
484 |
+
}
|
485 |
+
*/
|
486 |
+
|
487 |
/**
|
488 |
* Helper method to minify a string of data.
|
489 |
*
|
493 |
* @return string $string Minified string of data.
|
494 |
*/
|
495 |
public function minify( $string, $stripDoubleForwardslashes = true ) {
|
|
|
|
|
496 |
|
497 |
// Added a switch for stripping double forwardslashes
|
498 |
// This can be disabled when using URLs in JS, to ensure http:// doesn't get removed
|
readme.txt
CHANGED
@@ -57,10 +57,6 @@ Also, I'm an <a href="https://thomasgriffin.io" rel="me" title="WordPress Develo
|
|
57 |
|
58 |
== Changelog ==
|
59 |
|
60 |
-
= 1.1.5 =
|
61 |
-
* Fix: Metadata - close window would not always work after uploading new images
|
62 |
-
* Fix: Support single quotation character in Image Title
|
63 |
-
|
64 |
= 1.1.4 =
|
65 |
* Added: Metadata - Image Alt Text Helpful Tip
|
66 |
* Fix: Metadata - wp_editor too large for smaller screen resolutions
|
57 |
|
58 |
== Changelog ==
|
59 |
|
|
|
|
|
|
|
|
|
60 |
= 1.1.4 =
|
61 |
* Added: Metadata - Image Alt Text Helpful Tip
|
62 |
* Fix: Metadata - wp_editor too large for smaller screen resolutions
|