Skip to content
Snippets Groups Projects
Commit bd431c83 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

[gh-403] Use a cookie to preserve css/js syntax highlighting

parent 207edd57
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@
});
$(this).data('editor', editor);
$(this).text(Drupal.t('Disable syntax highlighting')).addClass('enabled');
$.cookie('codeHighlight', true);
}
// Disable
......@@ -37,10 +38,16 @@
$(this).data('editor').toTextArea();
$grippie.show();
$(this).text(Drupal.t('Enable syntax highlighting')).removeClass('enabled');
$.cookie('codeHighlight', null);
}
return false;
});
// Enable on page load if cookie is set
if ($.cookie('codeHighlight')) {
$('.codemirror-toggle').click();
}
}
};
......
......@@ -103,7 +103,7 @@ function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state) {
'#title' => t('Advanced settings'),
'sidebar_first_width' => array(
'#type' => 'textfield',
'#title' => t('Sidebar first Grid Size'),
'#title' => t('Sidebar first grid size'),
'#default_value' => theme_get_setting('sidebar_first_width'),
'#description' => t('Enter only the numeral, for grid4 just enter 4.'),
),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment