<?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>Mike Naberezny &#187; Javascript</title>
	<atom:link href="http://mikenaberezny.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://mikenaberezny.com</link>
	<description></description>
	<lastBuildDate>Sat, 04 Feb 2012 17:35:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Hide Inline Offers on Citi Card Activity</title>
		<link>http://mikenaberezny.com/2008/12/27/hide-inline-offers-on-citi-card-activity/</link>
		<comments>http://mikenaberezny.com/2008/12/27/hide-inline-offers-on-citi-card-activity/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 22:43:27 +0000</pubDate>
		<dc:creator>Mike Naberezny</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://mikenaberezny.com/?p=803</guid>
		<description><![CDATA[Citi&#174; Account Online recently revamped their credit cards website. It&#8217;s much nicer than the previous version except for one annoying addition. When viewing your account activity, it now shows yellow offers inline with the transactions: My account activity typically shows two or three of these offers and I find them very distracting when trying to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.accountonline.com">Citi&reg; Account Online</a> recently revamped their credit cards website.  It&#8217;s much nicer than the previous version except for one annoying addition.  When viewing your account activity, it now shows yellow offers inline with the transactions:</p>
<p><img src="http://mikenaberezny.com/wp-content/uploads/2008/12/citi-inline-1.gif" width="556" height="62" class="alignnone size-full wp-image-811" /></p>
<p>My account activity typically shows two or three of these offers and I find them very distracting when trying to read the transactions.  I haven&#8217;t been able to find an option on the website to hide these inline offers.</p>
<p>If you are using the Firefox browser, this problem can be solved with the <a href="https://addons.mozilla.org/en-US/firefox/addon/748">Greasemonkey</a> add-on.  I&#8217;ve written a short user script for Greasemonkey that hides these offers:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// ==UserScript==</span>
<span style="color: #006600; font-style: italic;">// @name         Hide Citi(R) Activity Inline Offers</span>
<span style="color: #006600; font-style: italic;">// @namespace    http://mikenaberezny.com</span>
<span style="color: #006600; font-style: italic;">// @description  Hide inline offers that make account activity unreadable.</span>
<span style="color: #006600; font-style: italic;">// @include      https://www.accountonline.com/cards/svc/AccountActivity*</span>
<span style="color: #006600; font-style: italic;">// ==/UserScript==</span>
&nbsp;
window.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'load'</span><span style="color: #339933;">,</span> 
  <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
    <span style="color: #006600; font-style: italic;">// find all &lt;tr class=&quot;promo-message&quot;&gt; elements</span>
    <span style="color: #003366; font-weight: bold;">var</span> elements <span style="color: #339933;">=</span> document.<span style="color: #660066;">evaluate</span><span style="color: #009900;">&#40;</span>
        <span style="color: #3366CC;">&quot;//tr[@class='promo-message']&quot;</span><span style="color: #339933;">,</span>
        document<span style="color: #339933;">,</span>
        <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>
        XPathResult.<span style="color: #660066;">UNORDERED_NODE_SNAPSHOT_TYPE</span><span style="color: #339933;">,</span>
        <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// set style &quot;display: none&quot; on those elements</span>
    <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> elements.<span style="color: #660066;">snapshotLength</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        elements.<span style="color: #660066;">snapshotItem</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>To install it, first install the Greasemonkey add-on and then download the user script that contains the source above: <a href='http://mikenaberezny.com/wp-content/uploads/2008/12/citi-inline-ads.user.js'>citi-inline-ads.user.js</a></p>
<p>Greasemonkey should then automatically prompt you to install it.  Please note that this user script is provided to the public domain without warranty.  After installation, the inline offers should appear briefly as the page loads and then will be hidden: </p>
<p><img src="http://mikenaberezny.com/wp-content/uploads/2008/12/citi-inline-2.gif" width="556" height="41" class="alignnone size-full wp-image-824" /></p>
<p>I&#8217;ve left the icon with the plus sign that indicates there is an offer.  Clicking it or the row will still expand to show the offer.  Now, you can still see when an offer is available but in a less obtrusive way that doesn&#8217;t hinder the readability of the transaction list.</p>
<p>Greasemonkey is a great way to customize websites to your liking.  To learn more about it, Mark Pilgrim&#8217;s <a href="http://diveintogreasemonkey.org/">Dive Into Greasemonkey</a> is an excellent guide.  </p>
]]></content:encoded>
			<wfw:commentRss>http://mikenaberezny.com/2008/12/27/hide-inline-offers-on-citi-card-activity/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>New Javascript Goodies</title>
		<link>http://mikenaberezny.com/2007/02/24/new-javascript-goodies/</link>
		<comments>http://mikenaberezny.com/2007/02/24/new-javascript-goodies/#comments</comments>
		<pubDate>Sat, 24 Feb 2007 20:21:32 +0000</pubDate>
		<dc:creator>Mike Naberezny</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://mikenaberezny.com/archives/65</guid>
		<description><![CDATA[On the Maintainable site today are two new articles on Javascript. Minifying Your Rails Javascript shows how to cut down your Javascript footprint with JSMin and Rake. Testing Javascript in Rails introduces the Test.Unit component of Scriptaculous. We also released Firebug RJS Errors, a tiny plugin that patches RJS to log errors to the Firebug [...]]]></description>
			<content:encoded><![CDATA[<p>On the Maintainable site today are two new articles on Javascript.  <a href="http://maintainable.com/articles/minifying_your_rails_javascript">Minifying Your Rails Javascript</a> shows how to cut down your Javascript footprint with JSMin and Rake.  <a href="http://maintainable.com/articles/testing_javascript_in_rails">Testing Javascript in Rails</a> introduces the Test.Unit component of Scriptaculous.</p>
<p>We also released <a href="http://maintainable.com/software/firebug_rjs_errors">Firebug RJS Errors</a>, a tiny plugin that patches RJS to log errors to the Firebug console instead of its default <code>alert()</code> box.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikenaberezny.com/2007/02/24/new-javascript-goodies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

