Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove jQuery mask because it isn't working right. Maybe it'll come b…

…ack at a later date.
  • Loading branch information...
commit 69334e7101948c77c24b95ce3ee5fae6fc938b98 1 parent 6ea1605
@pickhardt pickhardt authored
View
1  README.html
@@ -27,7 +27,6 @@
<!-- guiders.js requires jQuery as a prerequisite. Be sure to load guiders.js AFTER jQuery. -->
<script type="text/javascript" src="jquery.min.js"></script>
- <script type="text/javascript" src="jquery-mask.js"></script>
<script type="text/javascript" src="guiders.js"></script>
<link rel="stylesheet" href="guiders.css" type="text/css" />
</head>
View
8 README.md
@@ -89,14 +89,6 @@ You'll likely want to change the default values, such as the width (set to 400px
Creating a multi-page tour? If the URL of the current window is of the form `http://www.myurl.com/mypage.html#guider=foo`, then the guider with id equal to `foo` will be shown automatically. To use this, you can set the onHide of the last guider to an anonymous function: function() { window.location.href=`http://www.myurl.com/mypage.html#guider=foo`; }
-What is jQuery Mask?
---------------------
-jQuery Mask is an optional add-on for Guiders.js. If your site contains jQuery Mask, jQuery Mask will be used for the overlay instead of the guiders overlay.
-
-For more information, see:
-https://github.com/dbellizzi/jquery-mask
-
-
Contributing
------------
Contributions are welcome! If you would like to contribute, please issue a pull request against the dev branch, not the master branch.
View
25 guiders.js
@@ -262,9 +262,6 @@ var guiders = (function($) {
};
guiders._hideOverlay = function() {
- if ($.mask) { // jQuery Mask is an optional library to improve overlays
- $("body").mask(false);
- }
$("#guiders_overlay").fadeOut("fast");
};
@@ -279,20 +276,16 @@ var guiders = (function($) {
};
guiders._showOverlay = function(myGuider) {
- if ($.mask) {
- $("body").mask(myGuider);
- } else {
- // This callback is needed to fix an IE opacity bug.
- // See also:
- // http://www.kevinleary.net/jquery-fadein-fadeout-problems-in-internet-explorer/
- $("#guiders_overlay").fadeIn("fast", function(){
- if (this.style.removeAttribute) {
- this.style.removeAttribute("filter");
- }
- });
- if (guiders._isIE) {
- $("#guiders_overlay").css("position", "absolute");
+ // This callback is needed to fix an IE opacity bug.
+ // See also:
+ // http://www.kevinleary.net/jquery-fadein-fadeout-problems-in-internet-explorer/
+ $("#guiders_overlay").fadeIn("fast", function(){
+ if (this.style.removeAttribute) {
+ this.style.removeAttribute("filter");
}
+ });
+ if (guiders._isIE) {
+ $("#guiders_overlay").css("position", "absolute");
}
};
View
153 jquery-mask.js
@@ -1,153 +0,0 @@
-/*
- jQuery Mask Plugin
-
- https://github.com/dbellizzi/jquery-mask
-
- Copyright 2012 Dominick Bellizzi
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-(function($) {
-
- // NOTE: dimension objects are assumed to be immutable
-
- $.fn.mask = function(elems, options) {
-
- var settings = $.extend( {
- 'className' : 'mask'
- }, options);
-
- $('.' + settings.className).remove();
-
- if (elems === false) {
- return this;
- } else if (typeof elems !== "string") {
- elems = $(elems);
- }
-
- return this.each(function() {
- var container = $(this), containerDims = $.mask.getDims(container), myElems = elems,
- maskDimsList = [containerDims], nextMaskDimsList = [];
-
- if (typeof myElems === "string") {
- myElems = container.find(myElems);
- }
-
- myElems.each(function() {
- var dims = $.mask.getDims(this);
-
- $.each(maskDimsList, function() {
- nextMaskDimsList = $.merge(nextMaskDimsList, $.mask.getMaskDimsList(this, dims));
- });
-
- maskDimsList = nextMaskDimsList;
- nextMaskDimsList = [];
- });
-
- $.each(maskDimsList, function() {
- $('<div>').css(this).addClass(settings.className).appendTo($('body'));
- });
- });
- };
-
- $.mask = {};
-
- $.mask.getDims = function(elem) {
- elem = $(elem);
- var dims = elem.offset();
- if (dims === null) {
- // document has no offset, but has different height/width than body
- dims = { top: 0, left: 0 };
- }
- dims.height = elem.outerHeight();
- dims.width = elem.outerWidth();
- return dims;
- };
-
- $.mask.intersectDims = function(containerDims, elemDims) {
- var top = elemDims.top, left = elemDims.left, height = elemDims.height,
- width = elemDims.width, newObj = false;
-
- if (top < containerDims.top) {
- height -= containerDims.top - top;
- top = containerDims.top;
- newObj = true;
- }
-
- if (left < containerDims.left) {
- width -= containerDims.left - left;
- left = containerDims.left;
- newObj = true;
- }
-
- if (top + height > containerDims.top + containerDims.height) {
- height -= ((top + height) - (containerDims.top + containerDims.height));
- newObj = true;
- }
-
- if (left + width > containerDims.left + containerDims.width) {
- width -= ((left + width) - (containerDims.left + containerDims.width));
- newObj = true;
- }
-
- if (newObj) {
- return {'top': top, 'left': left, 'height': height, 'width': width};
- }
-
- return elemDims;
- };
-
- $.mask.dimsOverlap = function(dims1, dims2) {
- return !(dims2.top + dims2.height <= dims1.top || dims1.top + dims1.height <= dims2.top ||
- dims2.left + dims2.width <= dims1.left || dims1.left + dims1.width <= dims2.left);
- };
-
- $.mask.getMaskDimsList = function(containerDims, dims) {
- // if the trimmed element doesn't overlap, mask the whole container
- if (!$.mask.dimsOverlap(containerDims, dims)) {
- return [containerDims];
- }
-
- // Trim the element to the area that is contained inside the container
- dims = $.mask.intersectDims(containerDims, dims);
-
- var maskDimsList = [
- {
- 'top': containerDims.top,
- 'left': containerDims.left,
- 'height': dims.top - containerDims.top,
- 'width': dims.left + dims.width - containerDims.left
- },
- {
- 'top': containerDims.top,
- 'left': dims.left + dims.width,
- 'height': dims.top + dims.height - containerDims.top,
- 'width': containerDims.left + containerDims.width - (dims.left + dims.width)
- },
- {
- 'top': dims.top + dims.height,
- 'left': dims.left,
- 'height': containerDims.top + containerDims.height - (dims.top + dims.height),
- 'width': containerDims.left + containerDims.width - dims.left
- },
- {
- 'top': dims.top,
- 'left': containerDims.left,
- 'height': containerDims.top + containerDims.height - dims.top,
- 'width': dims.left - containerDims.left
- }];
-
- return $.grep(maskDimsList, function(d) { return (d.height > 0 && d.width > 0); });
- };
-
-})(jQuery);
View
53 jquery_mask_example.html
@@ -1,53 +0,0 @@
-<html>
- <head>
- <style type="text/css">
- body {
- margin: 0;
- padding: 0;
- }
- #div1 {
- border: 2px solid red;
- margin-left: 20px;
- width: 400px;
- }
- #overlay {
- background-color: #000;
- width: 100%;
- height: 100%;
- position: fixed;
- top: 0px;
- left: 0px;
- opacity: 0.5;
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
- filter: alpha(opacity=50);
- z-index: 1001;
- }
- .mask {
- z-index: 500000;
- position: absolute;
- background-color: #000;
- opacity: 0.5;
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
- filter: alpha(opacity=50);
- }
-
- </style>
- <script type="text/javascript" src="jquery.min.js"></script>
- <script type="text/javascript" src="jquery-mask.js"></script>
- </head>
- <body>
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <div id="div1">
- <div id="div2">jQuery Mask is optional and not necessary to use Guiders.js</div>
- </div>
- <script type="text/javascript">
- $("body").mask("#div1")
- </script>
- </body>
-</html>
Please sign in to comment.
Something went wrong with that request. Please try again.