Sat Nov 17 2012 02:32:27 GMT+0400 (Caucasus Standard Time) пользователь Roan 
Kattouw ([email protected]) написал:

On Tue, Nov 13, 2012 at 12:33 AM, Dmitriy Sintsov <[email protected]> wrote:
> However, 'skin.vector' module includes both styles and scripts. And
> setupSkinUserCss() adds styles only. So 'dependencies' did not help, vector
> styles are loaded later, anyway. What can I do with that?
>
Unfortunately, addModuleStyles() and dependencies don't work well
together. You shouldn't use dependencies for CSS that is essential for
rendering the page.

I figured that out. So I re-implemented screen.css from scratch, instead of 
overriding Vector's one.
At least I extend VectorTemplate, so I re-implemented only 
VectorTemplate::execute(), while
renderNavigation() and another helper methods were inherited.

But I cannot inherit from SkinVector, because SkinVector does:
$out->addModuleScripts( 'skins.vector' );
...
$out->addModuleStyles( 'skins.vector' );

Why can't SkinVector do:
$out->addModuleScripts( "skins.{$this->skinname}" );
...
$out->addModuleStyles( "skins.{$this->stylename}" );

so I do not have to copy / paste initPage() and  setupSkinUserCss(), only to 
define few short properties?
       var $skinname = 'artmuseum', $stylename = 'artmuseum',
            $template = 'ArtmuseumTemplate', $useHeadElement = true;

> Also, I need to load remote google webfonts. Does ResourceLoader support
> this or I have to use old-fashionated methods of OutputPage() ?
Unfortunately RL doesn't support this directly. Although to load a
webfont, all you need is a stylesheet with an @font-face in it, right?

Right. I can probably make local stylesheet with references to google cdn, 
however I am not sure it wil not violate IE security or something.
So I did:
               $out->addLink( array( "rel" => "stylesheet", "href" => 
"http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin,cyrillic,latin-ext";
) );
               $out->addLink( array( "rel" => "stylesheet", "href" => 
"http://fonts.googleapis.com/css?family=Open+Sans:400,600&subset=latin,cyrillic,latin-e
xt,cyrillic-ext,greek,greek-ext" ) );

in initPage().

I want to use google cdn, because it should be faster than my local hosting. 
Also, maybe there will be some improvements in fonts, I do not know.
What if they change their stylesheet's
url(http://themes.googleusercontent.com/static/fonts/ptsansnarrow/v3/UyYrYy3ltEffJV9QueSi4V77J2WsOmgW1CJPQ9ZetJo.woff)
 format('woff');
at some time?
Dmitriy

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to