Attachments - Version 1.5.5

Version Description

Re-implemented bulk Attach

Download this release

Release Info

Developer jchristopher
Plugin Icon wp plugin Attachments
Version 1.5.5
Comparing to
See all releases

Code changes from version 1.5.4 to 1.5.5

Files changed (4) hide show
  1. attachments.php +1 -1
  2. css/attachments.css +2 -14
  3. js/attachments.js +4 -7
  4. readme.txt +4 -1
attachments.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Attachments
4
  Plugin URI: http://mondaybynoon.com/wordpress-attachments/
5
  Description: Attachments gives the ability to append any number of Media Library items to Pages, Posts, and Custom Post Types
6
- Version: 1.5.4
7
  Author: Jonathan Christopher
8
  Author URI: http://mondaybynoon.com/
9
  */
3
  Plugin Name: Attachments
4
  Plugin URI: http://mondaybynoon.com/wordpress-attachments/
5
  Description: Attachments gives the ability to append any number of Media Library items to Pages, Posts, and Custom Post Types
6
+ Version: 1.5.5
7
  Author: Jonathan Christopher
8
  Author URI: http://mondaybynoon.com/
9
  */
css/attachments.css CHANGED
@@ -18,12 +18,13 @@ p.attachments-actions { float:right; margin:6px 0 0 !important; }
18
  #attachments-file-details .attachments a:hover { border:3px solid #ccc; }
19
 
20
  #attachments-file-details .attachments a.attachments-selected { border:3px solid #eb3525; }
 
21
 
22
  /* File listings, not images */
23
  #attachments-file-details .attachments-alt li { width:290px; }
24
  #attachments-file-details .attachments-alt span.attachments-thumbnail { display:block; width:70px; float:left; }
25
  #attachments-file-details .attachments-alt h2.attachments-title-display { display:block; width:220px; float:left; text-decoration:none; font:20px Georgia,"Times New Roman","Bitstream Charter",Times,serif; font-style:italic; font-weight:normal; height:2.4em; overflow:hidden; }
26
-
27
  #attachments-file-details .attachments-alt li a { display:block; border:0; text-decoration:none; }
28
  #attachments-file-details .attachments-alt li a.attachments-selected { border:0; }
29
  #attachments-file-details .attachments-alt li a span.attachments-thumbnail img { border:3px solid #fff; }
@@ -70,16 +71,3 @@ p.attachments-actions { float:right; margin:6px 0 0 !important; }
70
  #attachments-tabs-wrapper { border-bottom:1px solid #dfdfdf; position:relative; }
71
  #attachments-tabs #sidemenu { overflow:hidden; zoom:1; background:#f9f9f9; float:none !important; margin:0; }
72
  #attachments-live-filter { display:block; width:140px; float:left; margin:0 0 10px; }
73
-
74
-
75
- /* Hide WP UI elements only for Attachments */
76
- body#media-upload.attachments-media-upload #tab-type_url,
77
- body#media-upload.attachments-media-upload #tab-nextgen,
78
- body#media-upload.attachments-media-upload p.ml-submit,
79
- body#media-upload.attachments-media-upload p.savebutton.ml-submit,
80
- body#media-upload.attachments-media-upload div.media-item tr.url,
81
- body#media-upload.attachments-media-upload div.media-item tr.align,
82
- body#media-upload.attachments-media-upload div.media-item tr.image-size,
83
- body#media-upload.attachments-media-upload div.media-item tr.image_alt,
84
- body#media-upload.attachments-media-upload div.media-item tr.post_content,
85
- body#media-upload.attachments-media-upload div.media-item a.del-link { display:none !important; }
18
  #attachments-file-details .attachments a:hover { border:3px solid #ccc; }
19
 
20
  #attachments-file-details .attachments a.attachments-selected { border:3px solid #eb3525; }
