Changeset 759753
- Timestamp:
- 08/21/2013 06:45:37 AM (13 years ago)
- Location:
- side-matter
- Files:
-
- 10 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (modified) (previous)
-
tags/1.0/readme.txt (modified) (1 diff)
-
trunk/css/side-matter-admin.css (modified) (7 diffs)
-
trunk/css/side-matter.css (modified) (1 diff)
-
trunk/js/side-matter-admin.js (modified) (6 diffs)
-
trunk/js/side-matter.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (9 diffs)
-
trunk/side-matter.php (modified) (16 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
side-matter/tags/1.0/readme.txt
r742660 r759753 14 14 Side Matter turns your footnotes into sidenotes, magically aligning each note in the sidebar next to its corresponding reference in the text. Easily incorporate citations, digressions, and editorial remarks into the sidebar of a page or post with a simple-to-use shortcode and widget. Scholars, editors, and writers of all kinds will find particular benefit in the plugin. 15 15 16 Sidenotes have a centuries-long history of use in printed texts, from the Geneva Bible to the works of Edward Tufte. They function equally well on the Web: unlike hyperlinked footnotes, sidenotes don't require the user to click away from a page's main content to follow up a reference. Instead, they perch humbly and accessibly alongside the materialto which they refer.16 Sidenotes have a centuries-long history of use in printed texts, from the Geneva Bible to the works of Edward Tufte. They function equally well on the Web: unlike hyperlinked footnotes, sidenotes don't require the user to click away from a page's main content to follow up on a reference. Instead, they perch humbly and accessibly alongside the lines to which they refer. 17 17 18 18 Side Matter includes an options menu for toggling settings, as well as a set of built-in classes for [styling sidenotes and references with CSS](http://wordpress.org/extend/plugins/side-matter/other_notes/). The plugin works well with many popular base themes, including Twenty Twelve, Twenty Ten, Responsive, and Toolbox. -
side-matter/trunk/css/side-matter-admin.css
r741424 r759753 1 1 /* 2 2 side-matter-admin.css 3 Version 1. 03 Version 1.1 4 4 5 5 Plugin: Side Matter … … 9 9 */ 10 10 11 .side-matter- field{11 .side-matter-preview { 12 12 display: inline-block; 13 font-size: 1.1em; 13 14 background: #eee; 14 15 border: 1px solid #bbb; … … 23 24 } 24 25 25 .side-matter-content { 26 .side-matter-preview:focus { 27 outline: thin dotted; 28 } 29 30 .side-matter-preview-dark { 31 background-color: #444; 32 } 33 34 .side-matter-preview-content { 26 35 padding: 1.25em 2em; 27 36 } 28 37 29 .side-matter-field:focus { 30 outline: thin dotted; 31 } 32 33 .side-matter-field-dark { 34 background-color: #444; 35 } 36 37 .side-matter-field-dark > .side-matter-content { 38 .side-matter-preview-dark > .side-matter-preview-content { 38 39 color: #ccc; 39 40 box-shadow: inset rgba(0,0,0,0.3) 1px 1px 5px; 40 41 } 41 42 42 .side-matter- main {43 .side-matter-preview-main { 43 44 vertical-align: top; 44 45 display: inline-block; … … 47 48 } 48 49 49 .side-matter- side {50 .side-matter-preview-side { 50 51 vertical-align: top; 51 52 display: inline-block; … … 53 54 } 54 55 55 .side-matter- list, .side-matter-note, .side-matter-text {56 .side-matter-preview-list, .side-matter-preview-note, .side-matter-preview-text { 56 57 font-size: inherit; 57 58 margin: 0; … … 59 60 } 60 61 61 .side-matter- ref {62 .side-matter-preview-ref { 62 63 position: relative; 63 64 top: -0.5em; … … 67 68 } 68 69 69 . user_colors {70 .side-matter-user-colors { 70 71 margin-left: 18px; 71 72 } 73 74 .side-matter-figure-style { 75 color: #333; 76 } -
side-matter/trunk/css/side-matter.css
r741424 r759753 1 1 /* 2 2 side-matter.css 3 Version 1. 03 Version 1.1 4 4 5 5 Plugin: Side Matter -
side-matter/trunk/js/side-matter-admin.js
r741424 r759753 1 1 /* 2 2 side-matter-admin.js 3 Version 1. 03 Version 1.1 4 4 5 5 Plugin: Side Matter … … 13 13 /* Variables */ 14 14 15 var fieldIsDark; // True when `div.side-matter- field` has class `side-matter-field-dark` applied15 var fieldIsDark; // True when `div.side-matter-preview` has class `side-matter-preview-dark` applied 16 16 var colorsEnabled; // True when 'Use custom colors for figures and notes' checkbox is checked 17 17 var figureColor; // Current color to use for reference and note numeral figures … … 23 23 'georgian': 'ა', 24 24 'hebrew': 'א', 25 'hiragana': 'あ', 26 'hiragana-iroha': 'い', 27 'katakana': 'ア', 28 'katakana-iroha': 'イ', 25 29 'lower-alpha': 'a', 26 30 'lower-greek': 'α', … … 32 36 33 37 fieldIsDark = 0; 34 figureColor = $('. figure_color').val();35 textColor = $('. text_color').val();38 figureColor = $('.side-matter-figure-color').val(); 39 textColor = $('.side-matter-text-color').val(); 36 40 37 41 placeNote(); 38 42 39 $('. figure_color').wpColorPicker(figureOptions);40 $('. text_color').wpColorPicker(textOptions);43 $('.side-matter-figure-color').wpColorPicker(figureOptions); 44 $('.side-matter-text-color').wpColorPicker(textOptions); 41 45 42 if ( ! $(' #colors_enabled').prop('checked')) {43 $('. user_colors').hide();46 if ( ! $('.side-matter-colors-enabled').prop('checked')) { 47 $('.side-matter-user_colors').hide(); 44 48 } else { 45 $('.side-matter- ref,.side-matter-note').css('color', figureColor);46 $('.side-matter- text').css('color', textColor);49 $('.side-matter-preview-ref,.side-matter-preview-note').css('color', figureColor); 50 $('.side-matter-preview-text').css('color', textColor); 47 51 } 48 52 … … 50 54 51 55 function placeNote() { // Position note in preview field (variant of `placeNotes` from `side-matter.js`) 52 var refPosition = $('.side-matter- ref').position().top;53 var notePosition = $('.side-matter- note').position().top;56 var refPosition = $('.side-matter-preview-ref').position().top; 57 var notePosition = $('.side-matter-preview-note').position().top; 54 58 var noteOffset = refPosition - notePosition; 55 59 var finalOffset = (noteOffset < 0) ? 0 : noteOffset; 56 $('.side-matter- note').css('marginTop', finalOffset); // Position note60 $('.side-matter-preview-note').css('marginTop', finalOffset); // Position note 57 61 } 58 62 … … 61 65 var figureOptions = { 62 66 change: function(event, ui) { 63 $('.side-matter-ref,.side-matter-note').css('color', ui.color.toString()); 64 } 67 $('.side-matter-preview-ref,.side-matter-preview-note').css('color', ui.color.toString()); 68 }, 69 palettes: false 65 70 }; 66 71 67 72 var textOptions = { 68 73 change: function(event, ui) { 69 $('.side-matter-text').css('color', ui.color.toString()); 70 } 74 $('.side-matter-preview-text').css('color', ui.color.toString()); 75 }, 76 palettes: false 71 77 }; 72 78 73 /* Functions for live updates to preview field: toggling light/dark, enabling custom colors, updating figure style */79 /* Functions for live updates to preview field: toggling light/dark, enabling custom colors, updating figure style, fade effect */ 74 80 75 $('.side-matter- field,label[for^="preview_field"]').click(function() { // When user clicks preview field or its label, toggle class81 $('.side-matter-preview,label[for^="preview_field"]').click(function() { // When user clicks preview field or its label, toggle class 76 82 if (fieldIsDark == 0) { 77 $('.side-matter- field').addClass('side-matter-field-dark');83 $('.side-matter-preview').addClass('side-matter-preview-dark'); 78 84 fieldIsDark = 1; 79 85 } else { 80 $('.side-matter- field').removeClass('side-matter-field-dark');86 $('.side-matter-preview').removeClass('side-matter-preview-dark'); 81 87 fieldIsDark = 0; 82 88 } 83 89 }); 84 90 85 $('.side-matter- field').keyup(function(e) { // Enter and space keys will toggle preview field when it is in focus86 if (e.which == 13 || e.which == 32) $('.side-matter- field').click();91 $('.side-matter-preview').keyup(function(e) { // Enter and space keys will toggle preview field when it is in focus 92 if (e.which == 13 || e.which == 32) $('.side-matter-preview').click(); 87 93 }); 88 94 89 $(' #colors_enabled').click(function() { // When user clicks95 $('.side-matter-colors-enabled').click(function() { // When user clicks checkbox, open color picker drawer 90 96 if ($(this).prop('checked')) { 91 $('.side-matter- ref,.side-matter-note').css('color', figureColor);92 $('.side-matter- text').css('color', textColor);93 $('. user_colors').slideDown();97 $('.side-matter-preview-ref,.side-matter-preview-note').css('color', figureColor); 98 $('.side-matter-preview-text').css('color', textColor); 99 $('.side-matter-user-colors').slideDown(); 94 100 } else { 95 figureColor = $('. figure_color').val();96 textColor = $('. text_color').val();97 $('. user_colors').slideUp('fast');98 $('.side-matter- ref,.side-matter-note,.side-matter-text').css('color', '');101 figureColor = $('.side-matter-figure-color').val(); 102 textColor = $('.side-matter-text-color').val(); 103 $('.side-matter-user-colors').slideUp('fast'); 104 $('.side-matter-preview-ref,.side-matter-preview-note,.side-matter-preview-text').css('color', ''); 99 105 } 100 106 }); 101 107 102 $('#figure_style').change(function() { 103 $('.side-matter-ref').text(figures[$(this).val()]); 104 $('.side-matter-note').css('listStyleType', $(this).val()); 108 $('.side-matter-figure-style').change(function() { // When user selects a figure style, update preview field 109 $('.side-matter-preview-ref').text(figures[$(this).val()]); 110 $('.side-matter-preview-note').css('listStyleType', $(this).val()); 111 }); 112 113 $('.side-matter-use-effects').change(function() { // When user enables fade effects, update preview field 114 if ($(this).prop('checked')) { 115 $('.side-matter-preview-note').css('opacity', 0).delay(180).fadeTo(180, 1); 116 } 105 117 }); 106 118 -
side-matter/trunk/js/side-matter.js
r741996 r759753 1 1 /* 2 2 side-matter.js 3 Version 1. 03 Version 1.1 4 4 5 5 Plugin: Side Matter … … 32 32 33 33 $(document).ready(function() { 34 $('ol.' + htmlClass + '-list').css('opacity', 0); // Make notes briefly transparent to prevent flickering on load34 if (useEffects == 1) $('ol.' + htmlClass + '-list').css('opacity', 0); // Make notes briefly transparent 35 35 }); 36 36 37 37 $(window).load(function() { // Position notes and fade in 38 38 for (i = 1; i <= 2; i++) placeNotes(); // Loop twice to correct any misplacements on first load 39 if (useEffects == 1) { 40 $('ol.' + htmlClass + '-list').fadeTo(180, 1); 41 } else { 42 $('ol.' + htmlClass + '-list').css('opacity', 1); 43 } 39 if (useEffects == 1) $('ol.' + htmlClass + '-list').fadeTo(180, 1); 44 40 }); 45 41 -
side-matter/trunk/readme.txt
r742660 r759753 1 1 === Side Matter === 2 2 Contributors: setzer 3 Tags: academic, annotation, annotations, bibliography, bibliographic, citation, citations, cite, commentary, endnote, endnotes, footnote, footnotes, margin, ma tter, note, notes, ref, reference, references, scholar, scholarship, shortcode, side, sidebar, sidenote, sidenotes, widget3 Tags: academic, annotation, annotations, bibliography, bibliographic, citation, citations, cite, commentary, endnote, endnotes, footnote, footnotes, margin, marginal, matter, note, notes, ref, reference, references, scholar, scholarship, shortcode, side, sidebar, sidenote, sidenotes, widget 4 4 Requires at least: 3.0 5 Tested up to: 3. 5.26 Stable tag: 1. 05 Tested up to: 3.6 6 Stable tag: 1.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 10 Turns yourfootnotes into sidenotes, magically positioning each note in the sidebar next to its corresponding reference in the text.10 Turns footnotes into sidenotes, magically positioning each note in the sidebar next to its corresponding reference in the text. 11 11 12 12 == Description == 13 13 14 Side Matter turns your footnotes into sidenotes, magically aligning each note in the sidebar next to its corresponding reference in the text. Easily incorporate citations, digressions, and editorial remarks into the sidebar of a page or post with a simple-to-use shortcode and widget. Scholars, editors, and writers of all kinds will find particular benefit in the plugin.15 16 Sidenotes have a centuries-long history of use in printed texts, from the Geneva Bible to the works of Edward Tufte. They function equally well on the Web: unlike hyperlinked footnotes, sidenotes don't require the user to click away from a page's main content to follow up a reference. Instead, they perch humbly and accessibly alongside the materialto which they refer.17 18 Side Matter includes an options menu for toggling settings, as well as a set of built-in classes for [styling sidenotes and references with CSS](http://wordpress.org/extend/plugins/side-matter/other_notes/). The plugin works well with many popular base themes, including Twenty Twelve, Twenty Ten, Responsive, and Toolbox.14 Side Matter turns footnotes into sidenotes, magically aligning each note in the sidebar next to its corresponding reference in the text. Easily add citations, digressions, and editorial remarks to pages and posts with a simple shortcode and widget. Writers, editors, and scholars will find the plugin of particular benefit. 15 16 Margin notes have been used in printed texts for centuries. They function equally well on the Web: unlike hyperlinked footnotes, sidenotes don't require jumping down the page to follow up on each reference. Instead, they perch humbly and accessibly beside the lines to which they refer. 17 18 Side Matter includes an options menu for changing default settings as well as a set of built-in classes for [styling notes and reference figures with CSS](http://wordpress.org/extend/plugins/side-matter/other_notes/). 19 19 20 20 To use, place the Side Matter widget in your sidebar, then enclose sidenote text in a page or post using the `[ref]` shortcode, like so: 21 21 22 > Here's the text to annotate.`[ref]`Note text goes here.`[/ref]` 22 Here's the text to annotate.[ref]Note text goes here.[/ref] 23 23 24 24 == Installation == 25 25 26 26 1. Upload the directory `side-matter` to `wp-content/plugins`. 27 2. Activate Side Matter using the Plugins menu.28 3. Using the Widgets menu, place the Side Matter widget in your sidebar.29 4. You may now use the `[ref]` shortcode to generate sidenotes in posts and pages, like so:30 31 > Here's the text to annotate.`[ref]`Note text goes here.`[/ref]` 32 33 To modify the plugin's default settings, use the options menu locatedon your Reading Settings screen.34 35 If you'd like to customize the appearance of Side Matter notes and references using CSS, consult [Styling Side Matter with CSS](http://wordpress.org/extend/plugins/side-matter/other_notes/).27 2. Activate Side Matter using the Plugins screen. 28 3. Place the Side Matter widget in your sidebar using the Widgets screen. 29 4. Use the `[ref]` shortcode to generate sidenotes in posts and pages, like so: 30 31 Here's the text to annotate.[ref]Note text goes here.[/ref] 32 33 To change the plugin's default settings, use the Side Matter options menu on your Reading Settings screen. 34 35 For information on specifying the appearance of Side Matter elements using custom CSS, consult [Other Notes](http://wordpress.org/extend/plugins/side-matter/other_notes/). 36 36 37 37 == Frequently Asked Questions == … … 41 41 You can find the options menu on your Reading Settings screen. 42 42 43 = My notes don't appear. = 44 45 Some themes are one-column by design and do not include a sidebar. Without a sidebar, Side Matter has no place to generate your notes. Make sure that your theme includes a sidebar and that you've placed the Side Matter widget within the sidebar. 46 47 = My notes just sit at the top of the sidebar. = 48 49 Your theme may not be loading `side-matter/js/side-matter.js`, the script that aligns sidenotes. Check the page source to make sure that `side-matter.js` has been linked. 50 51 = My notes appear at a regular vertical offset from their proper position. = 52 53 Some themes idiosyncratically display notes at an offset from their corresponding references in the text. As a workaround for this problem, Side Matter's options menu includes a field for arbitrarily adjusting your notes' vertical offset. 54 55 = Some numeral figures don't display properly in my browser. = 56 57 Browser support for the CSS `armenian`, `georgian`, `lower-greek`, `hebrew`, `hiragana`, and `katakana` list styles varies. (See [Web Platform Docs](http://docs.webplatform.org/wiki/css/properties/list-style-type) for more details.) Decimal, Latin, and Roman figures enjoy broader support and are unlikely to cause problems. 58 59 = Why doesn't the plugin work with my theme? = 60 61 Not all layouts are built to incorporate a component like Side Matter. The plugin works well with most base themes that include a conventional sidebar, but it's not guaranteed to display notes perfectly on all sites. A little tinkering with note offset or CSS will fix most problems; in other cases, it's best to consult your theme's developer. 62 43 63 = Does Side Matter work with responsive layouts? = 44 64 45 Yes. The plugin includes an option, turned off by default, to responsively re-position sidenotes upon window resize or zoom. Enable this function using the Responsive Positioning control in Side Matter's options menu. 46 47 = My notes just sit at the top of the sidebar. = 48 49 Your theme may not be linking `side-matter.js`, the script that aligns sidenotes. Check the page source to see if `side-matter.js` has been linked. 50 51 = My notes appear at a regular vertical offset from their proper position. = 52 53 Some themes idiosyncratically display notes at an offset from their corresponding references in the text. As a workaround for this problem, Side Matter's options menu includes a field for arbitrarily adjusting your notes' vertical offset. 54 55 = Why doesn't the plugin work with some themes? = 56 57 Not all themes are built to neatly absorb a layout addition like Side Matter. The plugin works well with most base themes that incorporate a conventional sidebar, but it isn't guaranteed to display notes perfectly within all themes. Tinkering with note offset or CSS will fix most problems; in other cases, it's best to consult the theme author. 65 Yes. The plugin includes an option, turned off by default, to responsively re-position sidenotes upon browser resize or zoom. Enable this function using the Responsive Positioning control in Side Matter's options menu. 58 66 59 67 = Can sidenotes be displayed without using the widget? = … … 65 73 ?> 66 74 67 = Some numeral formats don't display properly in my browser. =68 69 Browser support for the CSS `armenian`, `georgian`, `hebrew`, and `lower-greek` list styles varies. (See [Web Platform Docs](http://docs.webplatform.org/wiki/css/properties/list-style-type) for compatibility specifics.) Decimal, Latin, and Roman numerals enjoy wide support and can serve as reliable fallbacks.70 71 75 == Screenshots == 72 76 73 1. Side Matter captures footnote text using the [ref] shortcode, then magically positions each footnote alongsideits corresponding reference in the text.77 1. Side Matter identifies sidenote text using the [ref] shortcode, then magically positions each note in the sidebar next to its corresponding reference in the text. 74 78 75 79 2. Modify default settings using Side Matter's options menu on the Reading Settings screen. 76 80 77 81 == Changelog == 82 83 = 1.1 = 84 * Added support for Hiragana and Katakana figure sets. 85 * Added localization domain path to plugin header and appended translation notes to some otherwise cryptic strings. 86 * Made various minor fixes to improve appearance and performance. 78 87 79 88 = 1.0 = … … 121 130 * Initial release. 122 131 123 == Upgrade Notice ==124 125 = 1.0 =126 This update fixes a few IE-specific bugs and adds several features, including new numeral formats and localization support.127 128 = 0.9 =129 This update adds a number of features, including alternate numeral formats and a color picker for Side Matter elements. Users who have modified `side-matter.css` are advised to make a backup copy before updating.130 131 = 0.8 =132 This update includes several fixes and additions, including the option to select which page types display sidenotes. Users who have modified `side-matter.css` are advised to make a backup copy before updating.133 134 = 0.7 =135 This update adds several features, including an options menu and transition-smoothing effects. Users who have modified their copy of `side-matter.css` are advised to make a backup copy before updating.136 137 = 0.6 =138 This update includes a number of tweaks and fixes, including improved classes for CSS and separate styling for sidenote numerals. Users who have customized their copy of `side-matter.css` are advised to make a backup copy before downloading.139 140 = 0.5 =141 This update fixes an error that was preventing plugin activation for some users. Recommended.142 143 132 == Styling Side Matter with CSS == 144 133 145 134 Side Matter's options menu allows you to render notes and figures in custom colors by way of the Iris color picker. Changing other aspects of Side Matter elements' appearance, such as typeface, indentation, or spacing, requires some tinkering with Cascading Style Sheets (CSS). This guide assumes some familiarity with CSS; if you're a beginner, start with a [tutorial](http://www.htmldog.com/guides/css/beginner/). 146 135 147 The simplest way to add custom styles to your site is to employ a plugin that houses your custom CSS in the WordPress database, thus preserving it even if Side Matter (or your theme) is updated. [Jetpack Custom CSS](http://wordpress.org/extend/plugins/jetpack/) is a good example.148 149 (Note that inline color styles set in the Side Matter options menu will generally override any custom styles you set elsewhere. If you're planning to use a custom stylesheetas described here, be sure to disable custom colors in the options menu.)150 151 Side Matter comes with a set of built-in classes that make it easy to c ustomize the appearance of sidenote and reference elements using [class selectors](http://www.htmldog.com/guides/css/intermediate/classid/). For example, all Side Matter elements can be styled at once using the class `side-matter`. The following rule will render all Side Matter content (reference numerals, sidenote numerals, and sidenote text) in blue 12-pixel serif type:136 The simplest way to add custom styles to your site is to employ a separate plugin to house your custom CSS, thus preserving it when Side Matter or your theme is updated. [Simple Custom CSS](http://wordpress.org/plugins/simple-custom-css/) or the Custom CSS module included with [Jetpack](http://wordpress.org/extend/plugins/jetpack/) are good examples. 137 138 (Note that inline color styles set in the Side Matter options menu will generally supersede style rules you set elsewhere. If you're planning to use your own CSS as described here, be sure to disable custom colors in the options menu.) 139 140 Side Matter comes with a set of built-in classes that make it easy to change the appearance of sidenote and reference elements using [class selectors](http://www.htmldog.com/guides/css/intermediate/classid/). For example, all Side Matter elements can be styled at once using the class `side-matter`. The following rule will render all Side Matter content (reference numerals, sidenote numerals, and sidenote text) in blue 12-pixel serif type: 152 141 153 142 .side-matter { … … 157 146 } 158 147 159 Notes and references may be styled with greater precision using element-specific class selectors. The following rules will render reference and list numerals in red while leaving sidenote text black (see [Screenshots](http://wordpress.org/extend/plugins/side-matter/screenshots/) for a similar example):148 Notes and references may be styled with greater precision using element-specific class selectors. The following rules will render reference and list numerals in red while leaving sidenote text black: 160 149 161 150 a.side-matter-ref, ol.side-matter-list { … … 167 156 } 168 157 169 In some cases, your custom CSS may fail to take effect because the theme CSS carries greater [specificity](http://www.htmldog.com/guides/css/intermediate/specificity/). There are ways around this. For example, if you can't modify the color of superscript reference links because your theme's rules have greater specificity, try overriding the theme stylesheet's specificity withnesting or an ID selector:158 In some cases, your CSS may fail to take effect because the theme CSS carries greater [specificity](http://www.htmldog.com/guides/css/intermediate/specificity/). There are ways around this, such as overriding the theme stylesheet's specificity via nesting or an ID selector: 170 159 171 160 .entry-content > p > a.side-matter.side-matter-ref { … … 177 166 } 178 167 179 The `!important` declaration should be used only in rare cases, but may resolve a stubborn CSS conflict where other efforts have failed:168 The `!important` declaration should be used sparingly, but may resolve a stubborn CSS conflict where other attempts have failed: 180 169 181 170 a.side-matter-ref { … … 186 175 Here is a complete list of Side Matter element class selectors and their uses: 187 176 188 * `a.side-matter-ref` selects the `a` link tags that enclose in-text reference numerals. Use this class to modify the links' colors, underline, etc. Target a specific reference link using its ID selector (e.g. `#ref-5`).177 * `a.side-matter-ref` selects the link tags that enclose in-text reference numerals. Use this class to modify the links' colors, underline, etc. Select a specific reference link using its ID selector (e.g. `#ref-5`). 189 178 * `sup.side-matter-sup` selects the `sup` (superscript) tags that enclose in-text reference numerals. Use this class to modify the numerals' typographic properties, such as size, offset, and font. 190 179 * `div.side-matter-widget` selects the `div` element that encloses the Side Matter widget. 191 180 * `ol.side-matter-list` selects the `ol` (ordered list) element that encloses notes in the sidebar, including note numeral figures. 192 * `li.side-matter-note` selects individual sidenote `li` (list item) elements. Target a specific note using the note's ID selector (e.g. `#note-6`).181 * `li.side-matter-note` selects individual sidenote `li` (list item) elements. Select a specific note using the note's ID selector (e.g. `#note-6`). 193 182 * `div.side-matter-text` selects the `div` elements that enclose sidenote text, but not sidenote list numerals. Use this to style sidenote text separately from sidenote numerals. 194 * WordPress further wraps each note paragraph in a `p` tag. Because they are generated outside Side Matter, these `p` elements cannot be selected directly using the `side-matter` class. Instead, target them indirectly with a [child selector](http://www.htmldog.com/guides/css/advanced/selectors/), e.g. `div.side-matter-text > p`. 183 184 Note that WordPress further wraps each note paragraph in a `p` tag. Because they are not generated by Side Matter, these `p` elements cannot be selected directly using the `side-matter` class. Instead, select them indirectly by way of [parent elements](http://www.htmldog.com/guides/css/advanced/selectors/), e.g. `li.side-matter-note > div.side-matter-text > p`. 195 185 196 186 = Default CSS = 197 Side Matter sets a few default rules in the included stylesheet `css/side-matter.css`. Their low-specificity selectors allow these rules to be easily superseded by your theme stylesheet or custom CSS.187 Side Matter sets a few basic rules by default in the included stylesheet `side-matter/css/side-matter.css`. Their low-specificity selectors mean these defaults will defer readily to rules set by your theme or any custom stylesheets. 198 188 199 189 The first rule removes underlines from reference numeral links: … … 206 196 } 207 197 208 The second rule specifies a consistent cross-theme appearance for superscript figures:198 The second rule specifies a consistent cross-theme, cross-browser appearance for superscript figures: 209 199 210 200 sup.side-matter-sup { -
side-matter/trunk/side-matter.php
r741424 r759753 3 3 Plugin Name: Side Matter 4 4 Plugin URI: http://wordpress.org/extend/plugins/side-matter/ 5 Description: Turns your footnotes into sidenotes, magically positioning each note in the sidebar next to its corresponding reference in the text. 6 Text Domain: side-matter 7 Version: 1.0 5 Description: Turns footnotes into sidenotes, magically positioning each note in the sidebar next to its corresponding reference in the text. 6 Version: 1.1 8 7 Author: Christopher Setzer 9 8 Author URI: http://christophersetzer.com 10 9 License: GPLv2 or later 10 Text Domain: side-matter 11 Domain Path: /languages/ 11 12 */ 12 13 … … 40 41 public function __construct() { // Set up defaults, register actions 41 42 42 add_action( 'admin_init', array( &$this, 'load_textdomain' ) ); 43 add_action( 'admin_init', array( &$this, 'load_textdomain' ) ); // Load text domain 'side-matter' for localization 43 44 add_action( 'admin_init', array( &$this, 'build_settings_section' ) ); // Assemble settings section 44 45 add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue' ) ); // Load script and CSS for options menu … … 71 72 ); 72 73 $this->options = wp_parse_args( get_option( 'side_matter_options' ), $this->defaults ); // Get options from database and apply defaults in place of any that are not set 73 $this->version = '1. 0'; // Current version of plugin74 $this->version = '1.1'; // Current version of plugin 74 75 75 76 } … … 111 112 'georgian' => __( 'Georgian: ა, ბ, გ, დ, ე, ვ, …', 'side-matter' ), 112 113 'lower-greek' => __( 'Greek: α, β, γ, δ, ε, ζ, …', 'side-matter' ), 113 'hebrew' => __( 'Hebrew: ו ,ה ,ד ,ג ,ב ,א, …', 'side-matter' ), // Comma weirdness is due to RTL text reversal 114 'hebrew' => _x( 'Hebrew: ו ,ה ,ד ,ג ,ב ,א, …', 'Comma placement is due to RTL text reversal', 'side-matter' ), // Comma placement is due to RTL text reversal 115 'hiragana' => __( 'Hiragana: あ, い, う, え, お, か, …', 'side-matter' ), 116 'hiragana-iroha' => __( 'Hiragana (Iroha): い, ろ, は, に, ほ, へ, …' ), 117 'katakana' => __( 'Katakana: ア, イ, ウ, エ, オ, カ, …', 'side-matter' ), 118 'katakana-iroha' => __( 'Katakana (Iroha): イ, ロ, ハ, ニ, ホ, ヘ, …', 'side-matter' ), 114 119 'none' => __( 'None', 'side-matter' ) 115 120 ) … … 130 135 'id' => 'note_adjust', 131 136 'title' => __( 'Adjust vertical offset of notes by', 'side-matter' ), 132 'label' => _ _( 'px', 'side-matter' ),137 'label' => _x( 'px', 'Abbreviation for "pixels"', 'side-matter' ), 133 138 'description' => __( 'A positive offset will push notes up; a negative offset will push them down.', 'side-matter' ), 134 139 'label_for' => 'note_adjust', … … 158 163 159 164 public function build_section_heading() { 160 return; 161 } 162 163 public function build_field( $args ) { // Generate settings field based on $id as passed from build_settings_section()165 return; // Don't build section heading 166 } 167 168 public function build_field( $args ) { // Generate settings fields for each array $args passed from build_settings_section() 164 169 165 170 extract( $args, EXTR_SKIP ); … … 175 180 $figure = $side_matter->get_figure( 1, $options['figure_style'] ); 176 181 ?> 177 <div class='side-matter- field' tabindex='0'>178 <div class='side-matter- content'>179 <div class='side-matter- main'>180 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.<sup class='side-matter-ref'><?php echo $side_matter->get_figure( 1, $figure_style ) ?></sup> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.182 <div class='side-matter-preview' tabindex='0'> 183 <div class='side-matter-preview-content'> 184 <div class='side-matter-preview-main'> 185 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor tincidunt ut labore et dolore nostrud.<sup class='side-matter-preview-ref'><?php echo $side_matter->get_figure( 1, $figure_style ) ?></sup> Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquip ex ea consequat. Cras ante lacus, libero et commodo sit magna aliqua. 181 186 </div> 182 <div class='side-matter- side'>183 <ol class='side-matter- list'>184 <li class='side-matter- note' style='list-style-type: <?php echo $figure_style ?>;'>185 <div class='side-matter- text'>187 <div class='side-matter-preview-side'> 188 <ol class='side-matter-preview-list'> 189 <li class='side-matter-preview-note' style='list-style-type: <?php echo $figure_style ?>;'> 190 <div class='side-matter-preview-text'> 186 191 Velit esse cillum dolore eu fugiat nulla pariatur. 187 192 </div> … … 196 201 ?> 197 202 <fieldset> 198 <label><input id='colors_enabled' type='checkbox' name='side_matter_options[<?php echo $id ?>][colors_enabled]' value='1' <?php checked( 1, $state['colors_enabled'] ) ?> /> <?php echo $label ?></label>199 <ul class=' user_colors'>203 <label><input class='side-matter-colors-enabled' type='checkbox' name='side_matter_options[<?php echo $id ?>][colors_enabled]' value='1' <?php checked( 1, $state['colors_enabled'] ) ?> /> <?php echo $label ?></label> 204 <ul class='side-matter-user-colors'> 200 205 <?php 201 206 foreach ( $colors as $color => $color_label ) { … … 203 208 <li> 204 209 <label><?php echo $color_label ?>:<br> 205 <input class='color-input <?php echo $color?>' type='text' name='side_matter_options[<?php echo $id ?>][colors][<?php echo $color ?>]' maxlength='7' data-default-color='<?php echo $this->defaults['user_colors']['colors'][ $color ] ?>' value='<?php echo $state['colors'][ $color ] ?>' /></label>210 <input class='color-input side-matter-<?php echo str_replace( '_', '-', $color ) ?>' type='text' name='side_matter_options[<?php echo $id ?>][colors][<?php echo $color ?>]' maxlength='7' data-default-color='<?php echo $this->defaults['user_colors']['colors'][ $color ] ?>' value='<?php echo $state['colors'][ $color ] ?>' /></label> 206 211 </li> 207 212 <?php … … 214 219 case 'figure_style': 215 220 ?> 216 <select name='side_matter_options[<?php echo $id ?>]' id='<?php echo $id ?>'>221 <select class='side-matter-<?php echo str_replace( '_', '-', $id ) ?>' name='side_matter_options[<?php echo $id ?>]'> 217 222 <?php 218 223 foreach ( $styles as $style => $style_title ) { … … 227 232 case 'note_adjust': 228 233 ?> 229 <label><input id='<?php echo $id?>' type='number' name='side_matter_options[<?php echo $id ?>]' value='<?php echo $state ?>' step='1' max='<?php echo $max ?>' min='<?php echo $min ?>' class='small-text' /> <?php echo $label ?></label>234 <label><input class='side-matter-<?php echo str_replace( '_', '-', $id ) ?>' type='number' name='side_matter_options[<?php echo $id ?>]' value='<?php echo $state ?>' step='1' max='<?php echo $max ?>' min='<?php echo $min ?>' class='small-text' /> <?php echo $label ?></label> 230 235 <p class='description'> 231 236 <?php echo $description ?> … … 236 241 case 'use_effects': 237 242 ?> 238 <label><input id='<?php echo $id?>' type='checkbox' name='side_matter_options[<?php echo $id ?>]' value='1' <?php checked( 1, $state ) ?> /> <?php echo $label ?></label>243 <label><input class='side-matter-<?php echo str_replace( '_', '-', $id ) ?>' type='checkbox' name='side_matter_options[<?php echo $id ?>]' value='1' <?php checked( 1, $state ) ?> /> <?php echo $label ?></label> 239 244 <?php 240 245 break; … … 242 247 foreach ( $pages as $page => $page_label ) { 243 248 ?> 244 <label><input type='checkbox' name='side_matter_options[<?php echo $id ?>][<?php echo $page ?>]' value='1' <?php checked( 1, $state[ $page ] ) ?>/> <?php echo $page_label ?></label><br>249 <label><input class='side-matter-pages-active-<?php echo str_replace( '_', '-', $page ) ?>' type='checkbox' name='side_matter_options[<?php echo $id ?>][<?php echo $page ?>]' value='1' <?php checked( 1, $state[ $page ] ) ?>/> <?php echo $page_label ?></label><br> 245 250 <?php 246 251 } … … 348 353 'georgian' => array( 'ჵ' => 10000, 'ჰ' => 9000, 'ჯ' => 8000, 'ჴ' => 7000, 'ხ' => 6000, 'ჭ' => 5000, 'წ' => 4000, 'ძ' => 3000, 'ც' => 2000, 'ჩ' => 1000, 'შ' => 900, 'ყ' => 800, 'ღ' => 700, 'ქ' => 600, 'ფ' => 500, 'ჳ' => 400, 'ტ' => 300, 'ს' => 200, 'რ' => 100, 'ჟ' => 90, 'პ' => 80, 'ო' => 70, 'ჲ' => 60, 'ნ' => 50, 'მ' => 40, 'ლ' => 30, 'კ' => 20, 'ი' => 10, 'თ' => 9, 'ჱ' => 8, 'ზ' => 7, 'ვ' => 6, 'ე' => 5, 'დ' => 4, 'გ' => 3, 'ბ' => 2, 'ა' => 1 ), 349 354 'hebrew' => array( 'ת' => 400, 'ש' => 300, 'ר' => 200, 'ק' => 100, 'צ' => 90, 'פ' => 80, 'ע' => 70, 'ס' => 60, 'נ' => 50, 'מ' => 40, 'ל' => 30, 'כ' => 20, 'יט' => 19, 'יח' => 18, 'יז' => 17, 'טז' => 16, 'טו' => 15, 'י' => 10, 'ט' => 9, 'ח' => 8, 'ז' => 7, 'ו' => 6, 'ה' => 5, 'ד' => 4, 'ג' => 3, 'ב' => 2, 'א' => 1 ), 355 'hiragana' => array( 'あ', 'い', 'う', 'え', 'お', 'か', 'き', 'く', 'け', 'こ', 'さ', 'し', 'す', 'せ', 'そ', 'た', 'ち', 'つ', 'て', 'と', 'な', 'に', 'ぬ', 'ね', 'の', 'は', 'ひ', 'ふ', 'へ', 'ほ', 'ま', 'み', 'む', 'め', 'も', 'や', 'ゆ', 'よ', 'ら', 'り', 'る', 'れ', 'ろ', 'わ', 'を', 'ん' ), 356 'hiragana-iroha' => array( 'い', 'ろ', 'は', 'に', 'ほ', 'へ', 'と', 'ち', 'り', 'ぬ', 'る', 'を', 'わ', 'か', 'よ', 'た', 'れ', 'そ', 'つ', 'ね', 'な', 'ら', 'む', 'う', 'ゐ', 'の', 'お', 'く', 'や', 'ま', 'け', 'ふ', 'こ', 'え', 'て', 'あ', 'さ', 'き', 'ゆ', 'め', 'み', 'し', 'ゑ', 'ひ', 'も', 'せ', 'す', 'ん' ), 357 'katakana' => array( 'ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ヲ', 'ン' ), 358 'katakana-iroha' => array( 'イ', 'ロ', 'ハ', 'ニ', 'ホ', 'ヘ', 'ト', 'チ', 'リ', 'ヌ', 'ル', 'ヲ', 'ワ', 'カ', 'ヨ', 'タ', 'レ', 'ソ', 'ツ', 'ネ', 'ナ', 'ラ', 'ム', 'ウ', 'ヰ', 'ノ', 'オ', 'ク', 'ヤ', 'マ', 'ケ', 'フ', 'コ', 'エ', 'テ', 'ア', 'サ', 'キ', 'ユ', 'メ', 'ミ', 'シ', 'ヱ', 'ヒ', 'モ', 'セ', 'ス', 'ン' ), 350 359 'lower-alpha' => array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' ), 351 360 'lower-greek' => array( 'α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ', 'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω' ), … … 371 380 public function get_figure( $note_id, $style ) { // Convert numeral to alternate format 372 381 373 $figures = $this->figures;374 375 382 switch ( $style ) { 376 383 case 'armenian': … … 378 385 case 'hebrew': 379 386 case 'lower-roman': 380 return $this->get_additive( $note_id, $figures[ $style ] ); 381 break; 387 return $this->get_additive( $note_id, $this->figures[ $style ] ); 388 break; 389 case 'hiragana': 390 case 'hiragana-iroha': 391 case 'katakana': 392 case 'katakana-iroha': 393 case 'lower-alpha': 382 394 case 'lower-greek': 383 case 'lower-alpha': 384 return $this->get_alpha( $note_id, $figures[ $style ] ); 395 return $this->get_alpha( $note_id, $this->figures[ $style ] ); 385 396 break; 386 397 case 'none': -
side-matter/trunk/uninstall.php
r741424 r759753 2 2 /* 3 3 uninstall.php 4 Version 1. 04 Version 1.1 5 5 6 6 Plugin: Side Matter
Note: See TracChangeset
for help on using the changeset viewer.