Skip to content

Commit cf0b42b

Browse files
committed
resizable table improvements
1 parent 0e8cf03 commit cf0b42b

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

resizer/plugin.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Resizer",
44
"description": "General-purpose resizer widget for TiddlyWiki5",
55
"author": "Simon Huber",
6-
"version": "0.4.9",
6+
"version": "0.4.10",
77
"core-version": ">=5.3.0",
88
"source": "https://github.com/BurningTreeC/resizer",
99
"plugin-type": "plugin",

resizer/styles.tid

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ body.tc-resizing .tc-edit-texteditor textarea {
754754
width: 8px;
755755
cursor: col-resize;
756756
z-index: 10;
757+
background-color: <<colour table-border>>;
758+
opacity: 0.25;
757759
}
758760

759761
/* =================================================================

resizer/ui/panels/panels.tid

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,18 @@ code-body: yes
590590
\end
591591

592592

593+
\function tf.get.row.map.header() [row.map<wikitextTable>,[tf.is.header]]
594+
\function tf.get.row.map.body() [row.map<wikitextTable>,[tf.exclude.header.caption.classes.footer]]
595+
\function tf.get.row.map.footer() [row.map<wikitextTable>,[tf.is.footer]]
596+
597+
598+
\function tf.is.last.cell()
599+
[<tableSection>match[thead]then<tf.get.row.map.header>split[ ]butfirst<colIndex>!match[0]count[]match[0]then[yes]else[no]]
600+
[<tableSection>match[tbody]then<tf.get.row.map.body>split[ ]butfirst<colIndex>!match[0]count[]match[0]then[yes]else[no]]
601+
[<tableSection>match[tfoot]then<tf.get.row.map.footer>split[ ]butfirst<colIndex>!match[0]count[]match[0]then[yes]else[no]]
602+
\end
603+
604+
593605
\procedure get-excel-column() <$transclude $variable="excel-column" index=<<colIndex>>/>
594606

595607

@@ -598,14 +610,15 @@ code-body: yes
598610
<%if [subfilter<sectionCondition>] %>
599611
<$genesis $type=<<tableSection>>>
600612
<$list filter="[range<sectionRows>]" variable="row" counter="rowIndex">
601-
<tr class={{{ tc-resizable-table-row [<sectionClasses>] [<rowIndex>remainder[2]match[1]then[evenRow]else[oddRow]] [<sectionClass>] :and[unique[]] +[join[ ]] }}}>
613+
<tr class={{{ tc-resizable-table-row [<sectionClasses>] [<rowIndex>remainder[2]match[1]then[evenRow]else[oddRow]] [<sectionClass>] :and[unique[]] :and[join[ ]] }}}>
602614
<$list filter="[range<columns>]" variable="column" counter="colIndex">
603615
<$let
604616
previousColIndex={{{ [<colIndex>subtract[1]] }}}
605617
nextColIndex={{{ [<colIndex>add[1]] }}}
606618
colspan={{{ [<wikitextTable>!is[blank]] :then[function<colspanFunction>] :else[[1]] }}}
607619
rowspan={{{ [<wikitextTable>!is[blank]] :then[function<rowspanFunction>] :else[[1]] }}}
608620
tableCell={{{ [tf.get.table.cell<tableCellFunction>] }}}
621+
isLastCell=<<tf.is.last.cell>>
609622
>
610623
<$wikify name="excelColumn" text=<<get-excel-column>>>
611624
<%if [<colspan>!match[0]then<rowspan>!match[0]] %>
@@ -624,7 +637,7 @@ code-body: yes
624637
<div class="tc-resizable-table-cell" style.width="100%">
625638
<$transclude $variable="resizable-table-content" filter=<<sectionFilter>> tableArea=<<tableSection>>/>
626639
</div>
627-
<%if [<colIndex>!match<columns>] %>
640+
<%if [<wikitextTable>is[blank]then<colIndex>!match<columns>] [<wikitextTable>!is[blank]then<isLastCell>!match[yes]] %>
628641
<$resizer
629642
class="tc-table-column-resizer"
630643
direction="horizontal"
@@ -663,13 +676,13 @@ code-body: yes
663676

664677
\function tf.data.tiddler.count.header.rows()
665678
[<dataTiddler>indexes[]prefix[head]]
666-
:map[<currentTiddler>split[ ]nth[2]]
679+
:map[<currentTiddler>split[ ]nth[3]]
667680
:and[unique[]count[]]
668681
\end
669682

670683
\function tf.data.tiddler.count.footer.rows()
671684
[<dataTiddler>indexes[]prefix[foot]]
672-
:map[<currentTiddler>split[ ]nth[2]]
685+
:map[<currentTiddler>split[ ]nth[3]]
673686
:and[unique[]count[]]
674687
\end
675688

0 commit comments

Comments
 (0)