Attachments - Version 1.5.10

Version Description

  • WordPress 3.3 compatibility
  • Updated Polish translation
  • Removed soon-to-be deprecated jQuery methods in prep for 1.7
Download this release

Release Info

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

Code changes from version 1.5.9 to 1.5.10

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.9
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.10
7
  Author: Jonathan Christopher
8
  Author URI: http://mondaybynoon.com/
9
  */
js/attachments.js CHANGED
@@ -1,10 +1,14 @@
1
  var attachments_button_label_updater=null;var attachments_button_label='Attach File';var attachments_asset=null;var attachments_hijacked_thickbox=false;function init_attachments_sortable(){if(jQuery('div#attachments-list ul:data(sortable)').length==0&&jQuery('div#attachments-list ul li').length>0){jQuery('div#attachments-list ul').sortable({containment:'parent',stop:function(e,ui){jQuery('#attachments-list ul li').each(function(i,id){jQuery(this).find('input.attachment_order').val(i+1);});}});}}
2
  function attachments_handle_attach(title,caption,id,thumb){attachment_index=jQuery('li.attachments-file',top.document).length;new_attachments='';attachment_name=title;attachment_caption=caption;attachment_id=id;attachment_thumb=thumb;attachment_index++;new_attachments+='<li class="attachments-file">';new_attachments+='<h2><a href="#" class="attachment-handle"><span class="attachment-handle-icon"><img src="'+attachments_base+'/images/handle.gif" alt="Drag" /></span></a><span class="attachment-name">'+attachment_name+'</span><span class="attachment-delete"><a href="#">Delete</a></span></h2>';new_attachments+='<div class="attachments-fields">';new_attachments+='<div class="textfield" id="field_attachment_title_'+attachment_index+'"><label for="attachment_title_'+attachment_index+'">Title</label><input type="text" id="attachment_title_'+attachment_index+'" name="attachment_title_'+attachment_index+'" value="'+attachment_name+'" size="20" /></div>';new_attachments+='<div class="textfield" id="field_attachment_caption_'+attachment_index+'"><label for="attachment_caption_'+attachment_index+'">Caption</label><input type="text" id="attachment_caption_'+attachment_index+'" name="attachment_caption_'+attachment_index+'" value="'+attachment_caption+'" size="20" /></div>';new_attachments+='</div>';new_attachments+='<div class="attachments-data">';new_attachments+='<input type="hidden" name="attachment_id_'+attachment_index+'" id="attachment_id_'+attachment_index+'" value="'+attachment_id+'" />';new_attachments+='<input type="hidden" class="attachment_order" name="attachment_order_'+attachment_index+'" id="attachment_order_'+attachment_index+'" value="'+attachment_index+'" />';new_attachments+='</div>';new_attachments+='<div class="attachment-thumbnail"><span class="attachments-thumbnail">';new_attachments+='<img src="'+attachment_thumb+'" alt="Thumbnail" />';new_attachments+='</span></div>';new_attachments+='</li>';jQuery('div#attachments-list ul',top.document).append(new_attachments);if(jQuery('#attachments-list li',top.document).length>0){jQuery('#attachments-list',top.document).show();}}
