DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:oddeven

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:oddeven [2023-04-04 14:14] 212.201.117.6plugin:oddeven [2024-04-22 10:21] (current) 212.201.117.6
Line 1: Line 1:
 ====== OddEven Plugin ====== ====== OddEven Plugin ======
 ---- plugin ---- ---- plugin ----
-description: Paints table rows background to alternating colour stripes.+description: Paints table rows background to alternating colour stripes
 author     : Vladimir Uryvaev author     : Vladimir Uryvaev
 email      : az@vovanium.ru email      : az@vovanium.ru
 type       : action type       : action
 lastupdate : 2009-03-24 lastupdate : 2009-03-24
-compatible : Elenor of Tsort, !Igor+compatible : !Kaos, Elenor of Tsort, !Igor
 depends    :  depends    : 
 conflicts  conflicts 
Line 15: Line 15:
 ---- ----
  
-===== Download and Installation =====+===== DownloadInstallation, License =====
  
-Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
   * http://vovanium.ru/_media/set/oddeven.tgz   * http://vovanium.ru/_media/set/oddeven.tgz
Line 25: Line 25:
 ===== Syntax ===== ===== Syntax =====
  
-No syntax required. Once the plugin is installed, the background of ALL tables in your Dokuwiki  will have alternating (odd) rows colored light grey.+No syntax required. Once the plugin is installed, the background of ALL tables in your DokuWiki will have alternating (odd) rows colored light grey.
  
-However, you can modify the color of the rows OR change the alternation from odd to even by modifying the style.css file included in the download (see below).+However, you can modify the color of the rows OR change the alternation from odd to even by modifying the ''style.css'' file included in the download (see below).
  
 ===== Plugin internals ===== ===== Plugin internals =====
Line 37: Line 37:
   - //style.css// -- stylesheet.   - //style.css// -- stylesheet.
  
-As plugin run, is registers RENDERER_CONTENT_POSTPROCESS action hook called 'oddeven'. When hook is called, it adds class 'roweven' to 'td' tags having class 'row0', 'row2' etc. and 'rowodd' for 'row1', 'row3' etc. using regexp replacement. Stylesheet defines class 'roweven' to have lightgray background color.+As plugin run, is registers ''RENDERER_CONTENT_POSTPROCESS'' action hook called 'oddeven'. When hook is called, it adds class 'roweven' to 'td' tags having class 'row0', 'row2' etc. and 'rowodd' for 'row1', 'row3' etc. using regexp replacement. Stylesheet defines class 'roweven' to have lightgray background color.
  
 ===== Discussion ===== ===== Discussion =====
  
-This plugin was not functioning anymore. I fixed the code, so it works again (in Igor). Just update the code in action.php like so: (and change the color to your liking in style.css)+This plugin was not functioning anymore. I fixed the code, so it works again (in "[[changes#release_2022-07-31a_igor|Igor]]"). Download, unpack the plugin directory ''/oddeven'' to your harddrive, update the code in ''action.php'' like so: 
  
-<code>+<code php>
 <?php <?php
 /** /**
Line 93: Line 93:
 ?> ?>
 </code> </code>
---- [[user>Chris75|Chris75]] //2022-11-18 12:25//+ 
 +And replace all code in style.css by the following two lines: 
 + 
 +<code css> 
 +table tr:nth-child(odd) { background-color: #f0ede6; } 
 +div.wrap_skip_css tr { background-color: white; } 
 +</code> 
 + 
 +... to make it compatible with modern javascript filtering and sorting ([[sortablejs]], [[datatable]], [[struct]]). Adjust the color to your liking (optional). Now, archive the directory ''/oddeven'' back to a zip file. Finally, install the plugin through the plugin manager from your harddrive (manual installation) and select the ''oddeven.zip'' file. 
 + 
 +Now, you can even exclude individual tables from the zebra coloring using the [[wrap|wrap plugin]] with following syntax on your wiki page: 
 + 
 +<code> 
 +<WRAP skip_css> 
 +... your table here 
 +</WRAP> 
 +<WRAP clear/> 
 +</code> 
 +    
 +**Note:** If using ''<sortable>'' and ''<WRAP skip_css>'' on the same table make sure, ''<sortable>'' is the outer wrap and ''<WRAP skip_css>'' is the inner wrap. It then works in harmony. 
 + 
 +--- [[user>Chris75|Chris75]] //2023-04-04// 
plugin/oddeven.1680610499.txt.gz · Last modified: 2023-04-04 14:14 by 212.201.117.6

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki