Selaa lähdekoodia

init projet

master
Heuzef 8 vuotta sitten
vanhempi
commit
d68c4e73c5
5 muutettua tiedostoa jossa 225 lisäystä ja 0 poistoa
  1. BIN
      4_tons.png
  2. +3
    -0
      bootstrap.min.css
  3. +83
    -0
      carch.js
  4. +41
    -0
      comlat.js
  5. +98
    -0
      index.html

BIN
4_tons.png Näytä tiedosto

Before After
Leveys: 640  |  Korkeus: 186  |  Koko: 12 KiB

+ 3
- 0
bootstrap.min.css
File diff suppressed because it is too large
Näytä tiedosto


+ 83
- 0
carch.js Näytä tiedosto

@@ -0,0 +1,83 @@
var car;
function transcrire() {
car = document.conversion.saisie.value.toLowerCase();
car = car.replace(/a1/g, "ā");
car = car.replace(/a2/g, "á");
car = car.replace(/a3/g, "ǎ");
car = car.replace(/a4/g, "à");
car = car.replace(/e1/g, "ē");
car = car.replace(/e2/g, "é");
car = car.replace(/e3/g, "ě");
car = car.replace(/e4/g, "è");
car = car.replace(/i1/g, "ī");
car = car.replace(/i2/g, "í");
car = car.replace(/i3/g, "ǐ");
car = car.replace(/i4/g, "ì");
car = car.replace(/o1/g, "ō");
car = car.replace(/o2/g, "ó");
car = car.replace(/o3/g, "ǒ");
car = car.replace(/o4/g, "ò");
car = car.replace(/u1/g, "ū");
car = car.replace(/u2/g, "ú");
car = car.replace(/u3/g, "ǔ");
car = car.replace(/u4/g, "ù");
car = car.replace(/ü1/g, "ǖ");
car = car.replace(/ü2/g, "ǘ");
car = car.replace(/ü3/g, "ǚ");
car = car.replace(/ü4/g, "ǜ");
car = car.replace(/an1/g, "ān");
car = car.replace(/an2/g, "án");
car = car.replace(/an3/g, "ǎn");
car = car.replace(/an4/g, "àn");
car = car.replace(/ang1/g, "āng");
car = car.replace(/ang2/g, "áng");
car = car.replace(/ang3/g, "ǎng");
car = car.replace(/ang4/g, "àng");
car = car.replace(/en1/g, "ēn");
car = car.replace(/en2/g, "én");
car = car.replace(/en3/g, "ěn");
car = car.replace(/en4/g, "èn");
car = car.replace(/eng1/g, "ēng");
car = car.replace(/eng2/g, "éng");
car = car.replace(/eng3/g, "ěng");
car = car.replace(/eng4/g, "èng");
car = car.replace(/in1/g, "īn");
car = car.replace(/in2/g, "ín");
car = car.replace(/in3/g, "ǐn");
car = car.replace(/in4/g, "ìn");
car = car.replace(/ing1/g, "īng");
car = car.replace(/ing2/g, "íng");
car = car.replace(/ing3/g, "ǐng");
car = car.replace(/ing4/g, "ìng");
car = car.replace(/ong1/g, "ōng");
car = car.replace(/ong2/g, "óng");
car = car.replace(/ong3/g, "ǒng");
car = car.replace(/ong4/g, "òng");
car = car.replace(/un1/g, "ūn");
car = car.replace(/un2/g, "ún");
car = car.replace(/un3/g, "ǔn");
car = car.replace(/un4/g, "ùn");
car = car.replace(/er2/g, "ér");
car = car.replace(/er3/g, "ěr");
car = car.replace(/er4/g, "èr");
car = car.replace(/aō/g, "āo");
car = car.replace(/aó/g, "áo");
car = car.replace(/aǒ/g, "ǎo");
car = car.replace(/aò/g, "ào");
car = car.replace(/oū/g, "ōu");
car = car.replace(/oú/g, "óu");
car = car.replace(/oǔ/g, "ǒu");
car = car.replace(/où/g, "òu");
car = car.replace(/aī/g, "āi");
car = car.replace(/aí/g, "ái");
car = car.replace(/aǐ/g, "ǎi");
car = car.replace(/aì/g, "ài");
car = car.replace(/eī/g, "ēi");
car = car.replace(/eí/g, "éi");
car = car.replace(/eǐ/g, "ěi");
car = car.replace(/eī/g, "èi");
document.conversion.saisie.value=car;
var obj=document.conversion.saisie;
obj.focus();
obj.scrollTop=obj.scrollHeight;
}

+ 41
- 0
comlat.js Näytä tiedosto

