diff --git a/vasl_templates/webapp/static/css/custom-bullets.css b/vasl_templates/webapp/static/css/custom-bullets.css new file mode 100644 index 0000000..e6bbe95 --- /dev/null +++ b/vasl_templates/webapp/static/css/custom-bullets.css @@ -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 ; } diff --git a/vasl_templates/webapp/static/css/html-editor.css b/vasl_templates/webapp/static/css/html-editor.css index 0689d2a..60f38e0 100644 --- a/vasl_templates/webapp/static/css/html-editor.css +++ b/vasl_templates/webapp/static/css/html-editor.css @@ -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 ; } diff --git a/vasl_templates/webapp/static/user_settings.js b/vasl_templates/webapp/static/user_settings.js index 5a2919d..669a16f 100644 --- a/vasl_templates/webapp/static/user_settings.js +++ b/vasl_templates/webapp/static/user_settings.js @@ -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 = $( "" ) ; + $( "head" ).append( $link ) ; + } + } else { + // nope - remove our custom CSS + $link.remove() ; + } } // --------------------------------------------------------------------