From 1d78c6a35dc111283a0690fc39cee3e4d156e4a4 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 15 May 2013 12:04:30 -0400 Subject: [PATCH] removing debug statements from ajaxify building in middle click and ctrl-click listeners for new tab opening instructing git to ignore everything in the /uploads folder --- public/src/ajaxify.js | 10 ++++------ public/uploads/.gitignore | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 9153042642..3dc1f39497 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -21,7 +21,6 @@ var ajaxify = {}; window.onpopstate = function(event) { - console.log('popstate called:', event.state); if (event !== null && event.state && event.state.url !== undefined) ajaxify.go(event.state.url, null, null, true); }; @@ -43,9 +42,6 @@ var ajaxify = {}; if (templates[tpl_url]) { if (quiet !== true) { - console.log('state pushed', { - "url": url - }); window.history.pushState({ "url": url }, url, "/" + url); @@ -80,9 +76,11 @@ var ajaxify = {}; if (this.href == window.location.href + "#") return; var url = this.href.replace(rootUrl +'/', ''); - if (ajaxify.go(url)) { + if (!ev.ctrlKey && ev.which === 1) { + if (ajaxify.go(url)) ev.preventDefault(); + } else if ((ev.ctrlKey && ev.which === 1) || ev.which === 2) { + window.open(this.href, '_blank'); ev.preventDefault(); - // return false; // Uncommenting this breaks event bubbling! } } diff --git a/public/uploads/.gitignore b/public/uploads/.gitignore index e69de29bb2..72e8ffc0db 100644 --- a/public/uploads/.gitignore +++ b/public/uploads/.gitignore @@ -0,0 +1 @@ +*