|
43 | 43 | *
|
44 | 44 | * @type string
|
45 | 45 | **/
|
46 |
| - Mobilebone.VERSION = '2.5.3'; |
| 46 | + Mobilebone.VERSION = '2.5.4'; |
47 | 47 |
|
48 | 48 | /**
|
49 | 49 | * Whether catch attribute of href from element with tag 'a'
|
|
579 | 579 | var create = document.createElement("div");
|
580 | 580 | if (typeof domHtml == "string") {
|
581 | 581 | create.innerHTML = domHtml;
|
582 |
| - |
583 |
| - if (Mobilebone.evalScript == true) { |
584 |
| - slice.call(create.getElementsByTagName("script")).forEach(function(originScript) { |
585 |
| - var scriptContent = originScript.innerHTML.trim(), type = originScript.getAttribute("type"); |
586 |
| - if (scriptContent.trim() == "" || originScript.src) return; |
587 |
| - var head = document.getElementsByTagName("head")[0] || document.documentElement, |
588 |
| - script = document.createElement("script"); |
589 |
| - if (type) script.type = type; |
590 |
| - script.appendChild(document.createTextNode(scriptContent)); |
591 |
| - setTimeout(function() { |
592 |
| - head.insertBefore(script, head.firstChild); |
593 |
| - head.removeChild(script); |
594 |
| - }, 16); |
595 |
| - originScript = null; |
596 |
| - }); |
597 |
| - } |
598 | 582 | } else {
|
599 | 583 | create.appendChild(domHtml);
|
600 | 584 | }
|
| 585 | + |
| 586 | + // excute inline JavaScript |
| 587 | + if (Mobilebone.evalScript == true) { |
| 588 | + slice.call(create.getElementsByTagName("script")).forEach(function(originScript) { |
| 589 | + var scriptContent = originScript.innerHTML.trim(), type = originScript.getAttribute("type"); |
| 590 | + if (scriptContent.trim() == "" || originScript.src) return; |
| 591 | + var head = document.getElementsByTagName("head")[0] || document.documentElement, |
| 592 | + script = document.createElement("script"); |
| 593 | + if (type) script.type = type; |
| 594 | + script.appendChild(document.createTextNode(scriptContent)); |
| 595 | + setTimeout(function() { |
| 596 | + head.insertBefore(script, head.firstChild); |
| 597 | + head.removeChild(script); |
| 598 | + }, 16); |
| 599 | + originScript = null; |
| 600 | + }); |
| 601 | + } |
| 602 | + |
601 | 603 | var create_title = create.getElementsByTagName("title")[0];
|
602 | 604 | // get the page element
|
603 | 605 | if (!(create_page = create.querySelector("." + classPage))) {
|
|
890 | 892 | history.tempBack = null;
|
891 | 893 | return true;
|
892 | 894 | }
|
| 895 | + if (typeof page_in == "undefined") return true; |
| 896 | + if (!page_out) return false; |
893 | 897 | return page_in.compareDocumentPosition(page_out) == 4;
|
894 | 898 | };
|
895 | 899 |
|
|
1190 | 1194 | if (page_in.id) return;
|
1191 | 1195 | } else {
|
1192 | 1196 | page_in = store[hash];
|
| 1197 | + |
| 1198 | + if (isSimple.test(hash) == false) { |
| 1199 | + // ajax store |
| 1200 | + Mobilebone.createPage(page_in, { |
| 1201 | + url: hash, |
| 1202 | + dataType: "unknown", |
| 1203 | + history: false, |
| 1204 | + back: true |
| 1205 | + }); |
| 1206 | + return; |
| 1207 | + } |
1193 | 1208 | }
|
1194 | 1209 |
|
1195 | 1210 | if (!page_in) {
|
1196 |
| - if(isSimple.test(hash) == false) { |
| 1211 | + if (isSimple.test(hash) == false) { |
1197 | 1212 | // as a url
|
1198 | 1213 | Mobilebone.ajax({
|
1199 | 1214 | url: hash,
|
|
0 commit comments