PHP Classes

File: js/admin.js

Recommend this page to a friend!
  Classes of TJ Webb   WP Crowd Fund   js/admin.js   Download  
File: js/admin.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WP Crowd Fund
Promote crowd-funding campaigns on WordPress sites
Author: By
Last change:
Date: 10 days ago
Size: 885 bytes
 

Contents

Class file image Download
jQuery(function($){ $(document).ready(function(){ if($('span#sample-permalink').text().split('/')[3] == "campaign" || location.search == "?post_type=wpcf-campaign"){ $('#wp-crowd-fund-giveback-add').click(function(){ $div = $('.wp-crowd-fund-giveback-region:last').clone(); num = parseInt($div.attr('id').replace(/[^0-9]/g, '')) + 1; $div.attr('id', $div.attr('id').replace(/[0-9]+/g, num)); $('input, textarea', $div).each(function(){ $(this).attr('id', $(this).attr('id').replace(/[0-9]+/g, num)); $(this).attr('name', $(this).attr('name').replace(/[0-9]+/g, num)); $(this).val(''); }); $('label', $div).each(function(){ $(this).attr('for', $(this).attr('for').replace(/[0-9]+/g, num)); }); $('.wp-crowd-fund-giveback-region:last').after($div); }); $('#wp-crowd-fund-settings-date').datepicker(); } }); });