diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 14:03:52 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 14:03:52 -0800 |
commit | 094268cf8cb37b9d904c8a1e3559cdd46d73cf66 (patch) | |
tree | 9d28fb439d1c7d37ec01058072c0542e8d6fa763 /tools/droiddoc/templates/assets/jquery-history.js | |
parent | a9b22497534d404bf956cdcc0941e20057219a2a (diff) | |
download | build-094268cf8cb37b9d904c8a1e3559cdd46d73cf66.zip build-094268cf8cb37b9d904c8a1e3559cdd46d73cf66.tar.gz build-094268cf8cb37b9d904c8a1e3559cdd46d73cf66.tar.bz2 |
auto import from //depot/cupcake/@132589
Diffstat (limited to 'tools/droiddoc/templates/assets/jquery-history.js')
-rw-r--r-- | tools/droiddoc/templates/assets/jquery-history.js | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/tools/droiddoc/templates/assets/jquery-history.js b/tools/droiddoc/templates/assets/jquery-history.js deleted file mode 100644 index ef96ec3..0000000 --- a/tools/droiddoc/templates/assets/jquery-history.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * jQuery history event v0.1 - * Copyright (c) 2008 Tom Rodenberg <tarodenberg gmail com> - * Licensed under the GPL (http://www.gnu.org/licenses/gpl.html) license. - */ -(function($) { - var currentHash, previousNav, timer, hashTrim = /^.*#/; - - var msie = { - iframe: null, - getDoc: function() { - return msie.iframe.contentWindow.document; - }, - getHash: function() { - return msie.getDoc().location.hash; - }, - setHash: function(hash) { - var d = msie.getDoc(); - d.open(); - d.close(); - d.location.hash = hash; - } - }; - - var historycheck = function() { - var hash = msie.iframe ? msie.getHash() : location.hash; - if (hash != currentHash) { - currentHash = hash; - if (msie.iframe) { - location.hash = currentHash; - } - var current = $.history.getCurrent(); - $.event.trigger('history', [current, previousNav]); - previousNav = current; - } - }; - - $.history = { - add: function(hash) { - hash = '#' + hash.replace(hashTrim, ''); - if (currentHash != hash) { - var previous = $.history.getCurrent(); - location.hash = currentHash = hash; - if (msie.iframe) { - msie.setHash(currentHash); - } - $.event.trigger('historyadd', [$.history.getCurrent(), previous]); - } - if (!timer) { - timer = setInterval(historycheck, 100); - } - }, - getCurrent: function() { - if (currentHash) { - return currentHash.replace(hashTrim, ''); - } else { - return ""; - } - } - }; - - $.fn.history = function(fn) { - $(this).bind('history', fn); - }; - - $.fn.historyadd = function(fn) { - $(this).bind('historyadd', fn); - }; - - $(function() { - currentHash = location.hash; - if ($.browser.msie) { - msie.iframe = $('<iframe style="display:none" src="javascript:false;"></iframe>').prependTo('body')[0]; - msie.setHash(currentHash); - currentHash = msie.getHash(); - } - }); -})(jQuery); |