| 1 | <pre id="sh_014_legacy_a" name="code" class="plain">basic check</pre> |
|---|
| 2 | <pre id="sh_014_legacy_b" name="code" class="plain:nocontrols">no toolbar</pre> |
|---|
| 3 | <pre id="sh_014_legacy_c" name="code" class="plain:nogutter">no gutter</pre> |
|---|
| 4 | <pre id="sh_014_legacy_d" name="code" class="plain:collapse">collapsed</pre> |
|---|
| 5 | <pre id="sh_014_legacy_e" name="code" class="plain:firstline[10]">first line</pre> |
|---|
| 6 | |
|---|
| 7 | <script type="text/javascript"> |
|---|
| 8 | queue(function() |
|---|
| 9 | { |
|---|
| 10 | var $sh; |
|---|
| 11 | |
|---|
| 12 | dp.SyntaxHighlighter.HighlightAll('code'); |
|---|
| 13 | |
|---|
| 14 | module('014_legacy'); |
|---|
| 15 | |
|---|
| 16 | test('basic check', function() |
|---|
| 17 | { |
|---|
| 18 | $sh = $('#sh_014_legacy_a'); |
|---|
| 19 | |
|---|
| 20 | ok_sh($sh); |
|---|
| 21 | ok_toolbar($sh); |
|---|
| 22 | ok_code($sh); |
|---|
| 23 | }); |
|---|
| 24 | |
|---|
| 25 | test('no toolbar', function() |
|---|
| 26 | { |
|---|
| 27 | $sh = $('#sh_014_legacy_b'); |
|---|
| 28 | |
|---|
| 29 | ok_sh($sh); |
|---|
| 30 | ok_code($sh); |
|---|
| 31 | ok($sh.find('> .syntaxhighlighter > .toolbar').length == 0, 'Toolbar not present'); |
|---|
| 32 | }); |
|---|
| 33 | |
|---|
| 34 | test('no gutter', function() |
|---|
| 35 | { |
|---|
| 36 | $sh = $('#sh_014_legacy_c'); |
|---|
| 37 | |
|---|
| 38 | ok_sh($sh); |
|---|
| 39 | ok_toolbar($sh); |
|---|
| 40 | ok_code($sh); |
|---|
| 41 | |
|---|
| 42 | ok($sh.find('> .syntaxhighlighter.nogutter').length == 1, '.nogutter present'); |
|---|
| 43 | ok($sh.find('> .syntaxhighlighter > table > tbody > tr > .gutter').length == 0, 'Gutter not present'); |
|---|
| 44 | }); |
|---|
| 45 | |
|---|
| 46 | test('collapsed check', function() |
|---|
| 47 | { |
|---|
| 48 | $sh = $('#sh_014_legacy_d'); |
|---|
| 49 | |
|---|
| 50 | ok_sh($sh); |
|---|
| 51 | ok_toolbar($sh); |
|---|
| 52 | ok_collapsed($sh); |
|---|
| 53 | |
|---|
| 54 | var $title = $sh.find('.toolbar a.toolbar_item.command_expandSource'); |
|---|
| 55 | ok($title.length == 1, 'Expand present'); |
|---|
| 56 | equal($title.text(), SyntaxHighlighter.config.strings.expandSource, 'Expand text'); |
|---|
| 57 | }); |
|---|
| 58 | |
|---|
| 59 | test('first line check', function() |
|---|
| 60 | { |
|---|
| 61 | $sh = $('#sh_014_legacy_e'); |
|---|
| 62 | |
|---|
| 63 | ok_sh($sh); |
|---|
| 64 | ok_toolbar($sh); |
|---|
| 65 | ok_gutter($sh); |
|---|
| 66 | ok_code($sh); |
|---|
| 67 | equals($sh.find('.gutter .index0').text(), '10', 'First line'); |
|---|
| 68 | }); |
|---|
| 69 | }); |
|---|
| 70 | </script> |
|---|