1/** 2 * Create a set of toggles for the config window 3 * 4 * @author John Dyer (http://j.hn/) 5 */ 6 7docs.plugins.push({ 8 9 init: function(docManager) { 10 11 12 // create options areas 13 var optionsArea = $('<div class="config-options"><h3>Elements</h3></div>') 14 .appendTo(docManager.configWindow.content); 15 16 17 docManager.createOptionToggle = function(title, prefix, checked) { 18 19 checked = $.jStorage.get('docs-config-' + prefix, checked); 20 21 22 var bod = $(document.body), 23 setStyle = function(on) { 24 if (on) { 25 bod.removeClass( 'config-' + prefix + '-off'); 26 } else { 27 bod.addClass( 'config-' + prefix + '-off'); 28 } 29 }, 30 configBlock = 31 $('<div class="config-toggle">' + 32 '<input type="checkbox" ' + (checked ? ' checked' : '') + ' id="config-' + prefix + '" />' + 33 '<label for="config-' + prefix + '" title="' + title + '">' + title +'</label>' + 34 '</div>') 35 .appendTo( optionsArea ) 36 .on('click', 'input', function() { 37 38 var checked = $(this).is(':checked'); 39 40 setStyle(checked); 41 42 // save setting 43 $.jStorage.set('docs-config-' + prefix + '', checked); 44 }); 45 46 setStyle(checked); 47 48 docManager.resizeConfigWindow(); 49 } 50 51 52 53 54 docManager.addStyle('\ 55.config-chapters-off .chapter-num {\ 56display: none;\ 57}'); 58 docManager.createOptionToggle(docs.Localizer.get('plugin_config_option_chapters'), 'chapters', true); 59 60 61 docManager.addStyle('\ 62.config-verses-off .verse-num {\ 63 display:none;\ 64}'); 65 docManager.createOptionToggle(docs.Localizer.get('plugin_config_option_verses'), 'verses', true); 66 67 68 69 docManager.addStyle('\ 70.config-notes-off .chapter .note,\ 71.config-notes-off .chapter .cf {\ 72 display:none;\ 73}'); 74 docManager.createOptionToggle(docs.Localizer.get('plugin_config_option_notes'), 'notes', true); 75 76 77 // <h3> title </h3> 78 docManager.addStyle('\ 79.config-titles-off .chapter h3 {\ 80 display:none;\ 81}'); 82 docManager.createOptionToggle(docs.Localizer.get('plugin_config_option_titles'), 'titles', true); 83 84 // <span class="woc">Word of Jesus</h3> 85 docManager.addStyle('\ 86.config-wordsofchrist-off .woc {\ 87 color:inherit;\ 88}'); 89 docManager.createOptionToggle(docs.Localizer.get('plugin_config_option_wordsofchrist'), 'wordsofchrist', true); 90 91 } 92 93});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.