Skip to content

Commit

Permalink
Merge branch 'master' into non-hash
Browse files Browse the repository at this point in the history
Conflicts:
	lib/sammy.js
  • Loading branch information
quirkey committed Apr 18, 2011
2 parents 1805ab2 + 159a86b commit 55ce926
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/sammy.js
Expand Up @@ -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;');
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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);
}
});
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 55ce926

Please sign in to comment.