Skip to content

Commit e8b648f

Browse files
committed
Remove support for IE
1 parent e8a06b0 commit e8b648f

File tree

3 files changed

+3
-130
lines changed

3 files changed

+3
-130
lines changed

Diff for: jquery.ba-hashchange.js

+1-91
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
// reside (so you can test it yourself).
3838
//
3939
// jQuery Versions - 1.2.6, 1.3.2, 1.4.1, 1.4.2
40-
// Browsers Tested - Internet Explorer 6-8, Firefox 2-4, Chrome 5-6, Safari 3.2-5,
40+
// Browsers Tested - Firefox 2-4, Chrome 5-6, Safari 3.2-5,
4141
// Opera 9.6-10.60, iPhone 3.1, Android 1.6-2.2, BlackBerry 4.6-5.
4242
// Unit Tests - http://benalman.com/code/projects/jquery-hashchange/unit/
4343
//
@@ -267,96 +267,6 @@
267267
timeout_id = setTimeout(poll, $.fn[str_hashchange].delay);
268268
};
269269

270-
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
271-
// vvvvvvvvvvvvvvvvvvv REMOVE IF NOT SUPPORTING IE6/7/8 vvvvvvvvvvvvvvvvvvv
272-
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
273-
(window.navigator.userAgent.indexOf("MSIE ") > -1 || !!window.navigator.userAgent.match(/Trident.*rv\:11\./) || navigator.appName == 'Microsoft Internet Explorer') && window.attachEvent && !window.addEventListener && !supports_onhashchange && (function () {
274-
// Not only do IE6/7 need the "magical" Iframe treatment, but so does IE8
275-
// when running in "IE7 compatibility" mode.
276-
277-
var iframe,
278-
iframe_src;
279-
280-
// When the event is bound and polling starts in IE 6/7, create a hidden
281-
// Iframe for history handling.
282-
self.start = function () {
283-
if (!iframe) {
284-
iframe_src = $.fn[str_hashchange].src;
285-
iframe_src = iframe_src && iframe_src + get_fragment();
286-
287-
// Create hidden Iframe. Attempt to make Iframe as hidden as possible
288-
// by using techniques from http://www.paciellogroup.com/blog/?p=604.
289-
iframe = $('<iframe tabindex="-1" title="empty"/>').hide()
290-
291-
// When Iframe has completely loaded, initialize the history and
292-
// start polling.
293-
.one('load', function () {
294-
iframe_src || history_set(get_fragment());
295-
poll();
296-
})
297-
298-
// Load Iframe src if specified, otherwise nothing.
299-
.attr('src', iframe_src || 'javascript:0')
300-
301-
// Append Iframe after the end of the body to prevent unnecessary
302-
// initial page scrolling (yes, this works).
303-
.insertAfter('body')[0].contentWindow;
304-
305-
// Whenever `document.title` changes, update the Iframe's title to
306-
// prettify the back/next history menu entries. Since IE sometimes
307-
// errors with "Unspecified error" the very first time this is set
308-
// (yes, very useful) wrap this with a try/catch block.
309-
doc.onpropertychange = function () {
310-
try {
311-
if (event.propertyName === 'title') {
312-
iframe.document.title = doc.title;
313-
}
314-
} catch (e) { }
315-
};
316-
317-
}
318-
};
319-
320-
// Override the "stop" method since an IE6/7 Iframe was created. Even
321-
// if there are no longer any bound event handlers, the polling loop
322-
// is still necessary for back/next to work at all!
323-
self.stop = fn_retval;
324-
325-
// Get history by looking at the hidden Iframe's location.hash.
326-
history_get = function () {
327-
return get_fragment(iframe.location.href);
328-
};
329-
330-
// Set a new history item by opening and then closing the Iframe
331-
// document, *then* setting its location.hash. If document.domain has
332-
// been set, update that as well.
333-
history_set = function (hash, history_hash) {
334-
var iframe_doc = iframe.document,
335-
domain = $.fn[str_hashchange].domain;
336-
337-
if (hash !== history_hash) {
338-
// Update Iframe with any initial `document.title` that might be set.
339-
iframe_doc.title = doc.title;
340-
341-
// Opening the Iframe's document after it has been closed is what
342-
// actually adds a history entry.
343-
iframe_doc.open();
344-
345-
// Set document.domain for the Iframe document as well, if necessary.
346-
domain && iframe_doc.write('\x3cscript>document.domain="' + domain + '"\x3c/script>');
347-
348-
iframe_doc.close();
349-
350-
// Update the Iframe's hash, for great justice.
351-
iframe.location.hash = hash;
352-
}
353-
};
354-
355-
})();
356-
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
357-
// ^^^^^^^^^^^^^^^^^^^ REMOVE IF NOT SUPPORTING IE6/7/8 ^^^^^^^^^^^^^^^^^^^
358-
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
359-
360270
return self;
361271
})();
362272

