PageRenderTime 47ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/syntaxhighlighter_3.0.83/tests/cases/007_collapse.html

#
HTML | 60 lines | 51 code | 9 blank | 0 comment | 0 complexity | b938a0d89c809043030cd7d4162422b6 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. <pre id="sh_007_collapse_a" class="brush: groovy; collapse: true" title="This is a title for collapsed block">
  2. /**
  3. * Returns an Image object that can then be painted on the screen.
  4. * The url argument must specify an absolute {@link URL}. The name
  5. * argument is a specifier that is relative to the url argument.
  6. *
  7. * @param url an absolute URL giving the base location of the image
  8. * @param name the location of the image, relative to the url argument
  9. * @return the image at the specified URL
  10. * @see Image
  11. */
  12. </pre>
  13. <pre id="sh_007_collapse_b" class="brush: groovy; collapse: true">
  14. /**
  15. * Returns an Image object that can then be painted on the screen.
  16. * The url argument must specify an absolute {@link URL}. The name
  17. * argument is a specifier that is relative to the url argument.
  18. *
  19. * @param url an absolute URL giving the base location of the image
  20. * @param name the location of the image, relative to the url argument
  21. * @return the image at the specified URL
  22. * @see Image
  23. */
  24. </pre>
  25. <script type="text/javascript">
  26. queue(function()
  27. {
  28. var $sh;
  29. module('007_collapse');
  30. test('collapsed block with title', function()
  31. {
  32. $sh = $('#sh_007_collapse_a');
  33. ok_sh($sh);
  34. ok_toolbar($sh);
  35. ok_collapsed($sh);
  36. var $title = $sh.find('.toolbar a.toolbar_item.command_expandSource');
  37. ok($title.length == 1, 'Expand present');
  38. equal($title.text(), 'This is a title for collapsed block', 'Expand text');
  39. });
  40. test('collapsed block without title', function()
  41. {
  42. $sh = $('#sh_007_collapse_b');
  43. ok_sh($sh);
  44. ok_toolbar($sh);
  45. ok_collapsed($sh);
  46. var $title = $sh.find('.toolbar a.toolbar_item.command_expandSource');
  47. ok($title.length == 1, 'Expand present');
  48. equal($title.text(), SyntaxHighlighter.config.strings.expandSource, 'Expand text');
  49. });
  50. });
  51. </script>