import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
70
webdir/javascript/yui/history/history-debug.js
vendored
70
webdir/javascript/yui/history/history-debug.js
vendored
@ -1,8 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.6.0
|
||||
version: 2.7.0
|
||||
*/
|
||||
/**
|
||||
* The Browser History Manager provides the ability to use the back/forward
|
||||
@ -345,7 +345,25 @@ YAHOO.util.History = (function () {
|
||||
|
||||
if (YAHOO.env.ua.ie) {
|
||||
|
||||
_checkIframeLoaded();
|
||||
if (typeof document.documentMode === "undefined" || document.documentMode < 8) {
|
||||
|
||||
// IE < 8 or IE8 in quirks mode or IE7 standards mode
|
||||
_checkIframeLoaded();
|
||||
|
||||
} else {
|
||||
|
||||
// IE8 in IE8 standards mode
|
||||
YAHOO.util.Event.on(top, "hashchange",
|
||||
function () {
|
||||
var hash = _getHash();
|
||||
_handleFQStateChange(hash);
|
||||
_storeStates();
|
||||
});
|
||||
|
||||
_initialized = true;
|
||||
YAHOO.util.History.onLoadEvent.fire();
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@ -526,19 +544,13 @@ YAHOO.util.History = (function () {
|
||||
return;
|
||||
}
|
||||
|
||||
if (YAHOO.env.ua.opera) {
|
||||
// Opera cannot be supported because of several problems that
|
||||
// have been reported to the Opera team, but never addressed:
|
||||
// 1) Hash changes are not detected (started happening with
|
||||
// recent versions of Opera)
|
||||
// 2) The entire DOM gets cached, so when you come back to
|
||||
// a page, the window's onload event does not get fired,
|
||||
// which prevents us from initializing the browser history
|
||||
// manager.
|
||||
// As a consequence, the best thing we can do is to throw an
|
||||
// exception. The application should catch it, and degrade
|
||||
// gracefully. This is the sad state of history management.
|
||||
YAHOO.log("Unsupported browser.", "error", this.toString());
|
||||
if (YAHOO.env.ua.opera && typeof history.navigationMode !== "undefined") {
|
||||
// Disable Opera's fast back/forward navigation mode and puts
|
||||
// it in compatible mode. This makes anchor-based history
|
||||
// navigation work after the page has been navigated away
|
||||
// from and re-activated, at the cost of slowing down
|
||||
// back/forward navigation to and from that page.
|
||||
history.navigationMode = "compatible";
|
||||
}
|
||||
|
||||
if (typeof stateField === "string") {
|
||||
@ -555,7 +567,8 @@ YAHOO.util.History = (function () {
|
||||
|
||||
_stateField = stateField;
|
||||
|
||||
if (YAHOO.env.ua.ie) {
|
||||
// IE < 8 or IE8 in quirks mode or IE7 standards mode
|
||||
if (YAHOO.env.ua.ie && (typeof document.documentMode === "undefined" || document.documentMode < 8)) {
|
||||
|
||||
if (typeof histFrame === "string") {
|
||||
histFrame = document.getElementById(histFrame);
|
||||
@ -646,7 +659,7 @@ YAHOO.util.History = (function () {
|
||||
|
||||
fqstate = currentStates.join("&");
|
||||
|
||||
if (YAHOO.env.ua.ie) {
|
||||
if (YAHOO.env.ua.ie && (typeof document.documentMode === "undefined" || document.documentMode < 8)) {
|
||||
|
||||
return _updateIFrame(fqstate);
|
||||
|
||||
@ -726,15 +739,16 @@ YAHOO.util.History = (function () {
|
||||
// URL-decoded, which creates problems if the state value
|
||||
// contained special characters...
|
||||
idx = top.location.href.indexOf("#");
|
||||
hash = idx >= 0 ? top.location.href.substr(idx + 1) : top.location.href;
|
||||
|
||||
states = hash.split("&");
|
||||
for (i = 0, len = states.length; i < len; i++) {
|
||||
tokens = states[i].split("=");
|
||||
if (tokens.length === 2) {
|
||||
moduleName = tokens[0];
|
||||
if (moduleName === module) {
|
||||
return unescape(tokens[1]);
|
||||
if (idx >= 0) {
|
||||
hash = top.location.href.substr(idx + 1);
|
||||
states = hash.split("&");
|
||||
for (i = 0, len = states.length; i < len; i++) {
|
||||
tokens = states[i].split("=");
|
||||
if (tokens.length === 2) {
|
||||
moduleName = tokens[0];
|
||||
if (moduleName === module) {
|
||||
return unescape(tokens[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -786,4 +800,4 @@ YAHOO.util.History = (function () {
|
||||
};
|
||||
|
||||
})();
|
||||
YAHOO.register("history", YAHOO.util.History, {version: "2.6.0", build: "1321"});
|
||||
YAHOO.register("history", YAHOO.util.History, {version: "2.7.0", build: "1799"});
|
||||
|
6
webdir/javascript/yui/history/history-min.js
vendored
6
webdir/javascript/yui/history/history-min.js
vendored
File diff suppressed because one or more lines are too long
69
webdir/javascript/yui/history/history.js
vendored
69
webdir/javascript/yui/history/history.js
vendored
@ -1,8 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.6.0
|
||||
version: 2.7.0
|
||||
*/
|
||||
/**
|
||||
* The Browser History Manager provides the ability to use the back/forward
|
||||
@ -345,7 +345,25 @@ YAHOO.util.History = (function () {
|
||||
|
||||
if (YAHOO.env.ua.ie) {
|
||||
|
||||
_checkIframeLoaded();
|
||||
if (typeof document.documentMode === "undefined" || document.documentMode < 8) {
|
||||
|
||||
// IE < 8 or IE8 in quirks mode or IE7 standards mode
|
||||
_checkIframeLoaded();
|
||||
|
||||
} else {
|
||||
|
||||
// IE8 in IE8 standards mode
|
||||
YAHOO.util.Event.on(top, "hashchange",
|
||||
function () {
|
||||
var hash = _getHash();
|
||||
_handleFQStateChange(hash);
|
||||
_storeStates();
|
||||
});
|
||||
|
||||
_initialized = true;
|
||||
YAHOO.util.History.onLoadEvent.fire();
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@ -526,18 +544,13 @@ YAHOO.util.History = (function () {
|
||||
return;
|
||||
}
|
||||
|
||||
if (YAHOO.env.ua.opera) {
|
||||
// Opera cannot be supported because of several problems that
|
||||
// have been reported to the Opera team, but never addressed:
|
||||
// 1) Hash changes are not detected (started happening with
|
||||
// recent versions of Opera)
|
||||
// 2) The entire DOM gets cached, so when you come back to
|
||||
// a page, the window's onload event does not get fired,
|
||||
// which prevents us from initializing the browser history
|
||||
// manager.
|
||||
// As a consequence, the best thing we can do is to throw an
|
||||
// exception. The application should catch it, and degrade
|
||||
// gracefully. This is the sad state of history management.
|
||||
if (YAHOO.env.ua.opera && typeof history.navigationMode !== "undefined") {
|
||||
// Disable Opera's fast back/forward navigation mode and puts
|
||||
// it in compatible mode. This makes anchor-based history
|
||||
// navigation work after the page has been navigated away
|
||||
// from and re-activated, at the cost of slowing down
|
||||
// back/forward navigation to and from that page.
|
||||
history.navigationMode = "compatible";
|
||||
}
|
||||
|
||||
if (typeof stateField === "string") {
|
||||
@ -554,7 +567,8 @@ YAHOO.util.History = (function () {
|
||||
|
||||
_stateField = stateField;
|
||||
|
||||
if (YAHOO.env.ua.ie) {
|
||||
// IE < 8 or IE8 in quirks mode or IE7 standards mode
|
||||
if (YAHOO.env.ua.ie && (typeof document.documentMode === "undefined" || document.documentMode < 8)) {
|
||||
|
||||
if (typeof histFrame === "string") {
|
||||
histFrame = document.getElementById(histFrame);
|
||||
@ -645,7 +659,7 @@ YAHOO.util.History = (function () {
|
||||
|
||||
fqstate = currentStates.join("&");
|
||||
|
||||
if (YAHOO.env.ua.ie) {
|
||||
if (YAHOO.env.ua.ie && (typeof document.documentMode === "undefined" || document.documentMode < 8)) {
|
||||
|
||||
return _updateIFrame(fqstate);
|
||||
|
||||
@ -725,15 +739,16 @@ YAHOO.util.History = (function () {
|
||||
// URL-decoded, which creates problems if the state value
|
||||
// contained special characters...
|
||||
idx = top.location.href.indexOf("#");
|
||||
hash = idx >= 0 ? top.location.href.substr(idx + 1) : top.location.href;
|
||||
|
||||
states = hash.split("&");
|
||||
for (i = 0, len = states.length; i < len; i++) {
|
||||
tokens = states[i].split("=");
|
||||
if (tokens.length === 2) {
|
||||
moduleName = tokens[0];
|
||||
if (moduleName === module) {
|
||||
return unescape(tokens[1]);
|
||||
if (idx >= 0) {
|
||||
hash = top.location.href.substr(idx + 1);
|
||||
states = hash.split("&");
|
||||
for (i = 0, len = states.length; i < len; i++) {
|
||||
tokens = states[i].split("=");
|
||||
if (tokens.length === 2) {
|
||||
moduleName = tokens[0];
|
||||
if (moduleName === module) {
|
||||
return unescape(tokens[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -785,4 +800,4 @@ YAHOO.util.History = (function () {
|
||||
};
|
||||
|
||||
})();
|
||||
YAHOO.register("history", YAHOO.util.History, {version: "2.6.0", build: "1321"});
|
||||
YAHOO.register("history", YAHOO.util.History, {version: "2.7.0", build: "1799"});
|
||||
|
Reference in New Issue
Block a user