| 1 |
|
| 2 |
jQuery(document).ready(function($) |
| 3 |
{ |
| 4 |
|
| 5 |
|
| 6 |
$(document).on('click', '#team_metabox .team-grid-builder .expand', function() |
| 7 |
{ |
| 8 |
|
| 9 |
//alert('Hello'); |
| 10 |
|
| 11 |
if($(this).parent().parent().hasClass('active')) |
| 12 |
{ |
| 13 |
$(this).parent().parent().removeClass('active'); |
| 14 |
} |
| 15 |
else |
| 16 |
{ |
| 17 |
$(this).parent().parent().addClass('active'); |
| 18 |
} |
| 19 |
|
| 20 |
|
| 21 |
}) |
| 22 |
|
| 23 |
|
| 24 |
$(document).on('click', '.team_member_social_icon', function() |
| 25 |
{ |
| 26 |
var team_member_social_icon = prompt("Please insert icon url",""); |
| 27 |
if(team_member_social_icon != null) |
| 28 |
{ |
| 29 |
var icon_name = $(this).attr("icon-name"); |
| 30 |
|
| 31 |
$(this).css("background-image",'url('+team_member_social_icon+')'); |
| 32 |
|
| 33 |
$(".team_member_social_icon_"+icon_name).val(team_member_social_icon); |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
}) |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
$(document).on('click', '.remove_icon', function() |
| 43 |
{ |
| 44 |
if (confirm('Do you really want to delete this field ?')) { |
| 45 |
|
| 46 |
$(this).parent().parent().remove(); |
| 47 |
} |
| 48 |
}) |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
$(document).on('click', '.team_content_source', function() |
| 54 |
{ |
| 55 |
var source = $(this).val(); |
| 56 |
var source_id = $(this).attr("id"); |
| 57 |
|
| 58 |
$(".content-source-box.active").removeClass("active"); |
| 59 |
$(".content-source-box."+source_id).addClass("active"); |
| 60 |
|
| 61 |
}) |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
$(document).on('click', '.reset_team_member_social_field', function() |
| 68 |
{ |
| 69 |
//alert('Hello'); |
| 70 |
if(confirm('Do you really want to reset ?')){ |
| 71 |
jQuery.ajax( |
| 72 |
{ |
| 73 |
type: 'POST', |
| 74 |
url: team_admin_ajax.team_admin_ajaxurl, |
| 75 |
data: {"action": "reset_team_member_social_field",}, |
| 76 |
success: function(data) |
| 77 |
{ |
| 78 |
//alert('Hello'); |
| 79 |
|
| 80 |
window.location.reload(); |
| 81 |
} |
| 82 |
}); |
| 83 |
|
| 84 |
} |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
}) |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
$(document).on('click', '.new_team_member_social_field', function() |
| 96 |
{ |
| 97 |
var user_profile_social = prompt("Please add new social site",""); |
| 98 |
|
| 99 |
if(user_profile_social != null && user_profile_social != '') |
| 100 |
{ |
| 101 |
$(".team_member_social_field").append('<tr><td class="sorting"></td><td><input type="text" value="'+user_profile_social+'" name="team_member_social_field['+user_profile_social+'][name]"></td><td><input type="text" name="team_member_social_field['+user_profile_social+'][meta_key]" value="'+user_profile_social+'" /></td><td><span class="team_member_social_icon empty_icon" icon-name="'+user_profile_social+'" title="Icon for this field." style=" "></span><input class="team_member_social_icon team_member_social_icon_'+user_profile_social+'" type="hidden" value="" name="team_member_social_field['+user_profile_social+'][icon]"></td><td><input type="checkbox" value="1" name="team_member_social_field['+user_profile_social+'][visibility]" checked=checked></td><td><span class="remove_icon">X</span><input type="hidden" value="yes" name="team_member_social_field['+user_profile_social+'][can_remove]"></td></tr>'); |
| 102 |
} |
| 103 |
|
| 104 |
|
| 105 |
}) |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
$(document).on('click', '.add_team_member_skill', function() |
| 110 |
{ |
| 111 |
var skill_name = prompt("Skill name ?",""); |
| 112 |
|
| 113 |
if(skill_name != null && skill_name != '') |
| 114 |
{ |
| 115 |
$(".team-member-skills").append('<tr><td class="sorting"></td><td><input type="text" value="'+skill_name+'" name="team_member_skill['+skill_name+'][name]" placeholder="Programming" size="30"></td><td><input type="text" value="" name="team_member_skill['+skill_name+'][value]" placeholder="80%" size="30"></td><td><span class="remove-skill">X</span></td></tr>'); |
| 116 |
} |
| 117 |
|
| 118 |
|
| 119 |
}) |
| 120 |
|
| 121 |
|
| 122 |
$(document).on('click', '.remove-skill', function() |
| 123 |
{ |
| 124 |
if (confirm('Do you really want to delete this field ?')) { |
| 125 |
|
| 126 |
$(this).parent().parent().remove(); |
| 127 |
} |
| 128 |
}) |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
$(document).on('click', '.add_team_member_meta', function() |
| 135 |
{ |
| 136 |
var meta_name = prompt("Meta name ?",""); |
| 137 |
|
| 138 |
if(meta_name != null && meta_name != '') |
| 139 |
{ |
| 140 |
$(".team-member-meta-fields").append('<tr><td class="sorting"></td><td><input type="text" value="'+meta_name+'" name="team_member_meta_fields['+meta_name+'][name]" placeholder="" size="30"></td><td><input type="text" value="'+meta_name+'" name="team_member_meta_fields['+meta_name+'][meta_key]" placeholder="meta_key" size="30"></td><td><span class="remove-meta">X</span></td></tr>'); |
| 141 |
} |
| 142 |
|
| 143 |
|
| 144 |
}) |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
$(document).on('click', '.team-member-meta-fields .remove-meta', function() |
| 149 |
{ |
| 150 |
if (confirm('Do you really want to delete this field ?')) { |
| 151 |
|
| 152 |
$(this).parent().parent().remove(); |
| 153 |
} |
| 154 |
}) |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
}); |
| 161 |
|