Permalink
Browse files

Release 0.5.5 tag

git-svn-id: http://svn.wp-plugins.org/file-un-attach/tags/0.5.0@401959 b8457f37-d9ea-0310-8a92-e5e31aec5664
  • Loading branch information...
Hax Hax
Hax authored and Hax committed Jun 28, 2011
0 parents commit 057ce035e4256842b5eccf97425158b2fd34c54b
Showing with 931 additions and 0 deletions.
  1. +10 −0 FAQ.txt
  2. +193 −0 admin.js
  3. +288 −0 admin.php
  4. +225 −0 ajax.php
  5. +106 −0 file-unattach.php
  6. +57 −0 front.php
  7. +52 −0 readme.txt
  8. BIN screenshot-1.png
  9. BIN screenshot-2.png
  10. BIN screenshot-3.png
10 FAQ.txt
@@ -0,0 +1,10 @@
+FAQ
+
+1. Where can I change the settings?
+There are no settings; the plugin adds functionality to the media screens.
+
+2. When I stall the plugin I get the following error "unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or �}�"
+This is because your using PHP4 and this plugin only works with PHP5
+
+3. How can I make donation to continue the plugin development?
+here is the link https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8SJEQXK5NK4ES
193 admin.js
@@ -0,0 +1,193 @@
+// Object Copied from media-dev.js and renamed
+var funFindPosts;
+(function($){
+ funFindPosts = {
+ open : function(af_name, af_val) {
+ var st = document.documentElement.scrollTop || $(document).scrollTop();
+
+ if ( af_name && af_val ) {
+ $('#fun-affected').attr('name', af_name).val(af_val);
+ }
+ $('#fun-find-posts').show().draggable({
+ handle: '#fun-find-posts-head'
+ }).css({'top':st + 50 + 'px','left':'50%','marginLeft':'-250px'});
+
+ $('#fun-find-posts-input').val('');
+ $('#fun-find-posts-input').focus().keyup(function(e){
+ if (e.which == 27) { funFindPosts.close(); } // close on Escape
+ });
+
+ return false;
+ },
+
+ close : function() {
+ $('#fun-find-posts-response').html('');
+ $('#fun-find-posts').draggable('destroy').hide();
+ },
+
+ send : function() {
+ var post = {
+ action: 'find_posts',
+ ps: $('#fun-find-posts-input').val(),
+ _wpnonce : funlocal.nonceajax
+ };
+
+ var selectedItem;
+ $("input[type='radio']:checked").each(function() { selectedItem = $(this).val() });
+ post['post_type'] = selectedItem;
+
+ var excludeIds = '';
+ $("#fun-find-posts-response input[type='checkbox']")
+ .each(function(){ excludeIds += $(this).val()+',';});
+ post['exclude'] = excludeIds; excludeIds= '';
+
+ $.ajax({
+ type : 'GET',
+ data : post,
+ url : funlocal.adminurl+"ajax.php",
+ success : function(x) { funFindPosts.show(x); },
+ error : function(r) { funFindPosts.error(r); }
+ });
+ },
+
+ attchd: function(imgid) {
+ var post = {
+ img: imgid,
+ action: 'find_attached',
+ ps: $('#fun-find-posts-input').val(),
+ _wpnonce : funlocal.nonceajax
+ };
+
+ $.ajax({
+ data : post,
+ type : 'GET',
+ url : funlocal.adminurl+"ajax.php",
+ success : function(x) { funFindPosts.show(x); },
+ error : function(r) { funFindPosts.error(r); }
+ });
+ },
+
+ show : function(x) {
+ $('.fun-search-results').remove();
+ if ( typeof(x) == 'string' ) {
+ this.error({'responseText': x});
+ return;
+ }
+
+ var r = wpAjax.parseAjaxResponse(x);
+
+ if ( r.errors ) {
+ this.error({'responseText': wpAjax.broken});
+ }
+ r = r.responses[0];
+ $('#fun-find-posts-response').append(r.data);
+ },
+
+ error : function(r) {
+ $('.fun-search-results').remove();
+ var er = r.statusText;
+ if ( r.responseText ) {
+ er = r.responseText;
+ }
+ if ( er ) {
+ $('#fun-find-posts-response').append(er);
+ }
+ }
+ };
+
+ $(document).ready(function() {
+ $('#fun-find-posts-submit').click(function(e) {
+ if ( '' == $('#fun-find-posts-response').html() )
+ e.preventDefault();
+ });
+ $( '#fun-find-posts .find-box-search :input' ).keypress( function( event ) {
+ if ( 13 == event.which ) {
+ funFindPosts.send();
+ return false;
+ }
+ } );
+ $('#fun-find-posts-search').click( funFindPosts.send );
+ $('#fun-find-posts-close' ).click( funFindPosts.close );
+ $('#doaction, #doaction2').click(function(e){
+ $('select[name^="action"]').each(function(){
+ if ( $(this).val() == 'attach' ) {
+ e.preventDefault();
+ funFindPosts.open();
+ }
+ });
+ });
+ });
+})(jQuery);
+
+// File Un-attach functions
+jQuery(document).ready(function($){
+
+ $('.funattach').live('click',function(){
+ id = $(this).attr('name').replace('unattach-','');
+ $('.fun-mess-'+id).show();
+ return false;
+ });
+
+ $('.fun-no').live('click',function(){
+ $(this).parents('.fun-message').hide();
+ return false;
+ });
+
+ $('.fun-yes').live('click',function(){
+ id = $(this).attr('id').replace('file-unattch-','');
+ count = parseInt($('#attachments-count').html());
+ if(count > 0) $('#attachments-count').html(count-1)
+ $.get(funlocal.adminurl+"ajax.php",{
+ imageid :id,
+ action :'unattach',
+ postid :$('#post_id').val(),
+ _wpnonce :funlocal.nonceajax
+ })
+ $(this).parents('.media-item').fadeOut('slow');
+ return false;
+ });
+
+ $('.fun-unattach-row').live('click',function(){
+ id = $(this).attr('id').replace('file-unattch-','');
+ $.get(funlocal.adminurl+"ajax.php",{
+ imageid :id,
+ action :'unattach',
+ postid :$('#post_id').val(),
+ _wpnonce :funlocal.nonceajax
+ })
+ td = $(this).parents('td');
+ td.find('span').remove();
+ td.find('strong').replaceWith('('+funlocal.unattach+')');
+ $(this).remove();
+ return false;
+ });
+
+
+ $('.fileattach').click(function(){
+ id = $(this).attr('name').replace('attach-','');
+
+ $(this).hide();
+ $('.fun-mess-'+id).show();
+ $('#attachments-count').html(parseInt($('#attachments-count').html())+1)
+ $.get(funlocal.adminurl+"ajax.php",{
+ imageid :id,
+ action :'attach',
+ postid :$('#post_id').val(),
+ _wpnonce :funlocal.nonceajax
+ })
+ return false;
+ });
+
+ $('.fun-find-posts').click(function(){
+ id = $(this).attr('id').replace('fun-find-posts-','');
+ funFindPosts.open('media[]',id);
+ return false;
+ });
+
+ $('.attached-list').click(function(){
+ id = $(this).attr('id').replace('attached-list-','');
+ funFindPosts.open('media[]',id);
+ funFindPosts.attchd(id);
+ return false;
+ });
+});
Oops, something went wrong.

0 comments on commit 057ce03

Please sign in to comment.