more chord polish...

This commit is contained in:
Tomas Groth 2017-02-23 22:40:22 +01:00
parent 9c299af567
commit aac10c5d2c
5 changed files with 36 additions and 35 deletions

View File

@ -382,11 +382,11 @@ def expand_and_align_chords_in_line(match):
if '_' in whitespaces: if '_' in whitespaces:
ws_length = len(whitespaces) ws_length = len(whitespaces)
if ws_length == 1: if ws_length == 1:
whitespaces = '-' whitespaces = '–'
else: else:
wsl_mod = ws_length // 2 wsl_mod = ws_length // 2
ws_right = ws_left = ' ' * wsl_mod ws_right = ws_left = ' ' * wsl_mod
whitespaces = ws_left + '-' + ws_right whitespaces = ws_left + '–' + ws_right
whitespaces = '<span class="ws">' + whitespaces + '</span>' whitespaces = '<span class="ws">' + whitespaces + '</span>'
return '<span class="chord"><span><strong>' + chord + '</strong></span></span>' + tail + whitespaces + remainder return '<span class="chord"><span><strong>' + chord + '</strong></span></span>' + tail + whitespaces + remainder

View File

@ -4,7 +4,7 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers # # Copyright (c) 2008-2017 OpenLP Developers #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it # # This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free # # under the terms of the GNU General Public License as published by the Free #
@ -33,7 +33,7 @@
<input type="hidden" id="next-text" value="${next}" /> <input type="hidden" id="next-text" value="${next}" />
<div id="right"> <div id="right">
<div id="clock"></div> <div id="clock"></div>
<div id="chords">Toggle Chords</div> <div id="chords" class="button">Toggle Chords</div>
<div id="notes"></div> <div id="notes"></div>
</div> </div>
<div id="header"> <div id="header">

View File

@ -1,7 +1,7 @@
/****************************************************************************** /******************************************************************************
* OpenLP - Open Source Lyrics Projection * * OpenLP - Open Source Lyrics Projection *
* --------------------------------------------------------------------------- * * --------------------------------------------------------------------------- *
* Copyright (c) 2008-2016 OpenLP Developers * * Copyright (c) 2008-2017 OpenLP Developers *
* --------------------------------------------------------------------------- * * --------------------------------------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it * * This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the Free * * under the terms of the GNU General Public License as published by the Free *
@ -17,17 +17,8 @@
* Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Temple Place, Suite 330, Boston, MA 02111-1307 USA *
******************************************************************************/ ******************************************************************************/
#chords {
font-size: 20pt;
color: gray;
background-color: gray;
color: white;
cursor: pointer;
}
#header { #header {
padding-bottom: 1em; padding-bottom: 1em;
} }
#transpose, #transpose,
@ -39,29 +30,35 @@
vertical-align: middle; vertical-align: middle;
} }
#header .button, .button {
#plus,
#minus {
display: inline-block; display: inline-block;
width: 1.2em; box-sizing: border-box;
border: 1px solid gray;
border-radius: .3em;
padding: 0 .2em;
min-width: 1.2em;
line-height: 1.2em; line-height: 1.2em;
vertical-align: middle; font-size: 25pt;
color: white; font-weight: bold;
background-color: gray;
font-size: 30pt;
text-align: center; text-align: center;
cursor: pointer; text-decoration: none;
} text-shadow: 0px 1px 0px white;
color: black;
#chords { background: linear-gradient(to bottom, white 5%, gray 100%);
line-height: 1.2em;
color: gray;
background-color: gray; background-color: gray;
color: white;
cursor: pointer; cursor: pointer;
} }
.button:hover {
background: linear-gradient(to bottom, white 10%, gray 150%);
color: darkslategray ;
background-color: gray;
}
.button:active {
position:relative;
top:1px;
}
/* Extending exiting definition in stage.css */ /* Extending existing definition in stage.css */
#verseorder { #verseorder {
line-height: 1.5; line-height: 1.5;
display: inline-block; display: inline-block;
@ -92,6 +89,7 @@
.ws { .ws {
white-space: pre-wrap; white-space: pre-wrap;
font-family: monospace;
} }
#nextslide .chordline span.chord span strong { #nextslide .chordline span.chord span strong {

View File

@ -21,6 +21,10 @@ body {
background-color: black; background-color: black;
font-family: sans-serif; font-family: sans-serif;
overflow: hidden; overflow: hidden;
-webkit-user-select: none; /* Chrome/Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE 10+ */
user-select: none; /* Future */
} }
#currentslide { #currentslide {

View File

@ -1,7 +1,7 @@
/****************************************************************************** /******************************************************************************
* OpenLP - Open Source Lyrics Projection * * OpenLP - Open Source Lyrics Projection *
* --------------------------------------------------------------------------- * * --------------------------------------------------------------------------- *
* Copyright (c) 2008-2016 OpenLP Developers * * Copyright (c) 2008-2017 OpenLP Developers *
* --------------------------------------------------------------------------- * * --------------------------------------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it * * This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the Free * * under the terms of the GNU General Public License as published by the Free *
@ -73,7 +73,7 @@ function transposeChord(chord, transposeValue, notation) {
rest = ""; rest = "";
} }
notenumber = (notesSharp.indexOf(note) === -1 ? notesFlat.indexOf(note) : notesSharp.indexOf(note)); notenumber = (notesSharp.indexOf(note) === -1 ? notesFlat.indexOf(note) : notesSharp.indexOf(note));
notenumber -= parseInt(transposeValue); notenumber += parseInt(transposeValue);
while (notenumber > 11) { while (notenumber > 11) {
notenumber -= 12; notenumber -= 12;
} }
@ -213,11 +213,11 @@ window.OpenLP = {
if (w[0] == '_') { if (w[0] == '_') {
ws_length = w.length; ws_length = w.length;
if (ws_length==1) { if (ws_length==1) {
w = '-'; w = '&ndash;';
} else { } else {
wsl_mod = Math.floor(ws_length / 2); wsl_mod = Math.floor(ws_length / 2);
ws_right = ws_left = new Array(wsl_mod +1).join(' '); ws_right = ws_left = new Array(wsl_mod +1).join(' ');
w = ws_left + '-' + ws_right; w = ws_left + '&ndash;' + ws_right;
} }
} }
w='<span class="ws">' + w + '</span>'; w='<span class="ws">' + w + '</span>';
@ -328,6 +328,5 @@ $(document).ready(function() {
$('#chords').click(function () { $('#chords').click(function () {
OpenLP.showchords = OpenLP.showchords ? false : true; OpenLP.showchords = OpenLP.showchords ? false : true;
OpenLP.loadSlides(); OpenLP.loadSlides();
$
}); });
}); });