Changeset 1532212
- Timestamp:
- 11/11/2016 10:01:56 AM (9 years ago)
- Location:
- give-me-recipes
- Files:
-
- 2 added
- 3 edited
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/ts-give-me-recipes.js (modified) (2 diffs)
-
trunk/ts-give-me-recipes.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
give-me-recipes/trunk/readme.txt
r1532173 r1532212 2 2 Contributors: tero2000 3 3 Donate link: startwordpressonline.net 4 Tags: widgets, food, recipes, ruoka, resepti, search food, cooking 4 Tags: widgets, food, recipes, ruoka, resepti, search food, cooking, food recipes, cocktails, drinks 5 5 Requires at least: 3.3 6 6 Tested up to: 4.6 … … 13 13 == Description == 14 14 15 This plugin uses Recipe Puppy API to get recipes. User can choose the ingredients like tomato, garlic etc. and / or search with a type of food as well like pasta for example. You can also use the plugin to search for drinks.15 This plugin uses Recipe Puppy API to get food recipes. User can choose the ingredients like tomato, garlic etc. and / or search with a type of food as well like pasta for example. You can also use the plugin to search for drinks like cocktails for example. So instead of just looking for food recipes you can also search for new ideas have to mix proper cocktails like mojitos for example. With the drinks the plugins works the same as well as it works with food recipes. 16 16 17 To use the Recipe Puppy you don't need to have an API key at the moment. 17 To use the Recipe Puppy you don't need to have an API key at the moment. For more information concerning the API visit www.recipepuppy.com 18 18 19 Results will display after the search is done and to access the full recipe user is provided with a link to it. 19 Results will be displayed after the search for food recipes is done. The result will display the link to access the full recipe alongside image of the recipes if there is one. 20 21 This plugin is a really good to add on food related websites like food bloggers for example as it creates additional value for the visitors. 20 22 21 23 == Installation == 22 24 23 1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory 25 1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory or install through the Plugins menu 24 26 2. Activate the plugin through the 'Plugins' menu in WordPress 25 27 3. Place the plugin in footer or sidebar. … … 27 29 == Frequently asked questions == 28 30 29 = A question that someone might have = 31 = What languages can I use when searchin recipes? = 32 33 At the moment the plugins works in English. As it uses the API provided by recipepuppy, you can look if they are thinking of adding another language in the future. 34 35 = Do I have to use both ingredients and search fields? = 36 37 No, you don't have to use both fields to search for food recipes as you can use just one as well. Even better, leave both empty and get random results! 38 39 = Is Get Recipes free to use? = 40 41 Yes, this plugin is free to use. 42 43 == Changelog == 44 45 = 1.0 = 30 46 31 47 == Screenshots == 32 48 33 1. Adding Food Recipes widget to the sidebar 49 1. Adding Food Recipes widget to the sidebar in Dashboard -> Appearance -> Widgets 50 51 2. The plugin showing results after search. 34 52 35 53 == Changelog == -
give-me-recipes/trunk/ts-give-me-recipes.js
r1531463 r1532212 1 /* 2 * Give me recipes JS 3 * Using ajax so there is no page refresh 4 */ 1 5 jQuery(document).ready(function(){ 6 7 // When the search button is pressed. 2 8 jQuery( "#give-me-recipe" ).click(function( event ) { 9 10 // Prevent the default button action. 3 11 event.preventDefault(); 4 12 13 // Get information from the form we're submitting. 5 14 var form = jQuery('#recipes-form'); 6 15 formsAction = form.attr( 'action' ); 7 jQuery(form).fadeOut(300); 16 jQuery(form).fadeOut(300); 17 18 // Add the nice .gif thingy so it looks like we're loading :) 19 // Using timeout function here so it happens smoothly 8 20 setTimeout(function(){ 9 21 jQuery('#the-recipes').append('<li><img src="'+wp_urls.plugin_url+'/img/clock.gif"></li><li>Searching recipes ...</li>'); 10 22 }, 400); 11 23 24 // Get values from the form fields. 12 25 var ingredients = jQuery('#ingredients').val(); 13 26 var query = jQuery('#query').val(); 27 28 // Submit the information 14 29 jQuery.ajax({ 15 30 type:"POST", … … 22 37 }, 23 38 success:function(response){ 24 39 // Getting the response AKA the recipes. 25 40 var obj = response.results; 41 // Set timeout funtion again here so the loading gif is displayed a bit longer. 26 42 setTimeout(function(){ 27 43 jQuery('#the-recipes').empty(); -
give-me-recipes/trunk/ts-give-me-recipes.php
r1531500 r1532212 12 12 13 13 if ( ! defined( 'ABSPATH' ) ) exit; 14 // Load Styles 14 // Load Styles for the admin, not actually necessary. 15 15 function foodrecipes_backend_styles() { 16 16 … … 20 20 add_action( 'admin_head', 'foodrecipes_backend_styles' ); 21 21 22 // Ajax function when sending the form 22 // Ajax function when sending the form this and the js file are the ones that do the magic. 23 23 function recipe_ajax_request() { 24 24 $i = $_REQUEST["ingredients"]; … … 34 34 35 35 36 // Loading the js file and the css file. 36 37 function foodrecipes_frontend_scripts_and_styles() { 37 38 … … 66 67 67 68 /** 68 * Front-end display of widget. 69 * Front-end display of widget. What will be put to the sidebar. 69 70 * 70 71 * @see WP_Widget::widget()
Note: See TracChangeset
for help on using the changeset viewer.