3
  jQuery(document).ready(function(){if(typeof send_to_editor==='function')
4
- {var attachments_send_to_editor_default=send_to_editor;send_to_editor=function(markup){clearInterval(attachments_button_label_updater);if(attachments_hijacked_thickbox){attachments_hijacked_thickbox=false;}else{attachments_send_to_editor_default(markup);}}}
5
  function attachments_update_button_label(){if(attachments_hijacked_thickbox){jQuery('#TB_iframeContent').contents().find('td.savesend input').unbind('click').click(function(e){theparent=jQuery(this).parent().parent().parent();jQuery(this).after('<span class="attachments-attached">Attached!</span>');thetitle=theparent.find('tr.post_title td.field input').val();thecaption=theparent.find('tr.post_excerpt td.field input').val();theid=theparent.find('td.imgedit-response').attr('id').replace('imgedit-response-','');thethumb=theparent.parent().parent().find('img.pinkynail').attr('src');attachments_handle_attach(thetitle,thecaption,theid,thethumb);theparent.find('span.attachments-attached').delay(1000).fadeOut('fast');return false;});if(jQuery('#TB_iframeContent').contents().find('.media-item .savesend input[type=submit], #insertonlybutton').length){jQuery('#TB_iframeContent').contents().find('.media-item .savesend input[type=submit], #insertonlybutton').val(attachments_button_label);}
6
  if(jQuery('#TB_iframeContent').contents().find('#tab-type_url').length){jQuery('#TB_iframeContent').contents().find('#tab-type_url').hide();}
7
  if(jQuery('#TB_iframeContent').contents().find('tr.post_title').length){jQuery('#TB_iframeContent').contents().find('tr.image-size input[value="full"]').prop('checked',true);jQuery('#TB_iframeContent').contents().find('tr.post_title,tr.image_alt,tr.post_excerpt,tr.image-size,tr.post_content,tr.url,tr.align,tr.submit>td>a.del-link').hide();}}
8
  if(jQuery('#TB_iframeContent').contents().length==0&&attachments_hijacked_thickbox){clearInterval(attachments_button_label_updater);attachments_hijacked_thickbox=false;}}
9
- jQuery('a#attachments-thickbox').live('click',function(event){var href=jQuery(this).attr('href'),width=jQuery(window).width(),H=jQuery(window).height(),W=(720<width)?720:width;if(!href)return;href=href.replace(/&width=[0-9]+/g,'');href=href.replace(/&height=[0-9]+/g,'');jQuery(this).attr('href',href+'&width='+(W-80)+'&height='+(H-85));attachments_hijacked_thickbox=true;attachments_button_label_updater=setInterval(attachments_update_button_label,500);tb_show('Attach a file',event.target.href,false);return false;});if(jQuery('div#attachments-list li').length==0){jQuery('#attachments-list').hide();}
10
- jQuery('span.attachment-delete a').live('click',function(){attachment_parent=jQuery(this).parent().parent().parent();attachment_parent.slideUp(function(){attachment_parent.remove();jQuery('#attachments-list ul li').each(function(i,id){jQuery(this).find('input.attachment_order').val(i+1);});if(jQuery('div#attachments-list li').length==0){jQuery('#attachments-list').slideUp(function(){jQuery('#attachments-list').hide();});}});return false;});setInterval('init_attachments_sortable()',500);});
 
 
 
 
1
  var attachments_button_label_updater=null;var attachments_button_label='Attach File';var attachments_asset=null;var attachments_hijacked_thickbox=false;function init_attachments_sortable(){if(jQuery('div#attachments-list ul:data(sortable)').length==0&&jQuery('div#attachments-list ul li').length>0){jQuery('div#attachments-list ul').sortable({containment:'parent',stop:function(e,ui){jQuery('#attachments-list ul li').each(function(i,id){jQuery(this).find('input.attachment_order').val(i+1);});}});}}
