home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2011 November
/
CHIP_2011_11.iso
/
Programy
/
Narzedzia
/
AIMP2
/
aimp_2.61.583.exe
/
$TEMP
/
YandexPackSetup.msi
/
fil469815FF3F72C0C9FDF7624E68BD3875
< prev
next >
Wrap
Extensible Markup Language
|
2010-07-12
|
3KB
|
103 lines
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE stylesheet SYSTEM "chrome://yasearch/locale/yasearch.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:data="urn:data"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
extension-element-prefixes="data"
>
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
<xsl:variable name="id" select="'yandex-menu'"/>
<xsl:variable name="domain" select="'.yandex.ru/'"/>
<xsl:variable name="images" select="'chrome://yasearch/skin/images/'"/>
<xsl:variable name="id-prefix" select="'yasearchMenuIdPrefix-'"/>
<xsl:template match="data:services">
<menu>
<xsl:apply-templates select="@*"/>
<menupopup>
<xsl:apply-templates select="data:group/data:service[@search-url]">
<xsl:sort select="@stat" order="descending" data-type="number"/>
</xsl:apply-templates>
<xsl:apply-templates select="data:group/data:complex[data:complex/data:service[@search-url] | data:service[@search-url]]"/>
</menupopup>
</menu>
</xsl:template>
<xsl:template match="data:complex">
<menu>
<xsl:apply-templates select="@*"/>
<menupopup>
<xsl:apply-templates select="data:complex | data:service | data:separator">
<xsl:sort select="@stat" order="descending" data-type="number"/>
</xsl:apply-templates>
</menupopup>
</menu>
</xsl:template>
<xsl:template match="data:separator">
<menuseparator/>
</xsl:template>
<xsl:template match="data:service">
<menuitem oncommand="Ya.search('{@id}', event);">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates />
</menuitem>
</xsl:template>
<xsl:template match="@*">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="@mode">
<xsl:if test="not(contains(.,$id))">
<xsl:attribute name="style">
<xsl:text>display: none !important;</xsl:text>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template match="@id">
<xsl:attribute name="id">
<xsl:value-of select="concat($id-prefix, .)"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="data:services/@id">
<xsl:attribute name="id">
<xsl:value-of select="concat($id-prefix, $id)"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="data:services/@image | data:complex/@image | data:group/@image">
<xsl:attribute name="class">
<xsl:text>menu-iconic</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="." mode="image"/>
</xsl:template>
<xsl:template match="data:service/@image">
<xsl:attribute name="class">
<xsl:text>menuitem-iconic</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="." mode="image"/>
</xsl:template>
<xsl:template match="@image" mode="image">
<xsl:attribute name="image">
<xsl:value-of select="concat($images, ., '.png')"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="@desc[. != '']">
<xsl:attribute name="tooltiptext">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="@desc | @service-timestamp | @search-url | @host | @https"/>
</xsl:stylesheet>