<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>dreagis.com - AJAX</title>
    <link>http://www.dreagis.com/</link>
    <description>when the ink flows true, worlds are born and thrive</description>
    <language>en-us</language>
    <copyright>BJ Herrington</copyright>
    <lastBuildDate>Wed, 03 Jun 2009 20:08:00 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>bob@dreagis.com</managingEditor>
    <webMaster>bob@dreagis.com</webMaster>
    <item>
      <trackback:ping>http://www.dreagis.com/Trackback.aspx?guid=00bd6da9-b44b-448a-8f17-c0f0aa1fbfb0</trackback:ping>
      <pingback:server>http://www.dreagis.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dreagis.com/PermaLink,guid,00bd6da9-b44b-448a-8f17-c0f0aa1fbfb0.aspx</pingback:target>
      <dc:creator>Bob</dc:creator>
      <wfw:comment>http://www.dreagis.com/CommentView,guid,00bd6da9-b44b-448a-8f17-c0f0aa1fbfb0.aspx</wfw:comment>
      <wfw:commentRss>http://www.dreagis.com/SyndicationService.asmx/GetEntryCommentsRss?guid=00bd6da9-b44b-448a-8f17-c0f0aa1fbfb0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p align="left">
I’ve been a fan of SharePoint since WSSv2 first came out. Development on the platform
wasn’t all that great though. Things changed in a big way with WSSv3, and had I known
just how easy things had become, I would have started this project a long time ago.
</p>
        <p align="left">
After being introduced to <a href="http://trac.edgewall.org/" target="_blank">Trac</a> a
few years ago, I immediately set up a site and linked it to my private repository.
Having a wiki and source browser tied together can be immensely useful. The one thing
I’ve always had an issue with regarding Trac is how it supports documents (barely
at all). You can attach them to pages or put them in your repository, that’s it. SharePoint,
however, was designed for document management; it just doesn’t have a way to browse
a source repository. I decided to fix that.
</p>
        <p align="left">
After fetching <a href="http://sharpsvn.open.collab.net/" target="_blank">SharpSvn</a> I
set about figuring out how to get it integrated with SharePoint. Eventually things
came together, and I ended up with this:
</p>
        <p align="left">
          <a href="http://www.dreagis.com/content/binary/WindowsLiveWriter/SubversionandSharePoint_97D8/wss-svn-browser_2.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="wss-svn-browser" border="0" alt="wss-svn-browser" src="http://www.dreagis.com/content/binary/WindowsLiveWriter/SubversionandSharePoint_97D8/wss-svn-browser_thumb.png" width="240" height="177" />
          </a>
        </p>
        <p align="left">
That wasn’t enough though. I needed to be able to view those files too, and of course
I wanted syntax highlighting. I don’t remember how I found <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter" target="_blank">this</a>,
but it works great. A bit more tinkering and…
</p>
        <p align="left">
          <a href="http://www.dreagis.com/content/binary/WindowsLiveWriter/SubversionandSharePoint_97D8/wss-svn-file_2.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="wss-svn-file" border="0" alt="wss-svn-file" src="http://www.dreagis.com/content/binary/WindowsLiveWriter/SubversionandSharePoint_97D8/wss-svn-file_thumb.png" width="240" height="177" />
          </a>
        </p>
        <p align="left">
Just need to do a bit of clean up and finish making the UI seamless with SharePoint.
</p>
        <img width="0" height="0" src="http://www.dreagis.com/aggbug.ashx?id=00bd6da9-b44b-448a-8f17-c0f0aa1fbfb0" />
      </body>
      <title>Subversion and SharePoint</title>
      <guid isPermaLink="false">http://www.dreagis.com/PermaLink,guid,00bd6da9-b44b-448a-8f17-c0f0aa1fbfb0.aspx</guid>
      <link>http://www.dreagis.com/PermaLink,guid,00bd6da9-b44b-448a-8f17-c0f0aa1fbfb0.aspx</link>
      <pubDate>Wed, 03 Jun 2009 20:08:00 GMT</pubDate>
      <description>&lt;p align="left"&gt;
