5

I have downloaded a minimized jquery plugin file and need to do some customization as per my project requirements. I am using Visual Studio 2010. And because the file is minimized, it is becoming very difficult to debug it or perform any modifications. Is there a way i can reformat the js file?

Thanks

user979189
  • 1,230
  • 2
  • 15
  • 39
  • I don't think so, why you just can look if exit's some version without minize what's the plugin?? – Jorge Dec 20 '11 at 20:10
  • I am using jquery slideshow from here - http://addyosmani.com/resources/coverflow/demo/demo.html It is just the minimized version, dont have the original copy for download – user979189 Dec 20 '11 at 20:11
  • It looks like there are a few plugins used as well for that as well. Minimization does things like rename variables among other things which make the code harder to read. You're best bet really is to try to find the pre-minimized versions of the plugin you are after. That site was kind enough to allow directory access, though, so you might poke around here: http://addyosmani.com/resources/coverflow/ – wes.stueve Dec 20 '11 at 20:25

4 Answers4

8

You can add the formatting back by going to http://jsfiddle.net, pasting the code into the javascript pane, and then clicking Tidy Up at the top.

Kevin B
  • 94,570
  • 16
  • 163
  • 180
5

You can use jsbeautifier.org for javascript beautification. It also decode Dean Edward's packer.

Also in Visual Studio you can use this shortcut: ctrl+K, ctrl+D

Emre Erkan
  • 8,433
  • 3
  • 48
  • 53
  • I just did it as per what Kevin said. But jsbeautifier is also a great tool to reformat it. Thanks for the suggestion – user979189 Dec 20 '11 at 20:25
  • You're welcome. You have `Vote Up` privilege, so you can show your appreciation voting up the answers you like. (I'm not talking about mine answer, any answer you like.) – Emre Erkan Dec 20 '11 at 20:29
  • Oh yes, i just realised i now have the voteup privilege, +1 goes to you :) Thanks – user979189 Dec 20 '11 at 20:30
0

We can do this in chrome itself. All you have to do is open your particular script file in sources and by clicking curly braces at bottom of the page to get formatted script and we can copy and paste it in original file you want to.

0

You should be able to reformat javascript in Visual Studio. Open the javascript file, and select Edit | Advanced | Format Document or Format Selection.

drdwilcox
  • 3,833
  • 17
  • 19