├── .gitignore ├── screenshots ├── indent-guides-on.png ├── indent-guides-dark.png ├── indent-guides-off.png └── indent-guides-red-dotted.png ├── CHANGELOG.md ├── package.json ├── nls ├── de │ └── strings.js ├── root │ └── strings.js ├── sv │ └── strings.js ├── pl │ └── strings.js └── strings.js ├── strings.js ├── README.md ├── main.js └── snap.svg-min.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /screenshots/indent-guides-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkcampbell/brackets-indent-guides/HEAD/screenshots/indent-guides-on.png -------------------------------------------------------------------------------- /screenshots/indent-guides-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkcampbell/brackets-indent-guides/HEAD/screenshots/indent-guides-dark.png -------------------------------------------------------------------------------- /screenshots/indent-guides-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkcampbell/brackets-indent-guides/HEAD/screenshots/indent-guides-off.png -------------------------------------------------------------------------------- /screenshots/indent-guides-red-dotted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkcampbell/brackets-indent-guides/HEAD/screenshots/indent-guides-red-dotted.png -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.3.11 (09/03/2017) 4 | * Indent Guides now work in Quick Edit editor 5 | 6 | ## 1.3.10 (07/22/2017) 7 | * Polish translation by [Michał Korczak](https://github.com/MajkelKorczak) 8 | 9 | ## 1.3.9 (04/23/2017) 10 | * Swedish translation by [Mikael Jorhult](https://github.com/mikaeljorhult) 11 | 12 | ## 1.3.8 (04/22/2017) 13 | * German translation by [FW](https://github.com/tweakimp) 14 | 15 | ## 1.3.7 (04/08/2017) 16 | * Add support for multiple languages 17 | 18 | ## 1.3.6 (04/07/2017) 19 | * Added screenshots 20 | * Added Change Log 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "brackets-indent-guides", 3 | "title": "Indent Guides", 4 | "version": "1.3.11", 5 | "description": "Show indent guides in the code editor.", 6 | "homepage": "https://github.com/lkcampbell/brackets-indent-guides", 7 | "author": "Lance Campbell (https://github.com/lkcampbell)", 8 | "contributors": [ 9 | "Kenneth Sundqvist (https://github.com/EvilOatmeal)", 10 | "FW (https://github.com/tweakimp)", 11 | "Mikael Jorhult (https://github.com/mikaeljorhult)", 12 | "Michał Korczak (https://github.com/MajkelKorczak)" 13 | ], 14 | "license": "MIT", 15 | "categories": "editing", 16 | "keywords": [ 17 | "indentation", 18 | "guide" 19 | ], 20 | "i18n": ["en", 21 | "de", 22 | "pl", 23 | "sv"], 24 | "package-i18n": { 25 | "de": { 26 | "title": "Einzugslinien", 27 | "description": "Zeige Einzugslinien im Codeeditor." 28 | }, 29 | "pl": { 30 | "title": "Podpowiedzi Wcięć", 31 | "description": "Pokaż podpowiedzi wcięć w edytorze kodu." 32 | }, 33 | "sv": { 34 | "title": "Indragslinjer", 35 | "description": "Visa stödlinjer för indentering i kodeditorn." 36 | } 37 | }, 38 | "engines": { 39 | "brackets": ">=1.9.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /nls/de/strings.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright (c) 2017 Lance Campbell. All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | * DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | 25 | /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ 26 | /*global define */ 27 | 28 | define({ 29 | COMMAND_NAME: "Einzugslinien", 30 | DESCRIPTION_ENABLED: "Aktiviert die Einzugslinien.", 31 | DESCRIPTION_HIDE_FIRST: "Entscheidet, ob die erste Einzugslinie angezeigt wird.", 32 | DESCRIPTION_GUIDE_COLOR: "Die Farbe der Einzugslinien. Jeder valide CSS-Farbwert ist möglich.", 33 | DESCRIPTION_GUIDE_STYLE: "Wählt den Stil der Einzugslinie: 'solid'(durchgezogen) oder 'dotted'(gepunktet)." 34 | }); 35 | -------------------------------------------------------------------------------- /nls/root/strings.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright (c) 2017 Lance Campbell. All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | * DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | 25 | /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ 26 | /*global define */ 27 | 28 | define({ 29 | COMMAND_NAME: "Indent Guides", 30 | DESCRIPTION_ENABLED: "Determines whether the indent guides will be shown or hidden.", 31 | DESCRIPTION_HIDE_FIRST: "Determines whether the first Indent Guide will be hidden or shown.", 32 | DESCRIPTION_GUIDE_COLOR: "The color of the indent guides. Can be any valid CSS Color value.", 33 | DESCRIPTION_GUIDE_STYLE: 'This value determines the style of the guide: "solid" or "dotted".' 34 | }); 35 | -------------------------------------------------------------------------------- /nls/sv/strings.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright (c) 2017 Lance Campbell. All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | * DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | 25 | /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ 26 | /*global define */ 27 | 28 | define({ 29 | COMMAND_NAME: "Indragslinjer", 30 | DESCRIPTION_ENABLED: "Avgör om indragslinjer ska visas eller inte.", 31 | DESCRIPTION_HIDE_FIRST: "Avgör om den första indragslinjen ska visas eller inte.", 32 | DESCRIPTION_GUIDE_COLOR: "Färg på indragslinjer. Kan anges i alla giltiga färgvärden i CSS.", 33 | DESCRIPTION_GUIDE_STYLE: 'Detta värde avgör vilken typ av linje som ska användas: "solid" (heldragen) eller "dotted" (streckad).' 34 | }); 35 | -------------------------------------------------------------------------------- /nls/pl/strings.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright (c) 2017 Lance Campbell. All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | * DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | 25 | /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ 26 | /*global define */ 27 | 28 | define({ 29 | COMMAND_NAME: "Podpowiedzi Wcięć", 30 | DESCRIPTION_ENABLED: "Określa czy podpowiedzi wcięć będą pokazywane lub ukrywane.", 31 | DESCRIPTION_HIDE_FIRST: "Określa czy pierwsza Podpowiedź Wcięcia będzie pokazana lub ukryta.", 32 | DESCRIPTION_GUIDE_COLOR: "Kolor podpowiedzi wcięć. Może być dowolną prawidłową wartością koloru CSS.", 33 | DESCRIPTION_GUIDE_STYLE: 'Ta wartość określa styl wcięć: "solid" (lity) lub "dotted" (kropkowanym).' 34 | }); 35 | -------------------------------------------------------------------------------- /strings.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright (c) 2017 Lance Campbell. All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | * DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | 25 | /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ 26 | /*global define */ 27 | 28 | /** 29 | * This file provides the interface to user visible strings in Brackets. Code that needs 30 | * to display strings should should load this module by calling var Strings = require("strings"). 31 | * The i18n plugin will dynamically load the strings for the right locale and populate 32 | * the exports variable. See src\nls\strings.js for the master file of English strings. 33 | */ 34 | define(function (require, exports, module) { 35 | "use strict"; 36 | module.exports = require("i18n!nls/strings"); 37 | }); -------------------------------------------------------------------------------- /nls/strings.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright (c) 2017 Lance Campbell. All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | * DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | 25 | /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ 26 | /*global define */ 27 | 28 | define(function (require, exports, module) { 29 | 30 | 'use strict'; 31 | 32 | // Code that needs to display user strings should call require("strings") to load 33 | // strings.js. This file will dynamically load strings.js for the specified by bracketes.locale. 34 | // 35 | // Translations for other locales should be placed in nls/>/strings.js 36 | // Localization is provided via the i18n plugin. 37 | // All other bundles for languages need to add a prefix to the exports below so i18n can find them. 38 | // TODO: dynamically populate the local prefix list below? 39 | module.exports = { 40 | root: true, 41 | de: true, 42 | pl: true, 43 | sv: true 44 | }; 45 | }); 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Indent Guides for Brackets 2 | An extension for [Brackets](https://github.com/adobe/brackets/) to show indent guides in the code editor. 3 | 4 | ### How to Install 5 | 1. Select **Brackets > File > Extension Manager...** 6 | 2. Search for this extension. 7 | 3. Click on the **Install** button. 8 | 9 | ### How to Use Extension 10 | Toggle the extension with **View > Indent Guides**. 11 | 12 | ## Screenshots: 13 | 14 | **Life without Indent Guides**: 15 | 16 | ![off](screenshots/indent-guides-off.png) 17 | 18 | **Life *with* Indent Guides**: 19 | 20 | ![on](screenshots/indent-guides-on.png) 21 | 22 | **Works great in the dark as well**: 23 | 24 | ![dark](screenshots/indent-guides-dark.png) 25 | 26 | **Preferences let you control the style and color**: 27 | 28 | ![preferences](screenshots/indent-guides-red-dotted.png) 29 | 30 | ### Extension Preferences 31 | 32 | **`brackets-indent-guides.enabled`** *(boolean)*
33 | Determines whether the indent guides will be shown or hidden. 34 | 35 | **`brackets-indent-guides.hideFirst`** *(boolean)*
36 | Determines whether the first Indent Guide will be hidden or shown. 37 | 38 | **`brackets-indent-guides.guideColor`** *(string)*
39 | The color of the indent guides. Can be any valid CSS Color value. 40 | 41 | **`brackets-indent-guides.guideStyle`** *(string)*
42 | This value determines the style of the guide: "solid" or "dotted". 43 | 44 | For more information on setting preferences see [How to Use Brackets - Preferences](https://github.com/adobe/brackets/wiki/How-to-Use-Brackets#preferences) 45 | 46 | ### Custom Key Bindings 47 | 48 | If you would like to add a customized keyboard shortcut to toggle indent guides, 49 | set your shortcut key to the following command id: `lkcampbell.toggleIndentGuides`. 50 | 51 | For example, if you want the shortcut `Ctrl-Shift-I` to toggle the indent guides, 52 | type the following entry into the `overrides` section of your `keyboardmap.json` 53 | file: 54 | 55 | `"Ctrl-Shift-I": "lkcampbell.toggleIndentGuides"` 56 | 57 | For more information on setting Custom Key Bindings see [User Key Bindings](https://github.com/adobe/brackets/wiki/User-Key-Bindings). 58 | 59 | ### Code Challenges 60 | 61 | Code challenges are closed issues and enhancement requests that I have attempted 62 | to resolve without success. Maybe you have an idea that will help? 63 | 64 | Just look for the `code challenge` label in the closed issues list. Post a comment 65 | on the issue and we can discuss your solution ideas. Here is a list of the current 66 | code challenges for this extension: 67 | 68 | 1. [Empty lines do not display indent guides](https://github.com/lkcampbell/brackets-indent-guides/issues/16) 69 | 1. [Show only one indent guide in hanging indent](https://github.com/lkcampbell/brackets-indent-guides/issues/11) 70 | 1. [Indent guides make scrolling less performant](https://github.com/lkcampbell/brackets-indent-guides/issues/12) 71 | 1. [Only show indent guides when text is present on line](https://github.com/lkcampbell/brackets-indent-guides/issues/15) 72 | 73 | ### License 74 | MIT-licensed -- see `main.js` for details. 75 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright (c) 2013-2014 Lance Campbell. All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | * DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | 25 | /*jslint vars: true, plusplus: true, devel: true, regexp: true, nomen: true, indent: 4, maxerr: 50 */ 26 | /*global define, brackets, $ */ 27 | 28 | define(function (require, exports, module) { 29 | "use strict"; 30 | 31 | // Brackets modules 32 | var PreferencesManager = brackets.getModule("preferences/PreferencesManager"), 33 | Menus = brackets.getModule("command/Menus"), 34 | Editor = brackets.getModule("editor/Editor").Editor, 35 | EditorManager = brackets.getModule("editor/EditorManager"), 36 | AppInit = brackets.getModule("utils/AppInit"), 37 | CommandManager = brackets.getModule("command/CommandManager"), 38 | MainViewManager = brackets.getModule("view/MainViewManager"); 39 | 40 | // Local modules 41 | var Strings = require("strings"); 42 | 43 | // SVG support 44 | var Snap = require("snap.svg-min"); 45 | 46 | // Constants 47 | var COMMAND_NAME = Strings.COMMAND_NAME, 48 | COMMAND_ID = "lkcampbell.toggleIndentGuides", 49 | GUIDE_CLASS = "lkcampbell-indent-guides"; 50 | 51 | var guideSVG = null, 52 | guideRect = null; 53 | 54 | // Define extension preferences 55 | var enabled = false, 56 | hideFirst = false, 57 | guideColor = "rgba(128, 128, 128, 0.5)", 58 | guideStyle = "solid", 59 | prefs = PreferencesManager.getExtensionPrefs("brackets-indent-guides"); 60 | 61 | prefs.definePreference("enabled", "boolean", enabled, { 62 | description: Strings.DESCRIPTION_ENABLED 63 | }); 64 | 65 | prefs.definePreference("hideFirst", "boolean", hideFirst, { 66 | description: Strings.DESCRIPTION_HIDE_FIRST 67 | }); 68 | 69 | prefs.definePreference("guideColor", "string", guideColor, { 70 | description: Strings.DESCRIPTION_GUIDE_COLOR 71 | }); 72 | 73 | prefs.definePreference("guideStyle", "string", guideStyle, { 74 | description: Strings.DESCRIPTION_GUIDE_STYLE, 75 | values: ["solid", "dotted"] 76 | }); 77 | 78 | function updateStyleRules() { 79 | var svgStr = "", 80 | imgStr = "", 81 | cssStr = ""; 82 | 83 | if ($("#lkcampbell-indent-guides-css").length) { 84 | $("#lkcampbell-indent-guides-css").remove(); 85 | } 86 | 87 | svgStr = window.btoa(guideSVG.toString()); 88 | imgStr = "url(data:image/svg+xml;base64," + svgStr + ")"; 89 | 90 | cssStr = ".cm-lkcampbell-indent-guides { "; 91 | cssStr += "position: relative; "; 92 | cssStr += "background-repeat: repeat-y; "; 93 | cssStr += "background-image: " + imgStr + "; "; 94 | cssStr += "}"; 95 | 96 | $("