https://wiki.london.hackspace.org.uk/w/index.php?title=Widget:PledgeTracker&action=history&feed=atom&&feed=atom&
Widget:PledgeTracker - Revision history
2024-03-29T05:43:10Z
Revision history for this page on the wiki
MediaWiki 1.35.5
https://wiki.london.hackspace.org.uk/w/index.php?title=Widget:PledgeTracker&diff=43874&oldid=prev
Naxxfish at 15:51, 13 November 2014
2014-11-13T15:51:54Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:51, 13 November 2014</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><noinclude></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><noinclude></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">```MERCILOUSLY STOLEN FROM NOTTINGHACK``` </del>https://wiki.nottinghack.org.uk/wiki/Widget:PledgeTracker</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">'''[</ins>https://wiki.nottinghack.org.uk/wiki/Widget:PledgeTracker <ins class="diffchange diffchange-inline">MERCILOUSLY STOLEN FROM NOTTINGHACK]''' </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This widget tracks the current amount pledged and collected for a pledge drive on a wiki page which makes use of table with specific columns.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This widget tracks the current amount pledged and collected for a pledge drive on a wiki page which makes use of table with specific columns.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Naxxfish
https://wiki.london.hackspace.org.uk/w/index.php?title=Widget:PledgeTracker&diff=43873&oldid=prev
Naxxfish: Created page with "<noinclude> ```MERCILOUSLY STOLEN FROM NOTTINGHACK``` https://wiki.nottinghack.org.uk/wiki/Widget:PledgeTracker This widget tracks the current amount pledged and collected fo..."
2014-11-13T15:51:24Z
<p>Created page with "<noinclude> ```MERCILOUSLY STOLEN FROM NOTTINGHACK``` https://wiki.nottinghack.org.uk/wiki/Widget:PledgeTracker This widget tracks the current amount pledged and collected fo..."</p>
<p><b>New page</b></p><div><noinclude><br />
<br />
```MERCILOUSLY STOLEN FROM NOTTINGHACK``` https://wiki.nottinghack.org.uk/wiki/Widget:PledgeTracker<br />
This widget tracks the current amount pledged and collected for a pledge drive on a wiki page which makes use of table with specific columns.<br />
<br />
== Using this widget ==<br />
You can insert a pledge tracker with the following wiki code:<br />
<br />
<nowiki>{{#widget:PledgeTracker|tableIndex=0|pledgeGoal=100|pledgeAmountColumn=1|pledgePaidColumn=2}}</nowiki><br />
<br />
=== Parameters ===<br />
;tableIndex<br />
:The index of the table on the page containing the pledges (0 = the first table). Default: <code>0</code><br />
<br />
;pledgeGoal<br />
:The goal amount for the pledge drive. Default: <code>0</code><br />
<br />
;pledgeAmountColumn<br />
:The index of the column within the pledges table which contains the pledge amount (0 = the first column). Default: <code>1</code><br />
<br />
;pledgePaidColumn<br />
:The index of the column within the table which indicates if the pledge amount has been paid (0 = the first column). If the column contains 'yes' or 'y' (case insensitive) then the pledge amount is considered to have been paid, any other content is considered as not paid. Default: <code>2</code><br />
<br />
== Example ==<br />
<nowiki>{{#widget:PledgeTracker|pledgeGoal=100}}</nowiki><br />
<br />
{| class="wikitable"<br />
|-<br />
! Who<br />
! Amount<br />
! Paid?<br />
! Method Paid<br />
|-<br />
| Alice || £30 || Yes || BACS<br />
|-<br />
| Bob || £50 || Yes || CASH<br />
|-<br />
| Carol || £25 || No || <br />
|}<br />
<br />
{{#widget:PledgeTracker|pledgeGoal=100}}<br />
<br />
</noinclude><br />
<includeonly><br />
<!-- PledgeTracker code starts here --><br />
<!--{counter name="pledgeTrackerDivId" assign="pledgeTrackerDivId"}--><br />
<div id="pledgeTracker<!--{$pledgeTrackerDivId|escape:'html'}-->"></div><br />
<br />
<script type="text/javascript"><br />
$(document).ready(function () {<br />
var pledgeGoalAmount = <!--{$pledgeGoal|validate:int|default:0}-->;<br />
var amountPledged = 0;<br />
var amountCollected = 0;<br />
$('.wikitable:eq(<!--{$tableIndex|validate:int|default:0}-->) tr:gt(0)').each(<br />
function(index, value) {<br />
var cols = $(value).children();<br />
var pledgeAmountCol = cols.eq(<!--{$pledgeAmountColumn|validate:int|default:1}-->);<br />
var pledgeAmountValue = parseFloat(pledgeAmountCol.text().trim().substring(1)) || 0;<br />
var pledgePaidCol = cols.eq(<!--{$pledgePaidColumn|validate:int|default:2}-->);<br />
var pledgePaidValue = pledgePaidCol.text().trim().toLowerCase();<br />
<br />
amountPledged += pledgeAmountValue;<br />
if (pledgePaidValue == "yes" || pledgePaidValue == "y") {<br />
amountCollected += pledgeAmountValue;<br />
}<br />
}<br />
)<br />
$("<p><b>Pledges Raised:</b> £" + amountPledged + <!--{if $pledgeGoal>0}-->" / £" + pledgeGoalAmount + " (" + ((amountPledged / pledgeGoalAmount) * 100).toFixed(2) + "%)" + <!--{/if}-->"</p>").appendTo('#pledgeTracker<!--{$pledgeTrackerDivId|escape:'html'}-->');<br />
$("<p><b>Pledges Collected:</b> £" + amountCollected + " / £" + amountPledged + " (" + ((amountCollected / amountPledged) * 100).toFixed(2) + "%)</p>").appendTo('#pledgeTracker<!--{$pledgeTrackerDivId|escape:'html'}-->');<br />
});<br />
</script><br />
<!-- PledgeTracker code ends here --><br />
</includeonly></div>
Naxxfish