PluginProbe
Timed Content / 2.70
Timed Content v2.70
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
← All changes | js/timed-content-admin.js +73 -61 2.12.70 View file →
@@ -1,61 +1,73 @@
1 -jQuery( document ).ready( function() {
2 - jQuery( "select#timed_content_rule_frequency" ).change( function() {
3 - jQuery( "select#timed_content_rule_frequency option:selected" ).each( function() {
4 - if ( jQuery( this ).val() == '0' )
5 - jQuery( "#timed_content_rule_hourly_num_of_hours_div" ).css( "display", "block" );
6 - else
7 - jQuery( "#timed_content_rule_hourly_num_of_hours_div" ).css( "display", "none" );
8 - if ( jQuery( this ).val() == '1' )
9 - jQuery( "#timed_content_rule_daily_num_of_days_div" ).css( "display", "block" );
10 - else
11 - jQuery( "#timed_content_rule_daily_num_of_days_div" ).css( "display", "none" );
12 - if ( jQuery( this ).val() == '2' ) {
13 - jQuery( "#timed_content_rule_weekly_num_of_weeks_div" ).css( "display", "block" );
14 - jQuery( "#timed_content_rule_weekly_days_of_week_to_repeat_div" ).css( "display", "block" );
15 - } else {
16 - jQuery( "#timed_content_rule_weekly_num_of_weeks_div" ).css( "display", "none" );
17 - jQuery( "#timed_content_rule_weekly_days_of_week_to_repeat_div" ).css( "display", "none" );
18 - }
19 - if ( jQuery( this ).val() == '3' ) {
20 - jQuery( "#timed_content_rule_monthly_num_of_months_div" ).css( "display", "block" );
21 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_div" ).css( "display", "block" );
22 - // Check the 'timed_content_rule_monthly_nth_weekday_of_month' checkbox when first displayed...
23 - if ( jQuery( "#timed_content_rule_monthly_nth_weekday_of_month" ).prop( "checked" ) ) {
24 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_nth_div" ).css( "display", "block" );
25 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_weekday_div" ).css( "display", "block" );
26 - } else {
27 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_nth_div" ).css( "display", "none" );
28 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_weekday_div" ).css( "display", "none" );
29 - }
30 - // ...then watch it for changes.
31 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month" ).change( function() {
32 - if ( jQuery( this ).prop( "checked" ) ) {
33 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_nth_div" ).css( "display", "block" );
34 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_weekday_div" ).css( "display", "block" );
35 - } else {
36 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_nth_div" ).css( "display", "none" );
37 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_weekday_div" ).css( "display", "none" );
38 - }
39 - });
40 - } else {
41 - jQuery( "#timed_content_rule_monthly_num_of_months_div" ).css( "display", "none" );
42 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_div" ).css( "display", "none" );
43 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_nth_div" ).css( "display", "none" );
44 - jQuery( "#timed_content_rule_monthly_nth_weekday_of_month_weekday_div" ).css( "display", "none" );
45 - }
46 - if ( jQuery( this ).val() == '4' )
47 - jQuery( "#timed_content_rule_yearly_num_of_years_div" ).css( "display", "block" );
48 - else
49 - jQuery( "#timed_content_rule_yearly_num_of_years_div" ).css( "display", "none" );
50 - })
51 - }).trigger( "change" );
52 - jQuery( "input[name=timed_content_rule_recurrence_duration]" ).change( function() {
53 - if ( jQuery( "input[name=timed_content_rule_recurrence_duration]:checked" ).val() == "recurrence_duration_end_date" ) {
54 - jQuery( "#timed_content_rule_recurrence_duration_end_date_div" ).css( "display", "block" );
55 - jQuery( "#timed_content_rule_recurrence_duration_num_repeat_div" ).css( "display", "none" );
56 - } else {
57 - jQuery( "#timed_content_rule_recurrence_duration_end_date_div" ).css( "display", "none" );
58 - jQuery( "#timed_content_rule_recurrence_duration_num_repeat_div" ).css( "display", "block" );
59 - }
60 - }).trigger( "change" );
61 -});
1 +jQuery(document).ready(function () {
2 + jQuery("select#timed_content_rule_frequency").change(function () {
3 + jQuery("select#timed_content_rule_frequency option:selected").each(function () {
4 + if (jQuery(this).val() == '0')
5 + jQuery("#timed_content_rule_hourly_num_of_hours_div").css("display", "block");
6 + else
7 + jQuery("#timed_content_rule_hourly_num_of_hours_div").css("display", "none");
8 + if (jQuery(this).val() == '1')
9 + jQuery("#timed_content_rule_daily_num_of_days_div").css("display", "block");
10 + else
11 + jQuery("#timed_content_rule_daily_num_of_days_div").css("display", "none");
12 + if (jQuery(this).val() == '2') {
13 + jQuery("#timed_content_rule_weekly_num_of_weeks_div").css("display", "block");
14 + jQuery("#timed_content_rule_weekly_days_of_week_to_repeat_div").css("display", "block");
15 + } else {
16 + jQuery("#timed_content_rule_weekly_num_of_weeks_div").css("display", "none");
17 + jQuery("#timed_content_rule_weekly_days_of_week_to_repeat_div").css("display", "none");
18 + }
19 + if (jQuery(this).val() == '3') {
20 + jQuery("#timed_content_rule_monthly_num_of_months_div").css("display", "block");
21 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_div").css("display", "block");
22 + // Check the 'timed_content_rule_monthly_nth_weekday_of_month' checkbox when first displayed...
23 + if (jQuery("#timed_content_rule_monthly_nth_weekday_of_month").prop("checked")) {
24 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_nth_div").css("display", "block");
25 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_weekday_div").css("display", "block");
26 + } else {
27 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_nth_div").css("display", "none");
28 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_weekday_div").css("display", "none");
29 + }
30 + // ...then watch it for changes.
31 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month").change(function () {
32 + if (jQuery(this).prop("checked")) {
33 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_nth_div").css("display", "block");
34 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_weekday_div").css("display", "block");
35 + } else {
36 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_nth_div").css("display", "none");
37 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_weekday_div").css("display", "none");
38 + }
39 + });
40 + } else {
41 + jQuery("#timed_content_rule_monthly_num_of_months_div").css("display", "none");
42 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_div").css("display", "none");
43 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_nth_div").css("display", "none");
44 + jQuery("#timed_content_rule_monthly_nth_weekday_of_month_weekday_div").css("display", "none");
45 + }
46 + if (jQuery(this).val() == '4')
47 + jQuery("#timed_content_rule_yearly_num_of_years_div").css("display", "block");
48 + else
49 + jQuery("#timed_content_rule_yearly_num_of_years_div").css("display", "none");
50 + })
51 + }).trigger("change");
52 + jQuery("input[name=timed_content_rule_recurrence_duration]").change(function () {
53 + if (jQuery("input[name=timed_content_rule_recurrence_duration]:checked").val() == "recurrence_duration_end_date") {
54 + jQuery("#timed_content_rule_recurrence_duration_end_date_div").css("display", "block");
55 + jQuery("#timed_content_rule_recurrence_duration_num_repeat_div").css("display", "none");
56 + } else {
57 + jQuery("#timed_content_rule_recurrence_duration_end_date_div").css("display", "none");
58 + jQuery("#timed_content_rule_recurrence_duration_num_repeat_div").css("display", "block");
59 + }
60 + }).trigger("change");timed_content_rule_exceptions_dates_picker
61 +
62 + jQuery("#timed_content_rule_exceptions_dates").on("dblclick", "option", function(){
63 + jQuery(this).remove();
64 + if (jQuery("#timed_content_rule_exceptions_dates option").length == 0 )
65 + jQuery("#timed_content_rule_exceptions_dates").append( '<option value="0">' + timedContentRuleAdmin.no_exceptions_label + '</option>' );
66 + jQuery("#timed_content_rule_exceptions_dates_picker").trigger("change");
67 +
68 + });
69 + jQuery("#publish").on("click", function() {
70 + jQuery("#timed_content_rule_exceptions_dates option[value='0']" ).remove();
71 + jQuery("#timed_content_rule_exceptions_dates option").attr("selected", "selected");
72 + });
73 +});