Rev 23629 | Rev 27754 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
$(function() {$(".create-prebooking-listing").live('click', function() {console.log("Create Prebooking Listing Button Clicked...")loadCreatePrebookingListing("main-content");});$(".prebooking-listings").live('click', function() {console.log("Prebooking Listings Button Clicked...")loadPrebookingListings("main-content");});$(".create-prebooking-order").live('click', function() {console.log("Create Prebooking Order Button Clicked...")loadCreatePrebookingListings("main-content");});$(".prebooking-orders").live('click', function() {console.log("Prebooking Orders Button Clicked...")loadPrebookingOrders("main-content");});$("#prebooking-listings-paginated .next").live('click', function() {loadPaginatedNextItems('/getPaginatedPrebookingListings', null, 'prebooking-listings-paginated', 'prebooking-listings-table', 'prebooking-listing-details-container');$(this).blur();});$("#prebooking-listings-paginated .previous").live('click', function() {loadPaginatedPreviousItems('/getPaginatedPrebookingListings', null, 'prebooking-listings-paginated', 'prebooking-listings-table', 'prebooking-listing-details-container');$(this).blur();});$("#prebooking-orders-paginated .next").live('click', function() {loadPaginatedNextItems('/getPaginatedPrebookingOrders', null, 'prebooking-orders-paginated', 'prebooking-orders-table', 'prebooking-order-details-container');$(this).blur();});$("#prebooking-orders-paginated .previous").live('click', function() {loadPaginatedPreviousItems('/getPaginatedPrebookingOrders', null, 'prebooking-orders-paginated', 'prebooking-orders-table', 'prebooking-order-details-container');$(this).blur();});/*$('#brands li a').live('click', function(){$('#brand-value').text($(this).text());loadItemsDescriptionByBrand("items-description-container", $(this).text());console.log($(this).text());});*/$(".prebooking-listing-details").live('click',function(){var prebookingListingId = $(this).attr('data');console.log("prebookingListingId = " + prebookingListingId);loadPrebookingListingDetails(prebookingListingId, "prebooking-listing-details-container");});$(".active-prebooking-listing").live('click',function(){var prebookingListingId = $(this).attr('data');console.log("active-prebooking-listing id : "+prebookingListingId);var start = $( "#prebooking-listings-paginated .start" ).text();//var end = $( "#schemes-paginated .end" ).text();var offset = start - 1;if(confirm("Are you sure you want to Active Prebooking Listing!") == true){activePrebookingListing(prebookingListingId, offset, "prebooking-listings-table");}});$(".expire-prebooking-listing").live('click',function(){var prebookingListingId = $(this).attr('data');console.log("expire-prebooking-listing id : "+prebookingListingId);var start = $( "#prebooking-listings-paginated .start" ).text();//var end = $( "#schemes-paginated .end" ).text();var offset = start - 1;if(confirm("Are you sure you want to Expire Prebooking Listing!") == true){expirePrebookingListing(prebookingListingId, offset, "prebooking-listings-table");}});$("#quantity").live("change paste keyup", function() {var quantity = parseFloat($(this).val());if(quantity <= 0){alert("Quantity must be greater than zero");$(this).val(1);}else if(quantity > 0){var totalAmount = parseFloat($('#advanceAmount').val());$('#totalAmount').val(quantity * totalAmount);}});});$(document).ready(function() {$( "#quantity").live("blur", function() {console.log("quantity blur called");if($(this).val() == ""){$(this).val(1);$('#totalAmount').val($('#advanceAmount').val());}});});function configureItemsDescriptionDropDown(){$(document).ready(function() {$('#itemsDescription').multiselect({//includeSelectAllOption: true,maxHeight: 200,buttonWidth: '280px',// numberDisplayed: 1,nonSelectedText: 'Items',nSelectedText: ' - Items Selected',enableFiltering: true,enableCaseInsensitiveFiltering:true,multiple: false});});}function loadCreatePrebookingListing(domId){doAjaxRequestHandler(context+"/createPrebookingListing", "GET", function(response){$('#' + domId).html(response);});}function loadPrebookingListings(domId){doAjaxRequestHandler(context+"/getPrebookingListings", "GET", function(response){$('#' + domId).html(response);});}function loadCreatePrebookingListings(domId){doAjaxRequestHandler(context+"/createPrebookingOrder", "GET", function(response){$('#' + domId).html(response);});}function loadPrebookingOrders(domId){doAjaxRequestHandler(context+"/getPrebookingOrders", "GET", function(response){$('#' + domId).html(response);});}function loadItemsDescriptionByBrand(domId, brand){doAjaxRequestHandler(context+"/getItemsByBrand?brand="+brand, "GET", function(response){$('#' + domId).html(response);configureItemsDescriptionDropDown();});}function loadPrebookingListingDetails(prebookingListingId, domId){doAjaxRequestHandler(context+"/getPrebookingListingById?prebookingListingId="+prebookingListingId, "GET", function(response){$('#' + domId).html(response);window.dispatchEvent(new Event('resize'));});}function activePrebookingListing(prebookingListingId, offset, domId){doAjaxRequestHandler(context+"/activePrebookingListingById?prebookingListingId="+prebookingListingId+"&offset="+offset, "PUT", function(response){$('#' + domId).html(response);$('#prebooking-listing-details-container').html('');});}function expirePrebookingListing(prebookingListingId, offset, domId){doAjaxRequestHandler(context+"/expirePrebookingListingById?prebookingListingId="+prebookingListingId+"&offset="+offset, "PUT", function(response){$('#' + domId).html(response);$('#prebooking-listing-details-container').html('');});}