Initial commit

parents
.DS_Store
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-gb" xml:lang="en-gb">
<head>
<title>Example usage:jquery.history.js</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="en-gb" />
<meta name="robots" content="all" />
<meta http-equiv="imagetoolbar" content="false" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="author" content="Ben Sekulowicz-Barclay" />
<meta name="Copyright" content="Copyright (c) 2009" />
<meta name="description" content="jQuery plugin allowing you to test for previously visited sites on the client side. Written by Ben Sekulowicz-Barclay, (www.beseku.com)" />
<meta name="keywords" content="jquery, plugin, history, visited, beseku" />
<!-- JS -->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.history.mini.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('body > ol > li').each(function() {
$(this).css('backgroundColor', ($.history.test($('a', $(this)).attr('href')))? "#D1FFD1": "#FFD1D1");
});
});
</script>
<!-- CSS -->
<style type="text/css">
body {
background:#FFFFFF;
color:#393939;
font-size:62.5%;
margin:0;
padding:0;
}
body ol {
font:normal normal 200 1em/3em Georgia, Serif;
list-style:none;
margin:3em 3em 0;
padding:0;
text-indent:none;
}
body ol li {
border: solid 0.05em #C6C6C6;
font-size:2em;
line-height:1.5em;
margin:0 0 1.5em;
padding:0.75em;
}
body ol li a {
color:#AA0000;
text-decoration: none;
}
body ol li a:hover {
color:#0000AA;
text-decoration: underline;
}
body ol li a:visited {
color:#00AA00;
}
</style>
</head>
<body>
<ol>
<li><a href="http://www.arsenal.com/">Arsenal</a></li>
<li><a href="http://www.bbc.com/">BBC</a></li>
<li><a href="http://www.beseku.com/">Beseku</a></li>
<li><a href="http://www.flickr.com/">Flickr</a></li>
<li><a href="http://www.google.com/">Google</a></li>
<li><a href="http://www.outsideline.co.uk/">Outside Line</a></li>
<li><a href="http://twitter.com/">Twitter</a></li>
<li><a href="http://www.yahoo.com/">Yahoo</a></li>
</ol>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-gb" xml:lang="en-gb">
<head>
<title>Example usage:jquery.history.js</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="en-gb" />
<meta name="robots" content="all" />
<meta http-equiv="imagetoolbar" content="false" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="author" content="Ben Sekulowicz-Barclay" />
<meta name="Copyright" content="Copyright (c) 2009" />
<meta name="description" content="jQuery plugin allowing you to test for previously visited sites on the client side. Written by Ben Sekulowicz-Barclay, (www.beseku.com)" />
<meta name="keywords" content="jquery, plugin, history, visited, beseku" />
</head>
<body>
<ol>
<li><a href="example1.html">Example #1</a> &ndash; A list of commonly visited sites, using the jquery.history.js plugin to ascertain and indicate whether they have been visited by the user or not.</li>
</ol>
</body>
</html>
\ No newline at end of file
/*!
* jquery.history
* http://www.beseku.com/2009/05/06/detecting-visited-sites-with-jquery/
*
* Copyright (c) 2009 Ben sekulowicz-Barclay
*
* Date: 2009-05-06 (Wed, 06 May 2009)
* Revision: 1.0
*/
jQuery.history = {
test: function(user_url) {
// Define our defaults
var user = {url:''};
// Overwrite our defaults with user supplied values, if required...
user.url = (typeof(user_url) != 'undefined')? user_url: user.url;
// Insert our test paragraph style default style
$('body').prepend('<p id="jQuery-History-Test-P" style="height:20px;left:0;margin:0;padding:0;overflow:hidden;position:absolute;top:0;visibility:visible;width:20px;"><a href="' + user.url + '" style="display:block;overflow:hidden;"></a></p>');
$('html').prepend('<style id="jQuery-History-Test-S1" type="text/css">p#jQuery-History-Test-P a {height:100px !important;width:100px !important;}</style>');
$('html').prepend('<style id="jQuery-History-Test-S2" type="text/css">p#jQuery-History-Test-P a:visited {height:999px !important;width:999px !important;}</style>');
// Get our test paragraph's dimensions
var x = $('#jQuery-History-Test-P > a').width();
var y = $('#jQuery-History-Test-P > a').height();
// Remove our test paragraph and visited style
$('#jQuery-History-Test-P').remove();
$('#jQuery-History-Test-S1').remove();
$('#jQuery-History-Test-S2').remove();
// If the dimensions are exact, we have a match
return (((x == 999) && (y == 999))? true: false);
}
};
\ No newline at end of file
/*!
* jquery.history
* http://www.beseku.com/2009/05/06/detecting-visited-sites-with-jquery/
*
* Copyright (c) 2009 Ben sekulowicz-Barclay
*
* Date: 2009-05-06 (Wed, 06 May 2009)
* Revision: 1.0
*/
jQuery.history={test:function(user_url){var user={url:''};user.url=(typeof(user_url)!='undefined')?user_url:user.url;$('body').prepend('<p id="jQuery-History-Test-P" style="height:20px;left:0;margin:0;padding:0;overflow:hidden;position:absolute;top:0;visibility:visible;width:20px;"><a href="'+user.url+'" style="display:block;overflow:hidden;"></a></p>');$('html').prepend('<style id="jQuery-History-Test-S1" type="text/css">p#jQuery-History-Test-P a {height:100px !important;width:100px !important;}</style>');$('html').prepend('<style id="jQuery-History-Test-S2" type="text/css">p#jQuery-History-Test-P a:visited {height:999px !important;width:999px !important;}</style>');var x=$('#jQuery-History-Test-P > a').width();var y=$('#jQuery-History-Test-P > a').height();$('#jQuery-History-Test-P').remove();$('#jQuery-History-Test-S1').remove();$('#jQuery-History-Test-S2').remove();return(((x==999)&&(y==999))?true:false);}};
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment