Revision 3c058d7f
Von Sven Schöling vor etwa 12 Jahren hinzugefügt
bin/mozilla/menu.pl | ||
---|---|---|
129 | 129 |
my $anchor = $menuitem->{href}; |
130 | 130 |
|
131 | 131 |
my %common_args = ( |
132 |
label => $label,
|
|
133 |
spacer => $spacer,
|
|
134 |
target => $menuitem->{target},
|
|
135 |
item_id => "$id_prefix\_$id",
|
|
132 |
l => $label, |
|
133 |
s => $spacer, |
|
134 |
t => $menuitem->{target}, |
|
135 |
id => "$id_prefix\_$id", |
|
136 | 136 |
height => 16, |
137 | 137 |
); |
138 | 138 |
|
139 | 139 |
if (!$level) { # toplevel |
140 | 140 |
push @items, { %common_args, |
141 |
img => "icon24 $icon_class", # make_image(size => 24, label => $item), |
|
142 |
height => 24, |
|
143 |
class => 'm', |
|
141 |
i => "icon24 $icon_class", # make_image(size => 24, label => $item), |
|
142 |
c => 'm', |
|
144 | 143 |
}; |
145 | 144 |
push @items, section_menu($menu, $item, "$id_prefix\_$id"); |
146 | 145 |
} elsif ($menuitem->{submenu}) { |
147 | 146 |
push @items, { %common_args, |
148 |
img => "icon16 submenu", #make_image(label => 'submenu'),
|
|
149 |
class => 'sm',
|
|
147 |
i => "icon16 submenu", #make_image(label => 'submenu'), |
|
148 |
c => 'sm', |
|
150 | 149 |
}; |
151 | 150 |
push @items, section_menu($menu, $item, "$id_prefix\_$id"); |
152 | 151 |
} elsif ($menuitem->{module}) { |
153 | 152 |
push @items, { %common_args, |
154 |
img => "icon16 $icon_class", #make_image(size => 16, label => $item),
|
|
155 |
href => $anchor,
|
|
156 |
class => 'i',
|
|
153 |
i => "icon16 $icon_class", #make_image(size => 16, label => $item), |
|
154 |
h => $anchor, |
|
155 |
c => 'i', |
|
157 | 156 |
}; |
158 | 157 |
} |
159 | 158 |
} continue { |
templates/webpages/menu/menu.html | ||
---|---|---|
4 | 4 |
<body class="menu"> |
5 | 5 |
<div id='html-menu'> |
6 | 6 |
</div> |
7 |
<script type='text/javascript'> |
|
8 |
$(function(){ |
|
9 |
$([% JSON.json(sections) %]).each(function(i,b){ |
|
10 |
var a = $('<a class="ml">').append( |
|
11 |
$('<span class="mii ms">').append($('<div>').addClass(b.img)), |
|
12 |
$('<span class="mic">').append(b.label)); |
|
13 |
if (b.href) a.attr('href', b.href); |
|
14 |
if (b.target) a.attr('target', b.target); |
|
15 |
$('#html-menu').append($('<div class="mi">').addClass(b.class).addClass(b.spacer).attr('id', 'mi' + b.item_id).append(a)); |
|
16 |
}); |
|
17 |
$('#html-menu div.i, #html-menu div.sm').hide(); |
|
18 |
$('#html-menu div.m').each(function() { |
|
19 |
$(this).click(function(){ |
|
20 |
$('#html-menu div.mi').not('div.m').not('[id^=' + $(this).attr('id') + '_]').hide(); |
|
21 |
$('#html-menu div.mi[id^=' + $(this).attr('id') + '_]').toggle(); |
|
22 |
}); |
|
23 |
}); |
|
24 |
}); |
|
25 |
</script> |
|
7 |
<script type='text/javascript'>$(function(){$([% JSON.json(sections) %]).each(function(i,b){var a=$('<a class="ml">').append($('<span class="mii ms">').append($('<div>').addClass(b.i)),$('<span class="mic">').append(b.l));if(b.h)a.attr('href', b.h);if(b.t)a.attr('target', b.t);$('#html-menu').append($('<div class="mi">').addClass(b.c).addClass(b.s).attr('id','mi'+b.id).append(a));});$('#html-menu div.i, #html-menu div.sm').hide();$('#html-menu div.m').each(function(){$(this).click(function(){$('#html-menu div.mi').not('div.m').not('[id^='+$(this).attr('id')+'_]').hide();$('#html-menu div.mi[id^='+$(this).attr('id')+'_]').toggle()})})})</script> |
|
26 | 8 |
</body> |
27 | 9 |
</html> |
Auch abrufbar als: Unified diff
Whitespace entfernt und Identifier minifiziert um response zu verkleinern