2
  function attachments_handle_attach(title,caption,id,thumb){attachment_index=jQuery('li.attachments-file',top.document).length;new_attachments='';attachment_name=title;attachment_caption=caption;attachment_id=id;attachment_thumb=thumb;attachment_index++;new_attachments+='<li class="attachments-file">';new_attachments+='<h2><a href="#" class="attachment-handle"><span class="attachment-handle-icon"><img src="'+attachments_base+'/images/handle.gif" alt="Drag" /></span></a><span class="attachment-name">'+attachment_name+'</span><span class="attachment-delete"><a href="#">Delete</a></span></h2>';new_attachments+='<div class="attachments-fields">';new_attachments+='<div class="textfield" id="field_attachment_title_'+attachment_index+'"><label for="attachment_title_'+attachment_index+'">Title</label><input type="text" id="attachment_title_'+attachment_index+'" name="attachment_title_'+attachment_index+'" value="'+attachment_name+'" size="20" /></div>';new_attachments+='<div class="textfield" id="field_attachment_caption_'+attachment_index+'"><label for="attachment_caption_'+attachment_index+'">Caption</label><input type="text" id="attachment_caption_'+attachment_index+'" name="attachment_caption_'+attachment_index+'" value="'+attachment_caption+'" size="20" /></div>';new_attachments+='</div>';new_attachments+='<div class="attachments-data">';new_attachments+='<input type="hidden" name="attachment_id_'+attachment_index+'" id="attachment_id_'+attachment_index+'" value="'+attachment_id+'" />';new_attachments+='<input type="hidden" class="attachment_order" name="attachment_order_'+attachment_index+'" id="attachment_order_'+attachment_index+'" value="'+attachment_index+'" />';new_attachments+='</div>';new_attachments+='<div class="attachment-thumbnail"><span class="attachments-thumbnail">';new_attachments+='<img src="'+attachment_thumb+'" alt="Thumbnail" />';new_attachments+='</span></div>';new_attachments+='</li>';jQuery('div#attachments-list ul',top.document).append(new_attachments);if(jQuery('#attachments-list li',top.document).length>0){jQuery('#attachments-list',top.document).show();}}
3
  jQuery(document).ready(function(){if(typeof send_to_editor==='function')
4
+ {var attachments_send_to_editor_default=send_to_editor;send_to_editor=function(markup){clearInterval(attachments_button_label_updater);if(attachments_hijacked_thickbox){attachments_hijacked_thickbox=false;}else{attachments_send_to_editor_default(markup);}};}
5
  function attachments_update_button_label(){if(attachments_hijacked_thickbox){jQuery('#TB_iframeContent').contents().find('td.savesend input').unbind('click').click(function(e){theparent=jQuery(this).parent().parent().parent();jQuery(this).after('<span class="attachments-attached">Attached!</span>');thetitle=theparent.find('tr.post_title td.field input').val();thecaption=theparent.find('tr.post_excerpt td.field input').val();theid=theparent.find('td.imgedit-response').attr('id').replace('imgedit-response-','');thethumb=theparent.parent().parent().find('img.pinkynail').attr('src');attachments_handle_attach(thetitle,thecaption,theid,thethumb);theparent.find('span.attachments-attached').delay(1000).fadeOut('fast');return false;});if(jQuery('#TB_iframeContent').contents().find('.media-item .savesend input[type=submit], #insertonlybutton').length){jQuery('#TB_iframeContent').contents().find('.media-item .savesend input[type=submit], #insertonlybutton').val(attachments_button_label);}
6
  if(jQuery('#TB_iframeContent').contents().find('#tab-type_url').length){jQuery('#TB_iframeContent').contents().find('#tab-type_url').hide();}
7
  if(jQuery('#TB_iframeContent').contents().find('tr.post_title').length){jQuery('#TB_iframeContent').contents().find('tr.image-size input[value="full"]').prop('checked',true);jQuery('#TB_iframeContent').contents().find('tr.post_title,tr.image_alt,tr.post_excerpt,tr.image-size,tr.post_content,tr.url,tr.align,tr.submit>td>a.del-link').hide();}}
8
  if(jQuery('#TB_iframeContent').contents().length==0&&attachments_hijacked_thickbox){clearInterval(attachments_button_label_updater);attachments_hijacked_thickbox=false;}}
9
+ function attachments_handle_thickbox(event,theparent){var href=theparent.attr('href'),width=jQuery(window).width(),H=jQuery(window).height(),W=(720<width)?720:width;if(!href)return;href=href.replace(/&width=[0-9]+/g,'');href=href.replace(/&height=[0-9]+/g,'');theparent.attr('href',href+'&width='+(W-80)+'&height='+(H-85));attachments_hijacked_thickbox=true;attachments_button_label_updater=setInterval(attachments_update_button_label,500);tb_show('Attach a file',event.target.href,false);}
10
+ if(parseFloat(jQuery.fn.jquery)>=1.7){jQuery(document).on("click","a#attachments-thickbox",function(event){theparent=jQuery(this);attachments_handle_thickbox(event,theparent);return false;});}else{jQuery('a#attachments-thickbox').live('click',function(event){theparent=jQuery(this);attachments_handle_thickbox(event,theparent);return false;});}
11
+ if(jQuery('div#attachments-list li').length==0){jQuery('#attachments-list').hide();}
12
+ function attachments_hook_delete_links(theparent){attachment_parent=theparent.parent().parent().parent();attachment_parent.slideUp(function(){attachment_parent.remove();jQuery('#attachments-list ul li').each(function(i,id){theparent.find('input.attachment_order').val(i+1);});if(jQuery('div#attachments-list li').length==0){jQuery('#attachments-list').slideUp(function(){jQuery('#attachments-list').hide();});}});}
13
+ if(parseFloat(jQuery.fn.jquery)>=1.7){jQuery(document).on("click","span.attachment-delete a",function(event){theparent=jQuery(this);attachments_hook_delete_links(theparent);return false;});}else{jQuery('span.attachment-delete a').live('click',function(event){theparent=jQuery(this);attachments_hook_delete_links(theparent);return false;});}
14
+ setInterval('init_attachments_sortable()',500);});
languages/attachments-pl_PL.mo CHANGED
Binary file
languages/attachments-pl_PL.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Attachments pl_PL 1.5.6\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-08-14 23:32+0100\n"
6
- "PO-Revision-Date: 2011-08-14 23:36+0100\n"
7
  "Last-Translator: Wiktor Maj <w.maj@majpage.com>\n"
