forked from drublic/isMothereffinjQueryUp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
149 lines (114 loc) · 5.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Is Mothereffin' jQuery up? - Check if the latest jQuery-version is already available on CDNs</title>
<meta name="description" content="Check out if the latest version* of jQuery is already up on the major CDNs">
<meta name="author" content="Hans Christian Reinl">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="css/styles.css">
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<body>
<header>
<h1><span>Is the mothereffin' latest</span> jQuery-version <span>already up?</span></h1>
<p>Check out if the latest version* of jQuery is already up on the major <abbr title="Content Delivery Network">CDN</abbr>s.</p>
<p class="refresh"><a href="#" class="button">Refresh</a></p>
</header>
<h2>The current version is <span>1.7.1</span></h2>
<div id="libs">
<section class="jquery">
<a href="http://code.jquery.com/jquery-%current%.js" class="full button">jQuery CDN - Full</a>
<a href="http://code.jquery.com/jquery-%current%.min.js" class="min button">jQuery CDN - Minimized</a>
</section>
<section class="google">
<a href="http://ajax.googleapis.com/ajax/libs/jquery/%current%/jquery.js" class="full button">Google CDN - Full</a>
<a href="http://ajax.googleapis.com/ajax/libs/jquery/%current%/jquery.min.js" class="min button">Google CDN - Minimized</a>
</section>
<section class="ms">
<a href="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-%current%.js" class="full button">Microsoft CDN - Full</a>
<a href="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-%current%.min.js" class="min button">Microsoft CDN - Minimized</a>
</section>
</div>
<footer>
<p>* latest version refers to the <a href="http://code.jquery.com/jquery-latest.js">jQuery-latest.js</a> file on the jQuery CDN as this might be the first file to be updated.</p>
<p>This page is created by <a href="http://drublic.de/blog" title="A Wedesign Blog - HTML5, CSS3 and JavaScript - Cutting Edge techlogoies">drublic</a> and is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License (CC BY-SA 3.0)</a>.</p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img src="img/license.png" alt="Creative Commons License" width="80" height="15"></a></p>
<p class="social">
<g:plusone size="medium"></g:plusone>
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Is Mothereffin jQuery up? - Check out if the latest version of jQuery is already up on the major CDNs." data-related="drublic:Creator of this app" data-lang="en" data-url="http://ismothereffinjqueryup.drublic.de/">Tweet</a>
</p>
</footer>
<div id="message">
<p>Sorry dude, I cannot get a proper connection to the net. There's something wrong.</p>
</div>
<a href="https://github.com/drublic/isMothereffinjQueryUp" class="ribbon"><img src="https://a248.e.akamai.net/camo.github.com/7afbc8b248c68eb468279e8c17986ad46549fb71/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub"></a>
<script src="https://apis.google.com/js/plusone.js"></script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<script>
// $-save with IIFE
+function($) {
// Save current version
var current = $.fn.jquery;
// Update the heading with current version
$('h2 span').text(current);
// Test if the script can be loaded
// http://jsfiddle.net/mathias/c6RPm/
$.fn.loadTest = function(url) {
var $this = this,
timeout;
function success() {
clearTimeout(timeout);
$this.addClass('yep');
}
function error() {
clearTimeout(timeout);
$this.addClass('nope');
}
function loadScript(dataType) {
// Load scripts asynchronously
// Don't use $.getScript since it disables caching
$.ajax({
'url': url,
'dataType': dataType,
'cache': true,
'success': success,
'error': error,
'complete': function(xhr) {
(xhr && xhr.status ? success : error)();
}
});
}
loadScript('script');
timeout = setTimeout(function() {
loadScript('text');
}, 3000);
};
// Test the given CDNs
function runTests() {
$('#libs a').each(function() {
$(this)
.attr('href', this.getAttribute('href').replace(/%current%/g, current) )
.loadTest(
this.getAttribute('href')
);
});
}
runTests();
// Run tests again
$('.refresh a').click( function() {
$('section a').removeClass('yep nope');
runTests();
});
}(jQuery);
</script>
<!-- Piwik -->
<script src="http://drublic.de/piwik/piwik.js"></script>
<script>
try {
var pkBaseURL = 'http://drublic.de/piwik/',
piwikTracker = Piwik.getTracker(pkBaseURL + 'piwik.php', 2);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script>
<noscript><img src="http://drublic.de/piwik/piwik.php?idsite=2" alt=""></noscript>