/**! * @author @copyright zhangxinxu(.com) * @since 2014-09-26 * @description mobilebone.js(v2.8.1) - bone of switch for mobile web app - https://github.com/zhangxinxu/mobilebone * @license MIT **/ (function(root, factory) { if (document.MBLOADED) { root.console && console.warn("Don\'t repeat load Mobilebone!"); return; } // Set up Mobilebone appropriately for the environment. if (typeof define === "function" && (define.amd || define.cmd)) { define("mobilebone", function(exports) { return factory(root, exports); }); } else if ( typeof module === "object" && typeof module.exports === "object" ) { module.exports = factory(root, {}); } else { // Finally, as a browser global. root.Mobilebone = factory(root, {}); } })((typeof global !== "undefined") ? global : ((typeof window !== "undefined") ? window : ((typeof self !== "undefined") ? self : this)), function(root, Mobilebone) { // Avoid repeated callbacks var store = {}; // Create local references to array methods we'll want to use later. var array = []; var slice = array.slice; // Is it a id selector var isSimple = /^#?\w+(?:[\-_]\w+)*$/i; // Is it webkit var isWebkit = "WebkitAppearance" in document.documentElement.style || typeof document.webkitHidden != "undefined"; // Is it suppory history API var supportHistory = "pushState" in history && "replaceState" in history; Mobilebone.support = supportHistory; var hasInited = false; /** * Current version of the library. Keep in sync with `package.json`. * * @type string **/ Mobilebone.VERSION = "2.8.1"; /** * Whether auto init Mobilebone * If this value is false, you shou excute Mobilebone.init() in the right place */ Mobilebone.autoInit = true; /** * Whether catch attribute of href from element with tag 'a' * If the value set to false, jump links in a refresh form(not slide) * In most cases, you do not need to care about this parameter. Except some special pages that should refresh all links, as test/index.html show. However, if your only want several links refesh, you can use data-ajax="false" or data-rel="external" * * @type boolean **/ Mobilebone.captureLink = true; /** * Whether catch events of 'submit' from