From 6b8e323e2682c86a31fcff6e982f08aa720f0dff Mon Sep 17 00:00:00 2001 From: bsimpson63 Date: Thu, 9 May 2013 12:26:31 -0400 Subject: [PATCH] Delete update_bid. It did too much and was called in several templates where it did nothing. --- r2/r2/public/static/js/sponsored.js | 35 ----------------------------- r2/r2/templates/paymentform.html | 3 --- r2/r2/templates/roadblocks.html | 3 +-- 3 files changed, 1 insertion(+), 40 deletions(-) diff --git a/r2/r2/public/static/js/sponsored.js b/r2/r2/public/static/js/sponsored.js index 9612c3716..399ced7ff 100644 --- a/r2/r2/public/static/js/sponsored.js +++ b/r2/r2/public/static/js/sponsored.js @@ -195,41 +195,6 @@ r.sponsored = { } } -function update_bid(elem) { - var form = $(elem).parents(".campaign"); - var is_targeted = $("#targeting").prop("checked"); - var bid = parseFloat(form.find('*[name="bid"]').val()); - var ndays = ((Date.parse(form.find('*[name="enddate"]').val()) - - Date.parse(form.find('*[name="startdate"]').val())) / (86400*1000)); - ndays = Math.round(ndays); - - // min bid is slightly higher for targeted promos - var minimum_daily_bid = is_targeted ? $("#bid").data("min_daily_bid") * 1.5 : - $("#bid").data("min_daily_bid"); - $(".minimum-spend").removeClass("error"); - if (bid < ndays * minimum_daily_bid) { - $(".bid-info").addClass("error"); - if (is_targeted) { - $("#targeted_minimum").addClass("error"); - } else { - $("#no_targeting_minimum").addClass("error"); - } - - form.find('button[name="create"], button[name="save"]') - .prop("disabled", "disabled") - .addClass("disabled"); - } else { - $(".bid-info").removeClass("error"); - form.find('button[name="create"], button[name="save"]') - .removeProp("disabled") - .removeClass("disabled"); - } - - $(".bid-info").html("  →" + - "$" + (bid/ndays).toFixed(2) + - " per day for " + ndays + " day(s)"); - } - var dateFromInput = function(selector, offset) { if(selector) { var input = $(selector); diff --git a/r2/r2/templates/paymentform.html b/r2/r2/templates/paymentform.html index 8d99bc39d..80a2186dc 100644 --- a/r2/r2/templates/paymentform.html +++ b/r2/r2/templates/paymentform.html @@ -28,9 +28,6 @@ <%namespace file="utils.html" import="error_field"/> ${unsafe(js.use('sponsored'))} -

${_("set up payment for this link")}

diff --git a/r2/r2/templates/roadblocks.html b/r2/r2/templates/roadblocks.html index 138c86f7e..d32d8d1dc 100644 --- a/r2/r2/templates/roadblocks.html +++ b/r2/r2/templates/roadblocks.html @@ -60,13 +60,12 @@ ${unsafe(js.use('sponsored'))} newd.getDate() + "/" + newd.getFullYear()); } $("#datepicker-enddate").datepicker("destroy"); - update_bid(elem); } - <%p:datepicker name="enddate", value="${thing.enddate}" minDateSrc="startdate" initfuncname="init_enddate"> - function(elem) { update_bid(elem); } + function(elem) { }