Archive

Archive for the ‘JavaScript’ Category

SharePoint 2010: Show Dialog on Page Load

February 11th, 2010 Buta Comments

A quick tip…

Because the sp.ui.dialog.js library is lazy-loaded, it may not be available when the page is ready/loaded. I’ve seen some early examples where if you wanted to do something on page load, you use:

_spBodyOnLoadFunctionNames.push("YourInitFunction()");

This will not work if you want to open a SharePoint dialog on page load. Instead use:

ExecuteOrDelayUntilScriptLoaded(YourInitFunction, "sp.ui.dialog.js");

Vancouver Tech Fest – Creating jQuery Web Parts for SharePoint

November 21st, 2009 Buta Comments

It’s always fun to have your presentation laptop completely meltdown the night before your presentation!

Anyways, here are the presentation material and code:

Microsoft announces Internet Explorer 9 at PDC

November 20th, 2009 Buta Comments

Microsoft has announced they’re busy working away on the next version of Internet Explorer. Some of the more interesting things included:

  • Much better JavaScript performance! IE8 was a nice first step at improving JS performance on IE but still woefully behind the JS profilers and JIT compilers of Firefox, Safari, et al. Early builds of IE9 are already 4 times faster in the SunSpider benchmark than that of IE8 and putting it about par with Firefox 3.5.
  • CSS Level 3! Again early builds apparently are able to pass the majority of the CSS3 Selectors Testsuite, 41 out of 43. Of course, Firefox 3.5 and Safari 4 already completely pass this test. IE8 only passed 22 of these tests by the way.

Where’s more HTML5?

Microsoft was very non-committal about this. They made a good start in IE8 with things like DOM storage, cross document messaging (XDM) and have a built in JSON API, but where’s <video> or more importantly <canvas>?

It’s a promising start for Microsoft with news about IE9’s JS performance and CSS3 compliance. Here’s hoping to Microsoft finding time to implement some of the HTML elements that competitors have already integrated into their browsers. Don’t need IE10 to STILL be playing catch-up.

SPC09: Status Bar and Notification APIs

November 3rd, 2009 Buta Comments

SharePoint 2010 Status Bar and Notification elementsExcuse the really bad screen cap to the right… the Status Bar and Notifications are two UI elements in SharePoint 2010 which allow us to give the user information in context without distracting them. The Status Bar and Notifications are both exposed as client-side JavaScript APIs.

Status Bar

The Status Bar lives below the Ribbon and displays persistent information such as page status or web site alerts. It already existed in SharePoint 2007 as an UI element but it’s functionality was not exposed as an API. It will display an HTML message, which can include links and/or images, on 1 of 4 pre-set background colours depending on the importance of the status defined.

There is a Server API to set statuses at page render time as well as a JavaScript API to dynamically add/remove messages.

The JavaScript API is in the SP.UI.Status namespace and is as follows:

SP.UI.Status.addStatus(strTitle, strHtml, atBeginning)
SP.UI.Status.updateStatus(sid, strHtml)
SP.UI.Status.removeStatus(sid)
SP.UI.Status.removeAllStatus(hide)
SP.UI.Status.setStatusPriColor(sid, strColor)

Notifications

Notifications are brand new to SharePoint 2010 and they are used for transient or semi-transient messages such as action confirmations. Notifications appear on the right side of the page below the ribbon and default to a 5 second display period. Like the Status Bar, the message format is HTML with the ability of including links and/or images.

There is a JavaScript API to add/remove messages. You also have the option to make a Notification “sticky” which means it will continue to display until you manually remove it through the API.

Notifications are in the SP.UI.Notify namespace:

SP.UI.Notify.addNotification(strTitle, bSticky, tooltip, onclickHandler)
SP.UI.Notify.removeNotification(id)

Contoso Riders Quick App

June 2nd, 2008 Buta Comments

Hey, what’s a couple of years between posts right?

I recently had the opportunity to demo our Contoso Riders Quick App at EnergizeIT in Toronto. A big thanks to Jean-Luc David and Chris Dufour for being such great hosts and for making our Services track a great success!

Presenting the Contoso Riders Quick App at EnergizeIT!Chris Dufor and your's truly

So you might be asking yourself; “What’s a Quick App?”

Quick Apps are projects that showcase the Microsoft Live Platform service offerings and also serve as templates which developers can use as a springboard to base their own projects off of. They are open-source projects release under Microsoft Public License (Ms-PL).

In the case of Contoso Riders, we implemented services and APIs such as:

  • Live ID for user authentication
  • Live Messenger Presence API and IM Control for Instant Messenging
  • Virtual Earth Map Control to display and Virtual Earth Collections for storing map and routing information
  • Silverlight Streaming for hosting videos
  • Live Spaces Weblogs and the Metaweblog API to store and manage content
  • Live Spaces Photo Albums to store photos

You can download the source for Contoso Riders on CodePlex as part of the Windows Live Quick Apps project.

Microsoft “Atlas” – Features vs Size and Performance

September 24th, 2006 Buta Comments

I attended the Microsoft presentation of “Atlas, Microsoft AJAX Library and ASP.NET 2.0 AJAX Extensions, hosted by .Net BC this past Wednesday.

Something that had me intrigued was when Shaun Walker of DotNetNuke fame showed how easily it was to integrate “Atlas” into DNN. I’m wondering if the simplicity of the changes is due to the .Net Framework itself or if the DNN developers had pre-wired some hooks for “Atlas.”

While the rest of the presentation was pretty much the same top-level information I’ve heard in previous previews of “Atlas,” there are a few points about “Atlas” I would like to touch upon.

Read more…

Tags:

mootools from Valerio Proietti is now available

September 11th, 2006 Buta Comments

mootools is a very compact, modular, object-oriented JavaScript framework and is less than 19Kb in size (compressed JS, 34Kb uncompressed) for the entire set of scripts and add-ons. mootools replaces the moo family of JavaScript libraries (moo.fx, moo.dom, moo.ajax, etc).

I prefer the moo.* libraries over the Prototype/Script.aculo.us combo due to the former’s much smaller file size. Prototype by itself weighs in at 60Kb uncompressed and add at least another 30Kb for Script.aculo.us.

What’s really interesting is the way you can download mootools. The download page allows you to pick and choose which parts of the library you want and whether or not you want to compress the JS source file.

Read more…

Tags: