From 015215a629f46c5c9081a55b13475a0c76f66cf3 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 15 Feb 2015 13:12:26 -0800 Subject: [PATCH] Make CSS readable in compiled script. --- src/General/Main.coffee | 18 ++++++++---------- src/General/css/style.css | 6 +++--- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 179e80484..2bc10ba9b 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -283,16 +283,14 @@ Main = $.ready -> cb() if Main.isThisPageLegit() - css: """ - <%= grunt.file.read('src/General/css/font-awesome.css').replace(/\s+/g, ' ').replace(/\\/g, '\\\\').trim() %> - <%= grunt.file.read('src/General/css/style.css').replace(/\s+/g, ' ').trim() %> - <%= grunt.file.read('src/General/css/yotsuba.css').replace(/\s+/g, ' ').trim() %> - <%= grunt.file.read('src/General/css/yotsuba-b.css').replace(/\s+/g, ' ').trim() %> - <%= grunt.file.read('src/General/css/futaba.css').replace(/\s+/g, ' ').trim() %> - <%= grunt.file.read('src/General/css/burichan.css').replace(/\s+/g, ' ').trim() %> - <%= grunt.file.read('src/General/css/tomorrow.css').replace(/\s+/g, ' ').trim() %> - <%= grunt.file.read('src/General/css/photon.css').replace(/\s+/g, ' ').trim() %> - """ + css: `<%= + grunt.template.process( + ['font-awesome', 'style', 'yotsuba', 'yotsuba-b', 'futaba', 'burichan', 'tomorrow', 'photon'].map(function(name) { + return grunt.file.read('src/General/css/'+name+'.css'); + }).join(''), + {data: {type: type}} + ).trim().replace(/\n+/g, '\n').split(/^/m).map(JSON.stringify).join(' +\n').replace(/`/g, '\\`') + %>` features: [ ['Polyfill', Polyfill] diff --git a/src/General/css/style.css b/src/General/css/style.css index fed33c815..35e3454c6 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -266,10 +266,10 @@ audio.controls-added { display: none; } .brackets-wrap::before { - content: "\\00a0["; + content: "\00a0["; } .brackets-wrap::after { - content: "]\\00a0"; + content: "]\00a0"; } .dead-thread, .disabled:not(.replies-quoting-you) { @@ -773,7 +773,7 @@ span.hide-announcement { flex: 0 0 auto; } #watched-threads .watcher-unread::after { - content: "\\00a0"; + content: "\00a0"; } #watched-threads .watcher-title { overflow: hidden;