ScottGu's Scottsdale '08 Presentations Now Posted

by Jon Davis 25. March 2008 09:51

ScottGu's presentations from his Scottsdale presentations here are now posted. http://weblogs.asp.net/scottgu/archive/2008/03/09/my-presentations-in-arizona-this-tuesday.aspx

I was there. Yay me. Sadly, though, I was with some co-workers who wanted to sit in the back. I couldn't see.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Software Development | Web Development

XHTMLJS: Updated to v0.3

by Jon Davis 22. March 2008 23:17

I've updated XHTMLJS to version 0.3.

http://cachefile.net/scripts/xhtmljs/0.3/

Try the XHTML editor.

This implements the full strict tagset listed at:

http://www.htmldog.com/reference/htmltags/

It still has some flaws, but this mainly resolves what I observed previously, "a few more failures beyond indentation, namely some XHTML-accepted tags (like <input>) are still going missing in strict mode. The Editor should allow for the de-toggling of strict mode, and IMO I think enabling strict mode for the jQuery extension was a mistake. Also, plain-text '>' (&gt; in markup) is not outputting as '&gt;' but as '>'. "

There are still indentation bugs and missing event handlers, among a few other glitches, but this is an important milestone.

UPDATE: The editor itself had a bug I just fixed (kept the 0.3 version designation) where it would only XHTMLize the first node entered. This required no change to xhtml.js.

kick it on DotNetKicks.com

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Pet Projects | Open Source | Web Development

Introducing jqalert - The jQuery-empowered alert() replacement

by Jon Davis 22. March 2008 16:59

I'm releasing a beta build of something I've been working on called jqalert. It's basically a nice, skinnable modal dialog box that defaults to have a certain "fade-in" feel I wanted to have.

Here's the current project URL:

http://www.jondavis.net/codeprojects/jqalert/  

.. or on cachefile:

http://cachefile.net/scripts/jquery/plugins/jqalert/0.9/

I built this having been inspired by a few other similar libraries out there, including:

What sets jqalert apart is that it is a) specifically an alert() replacement, b) prefab'd to be functionally comparable to Visual Basic's MsgBox, which allows the user to set the title and the icon (and the buttons, too, but jqalert currently only supports OK), while c) also adding a lot of customizeability.

What does "specifically an alert() replacement" really mean, when other tools do the same basic thing? It's about the execution...

  • As quick and simple to use as possible: jqalert(message); or jqalert(message, title);
  • Predictable "windowing" appearance; universally recognizeable.
  • You get a titlebar.
  • You can drag the alert window around with the titlebar, for those "emergencies" where you might need to peek back behind the alert window, without closing out the message. 
  • You get an OK button.
  • The OK button claims focus, so that you can close it by just hitting spacebar or enter.
  • The OK button reclaims focus if it loses focus by clicking elsewhere in the alert window.
  • Modality blocks UI.

kick it on DotNetKicks.com

Currently rated 3.4 by 5 people

  • Currently 3.4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Pet Projects | Open Source | Computers and Internet | Web Development

LINQPad - One Of .NET's Best Kept Secrets

by Jon Davis 18. March 2008 14:36

http://www.linqpad.net/

This thing is awesome. :)

LINQPad supports everything in C# 3.0 and Framework 3.5:

  • LINQ to SQL
  • LINQ to Objects
  • LINQ to XML

LINQPad is also a great way to learn LINQ: it comes preloaded with 200 examples from my book, C# 3.0 in a Nutshell.  There's no better way to experience the coolness of LINQ and functional programming.

And LINQPad is more than just a LINQ query tool: it's a code snippet IDE. Instantly execute any C# 3 or VB 9 expression or statement block!

Best of all, LINQPad is free and needs no installation: just download and run.  The executable is under 2MB and is self-updating.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Cool Tools

65 WCF Links To Make You An Expert

by Jon Davis 16. March 2008 15:03

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Software Development

Web 2.0 Project Management With GoPlan

by Jon Davis 16. March 2008 14:44

For those who loved Base Camp but hated the fact that it had no issue tracker, task management, etc., there's a site out there called GoPlan, http://goplan.info/. I really like what I see at first glance here. Base Camp-like simplicity and easy-on-the-eyes design are king here, but it's not completely feature-incomplete, either. And I like the fact that besides its limited free package, its smallest complete package is moderately affordable at $10. I could afford that.

This is really just for lightweight project management. For real PM and issue tracking, people seem to be using Trac a lot. But you have to host it. If you have a dedicated host or are hosting it internally, and in either case if you have virtualization support (i.e. VMWare Server), try getting Trac from Jumpbox.

