diff --git a/rhodecode/public/js/ajax.js b/rhodecode/public/js/ajax.js index f43653bd..4b40620f 100644 --- a/rhodecode/public/js/ajax.js +++ b/rhodecode/public/js/ajax.js @@ -8,10 +8,13 @@ DOM UTILITIES ===================================================================== */ - /** Query single element */ - window.$ = function(selector, context) { + /** Query single element — only override $ if jQuery is not loaded */ + window.qs = function(selector, context) { return (context || document).querySelector(selector); }; + if (!window.jQuery) { + window.$ = window.qs; + } /** Query all elements */ window.$$ = function(selector, context) { @@ -89,17 +92,17 @@ ===================================================================== */ window.show = function(el) { - if (typeof el === 'string') el = $(el); + if (typeof el === 'string') el = qs(el); if (el) el.style.display = ''; }; window.hide = function(el) { - if (typeof el === 'string') el = $(el); + if (typeof el === 'string') el = qs(el); if (el) el.style.display = 'none'; }; window.toggle = function(el) { - if (typeof el === 'string') el = $(el); + if (typeof el === 'string') el = qs(el); if (!el) return; el.style.display = (el.style.display === 'none') ? '' : 'none'; }; @@ -128,14 +131,14 @@ ===================================================================== */ window.openDialog = function(selector) { - var dialog = typeof selector === 'string' ? $(selector) : selector; + var dialog = typeof selector === 'string' ? qs(selector) : selector; if (dialog && dialog.showModal) { dialog.showModal(); } }; window.closeDialog = function(selector) { - var dialog = typeof selector === 'string' ? $(selector) : selector; + var dialog = typeof selector === 'string' ? qs(selector) : selector; if (dialog && dialog.close) { dialog.close(); } @@ -166,7 +169,7 @@ ===================================================================== */ window.tooltip = function(el, text) { - if (typeof el === 'string') el = $(el); + if (typeof el === 'string') el = qs(el); if (!el) return; el.setAttribute('title', text); }; @@ -184,7 +187,7 @@ ===================================================================== */ window.dismissAlert = function(el) { - if (typeof el === 'string') el = $(el); + if (typeof el === 'string') el = qs(el); if (!el) return; el.style.transition = 'opacity 0.2s'; el.style.opacity = '0'; @@ -196,7 +199,7 @@ ===================================================================== */ window.scrollToElement = function(selector) { - var el = typeof selector === 'string' ? $(selector) : selector; + var el = typeof selector === 'string' ? qs(selector) : selector; if (el) { el.scrollIntoView({ behavior: 'smooth', block: 'start' }); } diff --git a/rhodecode/templates/base/root.mako b/rhodecode/templates/base/root.mako index a0de0cc7..ec0648e2 100644 --- a/rhodecode/templates/base/root.mako +++ b/rhodecode/templates/base/root.mako @@ -40,7 +40,7 @@ c.template_context['attachment_store'] = { } %> - + ${self.title()} @@ -62,6 +62,7 @@ c.template_context['attachment_store'] = { ## CSS definitions <%def name="css()"> + ## EXTRA FOR CSS @@ -144,6 +145,7 @@ c.template_context['attachment_store'] = { ## avoide escaping the %N + ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates ${self.js_extra()} diff --git a/rhodecode/templates/errors/error_document.mako b/rhodecode/templates/errors/error_document.mako index d58ff3ef..6e88c2ac 100644 --- a/rhodecode/templates/errors/error_document.mako +++ b/rhodecode/templates/errors/error_document.mako @@ -13,14 +13,15 @@ + - <%include file="/base/plugins_base.mako"/> +