Home Download Buy Blog Forum Support

Drag and drop image to code

Drag and drop image to code

Postby nobleach on Wed Jul 13, 2011 2:41 am

Love this editor more than I've ever loved any other. (and in the past 12 years, I have tried them all; pico, vim, emacs, BBcode, dreamweaver, Textwrangler, Notepad++, Textpad, Visual Studio, Aptana/Eclipse, Netbeans, Espresso, Coda, Textmate.... and a few other random ones in there as a trial basis.

One feature I'd really love to see is to drag and drop an image from the sidebar into the code window and have its HTML attributes set.

Use case: User clicks on images folder to expand it. User drags foo.jpg to code view. The following markup is generated:

<img src="images/foo.jpg" alt="foo" width="400" width="200">

I did use this in Textmate once I found out that the feature existed.... but I've moved on to the next level and I have no interest in going back!!! Long live Sublime!!!
nobleach
 
Posts: 48
Joined: Thu Jun 23, 2011 4:14 pm

Re: Drag and drop image to code

Postby Ventil on Sat Nov 12, 2011 9:16 am

I would like that same thing. I am still using php designer just because it has this feature. I would switch to subllime instantly when it would have that feature also.

I would also like that for css and javascript files. If the user grabs the css file in sidebar and drags it to html the following code is generated <link rel="stylesheet" href="/css/styles.css" />. If he drags the css file to the place where the tabs are it will open the file.

Is it maybe allready possible for images to be drag and drop? That's all that matters to me in code editor. Thank you
Ventil
 
Posts: 2
Joined: Fri Nov 11, 2011 11:38 pm

Re: Drag and drop image to code

Postby Ventil on Wed Nov 16, 2011 6:03 am

Noone answered to this topic in last 5 months. Support sucks here!
Ventil
 
Posts: 2
Joined: Fri Nov 11, 2011 11:38 pm

Re: Drag and drop image to code

Postby bizoo on Wed Nov 16, 2011 6:59 am

Ventil wrote:Noone answered to this topic in last 5 months. Support sucks here!

This is a feature request, not a support request.

This feature doesn't exists and I don't think that it's possible to drag'n'drop files from the sidebar yet (need some new API methods).
However it could be probably possible to add an entry in the context menu of the sidebar to do what you want.
A plugin using something like PIL (http://www.pythonware.com/products/pil/) or even a simple file parser can extract the size of the image and insert the data in the cursor position.
bizoo
 
Posts: 879
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Drag and drop image to code

Postby nobleach on Wed Nov 16, 2011 6:51 pm

First of all, support here does NOT suck.... not even slightly.

Secondly, Tito has created a great plugin for performing a workaround for this feature. It's one step more, but it works well:

viewtopic.php?f=5&t=3331&hilit=tito

Check out his sidebar enhancements.

-nobleach
nobleach
 
Posts: 48
Joined: Thu Jun 23, 2011 4:14 pm

Re: Drag and drop image to code

Postby jonathan on Mon Nov 21, 2011 6:14 pm

I too really want this feature. Looking up an images width and height is just an annoying, time consuming thing to do.

Until I can figure out how to do this in Sublime Text, I create a little tool to do this for me:

http://imgta.gs/

As in an editor, you simply drag and drop the images from your computer into this website, and it spits out the image tags. Best of all, it doesn't actually upload them, it uses HTML5 to figure out the dimensions, so it's instant.

Hope this helps someone!
jonathan
 
Posts: 22
Joined: Tue Aug 30, 2011 12:42 pm

Re: Drag and drop image to code

Postby ninjaroll on Tue Jan 03, 2012 7:11 pm

+1 for this feature. Coming from TextMate, I find this really handy when I need it.
ninjaroll
 
Posts: 31
Joined: Tue Jan 03, 2012 7:10 pm

Re: Drag and drop image to code

Postby javaporter on Wed Jan 04, 2012 4:31 pm

+1

Would also be nice to have the ability to slightly customize that script. So, for instance, if you wanted to have the link be /images vs images or if you wanted to prefix all links with /assets/, etc.
javaporter
 
Posts: 6
Joined: Tue Jan 03, 2012 4:12 pm

Re: Drag and drop image to code

Postby Fatbat on Mon Feb 20, 2012 11:57 am

+1 for this feature as well. Also, instead of opening gibberish when selecting an image file, opening an image preview instead would be a nice feature too.
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Drag and drop image to code

Postby mimoymima on Sun Aug 05, 2012 7:42 pm

+1 for this

also Textmate lets you drag images into css too which is really handy when you're putting background images in

It doesn't seem like this would be too hard to add and it'd be a big time saver for users!

brent
@
mimoYmima.com
mimoymima
 
Posts: 3
Joined: Wed Jul 18, 2012 8:14 am

Next

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 4 guests