Diff for: jquery.ba-hashchange.min.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
22
* jQuery hashchange event - v2.0 - 4/18/2020
33
* http://benalman.com/projects/jquery-hashchange-plugin/
4-
*
4+
*
55
* Copyright (c) 2010 "Cowboy" Ben Alman
66
* Dual licensed under the MIT and GPL licenses.
77
* http://benalman.com/about/license/
88
*/
9-
!function(t,n,e){var r,i="hashchange",o=document,a=t.event.special,c=o.documentMode,u="on"+i in n&&(void 0===c||c>7);function f(t){return"#"+(t=t||location.href).replace(/^[^#]*#?(.*)$/,"$1")}t.fn[i]=function(t){return t?this.bind(i,t):this.trigger(i)},t.fn[i].delay=50,a[i]=t.extend(a[i],{setup:function(){if(u)return!1;t(r.start)},teardown:function(){if(u)return!1;t(r.stop)}}),r=function(){var e,r,a,c={},s=f(),d=function(t){return t},l=d,p=d;function h(){var r=f(),o=p(s);r!==s?(l(s=r,o),t(n).trigger(i)):o!==s&&(location.href=location.href.replace(/#.*/,"")+o),e=setTimeout(h,t.fn[i].delay)}return c.start=function(){e||h()},c.stop=function(){e&&clearTimeout(e),e=void 0},(n.navigator.userAgent.indexOf("MSIE ")>-1||n.navigator.userAgent.match(/Trident.*rv\:11\./)||"Microsoft Internet Explorer"==navigator.appName)&&n.attachEvent&&!n.addEventListener&&!u&&(c.start=function(){r||(a=(a=t.fn[i].src)&&a+f(),r=t('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){a||l(f()),h()}).attr("src",a||"javascript:0").insertAfter("body")[0].contentWindow,o.onpropertychange=function(){try{"title"===event.propertyName&&(r.document.title=o.title)}catch(t){}})},c.stop=d,p=function(){return f(r.location.href)},l=function(n,e){var a=r.document,c=t.fn[i].domain;n!==e&&(a.title=o.title,a.open(),c&&a.write('<script>document.domain="'+c+'"<\/script>'),a.close(),r.location.hash=n)}),c}()}(jQuery,this);
9+
!function(n,t,e){var r,i="hashchange",o=document,u=n.event.special,c=o.documentMode,f="on"+i in t&&(void 0===c||c>7);function a(n){return"#"+(n=n||location.href).replace(/^[^#]*#?(.*)$/,"$1")}n.fn[i]=function(n){return n?this.bind(i,n):this.trigger(i)},n.fn[i].delay=50,u[i]=n.extend(u[i],{setup:function(){if(f)return!1;n(r.start)},teardown:function(){if(f)return!1;n(r.stop)}}),r=function(){var e,r={},o=a(),u=function(n){return n},c=u,f=u;function s(){var r=a(),u=f(o);r!==o?(c(o=r,u),n(t).trigger(i)):u!==o&&(location.href=location.href.replace(/#.*/,"")+u),e=setTimeout(s,n.fn[i].delay)}return r.start=function(){e||s()},r.stop=function(){e&&clearTimeout(e),e=void 0},r}()}(jQuery,this);

Diff for: unit/ie7-compat.html

-37
This file was deleted.

0 commit comments

Comments
 (0)