123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
-
- Namespace.register("U.AFB");
- U.AFB.GoList = {};
- U.AFB.UTH = null
- U.AFB.RGoL = function (UTF, UFT) {
- var _UDE = U.AFB.GoList;
-
- if (_UDE[UTF] && UFT !== true) {
- return _UDE[UTF].UT;
- }
- else {
- return new U.AFB.init(UTF);
- }
- }
- U.AFB.init = function (UTF) {
-
- U.Ut.AddObj(this, { OF: [], OL: 0, UT: this });
- U.AFB.GoList[UTF] = this;
- }
- U.AFB.AddEvent = function (UCB, UTF) {
- var _UTE = U.AFB.RGoL(UTF);
- UCB = U.M.apply(_UTE, UCB);
- _UTE.AddDrawBack(UCB); UCB();
- }
- U.AFB.AddDrawBack = function (UCB) {
- this.OF.splice(this.OL, this.OF.length - this.OL, UCB);
- this.OL++;
- }
- U.AFB.GQH = function (UTF) {
- var _UCB = this.OF[this.OL - UTF * 2];
- (_UCB) && (_UCB(), this.OL += ((-UTF * 2) + 1));
- }
- U.AFB.DrawBack = function (UTF) {
- U.AFB.GoList[UTF]["UT"].GQH(1);
- }
- U.AFB.GoForward = function (UTF) {
- U.AFB.GoList[UTF]["UT"].GQH(0);
- }
- U.AFB.init.prototype = {
- AddEvent: U.AFB.AddEvent,
- AddDrawBack: U.AFB.AddDrawBack,
- GQH: U.AFB.GQH,
- DrawBack: U.AFB.DrawBack,
- GoForward: U.AFB.GoForward
- }
- U.AFB.UrlRoute = function (UCB) {
- if (!U.AFB.UTH) {
- U.AFB.UTH = new U.AFB.Path(UCB).init();
- }
- return U.AFB.UTH;
- }
- U.AFB.Path = function (UCB) {
- this.UH = window.location.hash;
- this.UDE = [];
- this.UCB = UCB;
- this.UIE = window.history.length;
- this.UGT = this.UTF = true;
- this.IE = !("onhashchange" in window) || (document.documentMode < 8);
- }
- U.AFB.TJ = function (UDE) {
- this.UE = UDE[0];
- this.UCB = UDE[1];
- }
- U.AFB.Set = function (UDE) {
- var i, j, _UCE,
- _UTE = U.AFB.UrlRoute(),
- _UAE = _UTE.UDE;
- _UCE: for (i = 0; i < UDE.length; i++) {
- for (j = 0; j < _UAE.length; j++) {
-
- if (_UAE[j].UE.join("/") == UDE[i][0].join("/")) {
- continue _UCE;
- }
- }
-
- _UAE.push(new this.TJ(UDE[i]));
- }
- }
- U.AFB.Add = function (UDE, UN) {
- if (UDE) {
- var i, _UST = UDE.join("/");
- _UST = _UST ? "#!/" + _UST : "";
- if (this.IE) {
- this.UGT = true;
- this.UTF = false; this.ICHT(this.UH, _UST);
- }
- this.setNC();
- $(document).addAttrArray({ "location": { "hash": _UST }, "title": "云端 - " + (UN ? UN : "1473.cn") }); return false;
- }
- }
- U.AFB.Path.prototype = {
- constructor: U.AFB.Path,
- UrlRoute: U.AFB.UrlRoute,
- TJ: U.AFB.TJ,
- Set: U.AFB.Set,
- Add: U.AFB.Add,
- init: function () {
- this.UH = window.location.hash;
- if (this.UH) { this.Ch(); }
- if (this.IE) { document.documentElement.onpropertychange = window.onpropertychange = document.onpropertychange = U.M.apply(this, [[this.ICH]]); }
- window.onhashchange = U.M.apply(this, [[this.Ch]]);
- return this;
- },
- Ch: function () {
- if (this.UTF && !this.NC) {
- var i, _UTF, _USE, _UAE = this.UDE, _UDE = U.M.GetUF();
- if (_UDE[0]) {
- for (i = 0; i < _UAE.length; i++) {
- if (_UAE[i].UE.join("/").indexOf(_UDE.join("/")) > -1) {
- (_UAE[i].UCB) && (_UAE[i].UCB()); return;
- }
- }
-
- this.setNC();
- this.UCB(_UDE);
-
-
-
-
-
-
-
-
-
- }
- }
- },
- setNC: function () {
- if (!this.NC) {
- this.NC = true;
- setTimeout(U.M.apply(this, function () { this.NC = false; }), 0);
- }
- },
- ICH: function () {
- var _UE = window.event, _UHE = window.location.hash;
- if (_UE.propertyName == "onbeforeeditfocus" && this.UGT && _UHE != this.UH) {
- if (this.UTF) { this.UGT = this.UTF = false; setTimeout(this.GO, 0); setTimeout(U.M.apply(this, [[this.AddHS, [_UHE]]]), 0); }
- else { this.UH = _UHE; this.Ch(); }
- }
- },
- AddHS: function (UH) {
- this.Add(UH.split("/").slice(1));
- this.UH = UH; this.UTF = true;
- },
- ICHT: function (UH, UNH) {
- var _UDID = Guid.guidNoDash(),
- _UDOD = $$("iframe", { "UrlRoute": [UH, UNH, (this.UIE++)], "tabindex": "-1", "id": _UDID, "name": _UDID, "style": { "cssText": "width:0;height:0;display:none" }, "src": "about:blank" }, $("body")[0]);
- U.M.AddEvent("load", _UDOD, U.M.apply(this, [[this.UQJH, [_UDOD]]]));
- },
- UQJH: function (UDOD) {
- U.M.ReEvent("load", UDOD, arguments.callee.caller);
- var _UW = UDOD.contentWindow,
- _UD = _UW.document.open();
- _UD.close();
- U.M.AddEvent("load", UDOD, U.M.apply(this, [[this.AUQJH, [UDOD]]]));
- },
- AUQJH: function (UDOD) {
- var _UH = this.UH,
- _UNH = UDOD.UrlRoute,
- _UIE = this.UIE - _UNH[2];
- _UNH = _UNH[1 - _UIE];
- this.UGT = true; this.UTF = false; this.UIE -= (_UIE * 2 - 1); if (_UH != _UNH) { document.location.hash = _UNH; }
- },
- GO: function (UTF) {
- window.history.go(UTF || -1);
- }
- }
|