PluginProbe
Team Showcase / 1.15
Team Showcase v1.15
trunk 1.0 1.1 1.11 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.21 1.21.1 1.21.2 1.21.3 1.21.4 1.21.5 1.22.0 1.22.1 1.22.10 1.22.12 1.22.13 1.22.14 All 49 releases
team / js / scripts-admin.js

scripts-admin.js in Team Showcase 1.15, at js/scripts-admin.js

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