I’ve been a fan of SharePoint since WSSv2 first came out. Development on the platform
wasn’t all that great though. Things changed in a big way with WSSv3, and had I known
just how easy things had become, I would have started this project a long time ago.
&lt;/p&gt;
&lt;p align="left"&gt;
After being introduced to &lt;a href="http://trac.edgewall.org/" target="_blank"&gt;Trac&lt;/a&gt; a
few years ago, I immediately set up a site and linked it to my private repository.
Having a wiki and source browser tied together can be immensely useful. The one thing
I’ve always had an issue with regarding Trac is how it supports documents (barely
at all). You can attach them to pages or put them in your repository, that’s it. SharePoint,
however, was designed for document management; it just doesn’t have a way to browse
a source repository. I decided to fix that.
&lt;/p&gt;
&lt;p align="left"&gt;
After fetching &lt;a href="http://sharpsvn.open.collab.net/" target="_blank"&gt;SharpSvn&lt;/a&gt; I
set about figuring out how to get it integrated with SharePoint. Eventually things
came together, and I ended up with this:
&lt;/p&gt;
&lt;p align="left"&gt;
&lt;a href="http://www.dreagis.com/content/binary/WindowsLiveWriter/SubversionandSharePoint_97D8/wss-svn-browser_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="wss-svn-browser" border="0" alt="wss-svn-browser" src="http://www.dreagis.com/content/binary/WindowsLiveWriter/SubversionandSharePoint_97D8/wss-svn-browser_thumb.png" width="240" height="177" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p align="left"&gt;
That wasn’t enough though. I needed to be able to view those files too, and of course
I wanted syntax highlighting. I don’t remember how I found &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter" target="_blank"&gt;this&lt;/a&gt;,
but it works great. A bit more tinkering and…
&lt;/p&gt;
&lt;p align="left"&gt;
&lt;a href="http://www.dreagis.com/content/binary/WindowsLiveWriter/SubversionandSharePoint_97D8/wss-svn-file_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="wss-svn-file" border="0" alt="wss-svn-file" src="http://www.dreagis.com/content/binary/WindowsLiveWriter/SubversionandSharePoint_97D8/wss-svn-file_thumb.png" width="240" height="177" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p align="left"&gt;
Just need to do a bit of clean up and finish making the UI seamless with SharePoint.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dreagis.com/aggbug.ashx?id=00bd6da9-b44b-448a-8f17-c0f0aa1fbfb0" /&gt;</description>
      <comments>http://www.dreagis.com/CommentView,guid,00bd6da9-b44b-448a-8f17-c0f0aa1fbfb0.aspx</comments>
      <category>AJAX</category>
      <category>ASP.NET</category>
      <category>Development</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://www.dreagis.com/Trackback.aspx?guid=7618dd40-0325-4bc8-b677-6ae747916d0c</trackback:ping>
      <pingback:server>http://www.dreagis.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dreagis.com/PermaLink,guid,7618dd40-0325-4bc8-b677-6ae747916d0c.aspx</pingback:target>
      <dc:creator>Bob</dc:creator>
      <wfw:comment>http://www.dreagis.com/CommentView,guid,7618dd40-0325-4bc8-b677-6ae747916d0c.aspx</wfw:comment>
      <wfw:commentRss>http://www.dreagis.com/SyndicationService.asmx/GetEntryCommentsRss?guid=7618dd40-0325-4bc8-b677-6ae747916d0c</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
So a dev buddy popped a question in IRC the other day.  He was trying to host
an ad/offer thing inside of an iframe, but the offer checked for this and redirected
the top page to itself.  He had been wracking his brain trying to work around
this, and it looked like an interesting problem, so I stepped up to the plate.
</p>
        <p>
First we attempted to simply overwrite location.replace with an empty function. 
This seemed to work on IE but did nothing on FF3.  It also became apparent that
this method would fail as a subsequent refresh gave us different javascript that simply
changed the location.href.  FAIL.
</p>
        <p>
