Campaign CSS Splitter

Splits the Campaign CSS editor into multiple named fields for easier management and adds syntax highlighting

Versión del día 26/08/2021. Echa un vistazo a la versión más reciente.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

Autor
Salvatos
Calificaciones
0 0 0
Versión
1
Creado
26/08/2021
Actualizado
26/08/2021
Tamaño
8.36 KB
Licencia
Desconocida
Funciona en

This script introduces multiple changes to the Boosted tab of the Edit Campaign form in Kanka. The cornerstone feature is that you can click a button to split your CSS into multiple form fields. Those fields are collapsed by default to help you quickly find the section you need, they can be renamed and reordered easily and they provide syntax highlighting using a customizable theme.

IMPORTANT: BACK UP YOUR CSS BEFORE USING THIS SCRIPT

It's still early in this script's life and you might lose changes. Most notably, submitting the form while your code is split into sections could lead to unexpected results, and certainly would discard all changes made while split. I might be able to properly interface with the form submission button and keyboard shortcut in the distant future, but that is not a priority at the moment.

How to

Split/merge code

Just click the Split CSS sections button above the default CSS field to activate syntax highlighting and split your code into multiple fields if you already have section delimiters in place. If not, you can use the Create new section button below the editor to add more sections. When you're done editing, remember to click the Merge CSS sections button before saving!

Expand/collapse sections

Each code block is hidden in a details HTML element and collapsed by default. Depending on your browser, there should be an arrow or some other icon near each title to expand and collapse each section.

Rename sections

Each section name is an input field that you can edit. Of course, changes to titles in the full (flat) CSS will also be reflected when splitting again.

Reorder sections

Next to each section name, an icon (arrows pointing to the four cardinal directions) can be clicked and dragged to move the section to another position. When you merge the fields, the flat CSS field will reflect this new order.

Manually create sections

The script looks for the following syntax for section titles: /*† Title †*/. Any such comments already in your code will be handled seamlessly.

Change the editor's appearance

You can find instructions at the top of the script on how to choose and change the editor's theme in your copy of the script. You can also add your own CSS rules to the .CodeMirror element in your campaign CSS or in your copy of the script. Just remember to reapply your changes when updating the script, as there will certainly be updates at this stage.

This script relies on CodeMirror for the syntax highlighting, automatic indentation and related features. I've kept the editor close to default settings for now, but feel free to get in touch to request additional CM options and features be added to the script by default or via configuration options.