[Phpmyadmin-devel] best approach about jQuery dialogs' title bar?
Rouslan Placella
rouslan at placella.com
Fri Oct 21 12:31:29 CEST 2011
On Fri, 2011-10-21 at 12:21 +0200, Piotr Przybylski wrote:
> 2011/10/21 Rouslan Placella <rouslan at placella.com>:
> > On Fri, 2011-10-21 at 12:01 +0200, Piotr Przybylski wrote:
> >> 2011/10/21 Marc Delisle <marc at infomarc.info>:
> >> > Le 2011-10-19 08:53, Piotr Przybylski a écrit :
> >> >> 2011/10/19 Marc Delisle<marc at infomarc.info>:
> >> >>> Hi,
> >> >>>
> >> >>> Tyron Madlener suggested to get rid of the title bar in the create table
> >> >>> dialog.
> >> >>>
> >> >>> I've come up with this patch (done here just for pmahomme):
> >> > (snip)
> >> >>> Questions:
> >> >>>
> >> >>> 1. What do you think of this patch?
> >> >>>
> >> >>> 2. Should we instead remove the title bar for all our jQuery dialogs?
> >> >>>
> >> >>> P.S. We'll need to be extra careful when updating the jquery ui, by
> >> >>> reinserting phpMyAdmin's customizations under themes.
> >> >>
> >> >> I don't like adding CSS rules to jquery-ui-1.8.16.custom.css. IMO we
> >> >> should do this in theme's CSS or a separate file. Or at the bottom of
> >> >> jquery-ui-1.8.16.custom.css, in a commented section - then future
> >> >> updates of jQuery UI will be simple. Right now it requires to check
> >> >> what changes were done since last update and apply them to new
> >> >> version.
> >> >>
> >> >
> >> > Piotr,
> >> > about using a separate file, look at commit
> >> > b857e9580757a84132fc8ccd820a549115af7e2d by Michal, and his comment:
> >> > "Avoid using overrides for jquery CSS. It is better to modify the style
> >> > itself instead of including another tiny file with changes."
> >> >
> >> > In this commit, Michal removed an override file made by Rouslan in
> >> > commit 70c70db1392e703346434e65d59110a6ba321367.
> >> >
> >>
> >> Ok, then let's add our styles and overrides in
> >> jquery-ui-1.8.16.custom.css, in some commented section at the botom of
> >> this file.
> >>
> >
> > If the problem is just the extra http request for a tiny override file,
> > then why don't we just concatenate the two css files dynamically? E.g.:
> >
> > <?php
> > // file: jquery-ui.css.php
> > header('Content-Type: text/css; charset=UTF-8');
> > header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
> > require 'jquery-ui-1.8.16.custom.css';
> > echo "\n";
> > @include 'jquery-ui-1.8.16.overrides.css';
> > ?>
>
> It doesn't concatenate, it just adds CSS @include, which will fire a
> http request. It's better to 'include' override in phpmyadmin.css,
> which already serves our CSS.
You're thinking about the CSS @import rule, which will fire the extra
request. Let me re-write the above snippet (same functionality):
<?php
// file: jquery-ui.css.php
header('Content-Type: text/css; charset=UTF-8');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
echo file_get_contents('jquery-ui-1.8.16.custom.css') . "\n";
$override = 'jquery-ui-1.8.16.overrides.css';
if (is_readable($override)) {
echo file_get_contents($override);
}
?>
More information about the Developers
mailing list