[Rt-commit] rt branch, 4.6/remove-theme-js-from-noauth, created. rt-4.4.2-42-gf080692
Maureen Mirville
maureen at bestpractical.com
Wed Oct 11 16:06:46 EDT 2017
The branch, 4.6/remove-theme-js-from-noauth has been created
at f080692f2cf5dd8d971c474c1b58fbb35b14fdcd (commit)
- Log -----------------------------------------------------------------
commit f080692f2cf5dd8d971c474c1b58fbb35b14fdcd
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date: Wed Oct 11 15:53:26 2017 -0400
Remove Theme JS from NoAuth
In a previous RT update, all of the CSS/JS files for themes were
moved to share/html/static except for a couple of files,
'AfterMenus' and 'InHeaders'. Content from these files have now
been moved to share/html. As these files in NoAuth are no longer
referenced by themes, therefore it is no longer necessary for
theme extensions to add AfterMenus or InHeader to a NoAutho folder,
all CSS/JS can remain in static/.
diff --git a/share/html/Elements/Header b/share/html/Elements/Header
index 2ba8645..4127141 100644
--- a/share/html/Elements/Header
+++ b/share/html/Elements/Header
@@ -76,7 +76,7 @@
<link rel="alternate" href="<%$RSSAutoDiscovery%>" type="application/rss+xml" title="RSS RT Search" />
% }
-% my $stylesheet_plugin = "/NoAuth/css/".$style."/InHeader";
+% my $stylesheet_plugin = '<!--[if lt IE 8]><link rel="stylesheet" href="<%RT->Config->Get("WebPath")%>/static/css/'.$style.'/msie.css" type="text/css" media="all" /><![endif]--><!--[if lt IE 7]><link rel="stylesheet" href="<%RT->Config->Get("WebPath")%>/static/css/'.$style.'/msie6.css" type="text/css" media="all" /><![endif]-->';
% if ($m->comp_exists($stylesheet_plugin) ) {
<& $stylesheet_plugin &>
% }
diff --git a/share/html/Elements/PageLayout b/share/html/Elements/PageLayout
index 643b051..2c84cea 100644
--- a/share/html/Elements/PageLayout
+++ b/share/html/Elements/PageLayout
@@ -66,5 +66,5 @@ $show_menu => 1
my $style = $session{'CurrentUser'}
? $session{'CurrentUser'}->Stylesheet
: RT->Config->Get('WebDefaultStylesheet');
-my $stylesheet_plugin = "/NoAuth/css/".$style."/AfterMenus";
+my $stylesheet_plugin = "/aftermenus";
</%init>
diff --git a/share/html/Elements/PageLayout b/share/html/aftermenus
similarity index 69%
copy from share/html/Elements/PageLayout
copy to share/html/aftermenus
index 643b051..72c733f 100644
--- a/share/html/Elements/PageLayout
+++ b/share/html/aftermenus
@@ -45,26 +45,27 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-% if ( $show_menu ) {
-<div id="main-navigation"><& /Elements/Menu, menu => Menu(), id => 'app-nav' &></div>
-<div id="page-navigation"><& /Elements/Menu, menu => PageMenu(), id => 'page-menu', 'parent_id' => 'page' &></div>
-% }
-<div id="topactions"><& /Elements/WidgetBar, menu => PageWidgets() &></div>
+<script type="text/javascript">
+var initMenus = function() {
+ jQuery.fn.supersubs.defaults = {
+ maxWidth: 30,
+ extraWidth: 2
+ };
-% if ($m->comp_exists($stylesheet_plugin) ) {
-<& $stylesheet_plugin &>
-% }
+ jQuery("#app-nav.toplevel").addClass('sf-menu sf-js-enabled sf-shadow').supersubs().superfish({ speed: 'fast' });
+ jQuery("#page-menu.toplevel").addClass('sf-menu sf-js-enabled').supersubs().superfish({ dropShadows: false, speed: 'fast' }).supposition();
-<div id="body">
-% $m->callback( %ARGS, CallbackName => 'BeforeBody' );
-% $m->flush_buffer(); # we've got the page laid out, let's flush the buffer;
-<%ARGS>
-$title => $m->callers(-1)->path
-$show_menu => 1
-</%ARGS>
-<%init>
-my $style = $session{'CurrentUser'}
- ? $session{'CurrentUser'}->Stylesheet
- : RT->Config->Get('WebDefaultStylesheet');
-my $stylesheet_plugin = "/NoAuth/css/".$style."/AfterMenus";
-</%init>
+ var originalOffset = jQuery("#page-menu").offset().top;
+ var floatMenu = function () {
+ jQuery("#page-menu").toggleClass("pinned", jQuery(document).scrollTop() > originalOffset);
+ };
+ floatMenu();
+ jQuery(window).scroll(floatMenu);
+};
+
+// If everything is loaded, init NOW. Otherwise, defer to DOM ready.
+if (jQuery.fn.supersubs && jQuery.fn.superfish && jQuery.fn.supposition)
+ initMenus();
+else
+ jQuery(initMenus);
+</script>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list