mirror of
https://github.com/soulaklabs/bitoduc.fr.git
synced 2025-12-09 09:33:23 +00:00
Nettoyage du javascript
- Renommage de creuille.js en principal.js (plus soutenu et surtout plus bitoduc) - Utilisation de "'use strict';" - Code de gogol analytique mis dans un fichier dédié
This commit is contained in:
8
fr.js
8
fr.js
@@ -1,13 +1,15 @@
|
||||
Objet = Object
|
||||
'use strict';
|
||||
|
||||
var Objet = Object
|
||||
Objet.creer = Objet.create
|
||||
|
||||
Chaine = String
|
||||
var Chaine = String
|
||||
Chaine.prototype.enMinuscules = Chaine.prototype.toLowerCase
|
||||
Chaine.prototype.enMajuscules = Chaine.prototype.toUpperCase
|
||||
Chaine.prototype.remplacer = Chaine.prototype.replace
|
||||
Chaine.prototype.caractereA = Chaine.prototype.charAt
|
||||
|
||||
Tableau = Array
|
||||
var Tableau = Array
|
||||
Tableau.prototype.tri = Tableau.prototype.sort
|
||||
Tableau.prototype.longueur = function () { return this.length; }
|
||||
Tableau.prototype.pousser = Tableau.prototype.push
|
||||
|
||||
19
gogol-analytique.js
Normal file
19
gogol-analytique.js
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
$(function() {
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.pousser(['_setAccount', 'UA-42609030-1']);
|
||||
_gaq.pousser(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.creerElement('script');
|
||||
ga.type = 'text/javascript';
|
||||
ga.async = true;
|
||||
ga.src =
|
||||
('https:' == document.localisation.protocole ?
|
||||
'https://ssl' : 'http://www')
|
||||
+ '.google-analytics.com/ga.js';
|
||||
var s = document.recupererElementParNomDEtiquette('script')[0];
|
||||
s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
});
|
||||
23
index.html
23
index.html
@@ -8,29 +8,10 @@
|
||||
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||
<script type="text/javascript" src="fr.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="creuille.js" charset="utf-8"></script>
|
||||
<script>
|
||||
$( function() {
|
||||
$.recupererJSON( "traductions.json", function( traductions ) {
|
||||
construitListe(traductions);
|
||||
$( "#lienChange" ).clic( function() {changeDeSens(traductions);} );
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="principal.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="gogol-analytique.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.pousser(['_setAccount', 'UA-42609030-1']);
|
||||
_gaq.pousser(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.creerElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.localisation.protocole ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.recupererElementParNomDEtiquette('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
<div id="tout">
|
||||
<h1>Bitoduc.fr : termes informatiques en français</h1>
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var reciproque = {'anglais': 'francais', 'francais': 'anglais'};
|
||||
var embelli = {'francais': 'Français', 'anglais': 'Anglais'};
|
||||
|
||||
@@ -123,3 +125,11 @@ function construitListe(traductions) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$.recupererJSON( "traductions.json", function( traductions ) {
|
||||
construitListe(traductions);
|
||||
$( "#lienChange" ).clic( function() {changeDeSens(traductions);} );
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user