The version of vichan running on lainchan.org
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

46 行
1.1KB

  1. /*
  2. * style-select.js
  3. * https://github.com/savetheinternet/Tinyboard/blob/master/js/style-select.js
  4. *
  5. * Changes the stylesheet chooser links to a <select>
  6. *
  7. * Released under the MIT license
  8. * Copyright (c) 2013 Michael Save <savetheinternet@tinyboard.org>
  9. * Copyright (c) 2013-2014 Marcin Łabanowski <marcin@6irc.net>
  10. *
  11. * Usage:
  12. * $config['additional_javascript'][] = 'js/jquery.min.js';
  13. * $config['additional_javascript'][] = 'js/style-select.js';
  14. *
  15. */
  16. onready(function(){
  17. var stylesDiv = $('div.styles');
  18. var pages = $('div.pages');
  19. var stylesSelect = $('<select></select>');
  20. var i = 1;
  21. stylesDiv.children().each(function() {
  22. var opt = $('<option></option>')
  23. .html(this.innerHTML.replace(/(^\[|\]$)/g, ''))
  24. .val(i);
  25. if ($(this).hasClass('selected'))
  26. opt.attr('selected', true);
  27. stylesSelect.append(opt);
  28. $(this).attr('id', 'style-select-' + i);
  29. i++;
  30. });
  31. stylesSelect.change(function() {
  32. $('#style-select-' + $(this).val()).click();
  33. });
  34. stylesDiv.hide()
  35. pages.after(
  36. $('<div id="style-select"></div>')
  37. /*.text(_('Style: '))*/
  38. .append(stylesSelect)
  39. );
  40. });