Gallery – Photo Gallery and Images Gallery - Version 2.8.29

Version Description

  • Fixed media manager
Download this release

Release Info

Developer robosoft
Plugin Icon 128x128 Gallery – Photo Gallery and Images Gallery
Version 2.8.29
Comparing to
See all releases

Code changes from version 2.8.28 to 2.8.29

cmb2/fields/gallery/cmb-field-gallery.php CHANGED
@@ -13,7 +13,8 @@ define( 'ROBO_GALLERY_IMAGES_FIELD_URL', plugin_dir_url( __FILE__ ) );
13
 
14
  function robo_gallery_images_field( $field, $meta ) {
15
 
16
- wp_enqueue_script( 'robo-gallery-images-field', ROBO_GALLERY_IMAGES_FIELD_URL . 'js/script.js', array( 'jquery' ), ROBO_GALLERY_VERSION );
 
17
  wp_enqueue_style( 'robo-gallery-images-field', ROBO_GALLERY_IMAGES_FIELD_URL . 'css/style.css', array(), '', 'all', ROBO_GALLERY_VERSION );
18
 
19
  /* remove extra content from OUR PLUGIN settings section */
@@ -22,12 +23,12 @@ function robo_gallery_images_field( $field, $meta ) {
22
 
23
 
24
  if ( empty( $meta ) || $meta == ' ' || $meta == '' || !is_array($meta) ) {
25
- $meta = ' ';
26
  } else $meta = implode( ',', $meta );
27
 
28
  echo '<div class="robo-gallery-images-field rbs_block ">';
29
  echo ' <input type="hidden" class="robo-gallery-images-field-value" id="' . $field->args( 'id' ) . '" name="' . $field->args( 'id' ) . '" value="' . $meta . '" />';
30
- echo ' <button class="btn btn-info btn-lg "><span class="glyphicon glyphicon-picture" aria-hidden="true"></span> ' . ( $field->args( 'button' ) ? $field->args( 'button' ) : 'Manage gallery' ) . ' </button>';
31
  echo '</div>';
32
 
33
  $desc = $field->args( 'desc' );
13
 
14
  function robo_gallery_images_field( $field, $meta ) {
15
 
16
+ wp_enqueue_script( 'robo-gallery-images-field-lib', ROBO_GALLERY_IMAGES_FIELD_URL . 'js/gallery.lib.min.js', array( 'jquery' ), ROBO_GALLERY_VERSION );
17
+ wp_enqueue_script( 'robo-gallery-images-field', ROBO_GALLERY_IMAGES_FIELD_URL . 'js/script.min.js', array( 'jquery', 'robo-gallery-images-field-lib' ), ROBO_GALLERY_VERSION );
18
  wp_enqueue_style( 'robo-gallery-images-field', ROBO_GALLERY_IMAGES_FIELD_URL . 'css/style.css', array(), '', 'all', ROBO_GALLERY_VERSION );
19
 
20
  /* remove extra content from OUR PLUGIN settings section */
23
 
24
 
25
  if ( empty( $meta ) || $meta == ' ' || $meta == '' || !is_array($meta) ) {
26
+ $meta = '';
27
  } else $meta = implode( ',', $meta );
28
 
29
  echo '<div class="robo-gallery-images-field rbs_block ">';
30
  echo ' <input type="hidden" class="robo-gallery-images-field-value" id="' . $field->args( 'id' ) . '" name="' . $field->args( 'id' ) . '" value="' . $meta . '" />';
31
+ echo ' <button class="btn btn-info btn-lg " id="' . $field->args( 'id' ) . '_button"><span class="glyphicon glyphicon-picture" aria-hidden="true"></span> ' . ( $field->args( 'button' ) ? $field->args( 'button' ) : 'Manage gallery' ) . ' </button>';
32
  echo '</div>';
33
 
34
  $desc = $field->args( 'desc' );
cmb2/fields/gallery/js/gallery.lib.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*
2
+ @@copyright@@
3
+ */
4
+ !function(e,t){if(void 0!==wp.media.view.roboWpGallery){console.log("Robo Gallery already defined");return!1}var i=wp.media.view.MediaFrame.Select,a=wp.media.controller.Library,r=wp.media.view.l10n;wp.media.view.roboWpGallery=i.extend({initialize:function(){this.counts={audio:{count:wp.media.view.settings.attachmentCounts.audio,state:"playlist"},video:{count:wp.media.view.settings.attachmentCounts.video,state:"video-playlist"}};t.defaults(this.options,{multiple:!0,editing:!0,state:"insert",metadata:{}});i.prototype.initialize.apply(this,arguments);this.createIframeStates()},createStates:function(){var e=this.options;this.states.add([new a({id:"insert",title:r.insertMediaTitle,priority:20,toolbar:"main-insert",filterable:"all",library:wp.media.query(e.library),multiple:e.multiple?"reset":!1,editable:!1}),new a({id:"gallery",title:r.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!0,library:wp.media.query(t.defaults({type:"image"},e.library))}),new wp.media.controller.EditImage({model:e.editImage}),new wp.media.controller.GalleryEdit({library:e.selection,editing:e.editing,menu:"gallery",multiple:!0,displaySettings:!1,displayUserSettings:!1}),new wp.media.controller.GalleryAdd({multiple:"add",editable:!0})])},bindHandlers:function(){var e;i.prototype.bindHandlers.apply(this,arguments);this.on("activate",this.activate,this);if(void 0!==t.find(this.counts,function(e){return 0===e.count}))this.listenTo(wp.media.model.Attachments.all,"change:type",this.mediaTypeCounts);this.on("menu:create:gallery",this.createMenu,this);this.on("toolbar:create:main-insert",this.createToolbar,this);this.on("toolbar:create:gallery-add",this.createToolbar,this);this.on("toolbar:create:main-gallery",this.createToolbar,this);this.on("toolbar:create:main-embed",this.mainEmbedToolbar,this);e={menu:{default:"mainMenu",gallery:"galleryMenu"},content:{embed:"embedContent","edit-image":"editImageContent","edit-selection":"editSelectionContent"},toolbar:{"main-insert":"mainInsertToolbar","main-gallery":"mainGalleryToolbar","gallery-edit":"galleryEditToolbar","gallery-add":"galleryAddToolbar"}};t.each(e,function(e,i){t.each(e,function(e,t){this.on(i+":render:"+t,this[e],this)},this)},this)},activate:function(){t.each(this.counts,function(e){if(e.count<1)this.menuItemVisibility(e.state,"hide")},this)},mediaTypeCounts:function(e,t){if(void 0!==this.counts[t]&&this.counts[t].count<1){this.counts[t].count++;this.menuItemVisibility(this.counts[t].state,"show")}},mainMenu:function(e){},menuItemVisibility:function(e,t){var i=this.menu.get();if("hide"===t)i.hide(e);else if("show"===t)i.show(e)},galleryMenu:function(e){var t=this.lastState(),i=t&&t.id,a=this;e.set({cancel:{text:r.cancelGalleryTitle,priority:20,click:function(){if(i)a.setState(i);else a.close();this.controller.modal.focusManager.focus()}},separateCancel:new wp.media.View({className:"separator",priority:40})})},embedContent:function(){var e=new wp.media.view.Embed({controller:this,model:this.state()}).render();this.content.set(e)},editSelectionContent:function(){var e,t=this.state(),i=t.get("selection");(e=new wp.media.view.AttachmentsBrowser({controller:this,collection:i,selection:i,model:t,sortable:!0,search:!1,date:!1,dragInfo:!0,AttachmentView:wp.media.view.Attachments.EditSelection}).render()).toolbar.set("backToLibrary",{text:r.returnToLibrary,priority:-100,click:function(){this.controller.content.mode("browse");this.controller.modal.focusManager.focus()}});this.content.set(e);this.trigger("edit:selection",this)},editImageContent:function(){var e=this.state().get("image"),t=new wp.media.view.EditImage({model:e,controller:this}).render();this.content.set(t);t.loadEditor()},selectionStatusToolbar:function(e){var t=this.state().get("editable");e.set("selection",new wp.media.view.Selection({controller:this,collection:this.state().get("selection"),priority:-40,editable:t&&function(){this.controller.content.mode("edit-selection")}}).render())},mainInsertToolbar:function(e){var t=this;this.selectionStatusToolbar(e);e.set("insert",{style:"primary",priority:80,text:r.insertIntoPost,requires:{selection:!0},click:function(){var e=t.state(),i=e.get("selection");t.close();e.trigger("insert",i).reset()}})},mainGalleryToolbar:function(e){var t=this;this.selectionStatusToolbar(e);e.set("gallery",{style:"primary",text:r.createNewGallery,priority:60,requires:{selection:!0},click:function(){var e=t.state().get("selection"),i=t.state("gallery-edit"),a=e.where({type:"image"});i.set("library",new wp.media.model.Selection(a,{props:e.props.toJSON(),multiple:!0}));this.controller.setState("gallery-edit");this.controller.modal.focusManager.focus()}})},galleryEditToolbar:function(){var e=this.state().get("editing");this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:e?r.updateGallery:r.insertGallery,priority:80,requires:{library:!0},click:function(){var e=this.controller,t=e.state();e.close();t.trigger("update",t.get("library"));e.setState(e.options.state);e.reset()}}}}))},mainInsertToolbar:function(e){var t=this;this.selectionStatusToolbar(e);e.set("insert",{style:"primary",priority:80,text:r.insertIntoPost,requires:{selection:!0},click:function(){var e=t.state(),i=e.get("selection");t.close();e.trigger("insert",i).reset()}})},galleryAddToolbar:function(e){this.selectionStatusToolbar(e);e.set("insert",{style:"primary",text:r.addToGallery,priority:80,requires:{selection:!0},click:function(){var e=this.controller,t=e.state();e.state("gallery-edit").get("library").add(t.get("selection").models);t.trigger("reset");e.setState("gallery-edit");this.controller.modal.focusManager.focus()}})}})}(jQuery,_);
cmb2/fields/gallery/js/script.js DELETED
@@ -1,22 +0,0 @@
1
- (function ($) {
2
- $('.robo-gallery-images-field').each(function() {
3
- var instance = this;
4
- var imgIdInput = $('.robo-gallery-images-field-value', instance);
5
- $('button', instance).click(function(event){
6
- event.preventDefault();
7
- var idList = imgIdInput.val();
8
- var gallerysc = '[gallery ids="' +idList+ '"]';
9
- wp.media.gallery.edit(gallerysc).on('update', function(g){
10
- var id_array = [];
11
- // var marginCountCheck = 12;
12
- var marginCount = 0;
13
- $.each(g.models, function(id, img) { ++marginCount; /*if( marginCountCheck > marginCount )*/ id_array.push(img.id); });
14
- // if( marginCount > marginCountCheck ) alert("message");
15
- imgIdInput.val(id_array.join(","));
16
- });
17
- if(idList==' ' || idList=='' ){
18
- $('.media-frame-menu .media-menu-item').eq(2).click();
19
- }
20
- });
21
- });
22
- }(jQuery));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cmb2/fields/gallery/js/script.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t,l="gallery-library",n=document.getElementById("rsg_galleryImages_button"),a=document.getElementById("rsg_galleryImages"),o=a.value,r=""==o?[]:o.split(",");console.log("imagesIds",o);n.addEventListener("click",function(e,n){e.preventDefault(),t?t.open():(r.length>0&&(l="gallery-edit"),(t=new wp.media.view.roboWpGallery({multiple:!0,state:l,library:{order:"ASC",orderby:"title",type:"image",search:null,uploadedTo:null,multiple:!0}})).on("ready",function(){if(0!=r.length){var e=t.state().get("library");wp.media.query({post__in:r}).more().then(),r.forEach(function(t){var l=wp.media.attachment(t);e.add(l)})}}),t.on("open",function(){0!=r.length&&"gallery-edit"!=l&&(t.setState("gallery-edit"),t.options.state="gallery-edit",l="gallery-edit")}),t.on("insert",function(){var e=t.state().get("selection");console.log(e)}),t.on("update",function(e){var l,n=t.state();if(l=e||n.get("selection")){var i=l.toJSON();if(0!=i.length){r=[];for(var g=0;g<i.length;g++)r.push(i[g].id);o=r.join(","),a.value=o}}else console.log("return selection")}),t.open())})}(jQuery);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://robosoft.co/robogallery
4
  Tags: gallery, photo gallery, image gallery, wordpress gallery plugin, responsive gallery