@@ -0,0 +1,41 @@
function alpha(item) {
var input = document.conversion.saisie;
if (document.selection) {
input.focus();
range = document.selection.createRange() ;
range.text = item ;
range.select();
}
else if (input.selectionStart || input.selectionStart == '0') {
var startPos = input.selectionStart;
var endPos = input.selectionEnd;
var cursorPos = startPos;
var scrollTop = input.scrollTop;
var baselength = 0;
input.value = input.value.substring(0, startPos)
+ item
+ input.value.substring(endPos, input.value.length);
cursorPos += item.length;
input.focus();
input.selectionStart = cursorPos;
input.selectionEnd = cursorPos;
input.scrollTop = scrollTop;
}
else {
input.value += item;
input.focus();
}
}
function copy() {
textRange=document.conversion.saisie.createTextRange();
textRange.execCommand("Copy");
textRange="";
}
var car;
function annuler () {
car = document.conversion.saisie.value;
car=car.replace(/\u200b/g, "");
document.conversion.saisie.value=car;
}

+ 98
- 0
index.html Näytä tiedosto

@@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Pinyin</title>
<meta name="Description" content="Clavier en ligne pour écrire les caractères pinyin du chinois">
<meta name="Keywords" content="chinois,pinyin,clavier,alphabet,latin">
<meta name="viewport" content="width=device-width">
<meta name="author" content="Heuze Florent" />
<meta property="og:locale" content="fr_FR" />
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://www.heuzef.com/"/>
<meta property="og:site_name" content="Heuzef"/>
<meta property="og:image" content="http://heuzef.com/images/logo_heuzef_hd.png"/>
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="2153" />
<meta property="og:image:height" content="640" />
<meta property="og:title" content="Heuzef - Heuze Florent"/>
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@heuzef"/>
<meta name="twitter:creator" content="@heuzef"/>
<link rel="shortcut icon" href="http://heuzef.com/favicon.png">
<link href="./bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="./comlat.js"></script>
<script type="text/javascript" src="./carch.js"></script>
</head>
<body onload="conversion.saisie.focus()">
<div align="center">
<noscript>
&amp;lt;font color="red"&amp;gt;Attention ! &amp;amp;nbsp; JavaScript n'est pas activ&amp;amp;eacute;.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;
Vous devez activer JavaScript dans votre navigateur, veuillez suivre les &amp;lt;a class="ext" href="http://www.enable-javascript.com/fr/" target="_blank"&amp;gt;instructions&amp;lt;/a&amp;gt;.&amp;lt;p&amp;gt;
</noscript>
<br>
<form name="conversion" class="form-horizontal">
<div>
<h1><a href="https://github.com/heuzef/pinyin" target="_blank">Pinyin</a></h1>
<div class="col-lg-3">
<a href="http://localhost/pinyin/#" class="btn btn-primary" onclick="conversion.saisie.select();copy()"><i class="ion-document-text"> </i>Séléctionner tout</a>
<br><br>
<p class="text-primary"><i class="ion-scissors"></i> Couper [Ctrl]+[X] / <i class="ion-ios-copy"></i> Coller [Ctrl]+[V]</p>
<hr>
<h5>Mode d'emploi</h5>
<p>
Redigez votre mot, puis indiquez le chiffre correspondant au ton.
</p><p>
</p><p class="text-primary">zhong<span class="text-danger">1</span> wen<span class="text-danger">2</span>&nbsp;<i class="ion-arrow-right-c"></i>&nbsp;zh<span class="text-danger">ō</span>ng w<span class="text-danger">é</span>n</p><p>
</p><p class="text-primary">ni<span class="text-danger">3</span> hao<span class="text-danger">3</span> ma<span class="text-danger">1</span>&nbsp;<i class="ion-arrow-right-c"></i>&nbsp;n<span class="text-danger">ǐ</span> h<span class="text-danger">ǎ</span>o m<span class="text-danger">ā</span></p><p>
</p></div>
<div class="col-lg-6">
<textarea name="saisie" onkeyup="transcrire()" class="form-control" rows="10" id="textArea"></textarea>
<a href="https://fr.wikipedia.org/wiki/Hanyu_pinyin" target="_blank"><img src="./4_tons.png" alt="Les 4 tons chinois"></a>
</div>
<div class="col-lg-3">
<div class="btn-group">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ā&#39;)" value="ā">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ē&#39;)" value="ē">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ī&#39;)" value="ī">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ō&#39;)" value="ō">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ū&#39;)" value="ū">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ǖ&#39;)" value="ǖ">
</div>
<hr>
<div class="btn-group">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;á&#39;)" value="á">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;é&#39;)" value="é">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;í&#39;)" value="í">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ó&#39;)" value="ó">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ú&#39;)" value="ú">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ǘ&#39;)" value="ǘ">
</div>
<hr>
<div class="btn-group">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ǎ&#39;)" value="ǎ">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ě&#39;)" value="ě">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ǐ&#39;)" value="ǐ">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ǒ&#39;)" value="ǒ">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ǔ&#39;)" value="ǔ">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ǚ&#39;)" value="ǚ">
</div>
<hr>
<div class="btn-group">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;à&#39;)" value="à">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;è&#39;)" value="è">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ì&#39;)" value="ì">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ò&#39;)" value="ò">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ù&#39;)" value="ù">
<input type="button" class="btn btn-primary" onclick="alpha(&#39;ǜ&#39;)" value="ǜ">
</div>
</div>
</div>
<br>
<br>
<br>
</form>
</div>
</body>
</html>

Ladataan…
Peruuta
Tallenna