I did a bit of googling on the issue and stumbled across a forum post suggesting the
use of onBeforeUnload on the parent page.  I played around with this idea, getting
mixed results, but since there seemed like no other way, I dug a bit deeper. 
I was trying to do this by hand, with no libraries, and decided to bring in a little
help since I didn't care to handle all the x-browser event nonsense.  I loaded
up prototype.js and reworked my code to use it.  The following emerged:
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">function
windowUnload(evt) {<br />
var ifr <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> $('ifr');<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (ifr
== evt.element()) {<br />
evt.stop();<br />
}<br />
}<br /><br />
Event.observe(window, 'unload', windowUnload);<br />
$('ifr').observe('unload', windowUnload);</span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <br />
          </span>
        </p>
        <p>
The id 'ifr' is the iframe holding the offer/ad.  This also manages to prevent
any unload checks that the embedded page might popup.
</p>
        <p>
Enjoy!
</p>
        <img width="0" height="0" src="http://www.dreagis.com/aggbug.ashx?id=7618dd40-0325-4bc8-b677-6ae747916d0c" />
      </body>
      <title>Prevent &amp;lt;iframe /&amp;gt; break-away</title>
      <guid isPermaLink="false">http://www.dreagis.com/PermaLink,guid,7618dd40-0325-4bc8-b677-6ae747916d0c.aspx</guid>
      <link>http://www.dreagis.com/PermaLink,guid,7618dd40-0325-4bc8-b677-6ae747916d0c.aspx</link>
      <pubDate>Thu, 22 Jan 2009 20:45:01 GMT</pubDate>
      <description>&lt;p&gt;
