mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
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
This commit is contained in:
@@ -21,7 +21,6 @@ var ajaxify = {};
|
|||||||
|
|
||||||
|
|
||||||
window.onpopstate = function(event) {
|
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);
|
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 (templates[tpl_url]) {
|
||||||
if (quiet !== true) {
|
if (quiet !== true) {
|
||||||
console.log('state pushed', {
|
|
||||||
"url": url
|
|
||||||
});
|
|
||||||
window.history.pushState({
|
window.history.pushState({
|
||||||
"url": url
|
"url": url
|
||||||
}, url, "/" + url);
|
}, url, "/" + url);
|
||||||
@@ -80,9 +76,11 @@ var ajaxify = {};
|
|||||||
if (this.href == window.location.href + "#") return;
|
if (this.href == window.location.href + "#") return;
|
||||||
var url = this.href.replace(rootUrl +'/', '');
|
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();
|
ev.preventDefault();
|
||||||
// return false; // Uncommenting this breaks event bubbling!
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
public/uploads/.gitignore
vendored
1
public/uploads/.gitignore
vendored
@@ -0,0 +1 @@
|
|||||||
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user