Changeset 759516
- Timestamp:
- 08/20/2013 08:24:56 PM (13 years ago)
- Location:
- farm-calculators/trunk
- Files:
-
- 5 edited
-
css/calculators.css (modified) (1 diff)
-
farm-calculators.php (modified) (4 diffs)
-
js/calculators.js (modified) (3 diffs)
-
readme.md (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
farm-calculators/trunk/css/calculators.css
r758858 r759516 6 6 font-size: 18px; 7 7 } 8 9 .farmCalculator legend { 10 font-size: 18px; 11 } -
farm-calculators/trunk/farm-calculators.php
r758858 r759516 3 3 Plugin Name: Farm Calculators 4 4 5 Plugin URI: http:// github.com/wingdspur/farm-calculators5 Plugin URI: http://wordpress.org/plugins/farm-calculators/ 6 6 7 7 Description: Add farm calculators to your website to help users determine various farming and crop related information. 8 8 9 Version: 0. 19 Version: 0.2 10 10 Author: Bryce Johnston 11 11 Author URI: http://www.wingdspur.com … … 28 28 *******************************************************************************************/ 29 29 30 $fc_version = '0. 1';30 $fc_version = '0.2'; 31 31 $fc_dirname = plugin_basename(dirname(__FILE__)); 32 32 … … 82 82 } 83 83 84 function farming_calc_crop_population_bs_shortcode() { 85 extract( shortcode_atts( array( 86 'class' => 'farmCalculator span3', 87 ), $atts ) ); 88 89 $class = esc_attr($class); 90 91 $code = '<div class="'.$class.'"> 92 <form> 93 <div class="errors"></div>'; 94 $code .='<fieldset> 95 <legend>Crop Population</legend>'; 96 $code .=' 97 <label for="stand_count">Stand Count:</label> 98 <input name="stand_count" id="stand_count" type="number" step="any" class="input-medium" /> 99 <label for="row_length">Length of Row in Feet:</label> 100 <input name="row_length" id="row_length" type="number" step="any" class="input-medium" /> 101 <label for="row_spacing">Row Spacing in Inches:</label> 102 <input name="row_spacing" id="row_spacing" type="number" step="any" class="input-medium" /><br /> 103 <button type="submit" class="btn" name="calculateCropPopulation" id="calculateCropPopulation">Calculate</button> 104 </fieldset>'; 105 $code .= '<br /> 106 <label>Population (Plants/Acre):</label> 107 <input name="crop_population" type="text" class="input-medium" readonly="readonly" /> 108 </form>'; 109 $code .= ' 110 </div>'; 111 112 return $code; 113 } 114 84 115 function farming_calc_crop_population_hoop_shortcode() { 85 116 extract( shortcode_atts( array( … … 116 147 } 117 148 149 function farming_calc_crop_population_hoop_bs_shortcode() { 150 extract( shortcode_atts( array( 151 'class' => 'farmCalculator span3', 152 ), $atts ) ); 153 154 $class = esc_attr($class); 155 156 $code = '<div class="'.$class.'"> 157 <form> 158 <div class="errors"></div>'; 159 $code .='<fieldset> 160 <legend>Crop Population (Hoop)</legend>'; 161 $code .=' 162 <label for="stand_count">Stand Count:</label> 163 <input name="stand_count" id="stand_count" type="number" step="any" class="input-medium" /> 164 <label for="hoop_size">Hoop Size in Inches:</label> 165 <input name="hoop_size" id="hoop_size" type="number" step="any" class="input-medium" /><br /> 166 <button type="submit" class="btn" name="calculateCropPopulationHoop" id="calculateCropPopulationHoop">Calculate</button> 167 </fieldset>'; 168 $code .= '<br /> 169 <label>Population (Plants/Acre):</label> 170 <input name="crop_population" type="text" class="input-medium" readonly="readonly" /> 171 </form>'; 172 $code .= ' 173 </div>'; 174 175 return $code; 176 } 177 178 function farming_calc_sorghum_harvest_yield_loss_shortcode() { 179 extract( shortcode_atts( array( 180 'class' => 'farmCalculator', 181 ), $atts ) ); 182 183 $class = esc_attr($class); 184 185 $code = '<div class="'.$class.'"> 186 <form> 187 <div class="errors"></div>'; 188 $code .=' 189 <h4>Grain Sorghum Harvest Loss</h4> 190 <p><i>Also recommended to check standing crop for pre-harvest losses.</i></p> 191 <p> 192 <label for="kernals_count">Kernals Counted on Ground:</label><br /> 193 <input name="kernals_count" id="kernals_count" type="number" step="any" class="input-medium" /> 194 </p> 195 <p> 196 <label for="kernals_area">Area Kernals were Counted (ft<sup>2</sup>):</label><br /> 197 <input name="kernals_area" id="kernals_area" type="number" step="any" class="input-medium" /> 198 </p> 199 <p> 200 <button type="submit" class="btn" name="calculateSorghumHarvestYieldLoss" id="calculateSorghumHarvestYieldLoss">Calculate</button> 201 </p> 202 <p> 203 <label>Estimated Yield Loss (bu/ac):</label><br /> 204 <input name="yield_loss" type="text" class="input-medium" readonly="readonly" /> 205 </p> 206 </form>'; 207 $code .= ' 208 </div>'; 209 210 return $code; 211 } 212 213 function farming_calc_sorghum_harvest_yield_loss_bs_shortcode() { 214 extract( shortcode_atts( array( 215 'class' => 'farmCalculator', 216 ), $atts ) ); 217 218 $class = esc_attr($class); 219 220 $code = '<div class="'.$class.'"> 221 <form> 222 <div class="errors"></div>'; 223 $code .='<fieldset> 224 <legend>Grain Sorghum Harvest Loss</legend>'; 225 $code .=' 226 <label for="kernals_count">Kernals Counted on Ground:</label> 227 <input name="kernals_count" id="kernals_count" type="number" step="any" class="input-medium" /> 228 <label for="kernals_area">Area Kernals were Counted (ft<sup>2</sup>):</label> 229 <input name="kernals_area" id="kernals_area" type="number" step="any" class="input-medium" /><br /> 230 <button type="submit" class="btn" name="ccalculateSorghumHarvestYieldLoss" id="calculateSorghumHarvestYieldLoss">Calculate</button> 231 </fieldset>'; 232 $code .= '<br /> 233 <label>Estimated Yield Loss (bu/ac):</label> 234 <input name="yield_loss" type="text" class="input-medium" readonly="readonly" /> 235 </form>'; 236 $code .= ' 237 </div>'; 238 239 return $code; 240 } 241 118 242 add_shortcode('farming_calc_crop_population', 'farming_calc_crop_population_shortcode'); 243 add_shortcode('farming_calc_crop_population_bs', 'farming_calc_crop_population_bs_shortcode'); 119 244 add_shortcode('farming_calc_crop_population_hoop', 'farming_calc_crop_population_hoop_shortcode'); 245 add_shortcode('farming_calc_crop_population_hoop_bs', 'farming_calc_crop_population_hoop_bs_shortcode'); 246 add_shortcode('farming_calc_sorghum_harvest_yield_loss', 'farming_calc_sorghum_harvest_yield_loss_shortcode'); 247 add_shortcode('farming_calc_sorghum_harvest_yield_loss_bs', 'farming_calc_sorghum_harvest_yield_loss_bs_shortcode'); 120 248 121 249 ?> -
farm-calculators/trunk/js/calculators.js
r758858 r759516 8 8 $("#calculateCropPopulationHoop").bind('click submit', function() { 9 9 calculateCropPopulationHoop(this.form); 10 return false; 11 }); 12 13 $("#calculateSorghumHarvestYieldLoss").bind('click submit', function() { 14 calculateSorghumHarvestYieldLoss(this.form); 10 15 return false; 11 16 }); … … 22 27 function roundHundred(x) { 23 28 return Math.round(x/100)*100; 29 } 30 31 function roundTenth(x) { 32 return Math.round(x*10)/10; 33 } 34 35 function roundHundredth(x) { 36 return Math.round(x*100)/100; 24 37 } 25 38 … … 62 75 form.crop_population.value = roundHundred(population); 63 76 } 77 78 function calculateSorghumHarvestYieldLoss(form) { 79 if (!isValid(form.kernals_count, 0, 1000)) { 80 return false; 81 } else if (!isValid(form.kernals_area, 0, 1000)) { 82 return false; 83 } 84 85 var kernals_count = form.kernals_count.value; 86 var kernals_area = form.kernals_area.value; 87 88 var yield_loss = 0; 89 yield_loss = kernals_count/kernals_area/18.5; 90 91 form.yield_loss.value = roundTenth(yield_loss); 92 93 } 64 94 65 95 -
farm-calculators/trunk/readme.md
r758858 r759516 4 4 Requires at least: 3.5 5 5 Tested up to: 3.6 6 Stable tag: 0. 16 Stable tag: 0.2 7 7 Tags: farm, crop, farming, calculator, yield, population, agriculture 8 8 License: GPLv3 or later … … 21 21 Shows a calculator for determing crop population based on stand count, row length, and row spacing. 22 22 23 [farming_calc_crop_population_bs] 24 Same as above but styled for bootstrap themes. 25 23 26 [farming_calc_crop_population_hoop] 24 27 Shows a calculator for determing crop population based on stand count and hoop size. 28 29 [farming_calc_crop_population_hoop_bs] 30 Same as above but styled for bootstrap themes. 31 32 [farming_calc_sorghum_harvest_yield_loss] 33 Shows a calculator for determing grain sorghum harvest yield loss based on kernels counted on ground and the size of the area they were counted in. 34 35 [farming_calc_sorghum_harvest_yield_loss_bs] 36 Same as above but styled for bootstrap themes. 25 37 26 38 More shortcodes will follow soon. … … 42 54 ## Changelog 43 55 56 ### 0.2 57 * Added grain sorghum harvest yield loss calculator. 58 * Added bootstrap styled alternative shortcodes. 59 44 60 ### 0.1 45 61 * First public version. -
farm-calculators/trunk/readme.txt
r758858 r759516 4 4 Requires at least: 3.5 5 5 Tested up to: 3.6 6 Stable tag: 0. 16 Stable tag: 0.2 7 7 Tags: farm, crop, farming, calculator, yield, population, agriculture 8 8 License: GPLv3 or later … … 21 21 Shows a calculator for determing crop population based on stand count, row length, and row spacing. 22 22 23 [farming_calc_crop_population_bs] 24 Same as above but styled for bootstrap themes. 25 23 26 [farming_calc_crop_population_hoop] 24 27 Shows a calculator for determing crop population based on stand count and hoop size. 28 29 [farming_calc_crop_population_hoop_bs] 30 Same as above but styled for bootstrap themes. 31 32 [farming_calc_sorghum_harvest_yield_loss] 33 Shows a calculator for determing grain sorghum harvest yield loss based on kernels counted on ground and the size of the area they were counted in. 34 35 [farming_calc_sorghum_harvest_yield_loss_bs] 36 Same as above but styled for bootstrap themes. 25 37 26 38 More shortcodes will follow soon. … … 42 54 == Changelog == 43 55 56 = 0.2 = 57 * Added grain sorghum harvest yield loss calculator. 58 * Added bootstrap styled alternative shortcodes. 59 44 60 = 0.1 = 45 61 * First public version.
Note: See TracChangeset
for help on using the changeset viewer.