8
  "Language-Team: Wiktor Maj <w.maj@majpage.com>\n"
9
  "MIME-Version: 1.0\n"
@@ -17,47 +17,51 @@ msgstr ""
17
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
18
  "X-Poedit-SearchPath-0: ..\n"
19
 
20
- #: ../attachments.options.php:29
 
 
 
 
21
  msgid "Post Type Settings"
22
- msgstr "Ustawienia Custom Post Types"
23
 
24
- #: ../attachments.options.php:30
25
  msgid "Include Attachments in the following Post Types:"
26
- msgstr "Dodaj załączniki do następujących Custom Post Types:"
27
 
28
- #: ../attachments.options.php:42
29
  msgid "Attachments can be integrated with your Custom Post Types. Unfortunately, there are none to work with at this time."
30
  msgstr "Załączniki mogą być zintegrowane z Custom Post Types. Niestety w tej chwili nie ma żadnych zarejestrowanych Custom Post Types."
31
 
32
- #: ../attachments.options.php:48
33
  msgid "Miscellaneous"
34
  msgstr "Różne"
35
 
36
- #: ../attachments.options.php:58
37
  msgid "Save"
38
  msgstr "Zapisz"
39
 
40
- #: ../attachments.php:49
41
  msgid "Attachments requires PHP 5.2 or higher, as will WordPress 3.2 and higher. It has been automatically deactivated."
42
  msgstr "Załączniki wymagają PHP w wersji 5.2 lub wyższej, a także WordPressa w wersji 3.2 lub wyższej. Plugin został automatycznie wyłączony."
43
 
44
- #: ../attachments.php:156
45
  msgid "Attach"
46
  msgstr "Załącz"
47
 
48
- #: ../attachments.php:180
49
  msgid "Delete"
50
  msgstr "Usuń"
51
 
52
- #: ../attachments.php:184
53
  msgid "Title"
54
  msgstr "Tytuł"
55
 
56
- #: ../attachments.php:188
57
  msgid "Caption"
58
  msgstr "Opis"
59
 
60
- #: ../attachments.php:236
61
  msgid "Attachments"
