1jQuery(document).ready(function($){"use strict";function updateRecipeIndexing(){$('.rn-recipe-wrap').find('.rn-recipe-item').each(function(i,item){$('input',item).each(function(){var _recipe_input=$(this);_recipe_input.attr('name',_recipe_input.attr('name').replace(/rn_recipes\[[^\]]*\]/,'rn_recipes['+i+']'))});$('.rn-ingredient-item',item).each(function(ii,ingredient){$('input',ingredient).each(function(){var _ingredient=$(this);_ingredient.attr('name',_ingredient.attr('name').replace(/\[ingredient\]\[[^\]]*\]/,'[ingredient]['+ii+']'))})})})} 2function getIngredientHtml(){return'<div class="rn-ingredient-item">'+'<span class="item-sort"><i class="fa fa-arrows-alt"></i></span>'+'<div class="rn-ingredient-fields">'+'<input type="text" placeholder="'+ThemeObj.ingredient_name+'" class="form-control" name="rn_recipes[][ingredient][][title]">'+'<input type="text" placeholder="'+ThemeObj.quantity+'" class="form-control" name="rn_recipes[][ingredient][][quantity]">'+'<input type="text" placeholder="'+ThemeObj.unit+'" class="form-control" name="rn_recipes[][ingredient][][unit]">'+'</div>'+'<span class="rn-remove"><i class="fa fa-times" aria-hidden="true"></i></span>'+'</div>'} 3$(document).on('click','.rn-recipe-wrapper .add-recipe',function(e){e.preventDefault();var _self=$(this),recipe='<div class="rn-recipe-item">'+'<span class="rn-remove"><i class="fa fa-times" aria-hidden="true"></i></span>'+'<div class="rn-recipe-title"><input type="text" name="rn_recipes[][title]" class="form-control" placeholder="'+ThemeObj.recipe_title+'"></div>'+'<div class="rn-ingredient-wrap">'+getIngredientHtml()+'</div>'+'<div class="rn-ingredient-actions"><a href="javascript:void()" class="btn-upload add-ingredient btn-sm btn-primary">'+ThemeObj.add_new_ingredient+'</a></div>'+'</div>';_self.closest('.rn-recipe-wrapper').find('.rn-recipe-wrap').append(recipe);updateRecipeIndexing()});$(document).on('click','.rn-recipe-item > .rn-remove',function(e){e.preventDefault();var _self=$(this);if(_self.closest('.rn-recipe-wrapper').find('.rn-recipe-item').length>=2){_self.closest('.rn-recipe-item').slideUp('slow',function(){$(this).remove();updateRecipeIndexing()})}else{alert('You are not permited to remove all recipe')}});$(document).on('click','.rn-recipe-item .add-ingredient',function(e){e.preventDefault();var _self=$(this),ingredient=getIngredientHtml();_self.closest('.rn-recipe-item').find('.rn-ingredient-wrap').append(ingredient);updateRecipeIndexing()});$(document).on('click','.rn-ingredient-item .rn-remove',function(e){e.preventDefault();var _self=$(this);if(_self.closest('.rn-ingredient-wrap').find('.rn-ingredient-item').length>=2){_self.closest('.rn-ingredient-item').slideUp('slow',function(){$(this).remove();updateRecipeIndexing()})}else{alert('You are not permited to remove all ingradient')}});$('.add-nutrition').on('click',function(e){e.preventDefault();$(".nutrition-sorting .nutrition-item:last-child").after('<li'+' class="ui-state-default'+' nutrition-item">'+'<div class="item-sort" >'+'<i class="fa fa-arrows-alt"></i>'+'</div>'+'<div class="nutrition-field">'+'<input type="text" placeholder="'+ThemeObj.nutrition_item+'" class="form-control" name="nutrition_item[]">'+'<input type="text" placeholder="% '+ThemeObj.of_daily_value+'" class="form-control" name="nutrition_daily_value[]">'+'</div>'+'<div class="item-sort remove-section">'+'<i class="fa fa-times" aria-hidden="true"></i>'+'</div>'+'</li>');$(".nutrition-sorting").sortable();$(".nutrition-sorting").disableSelection()});$('.add-extra').on('click',function(e){e.preventDefault();$(".note-sorting .note-item:last-child").after('<li'+' class="ui-state-default'+' note-item">'+'<div class="note-sort" >'+'<i class="fa fa-arrows-alt"></i>'+'</div>'+'<div class="note-field">'+'<input type="text" placeholder="'+ThemeObj.nutrition_item+'" class="form-control" name="extra_item[]">'+'</div>'+'<div class="note-sort remove-section">'+'<i class="fa fa-times" aria-hidden="true"></i>'+'</div>'+'</li>');$(".note-sorting").sortable();$(".note-sorting").disableSelection()});$('.add-direction').on('click',function(e){e.preventDefault();var wrapper=$(".direction-wrapper");var test=wrapper.find('.direction-item').length;if(test!=0){$(".direction-sorting .direction-item:last-child").after('<li'+' class="ui-state-default'+' direction-item">'+'<div class="item-sort" >'+'<i class="fa fa-arrows-alt"></i>'+'</div>'+'<div class="direction-field">'+'<input type="file" id="recipe_direction_image" class="form-control" name="recipe_direction['+test+'][img]" >'+'<i>Upload image in jpg,png or gif </i>'+'<textarea name="recipe_direction['+test+'][text]" class="form-control" ></textarea>'+'<label class="rtrs-input-label">Video Source</label>'+'<select name="recipe_direction['+test+'][video_type]" class="rtrs-video-source">'+'<option value="self">Hosted Video</option><option value="external">External Video</option>'+'</select>'+'<div class="rtrs-multimedia-upload"><div class="rtrs-upload-box"><i class="fa fa-video-camera" aria-hidden="true"></i><span>Upload a Video</span></div><input type="file" class="recipe_direction_self_video form-control" accept="video/*" name="recipe_direction['+test+'][self_video]"></div>'+'<input type="text" placeholder="https://www.youtube.com/watch?v=668nUCeBHyY" class="form-control video" name="recipe_direction['+test+'][url]">'+'</div>'+'<div class="item-sort remove-section">'+'<i class="fa fa-times" aria-hidden="true"></i>'+'</div>'+'</li>')}else{$(".direction-sorting .blank-filler").after('<li'+' class="ui-state-default'+' direction-item">'+'<div class="item-sort" >'+'<i class="fa fa-arrows-alt"></i>'+'</div>'+'<div class="direction-field">'+'<input type="file" class="form-control" name="recipe_direction['+test+'][img]" >'+'<textarea name="recipe_direction['+test+'][text]" class="form-control" ></textarea>'+'<label class="rtrs-input-label">Video Source</label>'+'<select name="recipe_direction['+test+'][video_type]" class="rtrs-video-source">'+'<option value="self">Hosted Video</option><option value="external">External Video</option>'+'</select>'+'<div class="rtrs-multimedia-upload"><div class="rtrs-upload-box"><i class="fa fa-video-camera" aria-hidden="true"></i><span>Upload a Video</span></div><input type="file" class="recipe_direction_self_video form-control" class="form-control" accept="video/*" name="recipe_direction['+test+'][self_video]"></div>'+'<input type="text" placeholder="https://www.youtube.com/watch?v=668nUCeBHyY" class="form-control video" name="recipe_direction['+test+'][url]">'+'</div>'+'<div class="item-sort remove-section">'+'<i class="fa fa-times" aria-hidden="true"></i>'+'</div>'+'</li>')} 4wrapper.find('.direction-item').each(function(index,item){$(this).find("input[type='file'], textarea").each(function(){$(this).attr("name",$(this).attr("name").replace(/\[([0-9]+)\]/i,"["+index+"]"))})});$(".direction-sorting").sortable();$(".direction-sorting").disableSelection()});$(document).on('click','.rtrs-upload-box',function(){var rn_upload=$(this).parent().find('.recipe_direction_self_video');rn_upload.trigger('click')});$(document).on('change','.rtrs-video-source',function(){let video_source=$(this).val();
4var rn_self_video=$(this).parent().find('.rtrs-multimedia-upload');var rn_ext_video=$(this).parent().find('.form-control.video');if(video_source=='self'){rn_self_video.show();rn_ext_video.hide()}else{rn_self_video.hide();rn_ext_video.show()}});$('.project_images').on('click','.remove_project_file',function(e){e.preventDefault();$(this).parent().remove()});var _URL=window.URL||window.webkitURL;$('#recipe_feature_image').change(function(){var file=$(this)[0].files[0];console.log(file);var img=new Image();var imgwidth=0;var imgheight=0;var maxwidth=1210;var maxheight=700;img.src=_URL.createObjectURL(file);img.onload=function(){imgwidth=this.width;imgheight=this.height};img.onerror=function(){$("#response").text("not a valid file: "+file.type)}});$('a#show_login').on('click',function(e){$('body').prepend('<div class="login_overlay"></div>');$('form#login').fadeIn(500);$('div.login_overlay, form#login a.close').on('click',function(){$('div.login_overlay').remove();$('form#login').hide()});e.preventDefault()});$('form#login').on('submit',function(e){$('form#login p.status').show().text(ajax_login_object.loadingmessage);$.ajax({type:'POST',dataType:'json',url:ajax_login_object.ajaxurl,data:{'action':'ajaxlogin','username':$('form#login #username').val(),'password':$('form#login #password').val(),'security':$('form#login #security').val()},success:function(data){$('form#login p.status').text(data.message);if(data.loggedin==!0){document.location.href=ajax_login_object.redirecturl}}});e.preventDefault()});$(document).on('click','.remove-section i',function(e){$(this).parents('li').remove()});$(document).on('click','.direction-item .remove-section',function(e){if(confirm("Are you sure to delete?")){var wrapper=$(this).parents('.direction-wrapper');$(this).parents('.direction-item').remove();wrapper.find('.direction-item').each(function(index,item){$(this).find("input[type='file'], textarea").each(function(){$(this).attr("name",$(this).attr("name").replace(/\[([0-9]+)\]/i,"["+index+"]"))})})}});$(document).on('click','.delete-item',function(e){e.preventDefault();var _self=$(this),post_id=_self.attr('id');_self.closest('.product-box').addClass('rt-dim');$.ajax({url:ThemeObj.ajaxURL,data:{post_id:post_id,action:'my_recipe_list_id'},type:'POST',success:function(resp){if(resp.success){_self.parents('.product-box').remove()}else{console.log(resp.msg)}},error:function(e){console.log(e)}})});$(document).on('click','.remove-image',function(e){var _self=$(this),thumbnail=$('.rec-feature-image'),post_id=_self.attr('id'),thunmDiv=$('.image-box');$.ajax({url:ThemeObj.ajaxURL,data:{post_id:post_id,action:'my_recipe_thumb'},type:'POST',success:function(resp){if(resp.success){_self.remove();thunmDiv.find('.rec-feature-image').remove()}else{console.log(resp.msg)}},error:function(e){console.log(e)}})});$(document).on('click','.account-image .remove-user-image',function(e){$('.account-image').find('.user-image').remove();var _self=$(this),thunmDiv=$('.account-image'),post_id=_self.attr('id');$.ajax({url:ThemeObj.ajaxURL,data:{post_id:post_id,action:'my_user_thumb'},type:'POST',success:function(resp){if(resp.success){_self.remove();thunmDiv.find('.user-image').remove()}else{console.log(resp.msg)}},error:function(e){console.log(e)}})});var matchNoResult=$('.password-no-match');var matchResult=$('.password-match');$('#password2').keyup(function(){var pass=$('#password1').val();var pass2=$('#password2').val();if(pass!=pass2){matchResult.removeClass('show');matchNoResult.addClass('show');$('.registration-but').prop('disabled',!0)}else{matchNoResult.removeClass('show');matchResult.addClass('show');$('.registration-but').prop('disabled',!1)}})})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.