Skip to content
Extraits de code Groupes Projets
Valider a5084cfa rédigé par echarp's avatar echarp
Parcourir les fichiers

French typography, spacing at least, when applicable

parent ec60e885
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -22,6 +22,7 @@
#= require leaflet
#= require leaflet.markercluster
#= require leaflet.awesome-markers
#= require frTypo
#= require_tree .
$(document).on 'turbolinks:load', ->
......
###
@licstart The following is the entire license notice for the JavaScript code in this page.
frTypo, la typographie française simplifiée
Copyright (C) 2013 acoeuro
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
@licend The above is the entire license notice for the JavaScript code in this page.
###
$(document).on 'turbolinks:load', ->
if $('html').attr('lang') == 'fr'
# Ne devrait s'appliquer qu'à une page en français
$('body *').contents().filter ->
this.nodeType == Node.TEXT_NODE
.filter ->
# Supprime les éléments pouvant utiliser des ponctuations sans nécessiter
# un espacement
0 > ['CODE', 'PRE', 'STYLE'].indexOf this.parentNode.tagName
.filter ->
this.nodeValue.match(regexp)? || this.nodeValue.match(regexpPost)?
.each ->
console.log 'huuu'
$(this).replaceWith ->
this.nodeValue
.replace(regexp, '$1<span class="finePre">$2</span>$3')
.replace(regexpPost, '<span class="finePost">$1</span>$2')
regexp = /([\w])([!?:;»%])([\s]|[^\w\/]|$)/g
regexpPost = /([«])([\w])/g
......@@ -12,6 +12,7 @@
*
*= require jquery-ui
*= require jquery.tagsinput
*= require frTypo
*= require_tree .
*/
......
.finePre, .city:after, span.label:after
margin-left: 0.25em
.finePost
margin-right: 0.25em
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter