The version of vichan running on lainchan.org
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

33 lignes
863B

  1. /*
  2. * titlebar-notifications.js - a library for showing number of new events in titlebar
  3. * https://github.com/vichan-devel/Tinyboard/blob/master/js/titlebar-notifications.js
  4. *
  5. * Released under the MIT license
  6. * Copyright (c) 2014 Marcin Łabanowski <marcin@6irc.net>
  7. *
  8. * Usage:
  9. * $config['additional_javascript'][] = 'js/titlebar-notifications.js';
  10. * //$config['additional_javascript'][] = 'js/auto-reload.js';
  11. * //$config['additional_javascript'][] = 'js/watch.js';
  12. *
  13. */
  14. var orig_title = document.title;
  15. $(function(){
  16. orig_title = document.title;
  17. });
  18. update_title = function() {
  19. var updates = 0;
  20. for(var i in title_collectors) {
  21. updates += title_collectors[i]();
  22. }
  23. document.title = (updates ? "("+updates+") " : "") + orig_title;
  24. };
  25. var title_collectors = [];
  26. add_title_collector = function(f) {
  27. title_collectors.push(f);
  28. };