Skip to content

Commit

Permalink
Item11229: Update attachment count javascript
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@12976 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
ArthurClemens authored and ArthurClemens committed Nov 2, 2011
1 parent 24eebb0 commit 39524ff
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
1 change: 1 addition & 0 deletions PatternSkin/data/System/PatternSkin.txt
Expand Up @@ -174,6 +174,7 @@ For further troubleshooting and feedback, go to http://foswiki.org/Support/%TOPI
| Version: | %$VERSION% |
| Release: | %$RELEASE% |
| History: | <!-- specify latest version first -->&nbsp; |
| 02 Oct 2011: | v.5.4.17: Update javascript for attachment counting. |
| 26 Aug 2011: | v.5.4.15, v.5.4.16: Additional support for running Pattern Skin on Foswiki 1.0.x release. |
| 28 May 2011: | v.5.4.14: Fixed search results on Foswiki 1.0.x versions. |
| 29 Apr 2011: | v.5.4.13: Added no-column CSS for Fatwilly theme. |
Expand Down
2 changes: 1 addition & 1 deletion PatternSkin/lib/Foswiki/Contrib/PatternSkin.pm
Expand Up @@ -4,7 +4,7 @@ use strict;
use warnings;

our $VERSION = '$Rev$';
our $RELEASE = '5.4.16';
our $RELEASE = '5.4.17';
our $SHORTDESCRIPTION =
'Pattern skin provides a CSS based default look and feel - flexible and [[http://www.w3.org/][W3C]] compliant. Its layout and color scheme are designed to provide a nice, clean and productive editing environment';

Expand Down
33 changes: 19 additions & 14 deletions PatternSkin/pub/System/PatternSkin/pattern_src.js
@@ -1,22 +1,27 @@

jQuery(document).ready(
function ($) {
// Create an attachment counter in the attachment table twisty.
$('div.foswikiAttachments')
.each(
function(index, el) {
var count = $(el).find('table.foswikiTable').attr('rows').length - 1;
var countStr = " <span class='foswikiSmall'>"
+ count + "<\/span>";
$(el).find('.patternAttachmentHeader').each(
function(index, el) {
$(el).append(countStr);
});
}
);

var searchResultsCount = 0;

// Create an attachment counter in the attachment table twisty.
$('.foswikiAttachments').livequery(function() {
var table = $(this).find('table.foswikiTable');
if (!table) {
return;
}
var rows = table.attr('rows');
if (!rows) {
return;
}
var count = rows.length - 1;
var countStr = " <span class='foswikiSmall'>"
+ count + "<\/span>";
$(this).find('.patternAttachmentHeader').livequery(function() {
$(this).append(countStr);
});
}
);

// Search page handling
$('.foswikiSearchResultCount span').livequery(function() {
searchResultsCount += parseInt($(this).html());
Expand Down

0 comments on commit 39524ff

Please sign in to comment.