21
+ span.attachments-attached { background:#fff; color:#d54e21; padding-left:10px; font-style:italic; }
22
 
23
  /* File listings, not images */
24
  #attachments-file-details .attachments-alt li { width:290px; }
25
  #attachments-file-details .attachments-alt span.attachments-thumbnail { display:block; width:70px; float:left; }
26
  #attachments-file-details .attachments-alt h2.attachments-title-display { display:block; width:220px; float:left; text-decoration:none; font:20px Georgia,"Times New Roman","Bitstream Charter",Times,serif; font-style:italic; font-weight:normal; height:2.4em; overflow:hidden; }
27
+
28
  #attachments-file-details .attachments-alt li a { display:block; border:0; text-decoration:none; }
29
  #attachments-file-details .attachments-alt li a.attachments-selected { border:0; }
30
  #attachments-file-details .attachments-alt li a span.attachments-thumbnail img { border:3px solid #fff; }
71
  #attachments-tabs-wrapper { border-bottom:1px solid #dfdfdf; position:relative; }
72
  #attachments-tabs #sidemenu { overflow:hidden; zoom:1; background:#f9f9f9; float:none !important; margin:0; }
73
  #attachments-live-filter { display:block; width:140px; float:left; margin:0 0 10px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
js/attachments.js CHANGED
@@ -66,14 +66,8 @@ jQuery(document).ready(function() {
66
  send_to_editor = function(markup){
67
  clearInterval(attachments_button_label_updater);
68
  if(attachments_hijacked_thickbox){
69
- // determine what got retuned
70
- var src = markup.match(/src="(.*)" alt=/i);
71
- src = (src && src[1]) ? src[1] : '' ;
72
- var href = markup.match(/href='(.*)'/i);
73
- href = (href && href[1]) ? href[1] : '' ;
74
- var attachments_asset = href ? href : src ;
75
  attachments_hijacked_thickbox = false; // reset our flag
76
- tb_remove();
77
  }else{
78
  attachments_send_to_editor_default(markup);
79
  }
@@ -85,11 +79,14 @@ jQuery(document).ready(function() {
85
  // our new click handler for the attach button
86
  jQuery('#TB_iframeContent').contents().find('td.savesend input').unbind('click').click(function(e){
87
  theparent = jQuery(this).parent().parent().parent();
 
88
  thetitle = theparent.find('tr.post_title td.field input').val();
89
  thecaption = theparent.find('tr.post_excerpt td.field input').val();
90
  theid = theparent.find('td.imgedit-response').attr('id').replace('imgedit-response-','');
91
  thethumb = theparent.parent().parent().find('img.pinkynail').attr('src');
92
  attachments_handle_attach(thetitle,thecaption,theid,thethumb);
 
 
93
  });
94
  // update button
95
  if(jQuery('#TB_iframeContent').contents().find('.media-item .savesend input[type=submit], #insertonlybutton').length){
66
  send_to_editor = function(markup){
67
  clearInterval(attachments_button_label_updater);
68
  if(attachments_hijacked_thickbox){
 
 
 
 
 
 
69
  attachments_hijacked_thickbox = false; // reset our flag
70
+ // our click handler is in the interval, not here
71
  }else{
72
  attachments_send_to_editor_default(markup);
73
  }
79
  // our new click handler for the attach button
80
  jQuery('#TB_iframeContent').contents().find('td.savesend input').unbind('click').click(function(e){
81
  theparent = jQuery(this).parent().parent().parent();
82
+ jQuery(this).after('<span class="attachments-attached">Attached!</span>');
83
  thetitle = theparent.find('tr.post_title td.field input').val();
84
  thecaption = theparent.find('tr.post_excerpt td.field input').val();
85
  theid = theparent.find('td.imgedit-response').attr('id').replace('imgedit-response-','');
86
  thethumb = theparent.parent().parent().find('img.pinkynail').attr('src');
87
  attachments_handle_attach(thetitle,thecaption,theid,thethumb);
88
+ theparent.find('span.attachments-attached').delay(1000).fadeOut('fast');
89
+ return false;
90
  });
91
  // update button
92
  if(jQuery('#TB_iframeContent').contents().find('.media-item .savesend input[type=submit], #insertonlybutton').length){
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://mondaybynoon.com/donate/
4
  Tags: post, page, posts, pages, images, PDF, doc, Word, image, jpg, jpeg, picture, pictures, photos, attachment
5
  Requires at least: 3.0
6
  Tested up to: 3.2.1
7
- Stable tag: 1.5.4
8
 
9
  Attachments allows you to simply append any number of items from your WordPress Media Library to Posts, Pages, and Custom Post Types
10
 
@@ -67,6 +67,9 @@ Attachments uses WordPress' built in Media library for uploads and storage.
67
 
68
  == Changelog ==
69
 
 
 
 
70
  = 1.5.4 =
71
  * Updated the way Thickbox is hijacked in an effort to be more stable among tab switching. As an unfortunate result, bulk attaching is no longer possible.
72
  * Added environment check in preparation for future feature updates
4
  Tags: post, page, posts, pages, images, PDF, doc, Word, image, jpg, jpeg, picture, pictures, photos, attachment
5
  Requires at least: 3.0
6
  Tested up to: 3.2.1
7
+ Stable tag: 1.5.5
8
 
9
  Attachments allows you to simply append any number of items from your WordPress Media Library to Posts, Pages, and Custom Post Types
10
 
67
 
68
  == Changelog ==
69
 
70
+ = 1.5.5 =
71
+ # Re-implemented bulk Attach
72
+
73
  = 1.5.4 =
74
  * Updated the way Thickbox is hijacked in an effort to be more stable among tab switching. As an unfortunate result, bulk attaching is no longer possible.
75
  * Added environment check in preparation for future feature updates