Instant Images – One Click Unsplash Uploads - Version 2.1.1

Version Description

  • June 6, 2017 = ** NEW - Added infinite scroll while viewing Instant Images on large screens. ** FIX - Fixed missing js file error in browser console. ** UPDATE - Updated Masonry/Imagesloaded image load functionality.
Download this release

Release Info

Developer dcooney
Plugin Icon 128x128 Instant Images – One Click Unsplash Uploads
Version 2.1.1
Comparing to
See all releases

Code changes from version 2.1 to 2.1.1

README.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dcooney, connekthq
3
  Donate link: https://connekthq.com/donate/
4
  Tags: stock photo, stock, unsplash, prototyping, photos, upload, media, media library, ajax, image upload, direct upload, free stock photos
5
  Requires at least: 3.6
6
- Tested up to: 4.7.4
7
- Stable tag: 2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -16,7 +16,7 @@ One click uploads of Unsplash photos directly to your WordPress media library.
16
 
17
  [youtube https://www.youtube.com/watch?v=s6Q7Kfi2f1c]
18
 
19
- The perfect tool for users who want to save time and frustrating by uploading images directly inside their WordPress installation and for developers who want to prototype and develop using real world imagery.
20
 
21
  **[Visit Plugin Website](https://connekthq.com/plugins/instant-images/)**
22
 
@@ -103,11 +103,17 @@ How to install Instant Images.
103
  == Changelog ==
104
 
105
 
 
 
 
 
 
 
106
  = 2.1 - May 12, 2017 =
107
- * UPDATE - Remove App ID setting - Unsplash API is now open for everyone without API limit restrictions.
108
- * UPDATE - Updating default image upload from 'Full' to 'Raw'. Raw files are significantly smaller size and should make uploads quicker on slower connections and help to reduce upload errors.
109
- * UPDATE - UI/UX tweaks and updates.
110
- * FIX - Updating media_buttons hook. Was causing issues with other plugins.
111
 
112
 
113
  = 2.0.1 - January 12, 2017 =
3
  Donate link: https://connekthq.com/donate/
4
  Tags: stock photo, stock, unsplash, prototyping, photos, upload, media, media library, ajax, image upload, direct upload, free stock photos
5
  Requires at least: 3.6
6
+ Tested up to: 4.7.5
7
+ Stable tag: 2.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
16
 
17
  [youtube https://www.youtube.com/watch?v=s6Q7Kfi2f1c]
18
 
19
+ The perfect tool for users who want to save time and frustration by uploading images directly inside their WordPress installation and for developers who want to prototype and develop using real world imagery.
20
 
21
  **[Visit Plugin Website](https://connekthq.com/plugins/instant-images/)**
22
 
103
  == Changelog ==
104
 
105
 
106
+ = 2.1.1 - June 6, 2017 =
107
+ ** NEW - Added infinite scroll while viewing Instant Images on large screens.
108
+ ** FIX - Fixed missing js file error in browser console.
109
+ ** UPDATE - Updated Masonry/Imagesloaded image load functionality.
110
+
111
+
112
  = 2.1 - May 12, 2017 =
113
+ ** UPDATE - Remove App ID setting - Unsplash API is now open for everyone without API limit restrictions.
114
+ ** UPDATE - Updating default image upload from 'Full' to 'Raw'. Raw files are significantly smaller size and should make uploads quicker on slower connections and help to reduce upload errors.
115
+ ** UPDATE - UI/UX tweaks and updates.
116
+ ** FIX - Updating media_buttons hook. Was causing issues with other plugins.
117
 
118
 
119
  = 2.0.1 - January 12, 2017 =
admin/admin.php CHANGED
@@ -87,9 +87,7 @@ function instant_img_enqueue_scripts(){
87
  wp_enqueue_style('font-awesome-instant-image', INSTANT_IMG_ADMIN_URL. 'assets/css/font-awesome.min.css');
88
  wp_enqueue_script('jquery');
89
  wp_enqueue_script('jquery-form');
90
- wp_enqueue_script('jquery-masonry');
91
- wp_enqueue_script('imagesLoaded', INSTANT_IMG_ADMIN_URL. 'assets/js/libs/imagesloaded.pkgd.min.js', 'jquery');
92
- //wp_enqueue_script('unsplash-helpers', INSTANT_IMG_ADMIN_URL. 'assets/js/helpers.unsplash.js', array( 'jquery' ));
93
  wp_enqueue_script('unsplash', INSTANT_IMG_ADMIN_URL. 'assets/js/unsplash.js');
94
  wp_enqueue_script('instant-images', INSTANT_IMG_ADMIN_URL. 'assets/js/admin.js', 'jquery');
95
  }
@@ -132,10 +130,8 @@ function instant_img_media_popup_content() {
132
  wp_enqueue_style( 'font-awesome', INSTANT_IMG_ADMIN_URL. 'assets/css/font-awesome.min.css');
133
  wp_enqueue_script('jquery');
134
  wp_enqueue_script('jquery-form');
135
- wp_enqueue_script('jquery-masonry');
136
- wp_enqueue_script('imagesLoaded', INSTANT_IMG_ADMIN_URL. 'assets/js/libs/imagesloaded.pkgd.min.js', 'jquery');
137
- wp_enqueue_script('unsplash-helpers', INSTANT_IMG_ADMIN_URL. 'assets/js/helpers.unsplash.js', array( 'jquery' ));
138
- wp_enqueue_script('unsplash', INSTANT_IMG_ADMIN_URL. 'assets/js/unsplash.js', array( 'unsplash-helpers' ));
139
  wp_enqueue_script('instant-images', INSTANT_IMG_ADMIN_URL. 'assets/js/admin.js', 'jquery');
140
  ?>
141
  <div id="instant_images_modal" style="display:none;">
87
  wp_enqueue_style('font-awesome-instant-image', INSTANT_IMG_ADMIN_URL. 'assets/css/font-awesome.min.css');
88
  wp_enqueue_script('jquery');
89
  wp_enqueue_script('jquery-form');
90
+ wp_enqueue_script('masonry');
 
 
91
  wp_enqueue_script('unsplash', INSTANT_IMG_ADMIN_URL. 'assets/js/unsplash.js');
92
  wp_enqueue_script('instant-images', INSTANT_IMG_ADMIN_URL. 'assets/js/admin.js', 'jquery');
93
  }
130
  wp_enqueue_style( 'font-awesome', INSTANT_IMG_ADMIN_URL. 'assets/css/font-awesome.min.css');
131
  wp_enqueue_script('jquery');
132
  wp_enqueue_script('jquery-form');
133
+ wp_enqueue_script('masonry');
134
+ wp_enqueue_script('unsplash', INSTANT_IMG_ADMIN_URL. 'assets/js/unsplash.js');
 
 
135
  wp_enqueue_script('instant-images', INSTANT_IMG_ADMIN_URL. 'assets/js/admin.js', 'jquery');
136
  ?>
137
  <div id="instant_images_modal" style="display:none;">
admin/assets/css/admin.css CHANGED
@@ -1017,8 +1017,7 @@ a.button.instant-images span{
1017
  .cnkt-sidebar h2 + p{
1018
  padding: 0 20px 15px;
1019
  margin: 0 !important;
1020
- border-bottom: 1px solid #e7e7e7;
1021
- font-style: italic;
1022
  }
1023
  .cnkt-sidebar h2,
1024
  .cnkt-sidebar h2 + p{
1017
  .cnkt-sidebar h2 + p{
1018
  padding: 0 20px 15px;
1019
  margin: 0 !important;
1020
+ border-bottom: 1px solid #e7e7e7;
 
1021
  }
1022
  .cnkt-sidebar h2,
1023
  .cnkt-sidebar h2 + p{
admin/assets/js/unsplash.js CHANGED
@@ -133,23 +133,32 @@ jQuery(document).ready(function($) {
133
  }
134
  }
135
 
136
- $(el).appendTo(unsplash.photos);
 
137
 
138
  if(unsplash.masonryInit){
139
  unsplash.el.removeClass('relax');
140
  unsplash.masonryInit = false;
141
- unsplash.photos.masonry({
142
- itemSelector: '.item'
 
 
 
 
 
 
143
  });
144
- $('.cnkt-main .expand').addClass('show');
145
  } else {
146
- unsplash.photos.masonry('reloadItems');
147
- }
148
- // Imagesloaded
149
- unsplash.photos.imagesLoaded( function() {
150
- unsplash.photos.masonry();
151
- unsplash.loaded();
152
- });
 
 
153
 
154
  };
155
 
@@ -427,7 +436,7 @@ jQuery(document).ready(function($) {
427
  */
428
  unsplash.btn.on('click', function(){
429
  var el = $(this);
430
-
431
  if(!el.hasClass('disabled') && !unsplash.is_loading){
432
  el.addClass('loading');
433
  unsplash.page++;
@@ -442,6 +451,19 @@ jQuery(document).ready(function($) {
442
 
443
 
444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
 
446
  /* HELPER FUNCTIONS */
447
 
133
  }
134
  }
135
 
136
+ el = $(el);
137
+ el.hide().appendTo(unsplash.photos);
138
 
139
  if(unsplash.masonryInit){
140
  unsplash.el.removeClass('relax');
141
  unsplash.masonryInit = false;
142
+
143
+ unsplash.photos.imagesLoaded( function() {
144
+ el.fadeIn();
145
+ unsplash.photos.masonry({
146
+ itemSelector: '.item'
147
+ });
148
+ $('.cnkt-main .expand').addClass('show');
149
+ unsplash.loaded();
150
  });
151
+
152
  } else {
153
+
154
+ unsplash.photos.append( el );
155
+ unsplash.photos.imagesLoaded( function(){
156
+ el.show();
157
+ unsplash.photos.masonry( 'appended', el );
158
+ unsplash.loaded();
159
+ });
160
+
161
+ }
162
 
163
  };
164
 
436
  */
437
  unsplash.btn.on('click', function(){
438
  var el = $(this);
439
+
440
  if(!el.hasClass('disabled') && !unsplash.is_loading){
441
  el.addClass('loading');
442
  unsplash.page++;
451
 
452
 
453
 
454
+ /*
455
+ * Infinite Scroll
456
+ */
457
+ $(window).bind("scroll touchstart", function () {
458
+ var w = $(window).width();
459
+ if ((window.innerHeight + window.scrollY) >= document.body.scrollHeight && w > 900 && !unsplash.is_loading) {
460
+ unsplash.btn.trigger('click');
461
+
462
+ }
463
+ });
464
+
465
+
466
+
467
 
468
  /* HELPER FUNCTIONS */
469
 
admin/views/unsplash.php CHANGED
@@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
6
 
7
  <div class="header-wrap">
8
  <h1><?php echo INSTANT_IMG_TITLE; ?> <span><?php echo INSTANT_IMG_VERSION; ?></span></h1>
9
- <p><?php _e('One click uploads of <a href="https://unsplash.com/" target="_blank">unsplash.com</a> photos directly to your media library (formally UnsplashWP)', 'instant-images'); ?></p>
10
  </div>
11
 
12
  <div class="cnkt-main">
6
 
7
  <div class="header-wrap">
8
  <h1><?php echo INSTANT_IMG_TITLE; ?> <span><?php echo INSTANT_IMG_VERSION; ?></span></h1>
9
+ <p><?php _e('One click uploads of <a href="https://unsplash.com/" target="_blank">unsplash.com</a> photos directly to your media library', 'instant-images'); ?></p>
10
  </div>
11
 
12
  <div class="cnkt-main">
instant-images.php CHANGED
@@ -6,7 +6,8 @@ Description: One click photo uploads directly to your media library.
6
  Author: Darren Cooney
7
  Twitter: @connekthq
8
  Author URI: https://connekthq.com
9
- Version: 2.1
 
10
  License: GPL
11
  Copyright: Darren Cooney & Connekt Media
12
  */
@@ -68,8 +69,8 @@ class InstantImages {
68
  */
69
 
70
  private function constants(){
71
- define('INSTANT_IMG_VERSION', '2.1');
72
- define('INSTANT_IMG_RELEASE', 'May 12, 2017');
73
  define('INSTANT_IMG_TITLE', 'Instant Images');
74
  $upload_dir = wp_upload_dir();
75
  define('INSTANT_IMG_UPLOAD_PATH', $upload_dir['basedir'].'/instant-images');
6
  Author: Darren Cooney
7
  Twitter: @connekthq
8
  Author URI: https://connekthq.com
9
+ Text Domain: instant-images
10
+ Version: 2.1.1
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
  */
69
  */
70
 
71
  private function constants(){
72
+ define('INSTANT_IMG_VERSION', '2.1.1');
73
+ define('INSTANT_IMG_RELEASE', 'June 6, 2017');
74
  define('INSTANT_IMG_TITLE', 'Instant Images');
75
  $upload_dir = wp_upload_dir();
76
  define('INSTANT_IMG_UPLOAD_PATH', $upload_dir['basedir'].'/instant-images');