Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into non-hash

Conflicts:
	lib/sammy.js
  • Loading branch information...
commit 55ce9260005f19acb18b77909a3bd81436c0325b 2 parents 1805ab2 + 159a86b
@quirkey quirkey authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/sammy.js
View
8 lib/sammy.js
@@ -14,7 +14,7 @@
// borrowed from jQuery
_isFunction = function( obj ) { return Object.prototype.toString.call(obj) === "[object Function]"; },
_isArray = function( obj ) { return Object.prototype.toString.call(obj) === "[object Array]"; },
- _decode = function( str ) { return decodeURIComponent(str.replace(/\+/g, ' ')); },
+ _decode = function( str ) { return decodeURIComponent((str || '').replace(/\+/g, ' ')); },
_encode = encodeURIComponent,
_escapeHTML = function(s) {
return String(s).replace(/&(?!\w+;)/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
@@ -309,7 +309,7 @@
if (!every) { every = 10; }
var hashCheck = function() {
var current_location = proxy.getLocation();
- if (!Sammy.DefaultLocationProxy._last_location ||
+ if (typeof Sammy.DefaultLocationProxy._last_location == 'undefined' ||
current_location != Sammy.DefaultLocationProxy._last_location) {
window.setTimeout(function() {
$(window).trigger('hashchange', [true]);
@@ -918,7 +918,7 @@
});
// next, bind to listener names (only if they dont exist in APP_EVENTS)
$.each(this.listeners.keys(true), function(i, name) {
- if (app.APP_EVENTS.indexOf(name) == -1) {
+ if ($.inArray(name, app.APP_EVENTS) == -1) {
app.bind(name, callback);
}
});
@@ -1725,7 +1725,7 @@
if (_isFunction(engine)) { return engine; }
// lookup engine name by path extension
engine = (engine || context.app.template_engine).toString();
- if ((engine_match = engine.match(/\.([^\.]+)$/))) {
+ if ((engine_match = engine.match(/\.([^\.\?\#]+)/))) {
engine = engine_match[1];
}
// set the engine to the default template engine if no match is found
Please sign in to comment.
Something went wrong with that request. Please try again.