Skip to content

Commit 99efa14

Browse files
author
Nathan Walker
committed
removing event listeners
1 parent 0ee737c commit 99efa14

File tree

4 files changed

+47
-61
lines changed

4 files changed

+47
-61
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jQuery-linkify",
3-
"version": "1.1.7",
3+
"version": "infowrap1.1.7",
44
"homepage": "https://github.com/SoapBox/jQuery-linkify/",
55
"authors": [
66
"SoapBox Innovations, Inc. <[email protected]>"

dist/jquery.linkify.js

+2-16
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Made by SoapBox Innovations, Inc.
77
* Under MIT License
88
*/
9-
!function($, window, document) {
9+
!function($, window, document, undefined) {
1010
"use strict";
1111
function Linkified(element, options) {
1212
this._defaults = defaults, this.element = element, this.setOptions(options), this.init();
@@ -70,19 +70,5 @@
7070
var linkified;
7171
(linkified = $.data(this, "plugin-linkify")) ? (linkified.setOptions(options), linkified.init()) : $.data(this, "plugin-linkify", new Linkified(this, options));
7272
});
73-
}, $.fn.linkify.Constructor = Linkified, $(window).on("load", function() {
74-
$("[data-linkify]").each(function() {
75-
var $target, $this = $(this), target = $this.attr("data-linkify"), options = {
76-
tagName: $this.attr("data-linkify-tagname"),
77-
newLine: $this.attr("data-linkify-newline"),
78-
target: $this.attr("data-linkify-target"),
79-
linkClass: $this.attr("data-linkify-linkclass")
80-
};
81-
for (var option in options) "undefined" == typeof options[option] && delete options[option];
82-
$target = "this" === target ? $this : $this.find(target), $target.linkify(options);
83-
});
84-
}), $("body").on("click", ".linkified", function() {
85-
var $link = $(this), url = $link.attr("href"), isEmail = /^mailto:/i.test(url), target = $link.attr("target");
86-
return isEmail ? window.location.href = url : window.open(url, target), !1;
87-
});
73+
}, $.fn.linkify.Constructor = Linkified;
8874
}(jQuery, window, document);

dist/jquery.linkify.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jquery.linkify.js

+43-43
Original file line numberDiff line numberDiff line change
@@ -27,47 +27,47 @@ $.fn.linkify = function (options) {
2727
$.fn.linkify.Constructor = Linkified;
2828

2929
// DOM data- API setup
30-
$(window).on('load', function () {
31-
$('[data-linkify]').each(function () {
32-
var $this = $(this),
33-
$target,
34-
target = $this.attr('data-linkify'),
35-
options = {
36-
tagName: $this.attr('data-linkify-tagname'),
37-
newLine: $this.attr('data-linkify-newline'),
38-
target: $this.attr('data-linkify-target'),
39-
linkClass: $this.attr('data-linkify-linkclass')
40-
};
41-
42-
// Delete undefined options
43-
for (var option in options) {
44-
if (typeof options[option] === 'undefined') {
45-
delete options[option];
46-
}
47-
}
48-
49-
$target = target === 'this' ? $this : $this.find(target);
50-
$target.linkify(options);
51-
52-
});
53-
});
54-
55-
// Setup click events for linkified elements
56-
$('body').on('click', '.linkified', function () {
57-
var $link = $(this),
58-
url = $link.attr('href'),
59-
isEmail = /^mailto:/i.test(url),
60-
target = $link.attr('target');
61-
62-
if (isEmail) {
63-
64-
// mailto links ignore the target
65-
window.location.href = url;
66-
67-
} else {
68-
window.open(url, target);
69-
}
70-
71-
return false;
72-
});
30+
// $(window).on('load', function () {
31+
// $('[data-linkify]').each(function () {
32+
// var $this = $(this),
33+
// $target,
34+
// target = $this.attr('data-linkify'),
35+
// options = {
36+
// tagName: $this.attr('data-linkify-tagname'),
37+
// newLine: $this.attr('data-linkify-newline'),
38+
// target: $this.attr('data-linkify-target'),
39+
// linkClass: $this.attr('data-linkify-linkclass')
40+
// };
41+
42+
// // Delete undefined options
43+
// for (var option in options) {
44+
// if (typeof options[option] === 'undefined') {
45+
// delete options[option];
46+
// }
47+
// }
48+
49+
// $target = target === 'this' ? $this : $this.find(target);
50+
// $target.linkify(options);
51+
52+
// });
53+
// });
54+
55+
// // Setup click events for linkified elements
56+
// $('body').on('click', '.linkified', function () {
57+
// var $link = $(this),
58+
// url = $link.attr('href'),
59+
// isEmail = /^mailto:/i.test(url),
60+
// target = $link.attr('target');
61+
62+
// if (isEmail) {
63+
64+
// // mailto links ignore the target
65+
// window.location.href = url;
66+
67+
// } else {
68+
// window.open(url, target);
69+
// }
70+
71+
// return false;
72+
// });
7373

0 commit comments

Comments
 (0)