Committer: szhirkov
LJSUP-9646: Need to add confirmation before cancelling promoU trunk/htdocs/shop/selfpromo.bml.text.local U trunk/templates/Shop/SelfPromo.tmpl
Modified: trunk/htdocs/shop/selfpromo.bml.text.local =================================================================== --- trunk/htdocs/shop/selfpromo.bml.text.local 2011-08-31 03:18:25 UTC (rev 10938) +++ trunk/htdocs/shop/selfpromo.bml.text.local 2011-08-31 03:58:28 UTC (rev 10939) @@ -42,6 +42,8 @@ .label.price=Your price: +.confirm.delete.promoted=You promo will be cancelled without a refund. Are you sure? + .placeholder.entry_link=Paste your URL here .placeholder.price=LJ Tokens Modified: trunk/templates/Shop/SelfPromo.tmpl =================================================================== --- trunk/templates/Shop/SelfPromo.tmpl 2011-08-31 03:18:25 UTC (rev 10938) +++ trunk/templates/Shop/SelfPromo.tmpl 2011-08-31 03:58:28 UTC (rev 10939) @@ -23,7 +23,7 @@ <TMPL_IF body><dd><TMPL_VAR body></dd></TMPL_IF> </dl> <p class="remaining"><TMPL_VAR ml_remaining></p> - <button type="submit"><TMPL_VAR expr="ml('/shop/selfpromo.bml.info.btn.withdraw')"></button> + <button type="submit" id="selfpromo-withdraw-button"><TMPL_VAR expr="ml('/shop/selfpromo.bml.info.btn.withdraw')"></button> </form> <TMPL_ELSE> <h3><TMPL_VAR expr="ml('/shop/selfpromo.bml.info.title.somebody')"></h3> @@ -78,13 +78,19 @@ jQuery(function($) { $('#entry_link') - .change(function(e) { + .bind('change keyup input paste', function(e) { var fieldIsEmpty = $(this).val() === ''; $('#selfpromo-preview-button, #selfpromo-promote-button') .prop('disabled', fieldIsEmpty); }) .change(); + $('#selfpromo-withdraw-button').click(function(e) { + if (!confirm(Site.ml_text['/shop/selfpromo.bml.confirm.delete.promoted'])) { + return false; + } + }); + $("#selfpromo-preview-button").click(function(e) { e.preventDefault();