Only show custom list bullets in the UI if they have been enabled.

master
Pacman Ghost 2 years ago committed by Pacman Ghost
parent 53e14f753f
commit 4629b3421b
  1. 5
      vasl_templates/webapp/static/css/custom-bullets.css
  2. 6
      vasl_templates/webapp/static/css/html-editor.css
  3. 16
      vasl_templates/webapp/static/user_settings.js

@ -0,0 +1,5 @@
/* NOTE: This stylesheet will be dynamically injected into the UI when custom list bullets are enabled. */
.trumbowyg-editor ul { list-style-image: url("../images/bullet.png") ; }
.trumbowyg-editor ul ul { list-style-image: url("../images/bullet2.png") ; }
.trumbowyg-editor ul ul ul { list-style-image: url("../images/bullet3.png") ; }
.trumbowyg-editor ol { list-style-image: none ; }

@ -7,12 +7,8 @@
.trumbowyg-button-group button::after { top: 25px !important ; }
/* custom bullets for the editor */
.trumbowyg-editor ul { margin: 0 0 0 0.9em ; }
.trumbowyg-editor ol { margin: 0 0 0 1.8em ; list-style-image: none ; }
.trumbowyg-editor ul { list-style-image: url("../images/bullet.png") ; }
.trumbowyg-editor ul ul { list-style-image: url("../images/bullet2.png") ; }
.trumbowyg-editor ul ul ul { list-style-image: url("../images/bullet3.png") ; }
.trumbowyg-editor ol { margin: 0 0 0 1.8em ; }
/* make tables visible in the editor */
.trumbowyg-editor table.table { width: auto ; }

@ -1,4 +1,5 @@
SCENARIO_IMAGES_SOURCE_THIS_PROGRAM = 1 ;
SCENARIO_IMAGES_SOURCE_INTERNET = 2 ;
DEFAULT_USER_SETTINGS = {
@ -177,6 +178,21 @@ function apply_user_settings()
$.datepicker.formatDate( date_format, curr_date )
).trigger( "change" ) ;
}
// check if custom list bullets have been enabled
var $link = $( "head link[data-id='custom-bullets']" ) ;
if ( gUserSettings[ "custom-list-bullets" ] )
{
// yup - inject our custom CSS into the UI to show them
if ( $link.length === 0 ) {
var url = make_app_url( "/static/css/custom-bullets.css" ) ;
$link = $( "<link href='" + url + "' type='text/css' rel='stylesheet' data-id='custom-bullets'></link>" ) ;
$( "head" ).append( $link ) ;
}
} else {
// nope - remove our custom CSS
$link.remove() ;
}
}
// --------------------------------------------------------------------

Loading…
Cancel
Save