UPDATE: Sahil Parikh [sahil@deskaway.com] pointed out DeskAway.com .. I agree with him, it's much more complete and has a lot more features for a new user. Doesn't have the appearance polish (I hate the amateurish logo, for instance, and the whole thing just looks white-washed) but that's a fuzzy feely measure. I can see myself using this, for sure.

UPDATE 2: I've been trying to use DeskAway.com, but it has some usability issues. For example, the default phone number for a Contact record is Mobile, not Office, and there is no obvious way to make the Office number the default contact phone number. Worse, enter xxx-xxx-xxxx and it will clear the whole number out and scream at you for entering an invalid number. Enter it without the hyphens and it takes. (?!) And if you add a Company record, you can't add punctuation or symbols at the end; it will not let you. I got past it by inserting inside text rather than appending at the end. But.., I mean .., ?!! And to top it off, it refuses .docx files. And when you report this stuff, it asks you to select your operating system: Vista, XP, Mac, or Linux. Windows Server's not in the list, and it's not free-text. I hate these kinds of issues ... I'd prefer fewer features over dealing with these issues.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

XHTMLJS: New Javascript XHTML editor

by Jon Davis 15. March 2008 17:49

I just pushed a v0.2 of the DOM-to-XHTML conversion script.

  • New real-time XHTML editor! -- Type bad HTML into one textbox, see good XHTML come out the other textbox
    • I needed this so that I can test the XHTMLization with arbitrary markup, but the net result is a really handy tidy page that anyone an use without writing Javascript code
  • Moved the function declarations to an object variable at window.xhtmljs
  • Fixed an "[object]" output bug where there is no text and no HTML tag name
  • Extended jQuery using .fn. rather than .prototype.

http://cachefile.net/scripts/xhtmljs/

In the next round of tweaks I'll clean the formatting logic as there are some indentation errors. Awfully handy, somehow I overlooked it.

Update: Ugh, a few more failures beyond indentation, namely some XHTML-accepted tags (like <input>) and attributes (like onxxxx event handlers) are still going missing in strict mode. The Editor should allow for the de-toggling of strict mode, and IMO I think enabling strict mode for the jQuery extension was a mistake. Also, plain-text ">" (&gt; in markup) is not outputting as "&gt;" but as ">".

kick it on DotNetKicks.com

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Web Development

innerXHTML DOM-to-XHTML Generator in Javascript

by Jon Davis 13. March 2008 00:25

