|
27 | 27 | var isSimple = /^.[^:#\[\.,]*$/
|
28 | 28 |
|
29 | 29 | // Is it suppory history API
|
30 |
| - var supportHistory = "pushState" in history && |
31 |
| - "replaceState" in history && |
32 |
| - // When running inside a FF iframe, calling replaceState causes an error |
33 |
| - !( window.navigator.userAgent.indexOf( "Firefox" ) >= 0 && window.top !== window ) && |
34 |
| - ( window.navigator.userAgent.search(/CriOS/) === -1 ); |
| 30 | + var supportHistory = "pushState" in history && "replaceState" in history; |
35 | 31 |
|
36 | 32 | Mobilebone.support = supportHistory;
|
37 | 33 |
|
|
44 | 40 | *
|
45 | 41 | * @type string
|
46 | 42 | **/
|
47 |
| - Mobilebone.VERSION = '1.1.6'; |
| 43 | + Mobilebone.VERSION = '1.1.7'; |
48 | 44 |
|
49 | 45 | /**
|
50 | 46 | * Whether catch attribute of href from element with tag 'a'
|
|
100 | 96 | **/
|
101 | 97 | Mobilebone.pushStateEnabled = true;
|
102 | 98 |
|
| 99 | + if (// When running inside a FF iframe, calling replaceState causes an error. So set 'pushStateEnabled = false' |
| 100 | + !( window.navigator.userAgent.indexOf( "Firefox" ) >= 0 && window.top !== window ) && |
| 101 | + ( window.navigator.userAgent.search(/CriOS/) === -1 ) |
| 102 | + ) { |
| 103 | + Mobilebone.pushStateEnabled = false; |
| 104 | + } |
| 105 | + |
| 106 | + |
103 | 107 | /**
|
104 | 108 | * Function for transition
|
105 | 109 | * In most cases, you are unnecessary to use this function , unlike Mobilebone.createPage
|
106 | 110 |
|
107 | 111 | * @params pageInto: dom-object. Element which will transform into. - Necessary
|
108 |
| - pageOut: dom-object. Elementwhich will transform out. - Optional |
109 |
| - back: boolean. Direction of tranisition. - Optional |
| 112 | + pageOut: dom-object. Element which will transform out. - Optional |
| 113 | + back: boolean. Direction of transition. - Optional |
110 | 114 | options: object. Cover or add parameters. - Optional
|
111 | 115 | * @returns undefined
|
112 | 116 | * @example Mobilebone.transition(element);
|
|
297 | 301 |
|
298 | 302 | * @params trigger: dom-object. element with tag-"a". - Optional(at least one)
|
299 | 303 | url: string. ajax url. - Optional(at least one)
|
300 |
| - params: string|opject. ajax params. - Optional |
| 304 | + params: string|object. ajax params. - Optional |
301 | 305 | * @returns string
|
302 | 306 | * @example Mobilebone.getCleanUrl(elementOfA);
|
303 | 307 | Mobilebone.getCleanUrl(elementOfA, '', "a=1&b=2");
|
|
366 | 370 | Mobilebone.createPage('<div class="page out">xxx</div>');
|
367 | 371 | Mobilebone.createPage('<p>xxx</p>');
|
368 | 372 | Mobilebone.createPage(pageDom, triggerLink);
|
369 |
| - Mobilebone.createPage(pageDom, { reponse: '<div...>' }); |
370 |
| - Mobilebone.createPage(pageDom, triggerLink, { reponse: '<div...>' }); |
| 373 | + Mobilebone.createPage(pageDom, { response: '<div...>' }); |
| 374 | + Mobilebone.createPage(pageDom, triggerLink, { response: '<div...>' }); |
371 | 375 | *
|
372 | 376 | **/
|
373 | 377 | Mobilebone.createPage = function(dom_or_html, element_or_options, options) {
|
|
435 | 439 | * @params keys: string. - Necessary
|
436 | 440 | * @returns function
|
437 | 441 | undefined keys is not string
|
438 |
| - window keys unfinded |
| 442 | + window keys undefined |
439 | 443 | * @example Mobilebone.getFunction("a.b.c");
|
440 | 444 | *
|
441 | 445 | **/
|
|
817 | 821 | return element;
|
818 | 822 | };
|
819 | 823 | /**
|
820 |
| - * privite method: convert query string to key-value object |
| 824 | + * privatemethod: convert query string to key-value object |
821 | 825 | **/
|
822 | 826 | var _queryToObject = function(string) {
|
823 | 827 | var obj = {};
|
|
0 commit comments