Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing up formatting and added in ability to chain jQuery functions. #9

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Spoiler Alert! contributors:

Joshua Hull
Jared Volpe
Dwayne Charrington - https://github.com/Vheissu

Spoiler Alert! is used under the MIT license, availabie here:
https://github.com/joshbuddy/spoiler-alert/MIT-LICENSE.txt.
18 changes: 16 additions & 2 deletions spoiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@

var applyBlur = function() {
var radius = maxBlur - step
if (browser.msie) {
alert("WARNING, this site contains spoilers!")
if (browser.msie && ieLessThanTen()) {
var filterValue = "progid:DXImageTransform.Microsoft.Blur(pixelradius="+radius+")";
$spoiler.css('filter', filterValue);
} else if (browser.mozilla) {
var filterValue = radius > 0 ? "url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='blur'><feGaussianBlur stdDeviation='" + radius + "' /></filter></svg>#blur\")" : ''
$spoiler.css('filter', filterValue)
Expand Down Expand Up @@ -59,6 +60,19 @@
animationTimer = setTimeout(shroud, 10)
}
}

// Does the user have IE 9 or less?
var ieLessThanTen = function() {
// This conditional check will return true if browser supports CANVAS
// IE9 and under do not support CANVAS and this function is only ever
// called by the IE checking function anyway
if(!!document.createElement('canvas').getContext) {
return false;
} else {
return true;
}
}

applyBlur()

$(this).on('mouseover', function(e) {
Expand Down