Developers often need XHTML-compliant HTML markup when they fetch DOM elements' innerHTML. Since the W3C hasn't standardized on this property (and I don't know why?!), the browsers have been inconsistent in their approaches to innerHTML. Firefox doesn't put the trailing slash in <br> tags, for instance, while Internet Explorer shows tags in all-caps and strips the quotation marks from some attributes.

This week after my rant got posted on Ajaxian.com, I figured I'd do my part to express my sincerity with the situation of by creating innerXHTML() and outerXHTML() functions in Javascript. Not the first-ever effort, but seemed appropriate considering the strong weight of my public rant. I intended to add it to the prototype of HTMLElement, but *gasp* .. wouldn't you know it, Internet Explorer doesn't expose a prototype for DOM elements!! Ack!! (Dang it, IE team, get out of your cave. :P )

So, take it or leave it, I wrote the innerXHTML() and outerXHTML() functions anyway, added them to the HTMLElement prototype for browsers that support it (yay Firefox), and added xhtml() for innerXHTML() equivalence for jQuery.

I posted it up at http://cachefile.net/scripts/xhtmljs/ with a lightweight test for initial coding efforts. More code than desirable is devoted to formatting (pretty line breaks and tabs), and if you don't like any of that fluff you can turn it off by setting the global variable xhtmlFormatting to "none" or, for now, to anything other than "formatted".

http://cachefile.net/scripts/xhtmljs/ 

Hope everyone likes it. Please give feedback (ideas, concerns, complaints, bug reports, etc) to jon@jondavis.net. I might post this on CodePlex if I get a lot of feedback, but in the absence of feedback I don't see much point.  

kick it on DotNetKicks.com

Currently rated 4.0 by 4 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , , , , , , ,

Web Development

Silverlight: DOCX-to-XAML using TextGlow.net

by Jon Davis 10. March 2008 02:07

At http://www.textglow.net/ they've proven that Silverlight 2 and its CLR is flexible enough to be able to take a .docx file (that's a modern Microsoft Word document) and browse it in Silverlight. I am assuming it's converting to XAML under the covers, and even if not I'm sure that a Canvas object and its contents are serializable to XAML (yes?).

What I want to know is, if a Word document can be browsed in Silverlight, why doesn't Microsoft take this another nineteen miles and convert XHTML+CSS to XAML and make Internet Explorer 9 or IE 10 a completely WPF based renderer?

I know that's not nearly as simple as it sounds; there is a vast amount of complexity in Trident.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Computers and Internet | Cool Tools | Web Development

Silverlight: We've Got Window.Eval()!! Yay!!

by Jon Davis 9. March 2008 23:52

W00t!! The window.eval() function is something I've been wanting in Silverlight forever!! Looks like it's here now, finally, in Silverlight v2!

// App.xaml.cs:
private void Application_Startup(object sender, StartupEventArgs e)
{
    // Load the main control      // generated
    this.RootVisual = new Page(); // generated
 
    // added ..
    string html = HtmlPage.Window.Eval("document.documentElement.innerHTML").ToString();
    HtmlPage.Window.Alert(html); // worked!
}

Now lemme try some jQuery ..

<!-- HTML: -->
<script type="text/javascript" language="javascript">
    function showAlert(el) {
        alert("Alert from jQuery introspection of $(" + el.tagName + ").html() ..\n\n"
            + $(el).html());
    }
</script>

...

// App.xaml.cs:
private void Application_Startup(object sender, StartupEventArgs e)
{
    // Load the main control       // generated
    this.RootVisual = new Page();  // generated
 
    object bodyObject = HtmlPage.Window.Eval("document.body");
    HtmlPage.Window.Invoke("showAlert", bodyObject);
}

W00t! It works!! Now lemme try some plugin interop using only outer passing...

<!-- HTML -->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
    width="550" height="400" id="tweenMov">
    <!-- first random swf I found -->
    <param name="movie" value="
http://www.albinoblacksheep.com/flash01/tweenaflashodyssey(www.albinoblacksheep.com).swf">
   
    <param name="quality" value="high">
    <param name="bgcolor" value="#000000">
    <embed src="/support/flash/ts/documents/myFlashMovie.swf"
        quality=high bgcolor=#FFFFFF width="550" height="400"
        name="tweenMovie" id="smurfsMovie align="" type="application/x-shockwave-flash"
        pluginspage="
http://www.macromedia.com/go/getflashplayer">
    </embed>
</object>
  
...
  
// App.xaml.cs:
object movieObject = HtmlPage.Window.Eval("tweenMovie");

Hmm, putting a breakpoint on this and introspecting movieObject, it's still an HtmlElement with nothing much associated with it.

I can still pass it around as an object reference ...

Initial jQuery test:

<!-- HTML  <script>: -->
window.onload = function() {
    var movieObj = $("#tweenMov")[0];
    alert("bgcolor=" + movieObj.bgcolor + "\n"
        + "quality=" + movieObj.quality);
}

.. and then try same test after passing to Silverlight and having Silverlight pass it back out again ..

<!-- HTML <script>: -->
function showParams(movieObj, fromMsg) {
    alert(fromMsg + "\n\nbgcolor=" + movieObj.bgcolor + "\n"
        + "quality=" + movieObj.quality);
}

..

// App.xaml.cs:
object movieObject = HtmlPage.Window.Eval("tweenMov");
HtmlPage.Window.Invoke("showParams", movieObject, "From Silverlight:");

Worked! Tested in Firefox, too, but it failed; apparently, it choked on the Flash markup before the other stuff had a chance, and I'm too tired to clean it up.

Now let's see if I can declare Javascript functions on the fly so that I can use browser scripting to perform cross-plugin communications without prior scripting in markup:

// App.xaml.cs:
object val = HtmlPage.Window.Eval("function showHelloWorld() {"
    + "     alert(\"Hello world! This is Silverlight talkin!\");"
    + "     return \"Yay!\";"
    + "}"
    + "showHelloWorld();");
HtmlPage.Window.Alert(val.ToString());

It works. Yay!! Can I do the same to elaborately introspect the Flash plug-in?

object val = HtmlPage.Window.Eval("function getFlashBgColor() {"
    + "return $(\"#tweenMov\")[0].bgcolor;"
    + "}"
    + "getFlashBgColor();");
           
HtmlPage.Window.Alert("Flash background color: " + val.ToString());

Looks like I got my wish! Now I can use the CLR to control DHTML through the browser script runtime, which alone knows the full extent of its DOM. Silverlight is browser script runtime friendly!

kick it on DotNetKicks.com

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Computers and Internet | Software Development | Web Development


 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 


Tag cloud

Calendar

<<  March 2021  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar