Tuesday, April 20, 2010

Javascript tooling

So I've been working with Javascript for a week or two now. I still loathe it. However I would not probably touch it at all were it not for

  • JQuery - Feels like a .net framework for javascript
  • JQueryUi - Ah a (ightweight custom control library
  • JQuerify - Inject jQuery onto pages that don't have it for making bookmarklets.
I've used Visual Studio 2010 Ultimate primarily for the script writing because of the code/syntax coloring and  built in (poor but still built in) {} () [] matching capabilities. Those aren't specific to Ultimate, or 2010 for all I know. 

For debugging scripts I've used
  • FireBug
  • Google Chrome's built-in developer tool bar (alot)
  • JsBin - online javascript collaborative debugger (seemed slightly buggy, but still worth it)
  • Javascript Lint - nice online static analyzer for syntax and other problems.
On top of those as base scripts to help with life
  • qTip - Nice jQuery plugin  tool tip script for web pages
  • Google's lovely api hosting content delivery network for jQuery, and jQueryUi.
    • Sidenote: apparently resizable, and who knows what else required I also reference "http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css"

Saturday, April 10, 2010

ClickOnce Bookmarklets...maybe click twice

I have a set of bookmarklets that go to my website, and actually use the current version of the bookmarklet. So the bookmarklet on the bar is just a pointer to a script out on my site. So I can update the bookmarklets to my heart's content without the end user having to do anything at all. Unless I move where the bookmarklets live on my site. So if your bookmarklet living space can be more permanent here's the cross domain bookmarklet injection code:

var e=document.createElement('script');

'language', 'javascript');

'token', '@testToken');

'src', 'http://imaginarydevelopment.com/Sfc/Scripts/ClientScripts/AjaxXmlHttp.js');


Notice the token code. That makes it so that in the child script I can pull in which user it is, and make posts to that user's account directly.

Friday, April 2, 2010

Macro Resources

So for any that live primarily never paying any attention to the fact that Visual Studio supports macros like me.  I thought in the spirit of my last post it would help to have some resources around other useful macros.

Additionally apparently macros can be auto triggered by 'Environment' Events such as solution open or close
Here's a nice list from the Stackoverflow community
  • Awesome Visual Studio Macros
    • Selected Text browser macros (whatever you have highlighted/selected in your code file)
      • google it
      • spellcheck the word
      • MSDN search
    • InsertNewGuidLiteral
    • AutoClose the start page when you open a solution
    • AutoOpen the start page when you close a solution
    • Automatic Build timer with every build to the output window
    • Dual monitor / Single monitor macro for switching back and forth on the fly
    • Outlining: Collapse to definitions but expand regions