| @@ -1,11 +1,40 @@ | ||
| 1 | +<script type="text/javascript"> | |
| 2 | + | |
| 1 | 3 | <?php |
| 2 | -// this is the javascript code for the ckeck/uncheck all forecast boxes | |
| 4 | +/** | |
| 5 | + * This toggles the new window field. | |
| 6 | + * | |
| 7 | + * @package wp-forecast | |
| 8 | + */ | |
| 9 | + | |
| 3 | 10 | ?> |
| 4 | -<script type="text/javascript"> | |
| 11 | + | |
| 12 | +function nwfields_update() | |
| 13 | +{ | |
| 14 | + obja=document.getElementById('d_c_accuweather'); | |
| 15 | + objb=document.getElementById('d_c_aw_newwindow'); | |
| 16 | + objb.disabled = (obja.checked == false); | |
| 17 | +} | |
| 18 | + | |
| 19 | +<?php | |
| 20 | +// this toggles the visitorlocation / location fields. | |
| 21 | +?> | |
| 22 | + | |
| 23 | +function vlocfields_update() | |
| 24 | +{ | |
| 25 | + obja=document.getElementById('location'); | |
| 26 | + objb=document.getElementById('visitorlocation'); | |
| 27 | + obja.readOnly = (objb.checked == true); | |
| 28 | +} | |
| 29 | + | |
| 30 | + | |
| 31 | +<?php | |
| 32 | +// this is the javascript code for the ckeck/uncheck all forecast boxes. | |
| 33 | +?> | |
| 5 | 34 | function check(fname) |
| 6 | - { | |
| 7 | - if (fname=="day") { | |
| 35 | + { | |
| 36 | + if (fname=="day") { | |
| 8 | 37 | sammelvalue=document.woptions.alldays.checked; |
| 9 | 38 | document.woptions.day1.checked=sammelvalue; |
| 10 | 39 | document.woptions.day2.checked=sammelvalue; |
| 11 | 40 | document.woptions.day3.checked=sammelvalue; |
| @@ -14,9 +43,9 @@ | ||
| 14 | 43 | document.woptions.day6.checked=sammelvalue; |
| 15 | 44 | document.woptions.day7.checked=sammelvalue; |
| 16 | 45 | document.woptions.day8.checked=sammelvalue; |
| 17 | 46 | document.woptions.day9.checked=sammelvalue; |
| 18 | - } else { | |
| 47 | + } else { | |
| 19 | 48 | sammelvalue=document.woptions.allnight.checked; |
| 20 | 49 | document.woptions.night1.checked=sammelvalue; |
| 21 | 50 | document.woptions.night2.checked=sammelvalue; |
| 22 | 51 | document.woptions.night3.checked=sammelvalue; |
| @@ -25,180 +54,117 @@ | ||
| 25 | 54 | document.woptions.night6.checked=sammelvalue; |
| 26 | 55 | document.woptions.night7.checked=sammelvalue; |
| 27 | 56 | document.woptions.night8.checked=sammelvalue; |
| 28 | 57 | document.woptions.night9.checked=sammelvalue; |
| 29 | - } | |
| 30 | - return !sammelvalue; | |
| 31 | - } | |
| 58 | + } | |
| 59 | + return !sammelvalue; | |
| 60 | + } | |
| 32 | 61 | <?php |
| 33 | - // this is the javascript code for switchgin between weather providers | |
| 62 | + // this is the javascript code for switching between weather providers. | |
| 34 | 63 | ?> |
| 35 | 64 | function apifields(service) |
| 36 | - { | |
| 37 | - if (service=="accu") { | |
| 38 | - document.woptions.apikey1.disabled=true; | |
| 39 | - // document.woptions.apikey2.disabled=true; | |
| 40 | - if (typeof(document.woptions.allnight) != "undefined"){ | |
| 41 | - document.woptions.allnight.disabled=false; | |
| 42 | - document.woptions.night1.disabled=false; | |
| 43 | - document.woptions.night2.disabled=false; | |
| 44 | - document.woptions.night3.disabled=false; | |
| 45 | - document.woptions.night4.disabled=false; | |
| 46 | - document.woptions.night5.disabled=false; | |
| 47 | - document.woptions.night6.disabled=false; | |
| 48 | - document.woptions.night7.disabled=false; | |
| 49 | - document.woptions.night8.disabled=false; | |
| 50 | - document.woptions.night9.disabled=false; | |
| 51 | - document.woptions.day8.disabled=false; | |
| 52 | - document.woptions.day9.disabled=false; | |
| 53 | - document.woptions.d_d_wind.disabled=false; | |
| 54 | - document.woptions.d_n_wind.disabled=false; | |
| 55 | - document.woptions.d_d_wgusts.disabled=false; | |
| 56 | - document.woptions.d_n_wgusts.disabled=false; | |
| 57 | - | |
| 58 | - //document.woptions.searchloc.disabled=false; | |
| 59 | - //document.woptions.search_loc.disabled=false; | |
| 60 | - } | |
| 61 | - } | |
| 62 | - | |
| 63 | - if (service=="google") { | |
| 64 | - document.woptions.apikey1.disabled=false; | |
| 65 | - //document.woptions.apikey2.disabled=false; | |
| 66 | - if (typeof(document.woptions.allnight) != "undefined"){ | |
| 67 | - document.woptions.allnight.disabled=true; | |
| 68 | - document.woptions.night1.disabled=true; | |
| 69 | - document.woptions.night2.disabled=true; | |
| 70 | - document.woptions.night3.disabled=true; | |
| 71 | - document.woptions.night4.disabled=true; | |
| 72 | - document.woptions.night5.disabled=true; | |
| 73 | - document.woptions.night6.disabled=true; | |
| 74 | - document.woptions.night7.disabled=true; | |
| 75 | - document.woptions.night8.disabled=true; | |
| 76 | - document.woptions.night9.disabled=true; | |
| 77 | - document.woptions.day6.disabled=true; | |
| 78 | - document.woptions.day7.disabled=true; | |
| 79 | - document.woptions.day8.disabled=true; | |
| 80 | - document.woptions.day9.disabled=true; | |
| 81 | - document.woptions.d_c_sunrise.checked=false; | |
| 82 | - document.woptions.d_c_sunset.checked=false; | |
| 83 | - document.woptions.d_d_wind.checked=false; | |
| 84 | - document.woptions.d_n_wind.checked=false; | |
| 85 | - document.woptions.d_c_wgusts.checked=false; | |
| 86 | - document.woptions.d_d_wgusts.checked=false; | |
| 87 | - document.woptions.d_n_wgusts.checked=false; | |
| 88 | - document.woptions.d_c_humid.checked=false; | |
| 89 | - document.woptions.d_c_press.checked=false; | |
| 90 | - document.woptions.d_c_real.checked=false; | |
| 91 | - document.woptions.d_c_sunrise.disabled=true; | |
| 92 | - document.woptions.d_c_sunset.disabled=true; | |
| 93 | - document.woptions.d_d_wind.disabled=true; | |
| 94 | - document.woptions.d_n_wind.disabled=true; | |
| 95 | - document.woptions.d_c_humid.disabled=true; | |
| 96 | - document.woptions.d_c_press.disabled=true; | |
| 97 | - document.woptions.d_c_real.disabled=true; | |
| 98 | - document.woptions.d_c_wgusts.disabled=true; | |
| 99 | - document.woptions.d_d_wgusts.disabled=true; | |
| 100 | - document.woptions.d_n_wgusts.disabled=true; | |
| 101 | - | |
| 102 | - //document.woptions.searchloc.disabled=true; | |
| 103 | - //document.woptions.search_loc.disabled=true; | |
| 104 | - } | |
| 105 | - } | |
| 106 | - | |
| 107 | - if (service=="bug") { | |
| 108 | - document.woptions.apikey1.disabled=false; | |
| 109 | - //document.woptions.apikey2.disabled=true; | |
| 110 | - if (typeof(document.woptions.allnight) != "undefined"){ | |
| 111 | - document.woptions.allnight.disabled=true; | |
| 112 | - document.woptions.night1.disabled=true; | |
| 113 | - document.woptions.night2.disabled=true; | |
| 114 | - document.woptions.night3.disabled=true; | |
| 115 | - document.woptions.night4.disabled=true; | |
| 116 | - document.woptions.night5.disabled=true; | |
| 117 | - document.woptions.night6.disabled=true; | |
| 118 | - document.woptions.night7.disabled=true; | |
| 119 | - document.woptions.night8.disabled=true; | |
| 120 | - document.woptions.night9.disabled=true; | |
| 121 | - document.woptions.day8.disabled=true; | |
| 122 | - document.woptions.day9.disabled=true; | |
| 123 | - document.woptions.d_d_wind.checked=false; | |
| 124 | - document.woptions.d_n_wind.checked=false; | |
| 125 | - document.woptions.d_d_wgusts.checked=false; | |
| 126 | - document.woptions.d_n_wgusts.checked=false; | |
| 127 | - document.woptions.d_d_wind.disabled=true; | |
| 128 | - document.woptions.d_n_wind.disabled=true; | |
| 129 | - document.woptions.d_d_wgusts.disabled=true; | |
| 130 | - document.woptions.d_n_wgusts.disabled=true; | |
| 131 | - | |
| 132 | - //document.woptions.searchloc.disabled=false; | |
| 133 | - //document.woptions.search_loc.disabled=false; | |
| 134 | - | |
| 135 | - | |
| 136 | - } | |
| 137 | - } | |
| 138 | - return 0; | |
| 139 | - } | |
| 65 | + { | |
| 66 | + | |
| 67 | + if (service=="openweathermap3") { | |
| 68 | + document.woptions.apikey1.disabled=false; | |
| 69 | + if (typeof(document.woptions.allnight) != "undefined"){ | |
| 70 | + document.woptions.allnight.disabled=false; | |
| 71 | + document.woptions.night1.disabled=false; | |
| 72 | + document.woptions.night2.disabled=false; | |
| 73 | + document.woptions.night3.disabled=false; | |
| 74 | + document.woptions.night4.disabled=false; | |
| 75 | + document.woptions.night5.disabled=false; | |
| 76 | + document.woptions.night6.disabled=false; | |
| 77 | + document.woptions.night7.disabled=false; | |
| 78 | + document.woptions.night8.disabled=true; | |
| 79 | + document.woptions.night9.disabled=true; | |
| 80 | + document.woptions.day6.disabled=false; | |
| 81 | + document.woptions.day7.disabled=false; | |
| 82 | + document.woptions.day8.disabled=true; | |
| 83 | + document.woptions.day9.disabled=true; | |
| 84 | + document.woptions.d_d_wind.disabled=false; | |
| 85 | + document.woptions.d_n_wind.disabled=false; | |
| 86 | + document.woptions.d_d_wgusts.disabled=false; | |
| 87 | + document.woptions.d_n_wgusts.disabled=false; | |
| 88 | + document.woptions.d_c_precipe.disabled=false; | |
| 89 | + document.woptions.d_d_precipe.disabled=false; | |
| 90 | + document.woptions.d_n_precipe.disabled=false; | |
| 91 | + } | |
| 92 | + } | |
| 93 | + | |
| 94 | + if (service=="openweathermap" ) { | |
| 95 | + document.woptions.apikey1.disabled=false; | |
| 96 | + if (typeof(document.woptions.allnight) != "undefined"){ | |
| 97 | + document.woptions.allnight.disabled=false; | |
| 98 | + document.woptions.night1.disabled=false; | |
| 99 | + document.woptions.night2.disabled=false; | |
| 100 | + document.woptions.night3.disabled=false; | |
| 101 | + document.woptions.night4.disabled=false; | |
| 102 | + document.woptions.night5.disabled=false; | |
| 103 | + document.woptions.night6.disabled=true; | |
| 104 | + document.woptions.night7.disabled=true; | |
| 105 | + document.woptions.night8.disabled=true; | |
| 106 | + document.woptions.night9.disabled=true; | |
| 107 | + document.woptions.day6.disabled=true; | |
| 108 | + document.woptions.day7.disabled=true; | |
| 109 | + document.woptions.day8.disabled=true; | |
| 110 | + document.woptions.day9.disabled=true; | |
| 111 | + document.woptions.d_d_wind.disabled=false; | |
| 112 | + document.woptions.d_n_wind.disabled=false; | |
| 113 | + document.woptions.d_d_wgusts.disabled=false; | |
| 114 | + document.woptions.d_n_wgusts.disabled=false; | |
| 115 | + document.woptions.d_c_precipe.disabled=false; | |
| 116 | + document.woptions.d_d_precipe.disabled=false; | |
| 117 | + document.woptions.d_n_precipe.disabled=false; | |
| 118 | + } | |
| 119 | + } | |
| 120 | + | |
| 121 | + if (service=="openmeteo" ) { | |
| 122 | + document.woptions.apikey1.disabled=true; | |
| 123 | + if (typeof(document.woptions.allnight) != "undefined"){ | |
| 124 | + document.woptions.allnight.disabled=true; | |
| 125 | + document.woptions.night1.disabled=true; | |
| 126 | + document.woptions.night2.disabled=true; | |
| 127 | + document.woptions.night3.disabled=true; | |
| 128 | + document.woptions.night4.disabled=true; | |
| 129 | + document.woptions.night5.disabled=true; | |
| 130 | + document.woptions.night6.disabled=true; | |
| 131 | + document.woptions.night7.disabled=true; | |
| 132 | + document.woptions.night8.disabled=true; | |
| 133 | + document.woptions.night9.disabled=true; | |
| 134 | + document.woptions.day7.disabled=true; | |
| 135 | + document.woptions.day8.disabled=true; | |
| 136 | + document.woptions.day9.disabled=true; | |
| 137 | + document.woptions.d_d_wind.disabled=false; | |
| 138 | + document.woptions.d_n_wind.disabled=false; | |
| 139 | + document.woptions.d_d_wgusts.disabled=false; | |
| 140 | + document.woptions.d_n_wgusts.disabled=false; | |
| 141 | + document.woptions.d_c_precipe.disabled=false; | |
| 142 | + document.woptions.d_d_precipe.disabled=false; | |
| 143 | + document.woptions.d_n_precipe.disabled=false; | |
| 144 | + } | |
| 145 | + } | |
| 146 | + | |
| 147 | + return 0; | |
| 148 | + } | |
| 140 | 149 | <?php |
| 141 | -// this toggles the pulldown fields | |
| 150 | +// this toggles the pulldown fields. | |
| 142 | 151 | ?> |
| 143 | - | |
| 152 | + | |
| 144 | 153 | function pdfields_update() |
| 145 | 154 | { |
| 146 | - obja=document.getElementById('pdforecast'); | |
| 147 | - objb=document.getElementById('pdfirstday'); | |
| 148 | - objb.disabled = (obja.checked == false); | |
| 155 | + obja=document.getElementById('pdforecast'); | |
| 156 | + objb=document.getElementById('pdfirstday'); | |
| 157 | + objb.disabled = (obja.checked == false); | |
| 149 | 158 | } |
| 159 | + | |
| 150 | 160 | <?php |
| 151 | -// this toggles the new window field | |
| 161 | +// this toggles the css sprites field and the color selector. | |
| 152 | 162 | ?> |
| 153 | - | |
| 154 | -function nwfields_update() | |
| 163 | + | |
| 164 | +function fonticon_update() | |
| 155 | 165 | { |
| 156 | - obja=document.getElementById('d_c_accuweather'); | |
| 157 | - objb=document.getElementById('d_c_aw_newwindow'); | |
| 158 | - objb.disabled = (obja.checked == false); | |
| 166 | + obja=document.getElementById('fonticon'); | |
| 167 | + objc=document.getElementById('csssprites'); | |
| 168 | + objc.disabled = (obja.checked == true); | |
| 159 | 169 | } |
| 160 | - | |
| 161 | - | |
| 162 | -<?php | |
| 163 | -// the part for wpmu disabled fields by admin | |
| 164 | -global $blog_id; | |
| 165 | -if ( function_exists("is_multisite") && is_multisite() && $blog_id!=1) | |
| 166 | -{ | |
| 167 | - echo "function wpf_wpmu_disable_fields()\n{\n"; | |
| 168 | - // read defaults and allowed fields | |
| 169 | - $allowed = maybe_unserialize(wpf_get_option("wpf_sa_allowed")); | |
| 170 | - | |
| 171 | - foreach($allowed as $f => $fswitch) | |
| 172 | - { | |
| 173 | - $fname = substr($f,3); // strip ue_ prefix | |
| 174 | - | |
| 175 | - if ( $fswitch != "1" ) | |
| 176 | - { | |
| 177 | - if ($fname != "dispconfig" and $fname != "forecast") { | |
| 178 | - // replace value in av with forced default | |
| 179 | - echo "document.getElementById('$fname').disabled=true;\n"; | |
| 180 | - } | |
| 181 | - else if ($fname == "dispconfig") { | |
| 182 | - $do = array('d_c_icon','d_c_time','d_c_short','d_c_temp','d_c_real','d_c_press', | |
| 183 | - 'd_c_humid','d_c_wind','d_c_sunrise','d_c_sunset','d_d_icon','d_d_short', | |
| 184 | - 'd_d_temp','d_d_wind','d_n_icon','d_n_short','d_n_temp','d_n_wind','d_c_date', | |
| 185 | - 'd_c_copyright','d_c_wgusts','d_d_wgusts','d_n_wgusts', | |
| 186 | - 'd_c_accuweather','d_c_aw_newwindow','d_c_copyright','d_c_accuweather'); | |
| 187 | - | |
| 188 | - foreach ($do as $i) { | |
| 189 | - echo "document.getElementById('$i').disabled=true;\n"; | |
| 190 | - } | |
| 191 | - } else { | |
| 192 | - // for forecast options | |
| 193 | - $nd = array('day1','day2','day3','day4','day5','day6','day7','day8','day9', | |
| 194 | - 'night1','night2','night3','night4','night5','night6','night7','night8','night9'); | |
| 195 | - foreach ($nd as $i) { | |
| 196 | - echo "document.getElementById('$i').disabled=true;\n"; | |
| 197 | - } | |
| 198 | - } | |
| 199 | - } | |
| 200 | - } | |
| 201 | - echo "}\n"; | |
| 202 | -} | |
| 203 | -?> | |
| 204 | -</script> | |
| 170 | +</script> | |