Commit 35740755 authored by shibakaneki's avatar shibakaneki

Merge branch 'master' of github.com:Sankore/Sankore-3.1

parents 7f3760aa e66bb1bc
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ubwidget</title> <title>AnyEmbed</title>
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/jquery.disable.text.select.js" type="text/javascript"></script> <script src="js/jquery.disable.text.select.js" type="text/javascript"></script>
<script src="js/languages.js" type="text/javascript"></script>
<script src="js/ubw-main.js" type="text/javascript"></script> <script src="js/ubw-main.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/ubwidget.css" /> <link rel="stylesheet" type="text/css" href="css/ubwidget.css" />
......
var sankoreLang = {
"en":{
"embed": "Embed"
},
"ru":{
"embed": "Вставить"
},
"fr":{
"embed": "Intégrer"
}
};
...@@ -15,6 +15,18 @@ ...@@ -15,6 +15,18 @@
function init(){ function init(){
var embed; var embed;
var lang = "";
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].embed;
} catch(e){
lang = "en";
}
} else
lang = "en";
var inputBox = $("<textarea type='text'></textarea>") var inputBox = $("<textarea type='text'></textarea>")
.css({ .css({
width: "350px", width: "350px",
...@@ -22,7 +34,7 @@ function init(){ ...@@ -22,7 +34,7 @@ function init(){
marginRight: "5px" marginRight: "5px"
}); });
var submit = $("<div>Embed</div>") var submit = $("<div>" + sankoreLang[lang].embed + "</div>")
.css({ .css({
float: "right", float: "right",
width: "auto", width: "auto",
...@@ -47,13 +59,13 @@ function init(){ ...@@ -47,13 +59,13 @@ function init(){
position:"absolute", position:"absolute",
padding: "10px", padding: "10px",
backgroundColor: "rgb(230,230,233)", backgroundColor: "rgb(230,230,233)",
width: "425px", width: "460px",
height: "65px" height: "65px"
}); });
//FIT WIDGET FRAME ON LAUNCH... //FIT WIDGET FRAME ON LAUNCH...
if(window.sankore){ if(window.sankore){
window.sankore.resize($("#ubwidget").width()-15,85); window.sankore.resize($("#ubwidget").width() + 20,85);
} }
searchWrap.append(inputBox) searchWrap.append(inputBox)
...@@ -91,7 +103,12 @@ function init(){ ...@@ -91,7 +103,12 @@ function init(){
inputBox.val(loadEmbed); inputBox.val(loadEmbed);
submit.trigger("click"); submit.trigger("click");
} }
}
if (window.widget) {
window.widget.onremove = function(){
loadWindow.empty();
}
} }
} }
\ No newline at end of file
...@@ -109,8 +109,7 @@ body{ ...@@ -109,8 +109,7 @@ body{
height: 28px; height: 28px;
margin: 4px 5px; margin: 4px 5px;
border: none; border: none;
background-image: url(../images/greySquare.png); background-image: url(../images/greySquare2.png);
font-weight: bold;
font-family: Verdana; font-family: Verdana;
color: yellow; color: yellow;
cursor: pointer; cursor: pointer;
......
...@@ -10,6 +10,7 @@ and open the template in the editor. ...@@ -10,6 +10,7 @@ and open the template in the editor.
<link rel="stylesheet" type="text/css" href="css/basic.css"/> <link rel="stylesheet" type="text/css" href="css/basic.css"/>
<script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script>
<script src="scripts/jquery.disable.text.select.js" type="text/javascript"></script> <script src="scripts/jquery.disable.text.select.js" type="text/javascript"></script>
<script src="scripts/languages.js" type="text/javascript"></script>
<script type="text/javascript" src="scripts/blackYellow.js"></script> <script type="text/javascript" src="scripts/blackYellow.js"></script>
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -26,6 +26,7 @@ function init(){ ...@@ -26,6 +26,7 @@ function init(){
var popupFlag = false var popupFlag = false
var flagForSelect = false; var flagForSelect = false;
var dragElement = null; //the element that must be dragging var dragElement = null; //the element that must be dragging
var lang = ""; //locale language
var coords = { var coords = {
left:0, left:0,
top:0 top:0
...@@ -38,6 +39,16 @@ function init(){ ...@@ -38,6 +39,16 @@ function init(){
height:0 height:0
} }
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].edit;
} catch(e){
lang = "en";
}
} else
lang = "en";
var opacityChanged = false; var opacityChanged = false;
if(window.sankore){ if(window.sankore){
...@@ -133,13 +144,13 @@ function init(){ ...@@ -133,13 +144,13 @@ function init(){
if(!toggleFlag && !endFlag){ if(!toggleFlag && !endFlag){
endFlag = true; endFlag = true;
toggleButton.animate({ toggleButton.animate({
width:"72px" width:"115px"
},"fast",function(){ },"fast",function(){
toggleFlag = true; toggleFlag = true;
if(!mode) if(!mode)
toggleButton.text("Edit"); toggleButton.text(sankoreLang[lang].edit);
else else
toggleButton.text("Display"); toggleButton.text(sankoreLang[lang].display);
}); });
} }
} }
...@@ -182,10 +193,10 @@ function init(){ ...@@ -182,10 +193,10 @@ function init(){
if(!addToggleStart && !addToggleEnd){ if(!addToggleStart && !addToggleEnd){
addToggleEnd = true; addToggleEnd = true;
addButton.animate({ addButton.animate({
width:"72px" width:"115px"
},"fast",function(){ },"fast",function(){
addToggleStart = true; addToggleStart = true;
addButton.text("Add"); addButton.text(sankoreLang[lang].add);
}); });
} }
} }
...@@ -217,16 +228,16 @@ function init(){ ...@@ -217,16 +228,16 @@ function init(){
//input fields and buttons for a popup window //input fields and buttons for a popup window
var expressionDiv = $("<div id='expressionDiv' class='popupContainers'>").appendTo(popupBack); var expressionDiv = $("<div id='expressionDiv' class='popupContainers'>").appendTo(popupBack);
var experssionLabel = $("<span id='experssionLabel' class='popupLabels'><b>Enter data:</b></span>").appendTo(expressionDiv); var experssionLabel = $("<span id='experssionLabel' class='popupLabels'><b>" + sankoreLang[lang].enter_data + "</b></span>").appendTo(expressionDiv);
var expresionText = $("<input type='text' id='expresionText' class='expresionInput'/>").appendTo(expressionDiv); var expresionText = $("<input type='text' id='expresionText' class='expresionInput'/>").appendTo(expressionDiv);
var resultDiv = $("<div id='resultDiv' class='popupContainers'>").appendTo(popupBack); var resultDiv = $("<div id='resultDiv' class='popupContainers'>").appendTo(popupBack);
var resultLabel = $("<span id='resultLabel' class='popupLabels'><b>Enter result:</b></span>").appendTo(resultDiv); var resultLabel = $("<span id='resultLabel' class='popupLabels'><b>" + sankoreLang[lang].enter_result + "</b></span>").appendTo(resultDiv);
var resultText = $("<input type='text' id='resultText' class='expresionInput'/>").appendTo(resultDiv); var resultText = $("<input type='text' id='resultText' class='expresionInput'/>").appendTo(resultDiv);
var popupButtonsDiv= $("<div id='popupButtonsDiv' class='popupContainers'>").appendTo(popupBack); var popupButtonsDiv= $("<div id='popupButtonsDiv' class='popupContainers'>").appendTo(popupBack);
var cancelButton = $("<input type='button' id='cancelButton' class='popupButtons' value='Cancel'/>").appendTo(popupButtonsDiv); var cancelButton = $("<input type='button' id='cancelButton' class='popupButtons' value='" + sankoreLang[lang].cancel + "'/>").appendTo(popupButtonsDiv);
var okButton = $("<input type='button' id='okButton' class='popupButtons' value='Ok'/>").appendTo(popupButtonsDiv); var okButton = $("<input type='button' id='okButton' class='popupButtons' value='" + sankoreLang[lang].ok + "'/>").appendTo(popupButtonsDiv);
/* -------------- A WORK WITH POPUP BUTTONS AND FIELDS ---------------*/ /* -------------- A WORK WITH POPUP BUTTONS AND FIELDS ---------------*/
......
var sankoreLang = {
"en":{
"edit": "Edit",
"display":"Display",
"add":"Add",
"enter_data":"Enter data:",
"enter_result":"Enter result:",
"ok":"Ok",
"cancel":"Cancel"
},
"ru":{
"edit": "Изменить",
"display":"Показать",
"add":"Добавить",
"enter_data":"Введите вопрос:",
"enter_result":"Введите ответ:",
"ok":"Ок",
"cancel":"Отмена"
},
"fr":{
"edit": "Modifier",
"display":"Afficher",
"add":"Ajouter",
"enter_data":"Entrer les données:",
"enter_result":"Entrez le résultat:",
"ok":"Ok",
"cancel":"Annuler"
}
};
...@@ -9,6 +9,7 @@ and open the template in the editor. ...@@ -9,6 +9,7 @@ and open the template in the editor.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/basic.css"/> <link rel="stylesheet" type="text/css" href="css/basic.css"/>
<script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script>
<script src="scripts/languages.js" type="text/javascript"></script>
<script type="text/javascript" src="scripts/selQuestionApp.js"></script> <script type="text/javascript" src="scripts/selQuestionApp.js"></script>
<script type="text/javascript"> <script type="text/javascript">
......
var sankoreLang = {
"en":{
"edit": "Edit",
"display":"Display",
"question":"Question",
"example_question":"This is an example of the question",
"answer":"This is an example of the answer",
"q":"Q",
"add_new_question":"Add new question ...",
"options":"Options",
"close":"Close",
"delete_question":"Delete question",
"delete_answer":"Delete answer",
"right_answer":"Right answer",
"template_question":"Enter your question here ...",
"template_answer":"Enter the answer here ...",
"add_answer":"Add answer",
"select_text":"Choose the right answer",
"options_desc":"You can choose any of these three options of displaying your answers. See a short their description.",
"radio_desc":"This option allow to choose one answer only and the answers are displayed as radio buttons.",
"checkbox_desc":"This option allow to choose several answers and the answers are displayed as checkboxes.",
"select_desc":"This option allow to chose one answer only and the answers are displayed as pull-down menu.",
"a":"A"
},
"ru":{
"edit": "Изменить",
"display":"Показать",
"question":"Вопрос",
"example_question":"Это пример вопроса",
"answer":"Это пример ответа",
"q":"В",
"add_new_question":"Добавить новый вопрос ...",
"options":"Настройки",
"close":"Закрыть",
"delete_question":"Удалить вопрос",
"delete_answer":"Удалить ответ",
"right_answer":"Правильный ответ",
"template_question":"Введите Ваш вопрос здесь ...",
"template_answer":"Введите ответ здесь ...",
"add_answer":"Добавить ответ",
"select_text":"Выберите правильный ответ",
"options_desc":"Вы можете выбрать любой из трех вариантов отображения. Смотрите их краткое описание.",
"radio_desc":"Эта опция позволяет выбрать только один вариант ответа. Ответы будут показаны как радио-кнопки.",
"checkbox_desc":"Эта опция позволяет выбрать несколько вариантов ответов. Ответы будут показаны как чекбоксы.",
"select_desc":"Эта опция позволяет выбрать только один вариант ответа. Ответы будут показаны в виде выпадающего меню.",
"a":"О"
},
"fr":{
"edit": "Modifier",
"display":"Afficher",
"question":"La question",
"example_question":"Ceci est un exemple de la question",
"answer":"Ceci est un exemple de la réponse",
"q":"Q",
"add_new_question":"Ajouter nouvelle question ...",
"options":"Les options",
"close":"Fermer",
"delete_question":"Supprimer la question",
"delete_answer":"Supprimer réponse",
"right_answer":"Bonne réponse",
"template_question":"Saisissez votre question ici ...",
"template_answer":"Entrez la réponse ici ...",
"add_answer":"Ajouter une réponse",
"select_text":"Choisissez la bonne réponse",
"options_desc":"Vous pouvez choisir n'importe lequel de ces trois options d'affichage de vos réponses. Voir un court leur description.",
"radio_desc":"Cette option permet de choisir une seule réponse et les réponses sont affichées sous forme de boutons radio.",
"checkbox_desc":"Cette option permet de choisir plusieurs réponses et les réponses sont affichées comme des cases à cocher.",
"select_desc":"Cette option permet de choisir une seule réponse et les réponses sont affichées sous forme de menu déroulant.",
"a":"R"
}
};
...@@ -33,6 +33,17 @@ var imageEurope = "<img src='images/Cartes/EuropeOuest.bmp' usemap='#europe'/>"; ...@@ -33,6 +33,17 @@ var imageEurope = "<img src='images/Cartes/EuropeOuest.bmp' usemap='#europe'/>";
var imageEurope2 = "<img src='images/Cartes/Eurasie2.bmp' usemap='#eurasie'/>"; var imageEurope2 = "<img src='images/Cartes/Eurasie2.bmp' usemap='#eurasie'/>";
var imageAsie2 = "<img src='images/Cartes/EuropeOuestAsie.bmp' usemap='#europe'/>"; var imageAsie2 = "<img src='images/Cartes/EuropeOuestAsie.bmp' usemap='#europe'/>";
var lang = ""; //locale language
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].europe;
} catch(e){
lang = "en";
}
} else
lang = "en";
// adresse du serveur // adresse du serveur
var url = "http://bapsot.dyndns.org/GeoInfo-GeoInfoServer/GeoInfoService"; var url = "http://bapsot.dyndns.org/GeoInfo-GeoInfoServer/GeoInfoService";
...@@ -182,6 +193,25 @@ function recevoirPaysReponse(resultat, soapResponse) ...@@ -182,6 +193,25 @@ function recevoirPaysReponse(resultat, soapResponse)
// permet l'affichage de la description lors du passage de la souris // permet l'affichage de la description lors du passage de la souris
function writeText(txt) function writeText(txt)
{ {
switch(txt){
case "North America":
txt = sankoreLang[lang].north_america;
break;
case "Eurasia":
txt = sankoreLang[lang].eurasia;
break;
case "South America":
txt = sankoreLang[lang].south_america;
break;
case "Africa":
txt = sankoreLang[lang].africa;
break;
case "Oceania":
txt = sankoreLang[lang].oceania;
break;
default:
break;
}
document.getElementById("description").innerHTML = txt; document.getElementById("description").innerHTML = txt;
} }
...@@ -222,7 +252,8 @@ function fondu(carte) ...@@ -222,7 +252,8 @@ function fondu(carte)
// permet de faire apparaître les infos du pays dans la petite fenêtre // permet de faire apparaître les infos du pays dans la petite fenêtre
function afficheInfoPays(pays) function afficheInfoPays(pays)
{ {
//$("area[alt=" + pays + "]").css("z-index","9999"); $("#" + pays + " .nomPays").html(sankoreLang[lang][pays].country);
$("#" + pays + " .capitalePays").html(sankoreLang[lang].capital + ": " + sankoreLang[lang][pays].city);
document.getElementById("infoPays").innerHTML = "<div id='customCursor' class='customCursor'></div>" + document.getElementById(pays).innerHTML; document.getElementById("infoPays").innerHTML = "<div id='customCursor' class='customCursor'></div>" + document.getElementById(pays).innerHTML;
} }
......
This diff is collapsed.
...@@ -123,12 +123,24 @@ function point3D(x, y, z){ ...@@ -123,12 +123,24 @@ function point3D(x, y, z){
couleur[0] = Math.round((5+z)*echelle3D) couleur[0] = Math.round((5+z)*echelle3D)
couleur[1] = Math.round(510 - (5+z)*echelle3D) couleur[1] = Math.round(510 - (5+z)*echelle3D)
couleur[2] = couleurGenerale couleur[2] = couleurGenerale
if(opacity > 1){ opacity = 1 } if(opacity > 1){
if(opacity < 0){ opacity = 0 } opacity = 1
if(couleur[0] > 255){ couleur[0] = 255 } }
if(couleur[0] < 0){ couleur[0] = 0 } if(opacity < 0){
if(couleur[1] > 255){ couleur[1] = 255 } opacity = 0
if(couleur[1] < 0){ couleur[1] = 0 } }
if(couleur[0] > 255){
couleur[0] = 255
}
if(couleur[0] < 0){
couleur[0] = 0
}
if(couleur[1] > 255){
couleur[1] = 255
}
if(couleur[1] < 0){
couleur[1] = 0
}
ctx.save() ctx.save()
ctx.translate(centreX, centreY) ctx.translate(centreX, centreY)
...@@ -154,12 +166,24 @@ function polygone3D(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4){ ...@@ -154,12 +166,24 @@ function polygone3D(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4){
couleur[0] = Math.round((5+z1)*echelle3D) couleur[0] = Math.round((5+z1)*echelle3D)
couleur[1] = Math.round(510 - (5+z1)*echelle3D) couleur[1] = Math.round(510 - (5+z1)*echelle3D)
couleur[2] = couleurGenerale couleur[2] = couleurGenerale
if(opacity > 1){ opacity = 1 } if(opacity > 1){
if(opacity < 0){ opacity = 0 } opacity = 1
if(couleur[0] > 255){ couleur[0] = 255 } }
if(couleur[0] < 0){ couleur[0] = 0 } if(opacity < 0){
if(couleur[1] > 255){ couleur[1] = 255 } opacity = 0
if(couleur[1] < 0){ couleur[1] = 0 } }
if(couleur[0] > 255){
couleur[0] = 255
}
if(couleur[0] < 0){
couleur[0] = 0
}
if(couleur[1] > 255){
couleur[1] = 255
}
if(couleur[1] < 0){
couleur[1] = 0
}
ctx.fillStyle = "rgba("+couleur[rouge3D]+","+couleur[vert3D]+", "+couleur[bleu3D]+", "+opacity+")" ctx.fillStyle = "rgba("+couleur[rouge3D]+","+couleur[vert3D]+", "+couleur[bleu3D]+", "+opacity+")"
ctx.closePath() ctx.closePath()
...@@ -228,9 +252,15 @@ function checkCouleurs3D(){ ...@@ -228,9 +252,15 @@ function checkCouleurs3D(){
var sensRouge, sensVert, sensBleu var sensRouge, sensVert, sensBleu
var precisionApercu = 64 var precisionApercu = 64
couleurGenerale = parseInt(document.getElementById("couleur3Dgenerale").value) couleurGenerale = parseInt(document.getElementById("couleur3Dgenerale").value)
if(!couleurGenerale){ couleurGenerale = 0 } if(!couleurGenerale){
if(couleurGenerale < 0){ couleurGenerale = 0 } couleurGenerale = 0
if(couleurGenerale > 255){ couleurGenerale = 255 } }
if(couleurGenerale < 0){
couleurGenerale = 0
}
if(couleurGenerale > 255){
couleurGenerale = 255
}
switch(document.getElementById("selectRouge3D").value){ switch(document.getElementById("selectRouge3D").value){
case "plus": case "plus":
rouge3D = 0 rouge3D = 0
......
...@@ -136,13 +136,13 @@ function pariteFct(){ ...@@ -136,13 +136,13 @@ function pariteFct(){
} }
} }
if(paire){ if(paire){
document.getElementById("etudeParite").innerHTML = "even" document.getElementById("etudeParite").innerHTML = sankoreLang[lang].ev;
} }
else if(impaire){ else if(impaire){
document.getElementById("etudeParite").innerHTML = "uneven" document.getElementById("etudeParite").innerHTML = sankoreLang[lang].unev;
} }
else{ else{
document.getElementById("etudeParite").innerHTML = "n/a" document.getElementById("etudeParite").innerHTML = sankoreLang[lang].na;
} }
} }
...@@ -243,7 +243,6 @@ function signeFct(fct){ ...@@ -243,7 +243,6 @@ function signeFct(fct){
break break
} }
} }
//alert(signePlus[i]+" et "+signeMoins[i]+" -> "+millieu)
listeZeros.push(Math.round(millieu*100)/100) listeZeros.push(Math.round(millieu*100)/100)
} }
var texteZeros = "" var texteZeros = ""
...@@ -251,7 +250,7 @@ function signeFct(fct){ ...@@ -251,7 +250,7 @@ function signeFct(fct){
zeroFct() zeroFct()
texteZeros = "~ " texteZeros = "~ "
} }
var texte = "Signe : " var texte = sankoreLang[lang].signe;
var aSupprimer = new Array() var aSupprimer = new Array()
for(var i=0; i<signe.length; i++){ for(var i=0; i<signe.length; i++){
texte += "<td>"+signe[i]+"</td>" texte += "<td>"+signe[i]+"</td>"
...@@ -272,7 +271,7 @@ function signeFct(fct){ ...@@ -272,7 +271,7 @@ function signeFct(fct){
listeZeros.splice((aSupprimer[i]-i), 1) listeZeros.splice((aSupprimer[i]-i), 1)
} }
if(listeZeros==""){ if(listeZeros==""){
texteZeros = "n/a" texteZeros = sankoreLang[lang].na;
} }
document.getElementById("etudeZeros").innerHTML = texteZeros+listeZeros document.getElementById("etudeZeros").innerHTML = texteZeros+listeZeros
} }
...@@ -282,32 +281,32 @@ function asymptotes(){ ...@@ -282,32 +281,32 @@ function asymptotes(){
if(Math.abs(limGauche[0])<1000){ if(Math.abs(limGauche[0])<1000){
var limRound = Math.round(limGauche[0]*100)/100 var limRound = Math.round(limGauche[0]*100)/100
if(limGauche[0]<limRound){ if(limGauche[0]<limRound){
document.getElementById("etudeAHG").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>(curve is higher than a l'AH)</span>" document.getElementById("etudeAHG").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>" + sankoreLang[lang].curve_higher + "</span>"
} }
else if(limGauche[0]>limRound){ else if(limGauche[0]>limRound){
document.getElementById("etudeAHG").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>(curve is lower than a l'AH)</span>" document.getElementById("etudeAHG").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>" + sankoreLang[lang].curve_lower + "</span>"
} }
else{ else{
document.getElementById("etudeAHG").innerHTML = "y = "+limRound document.getElementById("etudeAHG").innerHTML = "y = "+limRound
} }
} }
else{ else{
document.getElementById("etudeAHG").innerHTML = "n/a" document.getElementById("etudeAHG").innerHTML = sankoreLang[lang].na;
} }
if(Math.abs(limDroite[0])<1000){ if(Math.abs(limDroite[0])<1000){
var limRound = Math.round(limDroite[0]*100)/100 var limRound = Math.round(limDroite[0]*100)/100
if(limDroite[0]<limRound){ if(limDroite[0]<limRound){
document.getElementById("etudeAHD").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>(curve is lower than a l'AH)</span>" document.getElementById("etudeAHD").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>" + sankoreLang[lang].curve_lower + "</span>"
} }
else if(limDroite[0]>limRound){ else if(limDroite[0]>limRound){
document.getElementById("etudeAHD").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>(curve is higher than a l'AH)</span>" document.getElementById("etudeAHD").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>" + sankoreLang[lang].curve_higher + "</span>"
} }
else{ else{
document.getElementById("etudeAHD").innerHTML = "y = "+limRound document.getElementById("etudeAHD").innerHTML = "y = "+limRound
} }
} }
else{ else{
document.getElementById("etudeAHD").innerHTML = "n/a" document.getElementById("etudeAHD").innerHTML = sankoreLang[lang].na;
} }
// Verticales // Verticales
var texteAV = "" var texteAV = ""
...@@ -318,7 +317,7 @@ function asymptotes(){ ...@@ -318,7 +317,7 @@ function asymptotes(){
} }
} }
if(texteAV==""){ if(texteAV==""){
texteAV = "n/a <br/>" texteAV = sankoreLang[lang].na + " <br/>"
} }
document.getElementById("etudeAV").innerHTML = texteAV document.getElementById("etudeAV").innerHTML = texteAV
} }
...@@ -332,10 +331,10 @@ function courbure(){ ...@@ -332,10 +331,10 @@ function courbure(){
for(i=0; i<etudeD.length; i++){ for(i=0; i<etudeD.length; i++){
if(etudeD[i]==0){ if(etudeD[i]==0){
if(etudeD[i-1]<0 && etudeD[i+1]>0){ if(etudeD[i-1]<0 && etudeD[i+1]>0){
texteMin += "<br/>Min("+Math.round(etudeX[i]*10000)/10000+";"+etudeY[i]+")"; texteMin += "<br/>" + sankoreLang[lang].min + "("+Math.round(etudeX[i]*10000)/10000+";"+etudeY[i]+")";
} }
else if(etudeD[i-1]>0 && etudeD[i+1]<0){ else if(etudeD[i-1]>0 && etudeD[i+1]<0){
texteMax += "<br/>Max("+Math.round(etudeX[i]*10000)/10000+";"+etudeY[i]+")"; texteMax += "<br/>" + sankoreLang[lang].max + "("+Math.round(etudeX[i]*10000)/10000+";"+etudeY[i]+")";
} }
else{ else{
nbrI++; nbrI++;
...@@ -343,10 +342,15 @@ function courbure(){ ...@@ -343,10 +342,15 @@ function courbure(){
} }
} }
} }
if(texteMin==""){texteMin = "<br/>No minimum";} if(texteMin==""){
if(texteMax==""){texteMax = "<br/>No maximum";} texteMin = "<br/>" + sankoreLang[lang].no_min;
if(texteI==""){texteI = "<br/>Aucun I";} }
if(texteMax==""){
texteMax = "<br/>" + sankoreLang[lang].no_max;
}
if(texteI==""){
texteI = "<br/>Aucun I";
}
document.getElementById("etudeMin").innerHTML = texteMin; document.getElementById("etudeMin").innerHTML = texteMin;
document.getElementById("etudeMax").innerHTML = texteMax; document.getElementById("etudeMax").innerHTML = texteMax;
document.getElementById("etudeI").innerHTML = texteI;
} }
\ No newline at end of file
...@@ -115,5 +115,5 @@ function checkOptions(){ ...@@ -115,5 +115,5 @@ function checkOptions(){
} }
function alertOptions(){ function alertOptions(){
alert("Now parameters will be saved\n------------------------------------------------------------\n"+document.cookie); alert(sankoreLang[lang].show_saved + "\n------------------------------------------------------------\n"+document.cookie);
} }
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>markItUp! Universal markup editor</title> <title>markItUp! Universal markup editor</title>
<link rel="stylesheet" type="text/css" href="images/style.css" /> <link rel="stylesheet" type="text/css" href="images/style.css" />
<!-- jQuery -->
<script type="text/javascript" src="jquery.pack.js"></script> <script type="text/javascript" src="jquery.pack.js"></script>
<!-- markItUp! --> <script type="text/javascript" src="languages.js"></script>
<script type="text/javascript" src="markitup/jquery.markitup.js"></script> <script type="text/javascript" src="markitup/jquery.markitup.js"></script>
<!-- markItUp! toolbar settings -->
<script type="text/javascript" src="markitup/sets/html/set.js"></script> <script type="text/javascript" src="markitup/sets/html/set.js"></script>
<!-- markItUp! toolbar skin -->
<link rel="stylesheet" type="text/css" href="markitup/skins/markitup/style.css" /> <link rel="stylesheet" type="text/css" href="markitup/skins/markitup/style.css" />
<link rel="stylesheet" type="text/css" href="markitup/sets/html/style.css" /> <link rel="stylesheet" type="text/css" href="markitup/sets/html/style.css" />
</head> </head>
<body> <body>
<script type="text/javascript" > <script type="text/javascript" >
$(document).ready(function() { var lang = "";
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].welcome;
} catch(e){
lang = "en";
}
} else
lang = "en";
$(document).ready(function(){
$("#reset-btn").hide(); $("#reset-btn").hide();
...@@ -27,7 +36,7 @@ ...@@ -27,7 +36,7 @@
$('iframe').width($(window).width()-24) $('iframe').width($(window).width()-24)
.height($(window).height()-46); .height($(window).height()-46);
if(window.sankore){ if(window.sankore){
var html = window.sankore.preference("iHtml", "Welcome to HTML EDITOR"); var html = window.sankore.preference("iHtml", sankoreLang[lang].welcome);
$("#markItUp").val(html); $("#markItUp").val(html);
}; };
...@@ -59,6 +68,7 @@ ...@@ -59,6 +68,7 @@
.height($(window).height()-46); .height($(window).height()-46);
$('#markItUpFooter').width($(window).width()-30); $('#markItUpFooter').width($(window).width()-30);
$("#markitUp").html(sankoreLang[lang].welcome);
}); });
</script> </script>
......
var sankoreLang = {
"en":{
"enter_title": "Enter yuor title here...",
"welcome":"Welcome to HTML Editor",
"source":"Source",
"link":"Link",
"preview":"Preview",
"text_to_link":"Your text to link",
"alt_text":"Alternative text"
},
"ru":{
"enter_title": "Введите Ваш заголовок ...",
"welcome":"Добро пожаловать в HTML-редактор",
"source":"Источник",
"link":"Ссылка",
"preview":"Предпросмотр",
"text_to_link":"Текст ссылки",
"alt_text":"Альтернативный текст"
},
"fr":{
"enter_title": "Entrer le titre yuor ici ...",
"welcome":"Bienvenue à HTML Editor",
"source":"Source",
"link":"Link",
"preview":"Aperçu",
"text_to_link":"Votre texte à lier",
"alt_text":"Texte alternatif"
}
};
\ No newline at end of file
...@@ -9,30 +9,43 @@ ...@@ -9,30 +9,43 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Basic set. Feel free to add more tags // Basic set. Feel free to add more tags
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
var lang = "";
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].welcome;
} catch(e){
lang = "en";
}
} else
lang = "en";
mySettings = { mySettings = {
onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'}, onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n'}, onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n'},
onTab: {keepDefault:false, openWith:' '}, onTab: {keepDefault:false, openWith:' '},
markupSet: [ markupSet: [
{name:'Heading 1', key:'1', openWith:'<h1(!( class="[![Class]!]")!)>', closeWith:'</h1>', placeHolder:'Your title here...' }, {name:'Heading 1', key:'1', openWith:'<h1(!( class="[![Class]!]")!)>', closeWith:'</h1>', placeHolder:sankoreLang[lang].enter_title},
{name:'Heading 2', key:'2', openWith:'<h2(!( class="[![Class]!]")!)>', closeWith:'</h2>', placeHolder:'Your title here...' }, {name:'Heading 2', key:'2', openWith:'<h2(!( class="[![Class]!]")!)>', closeWith:'</h2>', placeHolder:sankoreLang[lang].enter_title},
{name:'Heading 3', key:'3', openWith:'<h3(!( class="[![Class]!]")!)>', closeWith:'</h3>', placeHolder:'Your title here...' }, {name:'Heading 3', key:'3', openWith:'<h3(!( class="[![Class]!]")!)>', closeWith:'</h3>', placeHolder:sankoreLang[lang].enter_title},
{name:'Heading 4', key:'4', openWith:'<h4(!( class="[![Class]!]")!)>', closeWith:'</h4>', placeHolder:'Your title here...' }, {name:'Heading 4', key:'4', openWith:'<h4(!( class="[![Class]!]")!)>', closeWith:'</h4>', placeHolder:sankoreLang[lang].enter_title},
{name:'Heading 5', key:'5', openWith:'<h5(!( class="[![Class]!]")!)>', closeWith:'</h5>', placeHolder:'Your title here...' }, {name:'Heading 5', key:'5', openWith:'<h5(!( class="[![Class]!]")!)>', closeWith:'</h5>', placeHolder:sankoreLang[lang].enter_title},
{name:'Heading 6', key:'6', openWith:'<h6(!( class="[![Class]!]")!)>', closeWith:'</h6>', placeHolder:'Your title here...' }, {name:'Heading 6', key:'6', openWith:'<h6(!( class="[![Class]!]")!)>', closeWith:'</h6>', placeHolder:sankoreLang[lang].enter_title},
{name:'Paragraph', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>' }, {name:'Paragraph', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>'},
{separator:'---------------' }, {separator:'---------------'},
{name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' }, {name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)'},
{name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' }, {name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)'},
{name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' }, {name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>'},
{separator:'---------------' }, {separator:'---------------'},
{name:'Ul', openWith:'<ul>\n', closeWith:'</ul>\n' }, {name:'Ul', openWith:'<ul>\n', closeWith:'</ul>\n'},
{name:'Ol', openWith:'<ol>\n', closeWith:'</ol>\n' }, {name:'Ol', openWith:'<ol>\n', closeWith:'</ol>\n'},
{name:'Li', openWith:'<li>', closeWith:'</li>' }, {name:'Li', openWith:'<li>', closeWith:'</li>'},
{separator:'---------------' }, {separator:'---------------'},
{name:'Picture', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' }, {name:'Picture', key:'P', replaceWith:'<img src="[![' + sankoreLang[lang].source + ':!:http://]!]" alt="[![' + sankoreLang[lang].alt_text + ']!]" />'},
{name:'Link', key:'L', openWith:'<a target="_blank" href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' }, {name:'Link', key:'L', openWith:'<a target="_blank" href="[![' + sankoreLang[lang].link + ':!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:sankoreLang[lang].text_to_link},
{separator:'---------------' }, {separator:'---------------'},
//{name:'Editor', className:'clean', replaceWith:function() { $('textarea').show(); $('iframe').remove();} }, //{name:'Editor', className:'clean', replaceWith:function() { $('textarea').show(); $('iframe').remove();} },
{name:'', className:'preview', call:'preview'} {name:'', className:'preview', call:'preview'}
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment