Sha256: 94d43f1fa9622d3c9c8ff8efb8b6306cb8a3838f6e55df444d7651d967b88819

Contents?: true

Size: 783 Bytes

Versions: 12

Compression:

Stored size: 783 Bytes

Contents

$.fn.upload_maker = function(destination) {
	$(this).each(function() {
		//Get some vars
		var id = $(this).attr('id');
		var image_input_id = id + '_image_url';
		//write the iframe
		$(this).before('<iframe style="height: 1em;width:650px" src="'+destination+'&destination=' + image_input_id +'" frameborder="0"></iframe>');
		//write hidden input
		$(this).after('<input id="' + image_input_id +'" name="' + image_input_id +'" style="position:absolute;left:-9999em" />');
		$('#' + image_input_id).focus(function() {
			var url = $(this).val();
			if (tinyMCE && (ed = tinyMCE.get(id))) {
				ed.execCommand('mceInsertContent', false, '<img src="' + url + '" alt="' + url + '" />');		
			} else {
				insertTag(id, '<img src="' + url + '" alt="' + url + '" />');
			}
	  });
	})
}

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
ds-kitsune-0.2.5 generators/kitsune/templates/javascripts/upload_maker.js
ds-kitsune-0.2.3 generators/kitsune/templates/javascripts/upload_maker.js
kitsune-0.2.1 generators/kitsune/templates/javascripts/upload_maker.js
kitsune-0.2.0 generators/kitsune/templates/javascripts/upload_maker.js
kitsune-0.1.5 generators/kitsune/templates/javascripts/upload_maker.js
kitsune-0.1.4 generators/kitsune/templates/javascripts/upload_maker.js
kitsune-0.1.3 generators/kitsune/templates/javascripts/upload_maker.js
kitsune-0.1.2 generators/kitsune/templates/javascripts/upload_maker.js
kitsune-0.1.1 generators/kitsune/templates/javascripts/upload_maker.js
kitsune-0.1.0 generators/kitsune/templates/javascripts/upload_maker.js
kitsune-0.0.19 generators/kitsune/templates/javascripts/upload_maker.js
kitsune-0.0.18 generators/kitsune/templates/javascripts/upload_maker.js