Sha256: 4c75f64fff0609718bf2fb810f73b604c02578a065152d152254e94838ffbc0b

Contents?: true

Size: 920 Bytes

Versions: 1

Compression:

Stored size: 920 Bytes

Contents

jQuery(function(){
	
	var dp   	 		= jQuery('div.datepicker'),
		name 	 	  	= dp.attr('rel'),
		month_select 	= jQuery('#'+name+"_2i"),
		day_select 		= jQuery('#'+name+"_3i"),
		year_select		= jQuery('#'+name+"_1i");
	

	jQuery('.transit-editable').transit('editor');
	
	if( dp.length > 0 ){
		
		dp.datepicker({
			dateFormat: 'yy-m-d',
			defaultDate: [year_select.val(), month_select.val(), day_select.val()].join("-").toString(),
			onSelect: function( dateText, input ){
				var date_opts = dateText.split("-");
				year_select.val(date_opts[0]);
				month_select.val(date_opts[1]);
				day_select.val(date_opts[2]);
			}
		});
	}
	
	jQuery('#post_edit').bind('submit', function( event ){
		var i, inst;		
		for( i = 0; i < jQuery.wymeditors.length, i++; ){
			jQuery.wymeditors(i).update();
		}
		return true;
	});
	
	jQuery('#post_default_image').fileinput({ buttonText:'', inputText: 'Choose an image' });
	
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
transit-0.0.2 app/assets/javascripts/transit/admin/fields.js