From 0c27985c1c8d19d70bab8510770b3ea1df43e5a5 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Tue, 29 Jan 2019 21:02:53 +0100 Subject: news: get rid of inline css styles Remove the usage of an inline style for hiding #news-preview and hide it in our global css. Also move the newspreview function to it's sole user to reduce our global JS size. --- sitestatic/archweb.css | 4 ++++ sitestatic/archweb.js | 17 ----------------- templates/news/add.html | 18 ++++++++++++++++-- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/sitestatic/archweb.css b/sitestatic/archweb.css index f4b791ac..efa5c04d 100644 --- a/sitestatic/archweb.css +++ b/sitestatic/archweb.css @@ -653,6 +653,10 @@ div.news-article .article-info { width: 75%; } +#news-preview { + display: none; +} + /* todolists: list */ .todolist-nav { float: right; diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index b8ad6817..ae4a1f1c 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -178,23 +178,6 @@ if (typeof $ !== 'undefined' && typeof $.tablesorter !== 'undefined') { }; })(jQuery); -/* news/add.html */ -function enablePreview() { - $('#news-preview-button').click(function(event) { - event.preventDefault(); - $.post('/news/preview/', { - data: $('#id_content').val(), - csrfmiddlewaretoken: $('#newsform input[name=csrfmiddlewaretoken]').val() - }, - function(data) { - $('#news-preview-data').html(data); - $('#news-preview').show(); - } - ); - $('#news-preview-title').html($('#id_title').val()); - }); -} - /* packages/details.html */ function ajaxifyFiles() { $('#filelink').click(function(event) { diff --git a/templates/news/add.html b/templates/news/add.html index f171b503..7efc7b72 100644 --- a/templates/news/add.html +++ b/templates/news/add.html @@ -29,13 +29,27 @@ -