From f9165d0f0b8c688c04ba97b9e240869867f483e2 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 12 Oct 2012 10:12:27 +0100 Subject: More tidying for visuals --- http-assets/table.js | 1002 +++++++++++++++++++++++++++++++++++++++++++++++++ http-assets/trove.css | 77 ++++ 2 files changed, 1079 insertions(+) create mode 100644 http-assets/table.js (limited to 'http-assets') diff --git a/http-assets/table.js b/http-assets/table.js new file mode 100644 index 0000000..e1e5d5d --- /dev/null +++ b/http-assets/table.js @@ -0,0 +1,1002 @@ +/** + * Copyright (c)2005-2009 Matt Kruse (javascripttoolbox.com) + * + * Dual licensed under the MIT and GPL licenses. + * This basically means you can use this code however you want for + * free, but don't claim to have written it yourself! + * Donations always accepted: http://www.JavascriptToolbox.com/donate/ + * + * Please do not link to the .js files on javascripttoolbox.com from + * your site. Copy the files locally to your server instead. + * + */ +/** + * Table.js + * Functions for interactive Tables + * + * Copyright (c) 2007 Matt Kruse (javascripttoolbox.com) + * Dual licensed under the MIT and GPL licenses. + * + * @version 0.981 + * + * @history 0.981 2007-03-19 Added Sort.numeric_comma, additional date parsing formats + * @history 0.980 2007-03-18 Release new BETA release pending some testing. Todo: Additional docs, examples, plus jQuery plugin. + * @history 0.959 2007-03-05 Added more "auto" functionality, couple bug fixes + * @history 0.958 2007-02-28 Added auto functionality based on class names + * @history 0.957 2007-02-21 Speed increases, more code cleanup, added Auto Sort functionality + * @history 0.956 2007-02-16 Cleaned up the code and added Auto Filter functionality. + * @history 0.950 2006-11-15 First BETA release. + * + * @todo Add more date format parsers + * @todo Add style classes to colgroup tags after sorting/filtering in case the user wants to highlight the whole column + * @todo Correct for colspans in data rows (this may slow it down) + * @todo Fix for IE losing form control values after sort? + */ + +/** + * Sort Functions + */ +var Sort = (function(){ + var sort = {}; + // Default alpha-numeric sort + // -------------------------- + sort.alphanumeric = function(a,b) { + return (a==b)?0:(a0) { + var rows = section.rows; + for (var j=0,L2=rows.length; j0) { + var cells = row.cells; + for (var k=0,L3=cells.length; k1 && cells[cells.length-1].cellIndex>0) { + // Define the new function, overwrite the one we're running now, and then run the new one + (this.getCellIndex = function(td) { + return td.cellIndex; + })(td); + } + // Safari will always go through this slower block every time. Oh well. + for (var i=0,L=cells.length; i=0 && node.options) { + // Sort select elements by the visible text + return node.options[node.selectedIndex].text; + } + return ""; + }, + 'IMG':function(node) { + return node.name || ""; + } + }; + + /** + * Get the text value of a cell. Only use innerText if explicitly told to, because + * otherwise we want to be able to handle sorting on inputs and other types + */ + table.getCellValue = function(td,useInnerText) { + if (useInnerText && def(td.innerText)) { + return td.innerText; + } + if (!td.childNodes) { + return ""; + } + var childNodes=td.childNodes; + var ret = ""; + for (var i=0,L=childNodes.length; i-1) { + filters={ 'filter':filters.options[filters.selectedIndex].value }; + } + // Also allow for a regular input + if (filters.nodeName=="INPUT" && filters.type=="text") { + filters={ 'filter':"/^"+filters.value+"/" }; + } + // Force filters to be an array + if (typeof(filters)=="object" && !filters.length) { + filters = [filters]; + } + + // Convert regular expression strings to RegExp objects and function strings to function objects + for (var i=0,L=filters.length; ipageend) { + hideRow = true; + } + } + } + + row.style.display = hideRow?"none":""; + } + } + + if (def(page)) { + // Check to see if filtering has put us past the requested page index. If it has, + // then go back to the last page and show it. + if (pagestart>=unfilteredrowcount) { + pagestart = unfilteredrowcount-(unfilteredrowcount%pagesize); + tdata.page = page = pagestart/pagesize; + for (var i=pagestart,L=unfilteredrows.length; i0) { + if (typeof(args.insert)=="function") { + func.insert(cell,colValues); + } + else { + var sel = ''; + cell.innerHTML += "
"+sel; + } + } + } + }); + if (val = classValue(t,table.FilteredRowcountPrefix)) { + tdata.container_filtered_count = document.getElementById(val); + } + if (val = classValue(t,table.RowcountPrefix)) { + tdata.container_all_count = document.getElementById(val); + } + }; + + /** + * Attach the auto event so it happens on load. + * use jQuery's ready() function if available + */ + if (typeof(jQuery)!="undefined") { + jQuery(table.auto); + } + else if (window.addEventListener) { + window.addEventListener( "load", table.auto, false ); + } + else if (window.attachEvent) { + window.attachEvent( "onload", table.auto ); + } + + return table; +})(); diff --git a/http-assets/trove.css b/http-assets/trove.css index b097f1b..d8d4379 100644 --- a/http-assets/trove.css +++ b/http-assets/trove.css @@ -50,3 +50,80 @@ div#cgit table#header td.main > a:first-child { color: #adc81c !important; } +/* lorry-controller */ + +div.lorrycontroller { + background-color: white; +} + +div.lorrycontroller table { + border-collapse: collapse; +} + +div.lorrycontroller table#header { + width: 100%; +} + +div.lorrycontroller table#header td.logo { + width: 96px; +} + +div.lorrycontroller table#header td.main { + font-size: 250%; + white-space: nowrap; +} + +div.lorrycontroller table.steps span { + padding-left: 1em; + padding-right: 1em; + margin-left: 0.5em; + margin-right: 0.5em; +} + +div.lorrycontroller table.steps span.donestep { + background-color: #c5c8b4 !important; +} + +div.lorrycontroller table.steps span.pendingstep { + color: #ccc; +} + +div.lorrycontroller table.steps span.activestep { + background-color: #adc81c !important; +} + +div.lorrycontroller table.steps { + border-bottom: solid 3px #adc81c !important; + width: 100%; + margin-top: 2em; + margin-bottom: 0px; + border-collapse: collapse; +} + +div.lorrycontroller table.steps td { + padding: 0px; +} + +div.lorrycontroller div#troves, div.lorrycontroller div#lorries { + margin: 1em; +} + +div#troves table, div#lorries table { + border: 3px solid #adc81c; + border-collapse: collapse; +} + +div#troves table tr, div#lorries table tr { + border: 1px solid #adc81c; +} + +div#troves table th, div#lorries table th { + border: 2px solid #adc81c; +} + +div#troves table td, div#lorries table td { + border: 2px solid #adc81c; + padding-left: 0.5em; + padding-right: 0.5em; +} + -- cgit v1.2.1