So a dev buddy popped a question in IRC the other day.&amp;nbsp; He was trying to host
an ad/offer thing inside of an iframe, but the offer checked for this and redirected
the top page to itself.&amp;nbsp; He had been wracking his brain trying to work around
this, and it looked like an interesting problem, so I stepped up to the plate.
&lt;/p&gt;
&lt;p&gt;
First we attempted to simply overwrite&amp;nbsp;location.replace with an empty function.&amp;nbsp;
This seemed to work on IE but did nothing on FF3.&amp;nbsp; It also became apparent that
this method would fail as a subsequent refresh gave us different javascript that simply
changed the location.href.&amp;nbsp; FAIL.
&lt;/p&gt;
&lt;p&gt;
I did a bit of googling on the issue and stumbled across a forum post suggesting the
use of onBeforeUnload on the parent page.&amp;nbsp; I played around with this idea, getting
mixed results, but since there seemed like no other way, I dug a bit deeper.&amp;nbsp;
I was trying to do this by hand, with no libraries, and decided to bring in a little
help since I didn't care to handle all the x-browser event nonsense.&amp;nbsp; I loaded
up prototype.js and reworked my code to use it.&amp;nbsp; The following emerged:
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;function
windowUnload(evt) {&lt;br&gt;
var ifr &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; $('ifr');&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (ifr
== evt.element()) {&lt;br&gt;
evt.stop();&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
Event.observe(window, 'unload', windowUnload);&lt;br&gt;
$('ifr').observe('unload', windowUnload);&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
The id 'ifr' is the iframe holding the offer/ad.&amp;nbsp; This also manages to prevent
any unload checks that the embedded page might popup.
&lt;/p&gt;
&lt;p&gt;
Enjoy!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dreagis.com/aggbug.ashx?id=7618dd40-0325-4bc8-b677-6ae747916d0c" /&gt;</description>
      <comments>http://www.dreagis.com/CommentView,guid,7618dd40-0325-4bc8-b677-6ae747916d0c.aspx</comments>
      <category>AJAX</category>
      <category>Development</category>
    </item>
    <item>
      <trackback:ping>http://www.dreagis.com/Trackback.aspx?guid=a0c9742d-6f40-4dee-a732-951dc92a2287</trackback:ping>
      <pingback:server>http://www.dreagis.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dreagis.com/PermaLink,guid,a0c9742d-6f40-4dee-a732-951dc92a2287.aspx</pingback:target>
      <dc:creator>Bob</dc:creator>
      <wfw:comment>http://www.dreagis.com/CommentView,guid,a0c9742d-6f40-4dee-a732-951dc92a2287.aspx</wfw:comment>
      <wfw:commentRss>http://www.dreagis.com/SyndicationService.asmx/GetEntryCommentsRss?guid=a0c9742d-6f40-4dee-a732-951dc92a2287</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The ASP.NET AJAX UpdateProgress control is rather limited.  It only shows up
for UpdatePanels and then only for one at a time.  This was highly annoying,
since I needed it to display for the CascadingDropDown in particular.  After
a few failed attempts, I found that it is very easy to create your own control that
will work for any and all requests.
</p>
        <p>
The secret for this method is found in Sys.Net.WebRequestManager.  This object
contains two methods:  add_invokingRequest and add_completedRequest.  Using
these two events, we can set a short timeout, and using a ModalPopupExtender, show
a progress alert for every background action.
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">var
wrm <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Sys.Net.WebRequestManager;<br /><br />
wrm.add_invokingRequest(BeginRequest);<br />
wrm.add_completedRequest(EndReqest);<br /><br />
function BeginRequest(sender, args)<br />
{<br />
setTimeout('ShowProgress()', 800);<br />
}<br /><br />
function ShowProgress()<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
show the modal</span><br />
}<br /><br />
function EndRequest(sender, args0<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
hide the modal</span><br />
}</span>
        </p>
        <p>
I leave the rest as an exercise for the reader.
</p>
        <img width="0" height="0" src="http://www.dreagis.com/aggbug.ashx?id=a0c9742d-6f40-4dee-a732-951dc92a2287" />
      </body>
      <title>UpdateProgress for all Requests</title>
      <guid isPermaLink="false">http://www.dreagis.com/PermaLink,guid,a0c9742d-6f40-4dee-a732-951dc92a2287.aspx</guid>
      <link>http://www.dreagis.com/PermaLink,guid,a0c9742d-6f40-4dee-a732-951dc92a2287.aspx</link>
      <pubDate>Mon, 17 Sep 2007 21:25:15 GMT</pubDate>
      <description>&lt;p&gt;
The ASP.NET AJAX UpdateProgress control is rather limited.&amp;nbsp; It only shows up
for UpdatePanels and then only for one at a time.&amp;nbsp; This was highly annoying,
since&amp;nbsp;I needed it to display for the CascadingDropDown in particular.&amp;nbsp; After
a few failed attempts, I found that it is very easy to create your own control that
will work for any and all requests.
&lt;/p&gt;
&lt;p&gt;
The secret for this method is found in Sys.Net.WebRequestManager.&amp;nbsp; This object
contains two methods:&amp;nbsp; add_invokingRequest and add_completedRequest.&amp;nbsp; Using
these two events, we can set a short timeout, and using a ModalPopupExtender, show
a progress alert for every background action.
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;var
wrm &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Sys.Net.WebRequestManager;&lt;br&gt;
&lt;br&gt;
wrm.add_invokingRequest(BeginRequest);&lt;br&gt;
wrm.add_completedRequest(EndReqest);&lt;br&gt;
&lt;br&gt;
function BeginRequest(sender, args)&lt;br&gt;
{&lt;br&gt;
setTimeout('ShowProgress()', 800);&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
function ShowProgress()&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
show the modal&lt;/span&gt;
&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
function EndRequest(sender, args0&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
hide the modal&lt;/span&gt;
&lt;br&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
I leave the rest as an exercise for the reader.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dreagis.com/aggbug.ashx?id=a0c9742d-6f40-4dee-a732-951dc92a2287" /&gt;</description>
      <comments>http://www.dreagis.com/CommentView,guid,a0c9742d-6f40-4dee-a732-951dc92a2287.aspx</comments>
      <category>Development</category>
      <category>ASP.NET</category>
      <category>AJAX</category>
    </item>
  </channel>
</rss>