/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
- <pre id="sh_007_collapse_a" class="brush: groovy; collapse: true" title="This is a title for collapsed block">
- /**
- * Returns an Image object that can then be painted on the screen.
- * The url argument must specify an absolute {@link URL}. The name
- * argument is a specifier that is relative to the url argument.
- *
- * @param url an absolute URL giving the base location of the image
- * @param name the location of the image, relative to the url argument
- * @return the image at the specified URL
- * @see Image
- */
- </pre>
- <pre id="sh_007_collapse_b" class="brush: groovy; collapse: true">
- /**
- * Returns an Image object that can then be painted on the screen.
- * The url argument must specify an absolute {@link URL}. The name
- * argument is a specifier that is relative to the url argument.
- *
- * @param url an absolute URL giving the base location of the image
- * @param name the location of the image, relative to the url argument
- * @return the image at the specified URL
- * @see Image
- */
- </pre>
- <script type="text/javascript">
- queue(function()
- {
- var $sh;
-
- module('007_collapse');
-
- test('collapsed block with title', function()
- {
- $sh = $('#sh_007_collapse_a');
-
- ok_sh($sh);
- ok_toolbar($sh);
- ok_collapsed($sh);
-
- var $title = $sh.find('.toolbar a.toolbar_item.command_expandSource');
- ok($title.length == 1, 'Expand present');
- equal($title.text(), 'This is a title for collapsed block', 'Expand text');
- });
- test('collapsed block without title', function()
- {
- $sh = $('#sh_007_collapse_b');
-
- ok_sh($sh);
- ok_toolbar($sh);
- ok_collapsed($sh);
-
- var $title = $sh.find('.toolbar a.toolbar_item.command_expandSource');
- ok($title.length == 1, 'Expand present');
- equal($title.text(), SyntaxHighlighter.config.strings.expandSource, 'Expand text');
- });
- });
- </script>