this function was only referenced once

This commit is contained in:
Shish 2012-02-12 11:45:18 +00:00
parent 9472a1014c
commit 766cc9e959
2 changed files with 77 additions and 77 deletions

View File

@ -1,68 +1,77 @@
function find_thumb_link_containers () {
function toggle_tag( button, id ) {
id += ":"; var post_link = "a[href*='/post/view/']";
var list = $('#mass_tagger_ids'); var has_thumb_img = ":has(img[src*='/thumb/'])";
var string = list.val();
var list = $( post_link + has_thumb_img ).parent();
if( string.indexOf( id ) > -1 ) return remove_mass_tag_id( button, list, id, string );
return list;
return add_mass_tag_id( button, list, id, string ); }
}
function toggle_tag( button, id ) {
function add_mass_tag_id( button, list, id, string ) { id += ":";
$(button).attr( 'style', 'display:block;border: 3px solid blue;' ); var list = $('#mass_tagger_ids');
string += id; var string = list.val();
list.val( string );
return false; if( string.indexOf( id ) > -1 ) return remove_mass_tag_id( button, list, id, string );
}
return add_mass_tag_id( button, list, id, string );
function remove_mass_tag_id( button, list, id, string ) { }
$(button).attr( 'style', '' );
string = string.replace( id, '' ); function add_mass_tag_id( button, list, id, string ) {
list.val( string ); $(button).attr( 'style', 'display:block;border: 3px solid blue;' );
return false; string += id;
} list.val( string );
return false;
function activate_mass_tagger ( image_link ) { }
find_thumb_link_containers().each( function remove_mass_tag_id( button, list, id, string ) {
function ( index, block ) { $(button).attr( 'style', '' );
add_mass_tag_button( block, image_link ); string = string.replace( id, '' );
} list.val( string );
); return false;
$('#mass_tagger_controls').attr( 'style', 'display:block' ); }
$('#mass_tagger_activate').attr( 'style', 'display:none' );
function activate_mass_tagger ( image_link ) {
return false;
} find_thumb_link_containers().each(
function ( index, block ) {
function add_mass_tag_button ( block, image_link ) { add_mass_tag_button( block, image_link );
}
var id = get_image_id( block ); );
$('#mass_tagger_controls').attr( 'style', 'display:block' );
var button = create_mass_tag_button( id, image_link ); $('#mass_tagger_activate').attr( 'style', 'display:none' );
$(block).append( button );
return false;
return; }
}
function add_mass_tag_button ( block, image_link ) {
function get_image_id ( block ) {
var link = $(block).children(":first").attr('href'); var id = get_image_id( block );
var id = link.split('/').pop();
var button = create_mass_tag_button( id, image_link );
return id; $(block).append( button );
}
return;
function create_mass_tag_button ( id, image_link ) { }
var img = $('<img />');
img.attr( "src", image_link+'/ext/mass_tagger/toggle.gif' ); function get_image_id ( block ) {
var link = $(block).children(":first").attr('href');
var link = $('<a />'); var id = link.split('/').pop();
link.attr("class",'zoom');
link.attr("onclick",'return toggle_tag( this, "'+id+'")'); return id;
link.attr("href",'#'); }
link.append( img ); function create_mass_tag_button ( id, image_link ) {
var img = $('<img />');
return link; img.attr( "src", image_link+'/ext/mass_tagger/toggle.gif' );
}
var link = $('<a />');
link.attr("class",'zoom');
link.attr("onclick",'return toggle_tag( this, "'+id+'")');
link.attr("href",'#');
link.append( img );
return link;
}

View File

@ -1,9 +0,0 @@
function find_thumb_link_containers () {
var post_link = "a[href*='/post/view/']";
var has_thumb_img = ":has(img[src*='/thumb/'])";
var list = $( post_link + has_thumb_img ).parent();
return list;
}