Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
ce0bbc11
Commit
ce0bbc11
authored
Jan 14, 2013
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 829709: Do not load CSS files from all skins by default
r=dkl a=LpSolit
parent
e0d91b4a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
67 deletions
+16
-67
Template.pm
Bugzilla/Template.pm
+8
-31
header.html.tmpl
template/en/default/global/header.html.tmpl
+8
-36
No files found.
Bugzilla/Template.pm
View file @
ce0bbc11
...
...
@@ -419,13 +419,10 @@ sub mtime_filter {
#
# 1. YUI CSS
# 2. Standard Bugzilla stylesheet set (persistent)
# 3. Standard Bugzilla stylesheet set (selectable)
# 4. All third-party "skin" stylesheet sets (selectable)
# 5. Page-specific styles
# 6. Custom Bugzilla stylesheet set (persistent)
#
# "Selectable" skin file sets may be either preferred or alternate.
# Exactly one is preferred, determined by the "skin" user preference.
# 3. Third-party "skin" stylesheet set, per user prefs (persistent)
# 4. Page-specific styles
# 5. Custom Bugzilla stylesheet set (persistent)
sub
css_files
{
my
(
$style_urls
,
$yui
,
$yui_css
)
=
@_
;
...
...
@@ -442,20 +439,12 @@ sub css_files {
my
@css_sets
=
map
{
_css_link_set
(
$_
)
}
@requested_css
;
my
%
by_type
=
(
standard
=>
[]
,
alternate
=>
{},
skin
=>
[]
,
custom
=>
[]
);
my
%
by_type
=
(
standard
=>
[]
,
skin
=>
[]
,
custom
=>
[]
);
foreach
my
$set
(
@css_sets
)
{
foreach
my
$key
(
keys
%
$set
)
{
if
(
$key
eq
'alternate'
)
{
foreach
my
$alternate_skin
(
keys
%
{
$set
->
{
alternate
}
})
{
my
$files
=
$by_type
{
alternate
}
->
{
$alternate_skin
}
||=
[]
;
push
(
@$files
,
$set
->
{
alternate
}
->
{
$alternate_skin
});
}
}
else
{
push
(
@
{
$by_type
{
$key
}
},
$set
->
{
$key
});
}
}
}
return
\%
by_type
;
}
...
...
@@ -471,24 +460,12 @@ sub _css_link_set {
return
\%
set
;
}
my
$skin
_user_prefs
=
Bugzilla
->
user
->
settings
->
{
skin
};
my
$skin
=
Bugzilla
->
user
->
settings
->
{
skin
}
->
{
value
};
my
$cgi_path
=
bz_locations
()
->
{
'cgi_path'
};
# If the DB is not accessible, user settings are not available.
my
$all_skins
=
$skin_user_prefs
?
$skin_user_prefs
->
legal_values
:
[]
;
my
%
skin_urls
;
foreach
my
$option
(
@$all_skins
)
{
next
if
$option
eq
'standard'
;
my
$skin_file_name
=
$file_name
;
$skin_file_name
=~
s{(^|/)skins/standard/}{skins/contrib/$optio
n/}
;
$skin_file_name
=~
s{(^|/)skins/standard/}{skins/contrib/$ski
n/}
;
if
(
my
$mtime
=
_mtime
(
"$cgi_path/$skin_file_name"
))
{
$skin_urls
{
$option
}
=
mtime_filter
(
$skin_file_name
,
$mtime
);
}
}
$set
{
alternate
}
=
\%
skin_urls
;
my
$skin
=
$skin_user_prefs
->
{
'value'
};
if
(
$skin
ne
'standard'
and
defined
$set
{
alternate
}
->
{
$skin
})
{
$set
{
skin
}
=
delete
$set
{
alternate
}
->
{
$skin
};
$set
{
skin
}
=
mtime_filter
(
$skin_file_name
,
$mtime
);
}
my
$custom_file_name
=
$file_name
;
...
...
template/en/default/global/header.html.tmpl
View file @
ce0bbc11
...
...
@@ -22,10 +22,6 @@
# atomlink: Atom link URL, May contain HTML
#%]
[% IF message %]
[% PROCESS global/messages.html.tmpl %]
[% END %]
[% DEFAULT
subheader = ""
header_addl_info = ""
...
...
@@ -95,12 +91,8 @@
[% SET yui = yui_resolve_deps(yui, yui_deps) %]
[% SET css_sets = css_files(style_urls, yui, yui_css) %]
[%# CSS cascade, part 1: Standard Bugzilla stylesheet set (persistent).
# Always present.
#%]
[%# This allows people to switch back to the "Classic" skin if they
# are in another skin.
#%]
[%# CSS cascade, parts 1
&
2: YUI
&
Standard Bugzilla stylesheet set (persistent).
# Always present. %]
<link
href=
"[% 'skins/standard/global.css' FILTER mtime FILTER html %]"
rel=
"alternate stylesheet"
title=
"[% setting_descs.standard FILTER html %]"
>
...
...
@@ -108,22 +100,12 @@
[% PROCESS format_css_link css_set_name = 'standard' %]
[% END %]
[%# CSS cascade, part 2
&
3: Third-party stylesheet set (selected and
# selectable). All third-party skins are present as alternate
# stylesheets, even if they are not currently in use.
#%]
[%# CSS cascade, part 3: Third-party stylesheet set, per user prefs. %]
[% FOREACH style_url = css_sets.skin %]
[% PROCESS format_css_link css_set_name = user.settings.skin.value %]
[% END %]
[% FOREACH alternate_skin = css_sets.alternate.keys %]
[% FOREACH style_url = css_sets.alternate.$alternate_skin %]
[% PROCESS format_css_link css_set_name = alternate_skin %]
[% END %]
[% END %]
[%# CSS cascade, part 4: page-specific styles.
#%]
[%# CSS cascade, part 4: page-specific styles. %]
[% IF style %]
<style
type=
"text/css"
>
[%
style
%]
...
...
@@ -296,7 +278,8 @@
[% END %]
[% IF message %]
<div
id=
"message"
>
[% message %]
</div>
[% PROCESS global/messages.html.tmpl %]
<div
id=
"message"
>
[% message %]
</div>
[% END %]
[% BLOCK format_css_link %]
...
...
@@ -308,26 +291,15 @@
#%]
[% END %]
[% IF css_set_name == 'standard'
OR css_set_name == user.settings.skin.value
%]
[% SET css_rel = 'stylesheet' %]
[% SET css_set_display_name = setting_descs.${user.settings.skin.value}
|| user.settings.skin.value %]
[% ELSE %]
[% SET css_rel = 'alternate stylesheet' %]
[% SET css_set_display_name = setting_descs.$css_set_name || css_set_name %]
[% END %]
[% IF css_set_name == 'standard' %]
[% SET css_title_link = '' %]
[% ELSE %]
[% css_title_link = BLOCK ~%]
title="[%
css_set_display_nam
e FILTER html %]"
title="[%
setting_descs.${user.settings.skin.value} || user.settings.skin.valu
e FILTER html %]"
[% END %]
[% END %]
<link href="[% style_url FILTER html %]" rel="
[% css_rel FILTER none %]
"
<link href="[% style_url FILTER html %]" rel="
stylesheet
"
type="text/css" [% css_title_link FILTER none %]>
[% '<![endif]-->
' IF style_url.match('/IE-fixes\.css') %]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment