Changeset 3005455
- Timestamp:
- 12/05/2023 07:36:52 AM (16 months ago)
- Location:
- visualcrossing-weather-forecast
- Files:
-
- 22 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
visualcrossing-weather-forecast/trunk/assets/css/weather-forecast-widget-d3.css
r2348622 r3005455 1 1 2 .forecastwidget { 3 box-sizing: border-box; 4 display: flex; 5 flex-direction: column; 6 padding: 5px; 7 font-size: 14px; 8 background-color: #ffffff; 9 overflow:hidden; 10 border-radius: 5px; 11 } 12 .forecastwidget .icon { 13 height:40px; 14 width:40px; 2 15 3 .forecastwidget { 4 box-sizing: border-box; 5 display: flex; 6 flex-direction: column; 7 padding: 5px; 8 font-size: 14px; 9 background-color: #ffffff; 10 overflow:hidden; 11 border-radius: 5px; 12 } 13 .forecastwidget .icon { 14 height:40px; 15 width:40px; 16 17 } 18 .forecastwidget .icon.sunny {background-image:url(images/sun.png);} 19 .forecastwidget .icon.partsunny {background-image:url(images/partsun.png);} 20 .forecastwidget .icon.cloudy {background-image:url(images/cloudy.png);} 21 .forecastwidget .icon.rain {background-image:url(images/rain.png);} 22 .forecastwidget .icon.snow {background-image:url(images/snow.png);} 23 24 .forecastwidget .noselect { 25 -webkit-user-select: none; /* Safari */ 26 -ms-user-select: none; /* IE 10+ and Edge */ 27 user-select: none; /* Standard syntax */ 28 } 29 30 .forecastwidget .days { 31 position: relative; 32 33 max-height: 100px; 34 35 flex: 1; 36 } 37 .forecastwidget .chart { 38 flex: 1; 39 } 40 .forecastwidget .chart .line { 41 fill: url(#temperature-gradient); 42 stroke-width: 05px; 43 } 44 .forecastwidget .chart .precipbar { 45 fill: #196eb7; 46 } 47 48 .forecastwidget .chart .grid line { 49 stroke: darkgray; 50 51 shape-rendering: crispEdges; 52 } 53 54 .forecastwidget .chart .grid path { 55 stroke-width: 0; 56 } 57 58 59 .forecastwidget .days.vertical { 60 flex-direction: column; 61 font-size: 1.2em; 62 } 63 64 /*define a grid layout with two columns*/ 65 .forecastwidget .days .day { 66 position: absolute; 67 68 69 display: grid; 70 grid-template-columns: 50% 50%; 71 72 justify-content: center; 73 align-items: center; 74 padding: 0px 5px; 75 font-size: 0.9em; 76 justify-items: center; 77 grid-gap: 1px; 78 cursor: grab; 79 } 80 /* 81 .forecastwidget .days .day:hover { 82 background-color:lightgrey; 83 } 84 */ 85 /*most forecast elements take up two columns*/ 86 .forecastwidget .days .day * { 87 grid-column: span 2; 88 display: flex; 89 align-items: center; 90 justify-content: center; 91 } 92 /*maximum and minimum elements are arrange side by side*/ 93 .forecastwidget .days .day .maxt { 94 grid-column: 1 ; 95 } 96 .forecastwidget .days .day .mint { 97 grid-column: 2 ; 98 } 99 100 /*define a grid layout with size columns*/ 101 .forecastwidget .days.vertical .day { 102 grid-template-columns: 50px 30px 30px 30px 60px auto; 103 grid-gap: 4px; 104 justify-content: start; 105 margin: 2px 0px; 106 padding: 4px 0px; 107 } 108 /*Every element takes up a single grid cell*/ 109 .forecastwidget .days.vertical .day * { 110 grid-column: span 1; 111 } 112 /*No special layout is required for the temperature values*/ 113 .forecastwidget .days.vertical .day .maxt, .forecastwidget .days.vertical .day .mint { 114 grid-column: default ; 115 } 116 117 /*element styling rules*/ 118 .forecastwidget .location { 119 120 flex: 0; 121 122 display: flex; 123 justify-content: flex-start; 124 align-items: center; 125 } 126 .forecastwidget .location .value { 127 font-size: 1em; 128 font-weight: bold; 129 cursor: pointer; 130 131 } 132 .forecastwidget .location .editor { 133 display:none; 134 position: absolute; 135 padding: 5px; 136 margin: 1px 0px; 137 font-size: 1.2em; 138 z-index: 1; 139 } 140 .forecastwidget .location .value:hover { 141 color:darkgrey; 142 } 143 .forecastwidget .location.edit .editor { 144 display:block; 145 } 146 147 .forecastwidget .footer { 148 font-size: 0.8em; 149 color: darkgrey; 150 display: flex; 151 justify-content: flex-end; 152 align-items: center; 153 } 154 .forecastwidget .footer *{ 155 padding:2px 5px; 156 } 157 .forecastwidget .viewchooser { 158 font-size: 0.8em; 159 padding: 2px 5px; 160 cursor: pointer; 161 border-radius: 3px; 162 margin: 1px 0px; 163 164 } 165 .forecastwidget .viewchooser.day { 166 margin-left:auto; 167 } 168 .forecastwidget .viewchooser:hover { 169 background-color:lightgrey; 170 } 171 .forecastwidget .viewchooser.selected { 172 background-color:darkgrey; 173 color:white; 174 175 } 176 177 .forecastwidget .days .day .date { 178 color: darkgrey; 179 font-size: 1.1em; 180 white-space: nowrap; 181 182 } 183 .forecastwidget.edit .days { 184 opacity: 0.1; 185 } 186 187 188 .forecastwidget .days .day .icon { 189 padding: 5px 0px; 190 } 191 .forecastwidget .days .day .conditions { 192 display:none; 193 color:darkgrey; 194 font-size: 0.9em; 195 } 196 .forecastwidget .days.vertical .day .conditions { 197 display:block; 198 } 199 .forecastwidget .days .day .maxt { 200 font-weight: bold; 201 } 202 .forecastwidget .days .day .mint { 203 font-size: 0.9em; 204 color:darkgrey; 205 } 206 207 .forecastwidget .days .day .hidden { 208 visibility: hidden; 209 display:none; 210 } 16 } 17 .forecastwidget .icon.sunny {background-image:url(images/sun.png);} 18 .forecastwidget .icon.partsunny {background-image:url(images/partsun.png);} 19 .forecastwidget .icon.cloudy {background-image:url(images/cloudy.png);} 20 .forecastwidget .icon.rain {background-image:url(images/rain.png);} 21 .forecastwidget .icon.snow {background-image:url(images/snow.png);} 22 23 .forecastwidget .noselect { 24 -webkit-user-select: none; /* Safari */ 25 -ms-user-select: none; /* IE 10+ and Edge */ 26 user-select: none; /* Standard syntax */ 27 } 28 29 .forecastwidget .days { 30 position: relative; 31 32 max-height: 100px; 33 34 flex: 1; 35 } 36 .forecastwidget .chart { 37 flex: 1; 38 } 39 .forecastwidget .chart .line { 40 fill: url(#temperature-gradient); 41 stroke-width: 05px; 42 } 43 .forecastwidget .chart .precipbar { 44 fill: #196eb7; 45 } 46 47 .forecastwidget .chart .grid line { 48 stroke: darkgray; 49 50 shape-rendering: crispEdges; 51 } 52 53 .forecastwidget .chart .grid path { 54 stroke-width: 0; 55 } 56 57 58 .forecastwidget .days.vertical { 59 flex-direction: column; 60 font-size: 1.2em; 61 } 62 63 /*define a grid layout with two columns*/ 64 .forecastwidget .days .day { 65 position: absolute; 66 67 68 display: grid; 69 grid-template-columns: 50% 50%; 70 71 justify-content: center; 72 align-items: center; 73 padding: 0px 5px; 74 font-size: 0.9em; 75 justify-items: center; 76 grid-gap: 1px; 77 cursor: grab; 78 } 79 /* 80 .forecastwidget .days .day:hover { 81 background-color:lightgrey; 82 } 83 */ 84 /*most forecast elements take up two columns*/ 85 .forecastwidget .days .day * { 86 grid-column: span 2; 87 display: flex; 88 align-items: center; 89 justify-content: center; 90 } 91 /*maximum and minimum elements are arrange side by side*/ 92 .forecastwidget .days .day .maxt { 93 grid-column: 1 ; 94 } 95 .forecastwidget .days .day .mint { 96 grid-column: 2 ; 97 } 98 99 /*define a grid layout with size columns*/ 100 .forecastwidget .days.vertical .day { 101 grid-template-columns: 50px 30px 30px 30px 60px auto; 102 grid-gap: 4px; 103 justify-content: start; 104 margin: 2px 0px; 105 padding: 4px 0px; 106 } 107 /*Every element takes up a single grid cell*/ 108 .forecastwidget .days.vertical .day * { 109 grid-column: span 1; 110 } 111 /*No special layout is required for the temperature values*/ 112 .forecastwidget .days.vertical .day .maxt, .forecastwidget .days.vertical .day .mint { 113 grid-column: default ; 114 } 115 116 /*element styling rules*/ 117 .forecastwidget .location { 118 119 flex: 0; 120 121 display: flex; 122 justify-content: flex-start; 123 align-items: center; 124 } 125 .forecastwidget .location .value { 126 font-size: 1em; 127 font-weight: bold; 128 cursor: pointer; 129 130 } 131 .forecastwidget .location .editor { 132 display:none; 133 position: absolute; 134 padding: 5px; 135 margin: 1px 0px; 136 font-size: 1.2em; 137 z-index: 1; 138 } 139 .forecastwidget .location .value:hover { 140 color:darkgrey; 141 } 142 .forecastwidget .location.edit .editor { 143 display:block; 144 } 145 146 .forecastwidget .footer { 147 font-size: 0.8em; 148 color: darkgrey; 149 display: flex; 150 justify-content: flex-end; 151 align-items: center; 152 } 153 .forecastwidget .footer *{ 154 padding:2px 5px; 155 } 156 .forecastwidget .viewchooser { 157 font-size: 0.8em; 158 padding: 2px 5px; 159 cursor: pointer; 160 border-radius: 3px; 161 margin: 1px 0px; 162 163 } 164 .forecastwidget .viewchooser.day { 165 margin-left:auto; 166 } 167 .forecastwidget .viewchooser:hover { 168 background-color:lightgrey; 169 } 170 .forecastwidget .viewchooser.selected { 171 background-color:darkgrey; 172 color:white; 173 174 } 175 176 .forecastwidget .days .day .date { 177 color: darkgrey; 178 font-size: 1.1em; 179 white-space: nowrap; 180 181 } 182 .forecastwidget.edit .days { 183 opacity: 0.1; 184 } 185 186 187 .forecastwidget .days .day .icon { 188 padding: 5px 0px; 189 } 190 .forecastwidget .days .day .conditions { 191 display:none; 192 color:darkgrey; 193 font-size: 0.9em; 194 } 195 .forecastwidget .days.vertical .day .conditions { 196 display:block; 197 } 198 .forecastwidget .days .day .maxt { 199 font-weight: bold; 200 } 201 .forecastwidget .days .day .mint { 202 font-size: 0.9em; 203 color:darkgrey; 204 } 205 206 .forecastwidget .days .day .hidden { 207 visibility: hidden; 208 display:none; 209 } -
visualcrossing-weather-forecast/trunk/front/main.php
r2348622 r3005455 55 55 public function weather_shortcode_func($atts){ 56 56 57 $default = array('api'=>'', 'loc'=>'', 'days'=>7, 'mode'=>'simple', 'unit'=>'metric', 'title'=>'', 'stitle'=>'y', 'scond'=>'y');57 $default = array('api'=>'', 'loc'=>'', 'days'=>7, 'mode'=>'simple', 'unit'=>'metric', 'title'=>'', 'stitle'=>'y', 'scond'=>'y'); 58 58 $settings = get_option('_visualcrossingwfcst_settings', false); 59 if (is_array($settings)){59 if ( is_array($settings) ) { 60 60 $default = array_merge($default, $settings); 61 61 } 62 62 63 63 64 if( trim($default['api'])==''){return '';}64 if( trim($default['api']) == '' ){return '';} 65 65 66 66 $atts = shortcode_atts( array( … … 80 80 $widget_id = uniqid(); 81 81 82 $api = trim($atts['api']);83 $loc = trim(strtolower($atts['loc']));82 $api = trim($atts['api']); 83 $loc = trim(strtolower($atts['loc'])); 84 84 $days = (int)trim($atts['days']); 85 85 if($days <= 0 ){$days=7;} 86 86 87 87 $mode = trim(strtolower($atts['mode'])); 88 if( $mode !='simple' && $mode !='d3'){88 if( $mode !='simple' && $mode !='d3' ) { 89 89 $mode = 'simple'; 90 90 } … … 101 101 102 102 $include_script = ''; 103 if( $mode=='simple'):103 if( $mode == 'simple' ): 104 104 105 105 ob_start(); … … 121 121 wp_add_inline_script('wfmsmpl-js', $include_script, 'before'); 122 122 123 elseif( $mode=='d3'):123 elseif( $mode=='d3' ): 124 124 125 125 ob_start(); … … 144 144 endif; 145 145 146 return '<div class="weather Widget-'.$widget_id.'"></div>';146 return '<div class="weather-forecast-block weatherWidget-'.$widget_id.'"></div>'; 147 147 } 148 148 } -
visualcrossing-weather-forecast/trunk/readme.txt
r2791338 r3005455 4 4 Tags: weather shortcode, weather, weather widget, forecast, global, temp, local weather, local forecast, weather forecast, weather forecast API, weather forecast plugin 5 5 Requires at least: 5.6 6 Tested up to: 6. 0.26 Tested up to: 6.4.1 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 66 66 == Changelog == 67 67 68 = 1.0 = 68 = 1.0.1 = 69 * Plugin compatibility tested. 70 = 1.0.0 = 69 71 * Initial load of the plugin. -
visualcrossing-weather-forecast/trunk/visualcrossing-weather-forecast.php
r2791338 r3005455 4 4 * Plugin URI: https://www.visualcrossing.com 5 5 * Description: Display Weather Forecast using visualcrossing.com Weather API. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: srhelwig 8 8 * Author URI: mailto:[email protected]?subject=Visualcrossing Weather Forecast WordPress plugin … … 124 124 * @since 1.0 125 125 */ 126 public function admin_requirement_check() {126 public function admin_requirement_check() { 127 127 128 128 $requirement_error = self::$requirements_error; … … 147 147 //Dont initiate plugin if requirement error 148 148 $requirement_error = self::$requirements_error; 149 if( $requirement_error !== false){149 if( $requirement_error !== false ){ 150 150 return; 151 151 } … … 161 161 162 162 // Load Front 163 if ( ! is_admin() ) {163 if ( ! is_admin() ) { 164 164 165 165 require_once trailingslashit( VISUALCROSSINGWFCST_PLUGIN_DIR ) . 'front/main.php'; … … 194 194 * @since 1.0 195 195 */ 196 public static function requirements_check() {196 public static function requirements_check() { 197 197 198 198 $requirement_error = array(); … … 209 209 210 210 211 if(empty($requirement_error)){return false;} 212 else{return $requirement_error;} 211 if( empty($requirement_error) ) { 212 return false; 213 } 214 else{ 215 return $requirement_error; 216 } 213 217 } 214 218
Note: See TracChangeset
for help on using the changeset viewer.