PluginProbe
Timed Content / 2.99
Timed Content v2.99
2.99 trunk 1.0 1.1 1.2 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.10 2.11 2.12 2.15 2.2 2.3 2.3.1 2.4 2.5 2.5.1 2.50 2.51 2.52 All 67 releases
timed-content / js / timed-content-admin.js

timed-content-admin.js in Timed Content 2.99, at js/timed-content-admin.js

94 lines 4.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery( document ).ready(
2 function () {
3 jQuery( "select#timed_content_rule_frequency" ).change(
4 function () {
5 jQuery( "select#timed_content_rule_frequency option:selected" ).each(
6 function () {
7 if (jQuery( this ).val() == '0') {
8 jQuery( "#timed_content_rule_hourly_num_of_hours_div" ).css( "display", "block" );
9 } else {
10 jQuery( "#timed_content_rule_hourly_num_of_hours_div" ).css( "display", "none" );
11 }
12 if (jQuery( this ).val() == '1') {
13 jQuery( "#timed_content_rule_daily_num_of_days_div" ).css( "display", "block" );
14 } else {
15 jQuery( "#timed_content_rule_daily_num_of_days_div" ).css( "display", "none" );
16 }
17 if (jQuery( this ).val() == '2') {
18 jQuery( "#timed_content_rule_weekly_num_of_weeks_div" ).css( "display", "block" );
19 jQuery( "#timed_content_rule_weekly_days_of_week_to_repeat_div" ).css( "display", "block" );
20 } else {
21 jQuery( "#timed_content_rule_weekly_num_of_weeks_div" ).css( "display", "none" );
22 jQuery( "#timed_content_rule_weekly_days_of_week_to_repeat_div" ).css( "display", "none" );
23 }
24 if (jQuery( this ).val() == '3') {
25 jQuery( "#timed_content_rule_monthly_num_of_months_div" ).css( "display", "block" );
26 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_div" ).css( "display", "block" );
27 // Check the 'timed_content_rule_monthly_nth_weekday_of_month' checkbox when first displayed...
28 if (jQuery( "#timed_content_rule_monthly_nth_weekday_of_month" ).prop( "checked" )) {
29 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_nth_div" ).css( "display", "block" );
30 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_weekday_div" ).css( "display", "block" );
31 } else {
32 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_nth_div" ).css( "display", "none" );
33 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_weekday_div" ).css( "display", "none" );
34 }
35 // ...then watch it for changes.
36 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month" ).change(
37 function () {
38 if (jQuery( this ).prop( "checked" )) {
39 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_nth_div" ).css( "display", "block" );
40 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_weekday_div" ).css( "display", "block" );
41 } else {
42 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_nth_div" ).css( "display", "none" );
43 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_weekday_div" ).css( "display", "none" );
44 }
45 }
46 );
47 } else {
48 jQuery( "#timed_content_rule_monthly_num_of_months_div" ).css( "display", "none" );
49 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_div" ).css( "display", "none" );
50 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_nth_div" ).css( "display", "none" );
51 jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_weekday_div" ).css( "display", "none" );
52 }
53 if (jQuery( this ).val() == '4') {
54 jQuery( "#timed_content_rule_yearly_num_of_years_div" ).css( "display", "block" );
55 } else {
56 jQuery( "#timed_content_rule_yearly_num_of_years_div" ).css( "display", "none" );
57 }
58 }
59 )
60 }
61 ).trigger( "change" );
62 jQuery( "input[name=timed_content_rule_recurrence_duration]" ).change(
63 function () {
64 if (jQuery( "input[name=timed_content_rule_recurrence_duration]:checked" ).val() == "recurrence_duration_end_date") {
65 jQuery( "#timed_content_rule_recurrence_duration_end_date_div" ).css( "display", "block" );
66 jQuery( "#timed_content_rule_recurrence_duration_num_repeat_div" ).css( "display", "none" );
67 } else {
68 jQuery( "#timed_content_rule_recurrence_duration_end_date_div" ).css( "display", "none" );
69 jQuery( "#timed_content_rule_recurrence_duration_num_repeat_div" ).css( "display", "block" );
70 }
71 }
72 ).trigger( "change" );
73 jQuery( "#timed_content_rule_exceptions_dates" ).on(
74 "dblclick",
75 "option",
76 function(){
77 jQuery( this ).remove();
78 if (jQuery( "#timed_content_rule_exceptions_dates option" ).length == 0 ) {
79 jQuery( "#timed_content_rule_exceptions_dates" ).append( '<option value="0">' + timedContentRuleAdmin.no_exceptions_label + '</option>' );
80 }
81 jQuery( "#timed_content_rule_exceptions_dates_picker" ).trigger( "change" );
82
83 }
84 );
85 jQuery( "#publish" ).on(
86 "click",
87 function() {
88 jQuery( "#timed_content_rule_exceptions_dates option[value='0']" ).remove();
89 jQuery( "#timed_content_rule_exceptions_dates option" ).attr( "selected", "selected" );
90 }
91 );
92 }
93 );
94