diff options
author | Shaun McCance <shaunm@gnome.org> | 2017-05-22 13:10:02 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2017-05-22 13:10:24 -0400 |
commit | 999918bf1dac553fb91c72920fea9682efad6f81 (patch) | |
tree | 8991ce1f3a7b51a1857089ec2d9af2e6d98081c0 | |
parent | 545807e5c0016b463a700ceccfc612f050aeb569 (diff) | |
download | yelp-xsl-wip/html5.tar.gz |
Removing old faceted navigation experimentwip/html5
-rw-r--r-- | doc/yelp-xsl/Makefile.am | 2 | ||||
-rw-r--r-- | xslt/mallard/html/Makefile.am | 1 | ||||
-rw-r--r-- | xslt/mallard/html/mal2html-facets.xsl | 172 | ||||
-rw-r--r-- | xslt/mallard/html/mal2html-page.xsl | 33 | ||||
-rw-r--r-- | xslt/mallard/html/mal2xhtml.xsl | 1 |
5 files changed, 1 insertions, 208 deletions
diff --git a/doc/yelp-xsl/Makefile.am b/doc/yelp-xsl/Makefile.am index 9a3863ee..3dd0b55a 100644 --- a/doc/yelp-xsl/Makefile.am +++ b/doc/yelp-xsl/Makefile.am @@ -41,7 +41,7 @@ endif .PHONY: xsldoc-clean clean-local: xsldoc-clean xsldoc-clean: - rm -f $(xsldoc_pages) C/*.*.page C/index.cache + rm -f $(xsldoc_pages) C/*.*.page C/*-*.page C/index.cache EXTRA_DIST = \ mal2cache \ diff --git a/xslt/mallard/html/Makefile.am b/xslt/mallard/html/Makefile.am index af120658..50490123 100644 --- a/xslt/mallard/html/Makefile.am +++ b/xslt/mallard/html/Makefile.am @@ -3,7 +3,6 @@ xsldir=$(datadir)/yelp-xsl/xslt/mallard/html xsl_DATA = \ mal2html-api.xsl \ mal2html-block.xsl \ - mal2html-facets.xsl \ mal2html-gloss.xsl \ mal2html-inline.xsl \ mal2html-links.xsl \ diff --git a/xslt/mallard/html/mal2html-facets.xsl b/xslt/mallard/html/mal2html-facets.xsl deleted file mode 100644 index f86729bc..00000000 --- a/xslt/mallard/html/mal2html-facets.xsl +++ /dev/null @@ -1,172 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> -<!-- -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; see the file COPYING.LGPL. If not, see <http://www.gnu.org/licenses/>. ---> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:mal="http://projectmallard.org/1.0/" - xmlns:cache="http://projectmallard.org/cache/1.0/" - xmlns:facet="http://projectmallard.org/facet/1.0/" - xmlns:exsl="http://exslt.org/common" - xmlns:str="http://exslt.org/strings" - xmlns="http://www.w3.org/1999/xhtml" - exclude-result-prefixes="mal cache facet exsl str" - version="1.0"> - -<!--!!========================================================================== -Mallard to HTML - Facets -Support the Mallard Facets extension. - -This stylesheet contains templates and supporting JavaScript for the Mallard -Facets extension. ---> - -<!--**========================================================================== -mal2html.facets.controls -Output the controls to filter faceted links. -$node: The facets #{page} or #{section} to generate controls for. - -REMARK: Describe this template ---> -<xsl:template name="mal2html.facets.controls"> - <xsl:param name="node" select="."/> - <xsl:variable name="choices" select="$node/mal:info/facet:choice"/> - <xsl:if test="count($choices) > 0"> - <div class="facets"> - <xsl:for-each select="$choices"> - <div class="facet"> - <div class="title"> - <xsl:apply-templates mode="mal2html.inline.mode" select="facet:title/node()"/> - </div> - <ul> - <xsl:for-each select="facet:case"> - <li> - <label> - <input type="checkbox" checked="checked" class="facet"> - <xsl:attribute name="data-facet-key"> - <xsl:value-of select="../@key"/> - </xsl:attribute> - <xsl:attribute name="data-facet-values"> - <xsl:value-of select="@values"/> - </xsl:attribute> - </input> - <xsl:text> </xsl:text> - <span> - <xsl:apply-templates mode="mal2html.inline.mode"/> - </span> - </label> - </li> - </xsl:for-each> - </ul> - </div> - </xsl:for-each> - </div> - </xsl:if> -</xsl:template> - - -<!--**========================================================================== -mal2html.facets.links -Output the links for a facets node. -:Revision:version="1.0" date="2010-12-16" status="final" -$node: The facets #{page} or #{section} element to generate links for. - -This template outputs links for a facets node. It gets the links from -*{mal.link.facetlinks}, sorts them, and outputs HTML #{a} elements for each -link. Each #{a} element has data attribute for each facet tag in ${node} in -the form of #{data-facet-KEY="VALUES"}, where #{KEY} is the key of the facet -tag and VALUES is the values. ---> -<xsl:template name="mal2html.facets.links"> - <xsl:param name="node" select="."/> - <xsl:variable name="facetlinks"> - <xsl:call-template name="mal.link.facetlinks"> - <xsl:with-param name="node" select="$node"/> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="links"> - <xsl:for-each select="exsl:node-set($facetlinks)/mal:link"> - <xsl:copy> - <xsl:copy-of select="@*"/> - <xsl:attribute name="class"> - <xsl:value-of select="'facet-link'"/> - </xsl:attribute> - <xsl:for-each select="facet:tag"> - <xsl:attribute name="data-facet-{@key}"> - <xsl:value-of select="@values"/> - </xsl:attribute> - </xsl:for-each> - </xsl:copy> - </xsl:for-each> - </xsl:variable> - <xsl:call-template name="mal2html.links.links"> - <xsl:with-param name="node" select="($node | $node/mal:links[@type='facet'])[last()]"/> - <xsl:with-param name="links" select="exsl:node-set($links)/mal:link"/> - <xsl:with-param name="role" select="'facet'"/> - <xsl:with-param name="divs" select="true()"/> - </xsl:call-template> -</xsl:template> - - -<!--**========================================================================== -mal2html.facets.js - -REMARK: FIXME ---> -<xsl:template name="mal2html.facets.js"> -<xsl:text><![CDATA[ -$(document).ready(function () { - $('input.facet').change(function () { - var control = $(this); - var content = control.closest('div.body,div.sect'); - content.find('.facet-link').each(function () { - var link = $(this); - var facets = link.parents('div.body,div.sect').children('div.region').children('div.contents').children('div.facets').children('div.facet'); - var visible = true; - for (var i = 0; i < facets.length; i++) { - var facet = facets.slice(i, i + 1); - var facetvis = false; - var inputs = facet.find('input.facet:checked'); - for (var j = 0; j < inputs.length; j++) { - var input = inputs.slice(j, j + 1); - var inputvis = false; - var key = input.attr('data-facet-key'); - var values = input.attr('data-facet-values').split(' '); - for (var k = 0; k < values.length; k++) { - if (link.is('*[data-facet-' + key + ' ~= "' + values[k] + '"]')) { - inputvis = true; - break; - } - } - if (inputvis) { - facetvis = true; - break; - } - } - if (!facetvis) { - visible = false; - break; - } - } - if (!visible) - link.hide('fast'); - else - link.show('fast'); - }); - }); -}); -]]></xsl:text> -</xsl:template> - -</xsl:stylesheet> diff --git a/xslt/mallard/html/mal2html-page.xsl b/xslt/mallard/html/mal2html-page.xsl index 8c70a3a1..5639a829 100644 --- a/xslt/mallard/html/mal2html-page.xsl +++ b/xslt/mallard/html/mal2html-page.xsl @@ -663,9 +663,6 @@ templates that handle #{page} and #{section} elements. </div> <div class="region"> <div class="contents pagewide"> - <xsl:if test="$type = 'facets'"> - <xsl:call-template name="mal2html.facets.controls"/> - </xsl:if> <xsl:call-template name="html.content.pre"> <xsl:with-param name="page" select="boolean(self::mal:page)"/> </xsl:call-template> @@ -714,9 +711,6 @@ templates that handle #{page} and #{section} elements. <xsl:if test="$type = 'gloss:glossary'"> <xsl:call-template name="mal2html.gloss.terms"/> </xsl:if> - <xsl:if test="$type = 'facets'"> - <xsl:call-template name="mal2html.facets.links"/> - </xsl:if> <xsl:call-template name="html.content.post"> <xsl:with-param name="page" select="boolean(self::mal:page)"/> </xsl:call-template> @@ -1282,32 +1276,6 @@ span.hi { <xsl:value-of select="$color.bg.yellow"/><xsl:text>; } -<!-- FIXME --> -div.facets { - display: inline-block; - padding: 6px; - background-color: </xsl:text> - <xsl:value-of select="$color.bg.yellow"/><xsl:text>; - border: solid 1px </xsl:text> - <xsl:value-of select="$color.blue"/><xsl:text>; -} -div.facet { - vertical-align: top; - display: inline-block; - margin-top: 0; - margin-bottom: 1em; - margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 1em; -} -div.facet div.title { margin: 0; } -div.facet li { - margin: 0; padding: 0; - list-style-type: none; -} -div.facet input { - vertical-align: middle; - margin: 0; -} - <!-- experimental/gloss --> dt.gloss-term { margin-top: 1.2em; @@ -1420,7 +1388,6 @@ span.status-stub, span.status-draft, span.status-incomplete, span.status-outdate <!--%# html.js.mode --> <xsl:template mode="html.js.mode" match="mal:page"> - <xsl:call-template name="mal2html.facets.js"/> <xsl:text><![CDATA[ document.addEventListener('DOMContentLoaded', function() { var overlays = document.querySelectorAll('a.ui-overlay'); diff --git a/xslt/mallard/html/mal2xhtml.xsl b/xslt/mallard/html/mal2xhtml.xsl index 297939b0..3930afcd 100644 --- a/xslt/mallard/html/mal2xhtml.xsl +++ b/xslt/mallard/html/mal2xhtml.xsl @@ -63,7 +63,6 @@ mallard:1.0 <xsl:include href="mal2html-api.xsl"/> <xsl:include href="mal2html-block.xsl"/> -<xsl:include href="mal2html-facets.xsl"/> <xsl:include href="mal2html-gloss.xsl"/> <xsl:include href="mal2html-inline.xsl"/> <xsl:include href="mal2html-links.xsl"/> |