<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dave Cavins &#187; Endusersharepoint</title>
	<atom:link href="http://davecavins.com/tag/endusersharepoint/feed/" rel="self" type="application/rss+xml" />
	<link>http://davecavins.com</link>
	<description>web design, SharePoint customization &#38; random stuff</description>
	<lastBuildDate>Mon, 14 Jun 2010 18:48:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>SharePoint Vertical News Ticker</title>
		<link>http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/</link>
		<comments>http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 20:22:46 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Endusersharepoint]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[ticker]]></category>
		<category><![CDATA[webparts]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=341</guid>
		<description><![CDATA[On a recent project I needed to create a simple news ticker do display announcements from a SharePoint list. It was easy to do because I just used some of the code from the announcements slider I built a while back so I did not bother to write a post about it. Yesterday I saw [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Permanent Link: Image Slideshow with captions'>Image Slideshow with captions</a></li>
<li><a href='http://davecavins.com/2009/07/annoucement-slider-using-web-services/' rel='bookmark' title='Permanent Link: Annoucements Slider using SP Web Services'>Annoucements Slider using SP Web Services</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-349 alignright" title="ticker1" src="http://davecavins.com/wp-content/uploads/2009/11/ticker1.jpg" alt="ticker1" width="197" height="433" />On a recent project I needed to create a simple news ticker do display announcements from a SharePoint list. It was easy to do because I just used some of the code from the <a href="http://davecavins.com/2009/07/annoucement-slider-using-web-services">announcements slider</a> I built a while back so I did not bother to write a post about it. Yesterday I saw <a href="http://www.endusersharepoint.com/2009/11/13/scrolling-news-aggregator-in-sharepoint/" target="_blank">a post on EndUserSharePoint.com</a> about how to setup something similar so I figured I would share my (cheaper) solution.</p>
<p>A few features of the ticker:</p>
<ul>
<li>The ticker pulls its contents from the default SharePoint Announcements list using jQuery.</li>
<li>The title of the announcement links to the display form for the item</li>
<li>Ticker pauses on mouseover</li>
<li>For each Announcement the first 500 characters are shown as an intro.</li>
</ul>
<p>Here is the code it can just be pasted in a content editor web part. The only dependency is jQuery. The code for the ticker came from <a href="http://net.tutsplus.com/tutorials/javascript-ajax/build-a-simple-jquery-news-ticker/" target="_blank">this post on Net Tuts Plus</a>. I removed the comments but you can see the <a href="http://net.tutsplus.com/tutorials/javascript-ajax/build-a-simple-jquery-news-ticker/" target="_blank">commented code and an explanation here</a>.<br />
<span id="more-341"></span></p>
<pre class="brush: plain;">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;ticker.js&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
       $(document).ready(function() {
        var soapEnv =
            &quot;&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
                &lt;soapenv:Body&gt; \
                     &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
                        &lt;listName&gt;Announcements&lt;/listName&gt; \
                         &lt;viewFields&gt; \
                            &lt;ViewFields&gt; \
                               &lt;FieldRef Name='Title' /&gt; \
                               &lt;FieldRef Name='Body' /&gt; \
                               &lt;FieldRef Name='ID' /&gt; \
								&lt;FieldRef Name='FileDirRef' /&gt; \
								&lt;FieldRef Name='Created' /&gt; \
                           &lt;/ViewFields&gt; \
                        &lt;/viewFields&gt; \
                    &lt;/GetListItems&gt; \
                &lt;/soapenv:Body&gt; \
            &lt;/soapenv:Envelope&gt;&quot;;

        $.ajax({
            url: &quot;_vti_bin/lists.asmx&quot;,
            type: &quot;POST&quot;,
            dataType: &quot;xml&quot;,
            data: soapEnv,
            complete: processResult,
            contentType: &quot;text/xml; charset=\&quot;utf-8\&quot;&quot;
        });
    });

    function processResult(xData, status) {
        $(xData.responseXML).find(&quot;z\\:row&quot;).each(function() {
        	var teaser = $(this).attr(&quot;ows_Body&quot;);
        	var teaserText = teaser.slice(0,500);
        	var urlValue = $(this).attr(&quot;ows_FileDirRef&quot;);
			var urlArray;
			var urlName;
			     if (urlValue == undefined)
	    	{
      		urlName = &quot;&quot;;
        	}
        	else {
        		urlArray = urlValue.split(&quot;;#&quot;);
        		urlName= urlArray[1];
        	}     	

            var liHtml = &quot;&lt;dt class='newsItem'&gt;&lt;a href='/&quot; + urlName + &quot;/Dispform.aspx?ID=&quot; + $(this).attr(&quot;ows_ID&quot;) + &quot;'&gt;&quot;
            + $(this).attr(&quot;ows_Title&quot;) + &quot;&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;&quot; + teaserText + &quot;&lt;/p&gt;&lt;/dd&gt;&quot;;
            $(&quot;#ticker&quot;).append(liHtml);
        });
	$(function() {
		var ticker = $(&quot;#ticker&quot;);
		ticker.children().filter(&quot;dt&quot;).each(function() {
		  var dt = $(this),
		    container = $(&quot;&lt;div&gt;&quot;);
		  dt.next().appendTo(container);
		  dt.prependTo(container);
		  container.appendTo(ticker);
		});
		ticker.css(&quot;overflow&quot;, &quot;hidden&quot;);
		function animator(currentItem) {
		  var distance = currentItem.height();
			duration = (distance + parseInt(currentItem.css(&quot;marginTop&quot;))) / 0.025;
		  currentItem.animate({ marginTop: -distance }, duration, &quot;linear&quot;, function() {
			currentItem.appendTo(currentItem.parent()).css(&quot;marginTop&quot;, 0);
			animator(currentItem.parent().children(&quot;:first&quot;));
		  });
		};
		animator(ticker.children(&quot;:first&quot;));
		ticker.mouseenter(function() {
		  ticker.children().stop();
		});
		ticker.mouseleave(function() {
		  animator(ticker.children(&quot;:first&quot;));
		});
	  });
        }
&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
#ticker {
  width:180px; height:420px; overflow:auto; border:1px solid #aaaaaa;
}
#ticker dt {
  font:normal 14px Georgia; padding:0 10px 5px 10px;
  background:#e5e5e5 url('/_layouts/images/keyword.gif') no-repeat left 60%; padding-top:10px; padding-left:22px;
  border:1px solid #ffffff; border-bottom:none; border-right:none;
}
#ticker dd {
  margin-left:0; font:normal 11px Verdana; padding:0 10px 10px 10px;
  border-bottom:1px solid #aaaaaa; background-color:#e5e5e5;
  border-left:1px solid #ffffff;
}
#ticker dd.last { border-bottom:1px solid #ffffff;  }
#ticker div { margin-top:0; }
&lt;/style&gt;

&lt;div class=&quot;myclass&quot;&gt;
		&lt;dl id=&quot;ticker&quot;/&gt;
&lt;/div&gt;
</pre>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Permanent Link: Image Slideshow with captions'>Image Slideshow with captions</a></li>
<li><a href='http://davecavins.com/2009/07/annoucement-slider-using-web-services/' rel='bookmark' title='Permanent Link: Annoucements Slider using SP Web Services'>Annoucements Slider using SP Web Services</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>A Faster jQuery Preview Pane</title>
		<link>http://davecavins.com/2009/07/a-faster-jquery-preview-pane/</link>
		<comments>http://davecavins.com/2009/07/a-faster-jquery-preview-pane/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 19:49:50 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[Data View Web Part]]></category>
		<category><![CDATA[Endusersharepoint]]></category>
		<category><![CDATA[Gabe Hilado]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=144</guid>
		<description><![CDATA[A while back there was a post on EndUserSharePoint.com by Paul Grenier that described how to use jQuery and the CEWP to make a preview pane.  I thought it was a very nice solution and worked better than the out of the box preview pane SharePoint uses.   Too Much Code The only issue is the preview [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
<li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-2/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 2'>Adding Comments to a List Part 2</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A while back there was <a href="http://www.endusersharepoint.com/?p=1223" target="_blank">a post on EndUserSharePoint.com</a> by Paul Grenier that described how to use jQuery and the CEWP to make a preview pane.  I thought it was a very nice solution and worked better than the out of the box preview pane SharePoint uses.  </p>
<h3>Too Much Code</h3>
<p>The only issue is the preview pane solution is that in environments with slow internet connections the preview pane will be almost as slow as if the user actually broswed to the display form for the item.</p>
<p>Although its done through AJAX jQuery is still having to load the whole DispForm.aspx and then only displaying the contents of  a specific element.  DispForm.aspx when rendered through the borwser (like most pages in SharePoint) is very code heavy with over 700 lines of code ( An Announcement List item). Reducing the amount of code jQuery has to load from the diplay form will decrease load times and make everyone happy.</p>
<h3>Faster</h3>
<p><a href="http://www.spdeveloper.com" target="_blank">Gabe Hilado</a> and I decided to try to make it faster. The simple solution is to make your own diplay form in SharePoint Designer. First we tried creating a blank .aspx page and putting the list view webpart on it.  The reduced the amount of code on the page but I wanted it to be even faster.</p>
<p><span id="more-144"></span>The next step was to use a dataview webpart only displaying the fields we needed for the preview. The result was a page with under 100 lines of code (varies based on the item legnth). </p>
<p>Below is the modified javascript.</p>
<pre class="brush: jscript;">
&lt;script src=&lt;a href=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&quot;&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&lt;/a&gt;&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function handleError() { //fn needed for IE
return true;
}
function jLoadMe(t) {//load content

$(&quot;#jLoadMe&quot;).load(t+&quot; .ms-formtable&quot;, function(result,status,xhr) {
$(&quot;#jLoadMe h3&quot;).css(&quot;font-size&quot;,&quot;8pt&quot;);
});
}
function initjLoadMe() {//initialize page
var arrayList = $(&quot;a[href*='DispForm.aspx']&quot;);
$.each(arrayList, function(i,e){
var t = $(e).attr(&quot;href&quot;);
t = t.replace('DispForm.aspx','empty.aspx');
$(e).hover(function() {jLoadMe(t)});
});
}
$(function() {
window.onerror = handleError; //needed for IE
initjLoadMe();
});
function jLoadEdit(t) {//load content
$(&quot;#jLoadMe&amp;quot;).load(t+&quot; .editForm&quot;,  function(result,status,xhr) {
$(&quot;#jLoadMe h3&quot;).css(&quot;font-size&quot;,&quot;8pt&quot;);

});
}
&lt;/script&gt;
&lt;div id=&quot;jLoadMe&quot; class=&quot;content&quot;&gt;&lt;/div&gt;
</pre>
<h3>What&#8217;s going on</h3>
<p>The code has been modified so that onhover instead of calling DispForm.aspx it calls empy.aspx. However when the item title is clicked the browser will nagivate to the traditional DispForm.aspx.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
<li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-2/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 2'>Adding Comments to a List Part 2</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/07/a-faster-jquery-preview-pane/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