62
  msgstr "Załączniki"
63
 
2
  msgstr ""
3
  "Project-Id-Version: Attachments pl_PL 1.5.6\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-10-23 11:05+0100\n"
6
+ "PO-Revision-Date: 2011-10-23 11:05+0100\n"
7
  "Last-Translator: Wiktor Maj <w.maj@majpage.com>\n"
8
  "Language-Team: Wiktor Maj <w.maj@majpage.com>\n"
9
  "MIME-Version: 1.0\n"
17
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
18
  "X-Poedit-SearchPath-0: ..\n"
19
 
20
+ #: ../attachments.options.php:19
21
+ msgid "<p><strong>Attachments Pro is now available!</strong> <a href=\"http://mondaybynoon.com/store/attachments-pro/\">Find out more</a> about Attachments Pro. <a href=\"options-general.php?page=attachments/attachments.php&dismisspro=1\">Dismiss</a>.</p>"
22
+ msgstr "<p><strong>Dostępna jest wtyczka Attachments Pro!</strong> <a href=\"http://mondaybynoon.com/store/attachments-pro/\">Dowiedz się więcej</a> o Attachments Pro. <a href=\"options-general.php?page=attachments/attachments.php&dismisspro=1\">Usuń komunikat</a>.</p>"
23
+
24
+ #: ../attachments.options.php:48
25
  msgid "Post Type Settings"
26
+ msgstr "Ustawienia typów wpisów"
27
 
28
+ #: ../attachments.options.php:49
29
  msgid "Include Attachments in the following Post Types:"
30
+ msgstr "Dodaj Załączniki do następujących typów wpisów:"
31
 
32
+ #: ../attachments.options.php:61
33
  msgid "Attachments can be integrated with your Custom Post Types. Unfortunately, there are none to work with at this time."
34
  msgstr "Załączniki mogą być zintegrowane z Custom Post Types. Niestety w tej chwili nie ma żadnych zarejestrowanych Custom Post Types."
35
 
36
+ #: ../attachments.options.php:67
37
  msgid "Miscellaneous"
38
  msgstr "Różne"
39
 
40
+ #: ../attachments.options.php:77
41
  msgid "Save"
42
  msgstr "Zapisz"
43
 
44
+ #: ../attachments.php:52
45
  msgid "Attachments requires PHP 5.2 or higher, as will WordPress 3.2 and higher. It has been automatically deactivated."
46
  msgstr "Załączniki wymagają PHP w wersji 5.2 lub wyższej, a także WordPressa w wersji 3.2 lub wyższej. Plugin został automatycznie wyłączony."
47
 
48
+ #: ../attachments.php:182
49
  msgid "Attach"
50
  msgstr "Załącz"
51
 
52
+ #: ../attachments.php:206
53
  msgid "Delete"
54
  msgstr "Usuń"
55
 
56
+ #: ../attachments.php:210
57
  msgid "Title"
58
  msgstr "Tytuł"
59
 
60
+ #: ../attachments.php:214
61
  msgid "Caption"
62
  msgstr "Opis"
63
 
64
+ #: ../attachments.php:261
65
  msgid "Attachments"
66
  msgstr "Załączniki"
67
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: jchristopher
3
  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.9
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
 
@@ -62,6 +62,11 @@ Attachments uses WordPress' built in Media library for uploads and storage.
62
 
63
  == Changelog ==
64
 
 
 
 
 
 
65
  = 1.5.9 =
66
  * Retrieve file size when `firing attachments_get_attachments()`
67
 
3
  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.3
7
+ Stable tag: 1.5.10
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
 
62
 
63
  == Changelog ==
64
 
65
+ = 1.5.10 =
66
+ * WordPress 3.3 compatibility
67
+ * Updated Polish translation
68
+ * Removed soon-to-be deprecated jQuery methods in prep for 1.7
69
+
70
  = 1.5.9 =
71
  * Retrieve file size when `firing attachments_get_attachments()`
72