INSERT INTO `wp_dyxkdh_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_category`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
(1725, 3, '2011-10-09 12:33:21', '2011-10-09 16:33:21', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element. By setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"][{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n][/code]\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-16', '', '', '2011-10-09 12:33:21', '2011-10-09 16:33:21', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-16/', 0, 'revision', '', 0),
(1726, 3, '2011-10-09 12:36:57', '2011-10-09 16:36:57', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds.\r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-17', '', '', '2011-10-09 12:36:57', '2011-10-09 16:36:57', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-17/', 0, 'revision', '', 0),
(1727, 3, '2011-10-09 12:40:38', '2011-10-09 16:40:38', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n        [code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            idx = this.currIndex++;\r\n            this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n            this.dispOverlay(this.dataBin[idx]);\r\n\r\n        }[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>.\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-18', '', '', '2011-10-09 12:40:38', '2011-10-09 16:40:38', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-18/', 0, 'revision', '', 0),
(1728, 3, '2011-10-09 12:46:30', '2011-10-09 16:46:30', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n        [code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            idx = this.currIndex++;\r\n            this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n            this.dispOverlay(this.dataBin[idx]);\r\n\r\n        }[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n       dispOverlay: function (theData) {\r\n\r\n            var oImg = "";\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = "images/num_" + theData.num + ".ico";\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        }\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-19', '', '', '2011-10-09 12:46:30', '2011-10-09 16:46:30', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-19/', 0, 'revision', '', 0),
(1729, 3, '2011-10-09 12:47:13', '2011-10-09 16:47:13', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n        [code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            idx = this.currIndex++;\r\n            this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n            this.dispOverlay(this.dataBin[idx]);\r\n\r\n        }[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        }[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-20', '', '', '2011-10-09 12:47:13', '2011-10-09 16:47:13', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-20/', 0, 'revision', '', 0),
(1730, 3, '2011-10-09 12:47:44', '2011-10-09 16:47:44', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            idx = this.currIndex++;\r\n            this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n            this.dispOverlay(this.dataBin[idx]);\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-21', '', '', '2011-10-09 12:47:44', '2011-10-09 16:47:44', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-21/', 0, 'revision', '', 0),
(1731, 3, '2011-10-09 12:54:25', '2011-10-09 16:54:25', '', 'dragged-and-pinned', 0, '', 'inherit', 'open', 'open', '', 'dragged-and-pinned', '', '', '2011-10-09 12:54:25', '2011-10-09 16:54:25', '', 1707, 'http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png', 0, 'attachment', 'image/png', 0),
(1732, 3, '2011-10-09 12:49:07', '2011-10-09 16:49:07', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            idx = this.currIndex++;\r\n            this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n            this.dispOverlay(this.dataBin[idx]);\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-22', '', '', '2011-10-09 12:49:07', '2011-10-09 16:49:07', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-22/', 0, 'revision', '', 0),
(1733, 3, '2011-10-09 12:54:43', '2011-10-09 16:54:43', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            idx = this.currIndex++;\r\n            this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n            this.dispOverlay(this.dataBin[idx]);\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-23', '', '', '2011-10-09 12:54:43', '2011-10-09 16:54:43', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-23/', 0, 'revision', '', 0);
INSERT INTO `wp_dyxkdh_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_category`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
(1734, 3, '2011-10-09 12:56:33', '2011-10-09 16:56:33', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            idx = this.currIndex++;\r\n            this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n            this.dispOverlay(this.dataBin[idx]);\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-24', '', '', '2011-10-09 12:56:33', '2011-10-09 16:56:33', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-24/', 0, 'revision', '', 0),
(1735, 3, '2011-10-09 12:59:41', '2011-10-09 16:59:41', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            idx = this.currIndex++;\r\n            this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n            this.dispOverlay(this.dataBin[idx]);\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. The key to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to test out. So if you run into quirks, simply press the F12 key and the debugging tools will appear.\r\n\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-25', '', '', '2011-10-09 12:59:41', '2011-10-09 16:59:41', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-25/', 0, 'revision', '', 0),
(1736, 3, '2011-10-09 13:02:47', '2011-10-09 17:02:47', '', 'ietools', 0, '', 'inherit', 'open', 'open', '', 'ietools', '', '', '2011-10-09 13:02:47', '2011-10-09 17:02:47', '', 1707, 'http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png', 0, 'attachment', 'image/png', 0),
(1737, 3, '2011-10-09 13:00:55', '2011-10-09 17:00:55', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            idx = this.currIndex++;\r\n            this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n            this.dispOverlay(this.dataBin[idx]);\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nThe key to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to test out. So if you run into quirks, simply press the F12 key and the debugging tools will appear.\r\n\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-26', '', '', '2011-10-09 13:00:55', '2011-10-09 17:00:55', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-26/', 0, 'revision', '', 0),
(1738, 3, '2011-10-09 13:02:57', '2011-10-09 17:02:57', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            idx = this.currIndex++;\r\n            this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n            this.dispOverlay(this.dataBin[idx]);\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nThe key to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to test out. So if you run into quirks, simply press the F12 key and the debugging tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-27', '', '', '2011-10-09 13:02:57', '2011-10-09 17:02:57', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-27/', 0, 'revision', '', 0),
(1739, 3, '2011-10-09 13:11:54', '2011-10-09 17:11:54', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nThe key to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to test out. So if you run into quirks, simply press the F12 key and the debugging tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-28', '', '', '2011-10-09 13:11:54', '2011-10-09 17:11:54', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-28/', 0, 'revision', '', 0);
INSERT INTO `wp_dyxkdh_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_category`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
(1740, 3, '2011-10-09 13:14:58', '2011-10-09 17:14:58', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()\r\nwindow.external.msIsSiteMode()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nThe key to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to test out. So if you run into quirks, simply press the F12 key and the debugging tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-29', '', '', '2011-10-09 13:14:58', '2011-10-09 17:14:58', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-29/', 0, 'revision', '', 0),
(1741, 3, '2011-10-09 13:16:44', '2011-10-09 17:16:44', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()\r\nwindow.external.msIsSiteMode()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-30', '', '', '2011-10-09 13:16:44', '2011-10-09 17:16:44', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-30/', 0, 'revision', '', 0),
(1742, 3, '2011-10-09 13:25:52', '2011-10-09 17:25:52', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()\r\nwindow.external.msIsSiteMode()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-31', '', '', '2011-10-09 13:25:52', '2011-10-09 17:25:52', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-31/', 0, 'revision', '', 0),
(1743, 3, '2011-10-09 13:29:59', '2011-10-09 17:29:59', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()\r\nwindow.external.msIsSiteMode()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nRemember to drag the tab down to your taskbar and pin it. \r\n\r\nHere''s the full source code. You can also download everything here.\r\n\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-32', '', '', '2011-10-09 13:29:59', '2011-10-09 17:29:59', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-32/', 0, 'revision', '', 0);
INSERT INTO `wp_dyxkdh_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_category`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
(1744, 3, '2011-10-09 13:39:43', '2011-10-09 17:39:43', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()\r\nwindow.external.msIsSiteMode()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nRemember to drag the tab down to your taskbar and pin it. \r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>.\r\n\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-33', '', '', '2011-10-09 13:39:43', '2011-10-09 17:39:43', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-33/', 0, 'revision', '', 0),
(1745, 3, '2011-10-09 13:46:54', '2011-10-09 17:46:54', 'I was recently doing some work with <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()\r\nwindow.external.msIsSiteMode()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nRemember to drag the tab down to your taskbar and pin it. \r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement it. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate actually pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-34', '', '', '2011-10-09 13:46:54', '2011-10-09 17:46:54', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-34/', 0, 'revision', '', 0),
(1746, 3, '2011-10-09 13:47:22', '2011-10-09 17:47:22', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em>window.external.msSiteModeClearIconOverlay()\r\nwindow.external.msSiteModeSetIconOverlay(icon, desc)\r\nwindow.external.msSiteModeActivate()\r\nwindow.external.msIsSiteMode()</em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to "activate" the notification icon and have it render. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nRemember to drag the tab down to your taskbar and pin it. \r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement it. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate actually pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-35', '', '', '2011-10-09 13:47:22', '2011-10-09 17:47:22', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-35/', 0, 'revision', '', 0);
INSERT INTO `wp_dyxkdh_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_category`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
(1747, 3, '2011-10-09 13:51:31', '2011-10-09 17:51:31', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and renders it using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nRemember to drag the tab down to your taskbar and pin it. \r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement it. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate actually pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-36', '', '', '2011-10-09 13:51:31', '2011-10-09 17:51:31', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-36/', 0, 'revision', '', 0),
(1748, 3, '2011-10-09 13:52:50', '2011-10-09 17:52:50', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nRemember to drag the tab down to your taskbar and pin it. \r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement it. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate actually pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-37', '', '', '2011-10-09 13:52:50', '2011-10-09 17:52:50', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-37/', 0, 'revision', '', 0),
(1749, 3, '2011-10-09 13:54:24', '2011-10-09 17:54:24', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nRemember to drag the tab down to your taskbar and pin it. \r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement this. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-38', '', '', '2011-10-09 13:54:24', '2011-10-09 17:54:24', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-38/', 0, 'revision', '', 0);
INSERT INTO `wp_dyxkdh_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_category`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
(1750, 3, '2011-10-09 14:01:17', '2011-10-09 18:01:17', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nWhen the page renders, drag the tab down to your taskbar and pin it. You should see a new windows appear with your newly pinned site. Five seconds later, you''ll see the first overlay icon appear in the taskbar.\r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement this. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-39', '', '', '2011-10-09 14:01:17', '2011-10-09 18:01:17', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-39/', 0, 'revision', '', 0),
(1751, 3, '2011-10-09 14:23:03', '2011-10-09 18:23:03', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nWhen the page renders, drag the tab down to your taskbar and pin it. You should see a new windows appear with your newly pinned site. Five seconds later, you''ll see the first overlay icon appear in the taskbar.\r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement this. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Site Pinning and Overlay Icons for Enhanced User Notifications and Engagement', 0, '', 'inherit', 'open', 'open', '', '1707-autosave', '', '', '2011-10-09 14:23:03', '2011-10-09 18:23:03', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-autosave/', 0, 'revision', '', 0),
(1752, 3, '2011-10-09 14:03:32', '2011-10-09 18:03:32', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nWhen the page renders, drag the tab down to your taskbar and pin it. You should see a new windows appear with your newly pinned site. Five seconds later, you''ll see the first overlay icon appear in the taskbar.\r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement this. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Pinned Sites Overlay Icons for Better User Notifications', 0, '', 'inherit', 'open', 'open', '', '1707-revision-40', '', '', '2011-10-09 14:03:32', '2011-10-09 18:03:32', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-40/', 0, 'revision', '', 0);
INSERT INTO `wp_dyxkdh_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_category`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
(1753, 3, '2011-10-09 14:05:16', '2011-10-09 18:05:16', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nWhen the page renders, drag the tab down to your taskbar and pin it. You should see a new windows appear with your newly pinned site. Five seconds later, you''ll see the first overlay icon appear in the taskbar.\r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement this. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Site Pinning and Overlay Icons for Enhanced User Notifications and Engagement', 0, '', 'inherit', 'open', 'open', '', '1707-revision-41', '', '', '2011-10-09 14:05:16', '2011-10-09 18:05:16', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-41/', 0, 'revision', '', 0),
(1754, 3, '2011-10-09 14:08:00', '2011-10-09 18:08:00', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nWhen the page renders, drag the tab down to your taskbar and pin it. You should see a new windows appear with your newly pinned site. Five seconds later, you''ll see the first overlay icon appear in the taskbar.\r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement this. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Site Pinning and Overlay Icons for Enhanced User Notifications and Engagement', 0, '', 'inherit', 'open', 'open', '', '1707-revision-42', '', '', '2011-10-09 14:08:00', '2011-10-09 18:08:00', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-42/', 0, 'revision', '', 0),
(1755, 3, '2011-10-09 14:08:24', '2011-10-09 18:08:24', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nWhen the page renders, drag the tab down to your taskbar and pin it. You should see a new windows appear with your newly pinned site. Five seconds later, you''ll see the first overlay icon appear in the taskbar.\r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement this. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Site Pinning and Overlay Icons for Enhanced User Notifications and Engagement', 0, '', 'inherit', 'open', 'open', '', '1707-revision-43', '', '', '2011-10-09 14:08:24', '2011-10-09 18:08:24', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-43/', 0, 'revision', '', 0);
INSERT INTO `wp_dyxkdh_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_category`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
(1756, 3, '2011-10-09 14:09:36', '2011-10-09 18:09:36', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nWhen the page renders, drag the tab down to your taskbar and pin it. You should see a new windows appear with your newly pinned site. Five seconds later, you''ll see the first overlay icon appear in the taskbar.\r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement this. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Site Pinning and Overlay Icons for Enhanced User Notifications and Engagement', 0, '', 'inherit', 'open', 'open', '', '1707-revision-44', '', '', '2011-10-09 14:09:36', '2011-10-09 18:09:36', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-44/', 0, 'revision', '', 0),
(1757, 3, '2011-10-09 14:09:47', '2011-10-09 18:09:47', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nWhen the page renders, drag the tab down to your taskbar and pin it. You should see a new windows appear with your newly pinned site. Five seconds later, you''ll see the first overlay icon appear in the taskbar.\r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement this. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Site Pinning and Overlay Icons for Enhanced User Notifications and Engagement', 0, '', 'inherit', 'open', 'open', '', '1707-revision-45', '', '', '2011-10-09 14:09:47', '2011-10-09 18:09:47', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-45/', 0, 'revision', '', 0),
(1758, 3, '2011-10-09 14:10:10', '2011-10-09 18:10:10', 'I was recently doing some testing of <a href="http://msdn.microsoft.com/en-us/library/gg491731(v=VS.85).aspx">IE9''s Site Pinning API</a> and found out about a cool bit of functionality that can enhance user notifications. If you''re not familiar with site pinning, it''s a great way to allow users to have easy and quick access to their favorite sites via the Windows taskbar. There''s a really nice <a href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7/pinned-sites">overview on Beauty of the Web</a> that explains how it works.\r\n\r\n<h2>Keeping Users Up-to-Date</h2>\r\n\r\nOne of the features the API provides is the notion of notifications that can allow developers to provide alerts to end users. The functionality allows you to dynamically insert custom overlay icons that can alert users when an important bit of information is available. These overlay icons are rendered over the favicon that is pinned to the taskbar. If you look at the image below, you can see it in action:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nSo if you think about the possibilities, any site that offers users an inbox, special deals or sends out time-sensitive alerts could use this notification capability to keep their users up-to-date and more engaged on the site. Sites like the Huffington Post have already discovered that users that pinned HuffPost <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">spent 49% more time on the site</a>. \r\n\r\nThe best part is that adding this capability is insanely easy.\r\n\r\n<h2>Setting it Up</h2>\r\n\r\nFor this post, we''re not going to go into the basics of how to pin a site. If you want to learn more, here''s a GREAT resource for getting you up to speed quickly: <a href="http://buildmypinnedsite.com/">BuildMyPinnedSite.com</a>. In fact, I used that site to help get me up-to-speed on the basics and it''s well-worth visiting.\r\n\r\nTo add notifications, you''ll need a couple of things:\r\n\r\n<ul><li>A cool favicon for your site. If you don''t have one, you can use the handy <a href="http://ie.microsoft.com/testdrive/Browser/IconEditor/Default.html">web-based X-Icon Editor</a> to create one.</li>\r\n<li>A set of overlay icons to use. The recommended size is 16x16.</li>\r\n</ul>\r\nThe API is JavaScript-based and we''ll use the following methods:\r\n\r\n<em><a href="http://msdn.microsoft.com/en-us/library/ff976301(v=VS.85).aspx">window.external.msSiteModeClearIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976304(v=VS.85).aspx">window.external.msSiteModeSetIconOverlay()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976297(v=VS.85).aspx">window.external.msSiteModeActivate()</a>\r\n<a href="http://msdn.microsoft.com/en-us/library/ff976296(v=VS.85).aspx">window.external.msIsSiteMode()</a></em>\r\n\r\nThe <em>window.external.msSiteModeClearIconOverlay</em> method is used to clear out any previously set overlay icons. <em>window.external.msSiteModeSetIconOverlay</em> allows you to specify the name of the notification icon as well as a accessible description. Lastly, we''ll use <em>window.external.msSiteModeActivate</em> to flash the pinned icon to notify the user of the update. Lastly, <em>window.external.msIsSiteMode</em> will let us know if the page was launched as a pinned site, thus allowing us to better determine when to run the code.\r\n\r\nFor the overlay icons, I''m using five images that display numbers 1 through 5 respectively to designate the number of messages are in a user''s inbox.\r\n\r\n<h2>The Code</h2>\r\n\r\nThe first thing I need to add is the reference to my favicon. Note that if you don''t add one, then the Internet Explorer''s icon will be used by default.\r\n\r\n[code lang="html"]&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;[/code]\r\n\r\nNext, I want to create some sample data to work with. What I want to do for my demo is to have the overlay icon dynamically change every 5 seconds to simulate a more real-world scenario. The data is a simple array containing JSON data in each element.  \r\n\r\n[code lang="js"]myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n[/code]\r\n\r\nBy setting a timer, I''ll be able to pull a new set of data every 5 seconds. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData(); }, 5000);[/code]\r\n\r\nThe main thing to keep in mind is that I''m "simulating" getting data from some remote host. In reality, all that the <em>myPin.getData()</em> method does is use a running counter to grab a new set of data and render a new overlay icon:\r\n\r\n[code lang="js"]getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nAs you can see, it uses the running counter var <em>currIndex</em> to determine which array element to grab and then passes the data to <em>dispOverlay()</em>. This is where we use <em>window.external.msSiteModeClearIconOverlay()</em> to clear out any previously displayed overlay icons and also generate a string for the actual icon name. You can see that the oImg var is created on the fly based on the data we''re using. \r\n\r\n[code lang="js"]dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n}[/code]\r\n\r\nThat icon name, along with the accessible label text for the icon, is passed to <em>setOverlay()</em> which sets the overlay icon via <em>window.external.msSiteModeSetIconOverlay</em> and flashes the taskbar icon using <em>window.external.msSiteModeActivate</em>.\r\n\r\n[code lang="js"]setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n}[/code]\r\n\r\n<h2>Test it Out</h2>\r\n\r\nTo test this out, it''s a simple matter of running your newly pinned page in Internet Explorer 9, grabbing the tab and dragging it down to your taskbar:\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/dragged-and-pinned.png" alt="" title="dragged-and-pinned" width="576" height="151" class="alignleft size-full wp-image-1731" />\r\n<em>Tab being dragged to the taskbar</em>\r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" />\r\n<em>Pinned site with no overlay icon</em>\r\n\r\nFive seconds after the page has been pinned, the code will fire off the first notification and continue to cycle through the other icons every subsequent five seconds. \r\n\r\n<img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="533" height="150" class="alignleft size-full wp-image-1710" />\r\n<em>Pinned site with overlay icon</em>\r\n\r\nAn important thing to remember is that the <a href="http://msdn.microsoft.com/en-us/library/gg589512(v=VS.85).aspx">IE F12 Developer tools</a> are available to you to use in debugging your pinned site. So if you run into quirks, simply press the F12 key and the tools will appear.\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/ietools.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/ietools-300x225.png" alt="" title="ietools" width="300" height="225" class="alignleft size-medium wp-image-1736" /></a>\r\n\r\n<h2>The Demo and Final Code</h2>\r\n\r\nYou can check out the demo I whipped up by going here in IE9:\r\n\r\n<a href="http://reybango.com/demos/sitepinning/index.html">http://reybango.com/demos/sitepinning/index.html</a>\r\n\r\nWhen the page renders, drag the tab down to your taskbar and pin it. You should see a new windows appear with your newly pinned site. Five seconds later, you''ll see the first overlay icon appear in the taskbar.\r\n\r\nHere''s the full source code. You can also <a href="http://reybango.com/demos/sitepinning/src/pinned-sites-overlay-icons.zip">download everything here</a>. The really great part is that it isn''t a lot of code to implement this. In fact, to use the API only required 4 method calls. The bulk of the code was to simulate pulling in data. And the <a href="<a href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">">impact on user engagement</a> is certainly worth adding in the capability.\r\n\r\n[code lang="html"]&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Pinned Site Test&lt;/title&gt;\r\n&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; href=&quot;favicon.ico&quot; /&gt;\r\n&lt;meta name=&quot;application-name&quot; content=&quot;Pinned Site Test&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-starturl&quot; content=&quot;http://reybango.com/demos/sitepinning/index.html&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-navbutton-color&quot; content=&quot;#3480C0&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-window&quot; content=&quot;width=1024;height=768&quot; /&gt;\r\n&lt;meta name=&quot;msapplication-tooltip&quot; content=&quot;Testing the Pinned Site API&quot; /&gt;\r\n&lt;style&gt;\r\nbody {\r\n    background: none repeat scroll 0 0 #4492CE;\r\n    color: #EDEFF4;\r\n}\r\n \r\nh1 {\r\n    float: left;\r\n    font: 440%/1.4em ''Segoe Light'',Segoe,''Segoe UI'',''Meiryo Regular'',''Meiryo'',sans-serif;\r\n    margin-left: 10px;\r\n    position: relative;\r\n}\r\n&lt;/style&gt;\r\n\r\n&lt;/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Pinned Site Test&lt;/h1&gt;\r\n\r\n&lt;div&gt;&lt;/div&gt;\r\n\r\n&lt;script&gt;\r\n\r\n    var myPin = {\r\n\r\n        currIndex: 0,\r\n        dataBin: [],\r\n\r\n        getData: function () {\r\n            // A function that just simulates returning a result set...\r\n            var idx = 0;\r\n\r\n            // Determines whether the current page was launched as a pinned site.\r\n            if (window.external.msIsSiteMode()) {\r\n\r\n                idx = this.currIndex++;\r\n                this.currIndex = (this.currIndex &lt; 5) ? this.currIndex : 0;\r\n\r\n                this.dispOverlay(this.dataBin[idx]);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        setOverlay: function (icon, desc) {\r\n\r\n            // Sets the overlay icons...\r\n            window.external.msSiteModeSetIconOverlay(icon, desc);\r\n            window.external.msSiteModeActivate();\r\n\r\n        },\r\n\r\n\r\n        dispOverlay: function (theData) {\r\n\r\n            var oImg = &quot;&quot;;\r\n\r\n            // Is there any data?\r\n            if (theData) {\r\n\r\n                // Clear any preexisting overlay icon\r\n                window.external.msSiteModeClearIconOverlay();\r\n\r\n                // Create the image string...\r\n                oImg = &quot;images/num_&quot; + theData.num + &quot;.ico&quot;;\r\n\r\n                // Go ahead and create the overlay image and it''s label...\r\n                this.setOverlay(oImg, theData.label);\r\n\r\n            }\r\n\r\n        },\r\n\r\n        init: function (myData) {\r\n\r\n            this.dataBin = myData;\r\n\r\n        }\r\n\r\n    };\r\n\r\n    // This clears out any previously set overlay icons...\r\n    window.external.msSiteModeClearIconOverlay();\r\n\r\n    // Run it once to kick everything off...\r\n    myPin.init([{ &quot;num&quot;: 1, &quot;label&quot;: &quot;Label 1&quot; },\r\n                { &quot;num&quot;: 2, &quot;label&quot;: &quot;Label 2&quot; },\r\n                { &quot;num&quot;: 3, &quot;label&quot;: &quot;Label 3&quot; },\r\n                { &quot;num&quot;: 4, &quot;label&quot;: &quot;Label 4&quot; },\r\n                { &quot;num&quot;: 5, &quot;label&quot;: &quot;Label 5&quot; }\r\n                ]);\r\n\r\n    // This is only here because I want to simulate pulling data on a regular interval...\r\n    setInterval(function () { myPin.getData(); }, 5000);\r\n\r\n&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;[/code]\r\n\r\n\r\n', 'Using Site Pinning and Overlay Icons for Enhanced User Notifications and Engagement', 0, '', 'inherit', 'open', 'open', '', '1707-revision-46', '', '', '2011-10-09 14:10:10', '2011-10-09 18:10:10', '', 1707, 'http://blog.reybango.com/2011/10/09/1707-revision-46/', 0, 'revision', '', 0),
(1760, 3, '2011-10-17 18:14:16', '2011-10-17 22:14:16', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display an numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. It''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that ', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision', '', '', '2011-10-17 18:14:16', '2011-10-17 22:14:16', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision/', 0, 'revision', '', 0),
(1761, 3, '2011-10-17 18:15:43', '2011-10-17 22:15:43', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/pinned.png" alt="" title="pinned" width="533" height="151" class="alignleft size-full wp-image-1712" /></a>\r\n\r\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications?', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-2', '', '', '2011-10-17 18:15:43', '2011-10-17 22:15:43', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-2/', 0, 'revision', '', 0),
(1762, 3, '2011-10-17 18:24:13', '2011-10-17 22:24:13', '', 'messages-1', 0, '', 'inherit', 'open', 'open', '', 'messages-1', '', '', '2011-10-17 18:24:13', '2011-10-17 22:24:13', '', 1759, 'http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png', 0, 'attachment', 'image/png', 0),
(1763, 3, '2011-10-17 18:24:41', '2011-10-17 22:24:41', '', 'requests-1', 0, '', 'inherit', 'open', 'open', '', 'requests-1', '', '', '2011-10-17 18:24:41', '2011-10-17 22:24:41', '', 1759, 'http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png', 0, 'attachment', 'image/png', 0),
(1764, 3, '2011-10-17 18:24:58', '2011-10-17 22:24:58', '', 'actions-1', 0, '', 'inherit', 'open', 'open', '', 'actions-1', '', '', '2011-10-17 18:24:58', '2011-10-17 22:24:58', '', 1759, 'http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png', 0, 'attachment', 'image/png', 0),
(1765, 3, '2011-10-17 18:16:16', '2011-10-17 22:16:16', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\n\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications?', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-3', '', '', '2011-10-17 18:16:16', '2011-10-17 22:16:16', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-3/', 0, 'revision', '', 0),
(1766, 3, '2011-10-17 18:25:19', '2011-10-17 22:25:19', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\r\n\r\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\r\n\r\n<h2>Rotating Multiple Overlays Icons</h2>\r\n\r\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\r\n\r\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how they look:\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-4', '', '', '2011-10-17 18:25:19', '2011-10-17 22:25:19', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-4/', 0, 'revision', '', 0);
INSERT INTO `wp_dyxkdh_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_category`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
(1767, 3, '2011-10-17 18:28:32', '2011-10-17 22:28:32', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\n\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\n\n<h2>Rotating Multiple Overlays Icons</h2>\n\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\n\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how the first three look:\n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>\n\nThe code changed slightly from the last demo in order to accommodate multiple bits of data per \n', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-5', '', '', '2011-10-17 18:28:32', '2011-10-17 22:28:32', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-5/', 0, 'revision', '', 0),
(1768, 3, '2011-10-17 18:29:33', '2011-10-17 22:29:33', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\n\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\n\n<h2>Rotating Multiple Overlays Icons</h2>\n\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\n\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how the first three look:\n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>\n\nThe code changed slightly from the last demo in order to accommodate multiple bits of data per fetch. While previously, I was :\n\n[code lang="js"] myPin.init([{ &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 2 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 3 }] },\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 2 }] },\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 4 }] }\n			   ]);[/code]\n', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-6', '', '', '2011-10-17 18:29:33', '2011-10-17 22:29:33', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-6/', 0, 'revision', '', 0),
(1769, 3, '2011-10-17 18:31:48', '2011-10-17 22:31:48', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\r\n\r\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\r\n\r\n<h2>Rotating Multiple Overlays Icons</h2>\r\n\r\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\r\n\r\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how the first three look:\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>\r\n\r\nThe code changed slightly from the last demo in order to accommodate multiple bits of data per fetch. While previously, I was only fetching one piece of data, in this demo, I''m returning 3, one for each notification type:\r\n\r\n[code lang="js"] myPin.init([{ &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 2 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 3 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 2 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 4 }] }\r\n			   ]);[/code]\r\n\r\n', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-7', '', '', '2011-10-17 18:31:48', '2011-10-17 22:31:48', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-7/', 0, 'revision', '', 0),
(1770, 3, '2011-10-17 18:37:01', '2011-10-17 22:37:01', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\r\n\r\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\r\n\r\n<h2>Rotating Multiple Overlays Icons</h2>\r\n\r\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\r\n\r\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how the first three look:\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>\r\n\r\nThe code changed slightly from the last demo in order to accommodate multiple bits of data per fetch. While previously, I was only fetching one piece of data, in this demo, I''m returning 3, one for each notification type:\r\n\r\n[code lang="js"] myPin.init([{ &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 2 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 3 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 2 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 4 }] }\r\n			   ]);[/code]\r\n\r\nThe next thing that changed was the use of a timer to allow a slight delay while rendering the overlay icons. As a reminder, the method <em>getData()</em> <strong>simulates</strong> grabbing remote data. So if we look at the data above, we can simulate pulling back three distinct bits of data. This allows us to see how notifications might look over a period of time.\r\n\r\n\r\n\r\n', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-8', '', '', '2011-10-17 18:37:01', '2011-10-17 22:37:01', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-8/', 0, 'revision', '', 0),
(1771, 3, '2011-10-17 18:37:27', '2011-10-17 22:37:27', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\r\n\r\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\r\n\r\n<h2>Rotating Multiple Overlays Icons</h2>\r\n\r\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\r\n\r\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how the first three look:\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>\r\n\r\nThe code changed slightly from the last demo in order to accommodate multiple bits of data per fetch. While previously, I was only fetching one piece of data, in this demo, I''m returning 3, one for each notification type:\r\n\r\n[code lang="js"] myPin.init([{ &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 2 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 3 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 2 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 4 }] }\r\n			   ]);[/code]\r\n\r\nAs a reminder, the method <em>getData()</em> <strong>simulates</strong> grabbing remote data. So if we look at the data above, we can simulate pulling back three distinct bits of data. This allows us to see how notifications might look over a period of time.\r\n\r\nThe next thing that changed was the use of a timer to allow a slight delay while rendering the overlay icons. \r\n\r\n\r\n', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-9', '', '', '2011-10-17 18:37:27', '2011-10-17 22:37:27', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-9/', 0, 'revision', '', 0),
(1772, 3, '2011-10-17 18:42:53', '2011-10-17 22:42:53', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\r\n\r\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\r\n\r\n<h2>Rotating Multiple Overlays Icons</h2>\r\n\r\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\r\n\r\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how the first three look:\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>\r\n\r\nThe code changed slightly from the last demo in order to accommodate multiple bits of data per fetch. While previously, I was only fetching one piece of data, in this demo, I''m returning 3, one for each notification type:\r\n\r\n[code lang="js"] myPin.init([{ &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 2 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 3 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 2 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 4 }] }\r\n			   ]);[/code]\r\n\r\nAs a reminder, the method <em>getData()</em> <strong>simulates</strong> grabbing remote data. So if we look at the data above, we can simulate pulling back three distinct bits of data. This is why we call the method every 10 seconds using setInterval. This allows us to see how notifications might look over a period of time. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData() }, 10000);[/code]\r\n\r\nThe next thing that changed was the use of a timer to allow a slight delay while rendering the overlay icons. Using <em>setTimeout()</em> provides enough of delay so that the overlay icon is visible to the user before rotating to the next icon. If we didn''t have this delay, the rotation would be way too fast to provide any useful notification.\r\n\r\n\r\n', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-10', '', '', '2011-10-17 18:42:53', '2011-10-17 22:42:53', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-10/', 0, 'revision', '', 0),
(1773, 3, '2011-10-17 18:53:09', '2011-10-17 22:53:09', '', 'overlay', 0, '', 'inherit', 'open', 'open', '', 'overlay', '', '', '2011-10-17 18:53:09', '2011-10-17 22:53:09', '', 1759, 'http://blog.reybango.com/wp-content/uploads/2011/10/overlay.png', 0, 'attachment', 'image/png', 0),
(1774, 3, '2011-10-17 18:53:20', '2011-10-17 22:53:20', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\n\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\n\n<h2>Rotating Multiple Overlays Icons</h2>\n\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\n\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how the first three look:\n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>\n\nThe code changed slightly from the last demo in order to accommodate multiple bits of data per fetch. While previously, I was only fetching one piece of data, in this demo, I''m returning 3, one for each notification type:\n\n[code lang="js"] myPin.init([{ &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 2 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 3 }] },\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 2 }] },\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 4 }] }\n			   ]);[/code]\n\nAs a reminder, the method <em>getData()</em> <strong>simulates</strong> grabbing remote data. So if we look at the data above, we can simulate pulling back three distinct bits of data. This is why we call the method every 10 seconds using setInterval. This allows us to see how notifications might look over a period of time. \n\n[code lang="js"]setInterval(function () { myPin.getData() }, 10000);[/code]\n\nThe next thing that changed was the use of a timer to allow a slight delay while rendering the overlay icons. Using <em>setTimeout()</em> provides enough of delay so that an individual overlay icon is visible to the user before rotating on to the next icon. If we didn''t have this delay, the rotation would be way too fast to provide any useful notification.\n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay.png" alt="" title="overlay" width="332" height="150" class="alignleft size-full wp-image-1773" /></a>\n', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-11', '', '', '2011-10-17 18:53:20', '2011-10-17 22:53:20', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-11/', 0, 'revision', '', 0),
(1775, 3, '2011-10-17 18:54:20', '2011-10-17 22:54:20', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\n<em>Pinned site with overlay icon</em>\n\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\n\n<h2>Rotating Multiple Overlays Icons</h2>\n\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\n\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how the first three look:\n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>\n\nThe code changed slightly from the last demo in order to accommodate multiple bits of data per fetch. While previously, I was only fetching one piece of data, in this demo, I''m returning 3, one for each notification type:\n\n[code lang="js"] myPin.init([{ &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 2 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 3 }] },\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 2 }] },\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 4 }] }\n			   ]);[/code]\n\nAs a reminder, the method <em>getData()</em> <strong>simulates</strong> grabbing remote data. So if we look at the data above, we can simulate pulling back three distinct bits of data. This is why we call the method every 10 seconds using setInterval. This allows us to see how notifications might look over a period of time. \n\n[code lang="js"]setInterval(function () { myPin.getData() }, 10000);[/code]\n\nThe next thing that changed was the use of a timer to allow a slight delay while rendering the overlay icons. Using <em>setTimeout()</em> provides enough of delay so that an individual overlay icon is visible to the user before rotating on to the next icon. If we didn''t have this delay, the rotation would be way too fast to provide any useful notification. If we look at the following image, we can see what the notification will look like:\n\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay.png" alt="" title="overlay" width="332" height="150" class="alignleft size-full wp-image-1773" /></a>\n', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-12', '', '', '2011-10-17 18:54:20', '2011-10-17 22:54:20', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-12/', 0, 'revision', '', 0),
(1776, 3, '2011-10-17 19:01:17', '2011-10-17 23:01:17', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\r\n<em>Pinned site with overlay icon</em>\r\n\r\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\r\n\r\n<h2>Rotating Multiple Overlays Icons</h2>\r\n\r\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\r\n\r\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how the first three look:\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>\r\n\r\nThe code changed slightly from the last demo in order to accommodate multiple bits of data per fetch. While previously, I was only fetching one piece of data, in this demo, I''m returning 3, one for each notification type:\r\n\r\n[code lang="js"] myPin.init([{ &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 2 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 3 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 2 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 4 }] }\r\n			   ]);[/code]\r\n\r\nAs a reminder, the method <em>getData()</em> <strong>simulates</strong> grabbing remote data. So if we look at the data above, we can simulate pulling back three distinct bits of data. This is why we call the method every 10 seconds using setInterval. This allows us to see how notifications might look over a period of time. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData() }, 10000);[/code]\r\n\r\nThe next thing that changed is the use of a timer to allow a slight delay while rendering the overlay icons. Using <em>setTimeout()</em> provides enough of delay so that an individual overlay icon is visible to the user before rotating on to the next icon. If we didn''t have this delay, the rotation would be way too fast to provide any useful notification. If we look at the following image, we can see what the notification will look like:\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay.png" alt="" title="overlay" width="332" height="150" class="alignleft size-full wp-image-1773" /></a>\r\n<em>Overlay icon showing numeric notification</em>\r\n\r\nThis is accomplished via the following code:\r\n\r\n[code lang="js"]// Grab the current set of data...\r\ncurrData = this.dataBin[this.currIndex++].data;		\r\n		\r\n/* We''re going to display a new overlay every x number of seconds to display a new overlay icon so\r\n   let''s loop through the data elements for the current set of data... */\r\nfor (var i=0; i &lt; currData.length; i++ ){\r\n					\r\n	(function(idx) { setTimeout( function(){ myPin.dispOverlay( currData[idx] ); }, 1e3 * idx); }( i ));					\r\n					\r\n}[/code]\r\n\r\nHere''s what''s happening. In the first line, I grab the current set of data that holds all of the notification information (messages, requests & actions). I loop through each group of data and assign a timer using <em>setTimeout()</em> that will call <em>dispOverlay()</em> at a short, incrementing interval through each loop. That''s the magic code that allows for the gradual icon rendering delay I mentioned before. \r\n', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-13', '', '', '2011-10-17 19:01:17', '2011-10-17 23:01:17', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-13/', 0, 'revision', '', 0),
(1777, 3, '2011-10-17 19:03:00', '2011-10-17 23:03:00', 'In my last post, I went over how to use IE9′s Site Pinning API to implement overlay icons to enhance user notifications. The demo focused on how to display a numeric icon to indicate when a specific event (e.g.: messages in an inbox) had occurred. \r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay-icon.png" alt="" title="overlay-icon" width="508" height="150" class="alignleft size-full wp-image-1710" /></a>\r\n<em>Pinned site with overlay icon</em>\r\n\r\nIt''s a really great way of letting your users know that there''s pending information for them to check into but what happens if you have a site that offers multiple types of notifications? With websites offering so much functionality nowadays, it''s pretty common for websites to offer multiple types of notifications from friend requests and event reminders to new messages and game invites.\r\n\r\n<h2>Rotating Multiple Overlays Icons</h2>\r\n\r\nThe great thing about the Site Pinning API is that it''s very flexible and through some JavaScript magic, you can easily display multiple overlay icons for the various services you have. In this demo, I want to rotate through 3 different overlay icons that alert the user to pending messages, requests and actions.\r\n\r\nAs before, I had to flex some of my artistic talent by creating the overlay icons. I created 5 of each and here''s how the first three look:\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/messages-1.png" alt="" title="messages-1" width="32" height="32" class="alignleft size-full wp-image-1762" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/requests-1.png" alt="" title="requests-1" width="32" height="32" class="alignleft size-full wp-image-1763" /></a><a href="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/actions-1.png" alt="" title="actions-1" width="32" height="32" class="alignleft size-full wp-image-1764" /></a>\r\n\r\nThe code changed slightly from the last demo in order to accommodate multiple bits of data per fetch. While previously, I was only fetching one piece of data, in this demo, I''m returning 3, one for each notification type:\r\n\r\n[code lang="js"] myPin.init([{ &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 2 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 3 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 2 }] },\r\n		        { &quot;data&quot; : [{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 5 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 4 }] }\r\n			   ]);[/code]\r\n\r\nAs a reminder, the method <em>getData()</em> <strong>simulates</strong> grabbing remote data. So if we look at the data above, we can simulate pulling back three distinct bits of data. This is why we call the method every 10 seconds using setInterval. This allows us to see how notifications might look over a period of time. \r\n\r\n[code lang="js"]setInterval(function () { myPin.getData() }, 10000);[/code]\r\n\r\nThe next thing that changed is the use of a timer to allow a slight delay while rendering the overlay icons. Using <em>setTimeout()</em> provides enough of delay so that an individual overlay icon is visible to the user before rotating on to the next icon. If we didn''t have this delay, the rotation would be way too fast to provide any useful notification. If we look at the following image, we can see what the notification will look like:\r\n\r\n<a href="http://blog.reybango.com/wp-content/uploads/2011/10/overlay.png"><img src="http://blog.reybango.com/wp-content/uploads/2011/10/overlay.png" alt="" title="overlay" width="332" height="150" class="alignleft size-full wp-image-1773" /></a>\r\n<em>Overlay icon showing numeric notification</em>\r\n\r\nThis is accomplished via the following code:\r\n\r\n[code lang="js"]// Grab the current set of data...\r\ncurrData = this.dataBin[this.currIndex++].data;		\r\n		\r\n/* We''re going to display a new overlay every x number of seconds to display a new overlay icon so\r\n   let''s loop through the data elements for the current set of data... */\r\nfor (var i=0; i &lt; currData.length; i++ ){\r\n					\r\n	(function(idx) { setTimeout( function(){ myPin.dispOverlay( currData[idx] ); }, 1e3 * idx); }( i ));					\r\n					\r\n}[/code]\r\n\r\nHere''s what''s happening. In the first line, I grab the current set of data that holds all of the notification information (messages, requests & actions). That data looks like this:\r\n\r\n[code lang="js"][{ &quot;label&quot; : &quot;Messages&quot;, &quot;ntype&quot; : &quot;M&quot;, &quot;num&quot;: 2 }, { &quot;label&quot; : &quot;Requests&quot;, &quot;ntype&quot; : &quot;R&quot;, &quot;num&quot;: 1 }, { &quot;label&quot; : &quot;Actions&quot;, &quot;ntype&quot; : &quot;A&quot;, &quot;num&quot;: 3 }][/code]\r\n\r\nI loop through each group of data and assign a timer using <em>setTimeout()</em> that will call <em>dispOverlay()</em> at a short, incrementing interval through each loop. That''s the magic code that allows for the gradual icon rendering delay I mentioned before. \r\n', 'Site Pinning: Rotating Overlay Icons for Multiple Service Notifications', 0, '', 'inherit', 'open', 'open', '', '1759-revision-14', '', '', '2011-10-17 19:03:00', '2011-10-17 23:03:00', '', 1759, 'http://blog.reybango.com/2011/10/17/1759-revision-14/', 0, 'revision', '', 0);