5
  Requires at least: 3.3
6
  Tested up to: 5.3
7
- Stable tag: 2.8.28
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -209,6 +209,9 @@ If any problem occurs, please contact us.
209
 
210
  == Changelog ==
211
 
 
 
 
212
  = 2.8.28 =
213
  * Tested with Wordpress 5.3
214
 
@@ -530,6 +533,9 @@ If any problem occurs, please contact us.
530
 
531
  == Upgrade Notice ==
532
 
 
 
 
533
  = 2.8.28 =
534
  Tested with Wordpress 5.3
535
 
4
  Tags: gallery, photo gallery, image gallery, wordpress gallery plugin, responsive gallery
5
  Requires at least: 3.3
6
  Tested up to: 5.3
7
+ Stable tag: 2.8.29
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
209
 
210
  == Changelog ==
211
 
212
+ = 2.8.29 =
213
+ * Fixed media manager
214
+
215
  = 2.8.28 =
216
  * Tested with Wordpress 5.3
217
 
533
 
534
  == Upgrade Notice ==
535
 
536
+ = 2.8.29 =
537
+ Fixed media manager
538
+
539
  = 2.8.28 =
540
  Tested with Wordpress 5.3
541
 
robogallery.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Robo Gallery
4
  Plugin URI: https://robosoft.co/wordpress-gallery-plugin
5
  Description: Gallery modes photo gallery, images gallery, video gallery, Polaroid gallery, gallery lighbox, portfolio gallery, responsive gallery
6
- Version: 2.8.28
7
  Author: RoboSoft
8
  Author URI: https://robosoft.co/wordpress-gallery-plugin
9
  License: GPLv3 or later
@@ -14,7 +14,7 @@ Domain Path: /languages
14
  if(!defined('WPINC'))die;
15
 
16
  define("ROBO_GALLERY", 1);
17
- define("ROBO_GALLERY_VERSION", '2.8.28');
18
 
19
  define("ROBO_GALLERY_OPTIONS", 'rbs_opt_');
20
 
3
  Plugin Name: Robo Gallery
4
  Plugin URI: https://robosoft.co/wordpress-gallery-plugin
5
  Description: Gallery modes photo gallery, images gallery, video gallery, Polaroid gallery, gallery lighbox, portfolio gallery, responsive gallery
6
+ Version: 2.8.29
7
  Author: RoboSoft
8
  Author URI: https://robosoft.co/wordpress-gallery-plugin
9
  License: GPLv3 or later
14
  if(!defined('WPINC'))die;
15
 
16
  define("ROBO_GALLERY", 1);
17
+ define("ROBO_GALLERY_VERSION", '2.8.29');
18
 
19
  define("ROBO_GALLERY_OPTIONS", 'rbs_opt_');
20