The version of vichan running on lainchan.org
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

35 рядки
933B

  1. /*
  2. * smartphone-spoiler.js
  3. * https://github.com/savetheinternet/Tinyboard/blob/master/js/smartphone-spoiler.js
  4. *
  5. * Released under the MIT license
  6. * Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
  7. * Copyright (c) 2013-2014 Marcin Łabanowski <marcin@6irc.net>
  8. *
  9. * Usage:
  10. * $config['additional_javascript'][] = 'js/mobile-style.js';
  11. * $config['additional_javascript'][] = 'js/smartphone-spoiler.js';
  12. *
  13. */
  14. onready(function(){
  15. if(device_type == 'mobile') {
  16. var fix_spoilers = function(where) {
  17. var spoilers = where.getElementsByClassName('spoiler');
  18. for(var i = 0; i < spoilers.length; i++) {
  19. spoilers[i].onmousedown = function() {
  20. this.style.color = 'white';
  21. };
  22. }
  23. };
  24. fix_spoilers(document);
  25. // allow to work with auto-reload.js, etc.
  26. $(document).on('new_post', function(e, post) {
  27. fix_spoilers(post);
  28. });
  29. }
  30. });