PluginProbe
Tracking Script Manager / 1.0.8
Tracking Script Manager v1.0.8
trunk 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 All 33 releases
tracking-script-manager / js / main.js

main.js in Tracking Script Manager 1.0.8, at js/main.js

64 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(document).ready(function($) {
2 $('.tracking_script .active_tracking').click(function(e) {
3 var active = $(this).siblings('.script_active').attr('value');
4
5 $(this).removeClass('fa-circle-o');
6 $(this).removeClass('fa-check-circle');
7
8 if(active === 'true') {
9 $(this).addClass('fa-circle-o');
10 $(this).attr('title', 'Activate Script');
11 $(this).siblings('.script_active').attr('value', 'false');
12 } else {
13 $(this).addClass('fa-check-circle');
14 $(this).attr('title', 'Deactive Script');
15 $(this).siblings('.script_active').attr('value', 'true');
16 }
17 });
18
19 $('.tracking_script .edit_tracking').click(function(e) {
20 $(this).removeClass('fa-edit');
21 $(this).removeClass('fa-save');
22
23 if($(this).siblings('.script_info').find('input[type="text"]').attr('readonly') === 'readonly') {
24 $(this).siblings('.script_info').find('input[type="text"]').attr('readonly', false);
25 $(this).addClass('fa-save');
26 $(this).attr('title', 'Save Script');
27 } else {
28 $('.tracking_scripts_wrap form').submit();
29 $(this).siblings('.script_info').find('input[type="text"]').attr('readonly', 'readonly');
30 $(this).addClass('fa-edit');
31 $(this).attr('title', 'Edit Script');
32 }
33 });
34
35 $('.tracking_script .delete_tracking').click(function(e) {
36 var confirmed = confirm("Are you sure you want to delete this script?");
37 if(confirmed) {
38 $(this).parent().fadeOut(400, function() {
39 $(this).find('.script_exists').attr('value', 'false');
40
41 var index = 1;
42 $(this).parent().find('.tracking_script').each(function(i) {
43 if($(this).css('display') === 'block') {
44 $(this).find('> p').text(index);
45 $(this).find('.script_order').attr('value', index);
46 index++;
47 }
48 });
49
50 $('.tracking_scripts_wrap form').submit();
51 });
52 }
53 });
54
55 $('.tracking_scripts').sortable({
56 update: function(event, ui) {
57 $(this).find('.tracking_script').each(function(i) {
58 i++;
59 $(this).find('> p').text(i);
60 $(this).find('.script_order').attr('value', i);
61 });
62 }
63 });
64 });