Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/delibero.git

Revised CSS to be utf-8; resolved CSS dependencies; updated to Miller Columns with event hooks.

AuthorDave Jarvis <email>
Date2014-12-31 04:42:02 GMT-0800
Commit01af9c599c2d20480d69910108fa5f4642c0fe8e
Parent94e6d5b
xml/css/account.css
+@charset "utf-8";
+
@import url( "css/related.css" );
@import url( "css/xref.css" );
xml/css/common.css
+@charset "utf-8";
+
@import url( 'reset.min.css' );
xml/css/discuss.css
+@charset "utf-8";
+
@import url( "css/related.css" );
@import url( "css/xref.css" );
xml/css/edit-discuss-flag.css
+@charset "utf-8";
+
@import url( "related.css" );
xml/css/hypothesis.css
+@charset "utf-8";
+
@import url( "css/edit-discuss-flag.css" );
@import url( "css/xref.css" );
xml/css/index.css
+@charset "utf-8";
+
.policy {
display: flex;
xml/css/legend.css
+@charset "utf-8";
+
/**
* Decorates the tabular data for the pie chart values.
xml/css/parts.css
+@charset "utf-8";
+
.part > .title, .section > .title {
margin-top: 0.75em;
xml/css/policy.css
+@charset "utf-8";
+
+.policy {
+ padding-bottom: 0.5em;
+ border-bottom: 1px solid black;
+}
+
+.title {
+ border-bottom: 1px solid black;
+}
+
+.paragraph {
+ padding-top: 0.5em;
+ line-height: 120%;
+}
+
xml/css/proposal.css
+@charset "utf-8";
+
@import url( "css/edit-discuss-flag.css" );
@import url( "css/xref.css" );
xml/css/related.css
+@charset "utf-8";
+
.related {
display: flex;
xml/css/resources.css
+@charset "utf-8";
+
@import url( "css/edit-discuss-flag.css" );
@import url( "css/xref.css" );
xml/css/summary.css
+@charset "utf-8";
+
@import url( "css/related.css" );
@import url( "css/xref.css" );
xml/css/support.css
+@charset "utf-8";
+@import url( "css/policy.css" );
@import url( "css/edit-discuss-flag.css" );
@import url( "css/xref.css" );
@import url( "css/votes.css" );
-
-.policy {
- padding-bottom: 0.5em;
- border-bottom: 1px solid black;
-}
.implications::before {
font-family: 'Montserrat', Helvetica, sans-serif;
font-weight: bold;
-}
-
-.title {
- border-bottom: 1px solid black;
}
.support {
display: table;
-}
-
-.paragraph {
- padding-top: 0.5em;
- line-height: 120%;
}
xml/css/tags.css
@charset "utf-8";
-@import url( "css/support.css" );
+@import url( "css/policy.css" );
+@import url( "css/xref.css" );
div#container {
clear: both;
border-top: 1px solid #666;
-}
-div.toolbar:after {
- font-size: 0.8em;
- content: "new | edit | delete | flag";
- height: 1.25em;
- line-height: 1.25em;
- float: right;
padding-right: 1em;
+
+ text-align: right;
+ font-size: 0.8em;
}
/**
*
* Breadcrumb and toolbar styling.
*
*/
div.breadcrumb, div.toolbar {
- height: 1.25em;
+ padding-top: 0;
+ height: 1.75em;
+ line-height: 1.75em;
+
background: linear-gradient(#f0f0f0, #d8d8d8);
}
xml/css/tour.css
+@charset "utf-8";
+
a {
text-decoration: none;
xml/css/votes.css
+@charset "utf-8";
+
.votes {
display: flex;
xml/css/xref.css
+@charset "utf-8";
+
a {
text-decoration: none;
xml/js/columns.js
-(function( $ ) {
- $.fn.millerColumns = function() {
+;(function( $, window, document, undefined ) {
+ var settings;
+
+ $.fn.millerColumns = function( options ) {
+ var defaults = {
+ selection: function( $item ) {},
+ breadcrumb: $.fn.millerColumns.breadcrumb,
+ animation: $.fn.millerColumns.animation,
+ delay: 500
+ };
+
+ settings = $.extend( defaults, options );
+
return this.each( function() {
var $columns = $(this);
- $columns.before( $("<div/>").addClass( "breadcrumb" ) );
- $columns.after( $("<div/>").addClass( "toolbar" ) );
- unnest( $columns );
- collapse();
+ $.fn.millerColumns.unnest( $columns );
+ $.fn.millerColumns.collapse();
// Expand the requested child node on click.
$columns.find( "li" ).on( "click", function() {
- collapse();
+ $.fn.millerColumns.collapse();
$(".selected").removeClass( "selected" );
$ancestor = $ancestor.data( "ancestor" );
}
-
- breadcrumb();
- // Ensure the viewport shows the entire newly expanded item.
- $columns.animate( { scrollLeft: $(this).offset().left }, 500 );
+ settings.animation.call( this, $columns, $(this) );
+ settings.breadcrumb.call( this );
+ settings.selection.call( this, $(this) );
});
});
}
- /** Determine the breadcrumb path via the selected items. */
- function breadcrumb() {
+ /** Ensure the viewport shows the entire newly expanded item. */
+ $.fn.millerColumns.animation = function( $columns, $column ) {
+ $columns.animate( { scrollLeft: $column.offset().left }, settings.delay );
+ }
+
+ /** Add the breadcrumb path using the chain of selected items. */
+ $.fn.millerColumns.breadcrumb = function() {
var $breadcrumb = $("div.breadcrumb").empty();
- // Add the breadcrumb trail.
$("li.selected").each( function( _, crumb ) {
$("<span/>").text( $(crumb).text().trim() ).appendTo( $breadcrumb );
});
}
/** Convert nested lists into columns using breadth-first traversal. */
- function unnest( $columns ) {
+ $.fn.millerColumns.unnest = function( $columns ) {
var queue = [];
/** Hide all columns, except the first. */
- function collapse() {
+ $.fn.millerColumns.collapse = function() {
$(".column:gt(0)").addClass( "collapse" );
}
xml/js/tags.js
$(document).ready( function() {
$.getScript( "js/columns.js", function() {
- $("div.columns").millerColumns();
+ $("div.columns").millerColumns({
+ selection: function( $item ) {
+ console.log( $item.attr( "id" ) );
+ }
+ });
});
});
xml/tags.xsl
<xsl:template match="taglist" priority="1">
<div id="container">
+ <div class="breadcrumb"></div>
<div class="columns">
<ul>
<xsl:apply-templates mode="tag"/>
</ul>
+ </div>
+ <div class="toolbar">
+ <a href="do.xhtml?action=tag&amp;command=new">New</a> |
+ <a href="do.xhtml?action=tag&amp;command=edit">Edit</a> |
+ <a href="do.xhtml?action=tag&amp;command=delete">Delete</a> |
+ <a href="do.xhtml?action=tag&amp;command=flag">Flag</a>
</div>
</div>
Delta97 lines added, 40 lines removed, 57-line increase