[www-doc] [Git][VideoLAN.org/websites][master] counter: add large number separators
Ludovic Fauvet
gitlab at videolan.org
Sun Feb 14 14:09:35 CET 2016
Ludovic Fauvet pushed to branch master at VideoLAN organization / websites
Commits:
78fe4e71 by Ludovic Fauvet at 2016-02-14T14:09:04Z
counter: add large number separators
- - - - -
1 changed file:
- www.videolan.org/include/os-specific.php
Changes:
=====================================
www.videolan.org/include/os-specific.php
=====================================
--- a/www.videolan.org/include/os-specific.php
+++ b/www.videolan.org/include/os-specific.php
@@ -237,7 +237,8 @@ function downloadButton2($dropdownItems = null, $targetOS = null, $displayMainOS
if (ws === undefined || ws.readyState === undefined || ws.readyState > 1) {
ws = new WebSocket("wss://get.videolan.org/wscounter");
ws.onmessage = function(event) {
- $('#wscounter').text(event.data + " <?php echo _("downloads so far"); ?>");
+ var value = event.data.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
+ $('#wscounter').text(value + " <?php echo _("downloads so far"); ?>");
};
}
}
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/commit/78fe4e7186e88d50b27816faaf17653e3c26f051
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/www-doc/attachments/20160214/3700cda0/attachment.html>
More information about the www-doc
mailing list