init: function () { setStateAndPushToApp(getStateFromCurrentUrl()); History.Adapter.bind(window, 'statechange', function() { setStateAndPushToApp(History.getState().data || getStateFromCurrentUrl()); }); // We use the "History" library for "pushState" etc. capabilities on IE9. // If we drop IE9 support we should change "History" to "history" in this // module, and replace the above "bind" call with: // window.onpopstate = function(event) { // setStateAndPushToApp(event.state || getStateFromCurrentUrl()); // }; },
init = function(){ $.expr[':'].external = function (a) { var PATTERN_FOR_EXTERNAL_URLS = /^\w+:\/\//; var href = $(a).attr('href'); return href !== undefined && href.search(PATTERN_FOR_EXTERNAL_URLS) !== -1; }; $.expr[':'].internal = function (a) { return $(a).attr('href') !== undefined && !$.expr[':'].external(a); }; History.options.debug = false; History.Adapter.bind(window,'statechange',function(){ finch.call(History.getState().hash); }); };