imported sankore changes

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent ab689ce289
commit a102586f10
  1. 34
      resources/library/applications/Wikipedia.wgt/config.xml
  2. 751
      resources/library/applications/Wikipedia.wgt/index.html
  3. 34
      resources/library/applications/Wiktionnaire.wgt/config.xml
  4. 762
      resources/library/applications/Wiktionnaire.wgt/index.html

@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" <widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets" xmlns:ub="http://uniboard.mnemis.com/widgets"
identifier="http://uniboard.mnemis.com/widgets/wikipedia" identifier="http://uniboard.mnemis.com/widgets/wikipedia"
version="1.2" version="1.2"
width="370" minimum_height="260"
height="400" minimum_width="360"
ub:resizable = "true"> width="370"
height="400"
<name>Wikipedia</name> ub:resizable = "true">
<author href="http://www.getuniboard.com"
email="info@mnemis.com">Mnemis SA</author> <name>Wikipedia</name>
<description>Wikipedia, the free encyclopedia</description> <author href="http://www.getuniboard.com"
email="info@mnemis.com">Mnemis SA</author>
<content src="index.html"/> <description>Wikipedia, the free encyclopedia</description>
</widget>
<content src="index.html"/>
</widget>

@ -1,380 +1,373 @@
<!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" xmlns:v="urn:schemas-microsoft-com:vml"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<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>Wikipedia</title> <title>Wikipedia</title>
<link rel="stylesheet" type="text/css" href="css/master.css"/> <link rel="stylesheet" type="text/css" href="css/master.css"/>
<link rel="stylesheet" type="text/css" href="css/superfish.css"/> <link rel="stylesheet" type="text/css" href="css/superfish.css"/>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="script/jquery.min.js"></script> <script type="text/javascript" src="script/jquery.min.js"></script>
<script type="text/javascript" src="script/superfish.js"></script> <script type="text/javascript" src="script/superfish.js"></script>
<script type="text/javascript" src="script/languages.js"></script> <script type="text/javascript" src="script/languages.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var popupFlag = false var popupFlag = false
var browsing = false; var browsing = false;
var lang = 'en'; var lang = 'en';
var internalChange = false; var internalChange = false;
var syslang = "en"; var syslang = "en";
if(window.sankore){ if(window.sankore){
try{ try{
syslang = sankore.locale().substr(0,2); syslang = sankore.locale().substr(0,2);
sankoreLang[syslang].search; sankoreLang[syslang].search;
} catch(e){ } catch(e){
syslang = "en"; syslang = "en";
} }
} else } else
syslang = "en"; syslang = "en";
var toolbar = { var toolbar = {
state:"begin", state:"begin",
loading:false loading:false
}; };
var appHistory = { var appHistory = {
list:[], list:[],
back:function(){ back:function(){
if(typeof(appHistory.list[appHistory.index-1]) !== "undefined"){ if(typeof(appHistory.list[appHistory.index-1]) !== "undefined"){
appHistory.index--; appHistory.index--;
wikiReq(appHistory.list[appHistory.index]); wikiReq(appHistory.list[appHistory.index]);
} }
}, },
forward:function(){ forward:function(){
if(typeof(appHistory.list[appHistory.index+1]) !== "undefined"){ if(typeof(appHistory.list[appHistory.index+1]) !== "undefined"){
appHistory.index++; appHistory.index++;
wikiReq(appHistory.list[appHistory.index]); wikiReq(appHistory.list[appHistory.index]);
} }
}, },
index:-1 index:-1
} }
$(document).ready(function() { $(document).ready(function() {
var ubHistoryList = ""; var ubHistoryList = "";
var ubHistoryIndex = ""; var ubHistoryIndex = "";
$("#toolbar-down").html(sankoreLang[syslang].wikipedia); $("#toolbar-down").html(sankoreLang[syslang].wikipedia);
var popupText = $("<div id='popupWordInfo' class='popupWordInfo'></div>").appendTo("body"); var popupText = $("<div id='popupWordInfo' class='popupWordInfo'></div>").appendTo("body");
lang = navigator.userAgent.split(";"); lang = navigator.userAgent.split(";");
lang = (navigator.language || navigator.systemLanguage || lang = (navigator.language || navigator.systemLanguage ||
navigator.userLanguage || 'en').substr(0, 2).toLowerCase(); navigator.userLanguage || 'en').substr(0, 2).toLowerCase();
$("#current-language").text(lang.charAt(0).toUpperCase() + lang.substr(1)); $("#current-language").text(lang.charAt(0).toUpperCase() + lang.substr(1));
if(window.sankore){ if(window.sankore){
toolbar.state = loadPref("historyState", "begin"); toolbar.state = loadPref("historyState", "begin");
ubHistoryList = loadPref("historyList", ""); ubHistoryList = loadPref("historyList", "");
ubHistoryIndex = loadPref("historyIndex", "-1"); ubHistoryIndex = loadPref("historyIndex", "-1");
} }
if(ubHistoryList !== "") { if(ubHistoryList !== "") {
appHistory.list = ubHistoryList.split(","); appHistory.list = ubHistoryList.split(",");
appHistory.index = parseInt(ubHistoryIndex); appHistory.index = parseInt(ubHistoryIndex);
wikiReq(appHistory.list[appHistory.index]); wikiReq(appHistory.list[appHistory.index]);
} else { } else {
wikiReq(""); wikiReq("");
} }
$(window).resize(); $(window).resize();
$("#languages-dropdown>li>ul>li").each(function(){ $("#languages-dropdown>li>ul>li").each(function(){
$(this).click(function(){ $(this).click(function(){
languagesHandler($(this).text()); languagesHandler($(this).text());
$("#current-language").text(lang.charAt(0).toUpperCase() + lang.substr(1)); $("#current-language").text(lang.charAt(0).toUpperCase() + lang.substr(1));
}); });
}); });
$("#languages-dropdown").superfish({ $("#languages-dropdown").superfish({
dropShadows:false, dropShadows:false,
speed:1, speed:1,
delay:100 delay:100
}); });
$("#url") $("#url")
.change(function(){ .change(function(){
if(!toolbar.loading){ if(!toolbar.loading){
browsing = false; browsing = false;
wikiReq($("#url").val()); wikiReq($("#url").val());
} }
}) })
.keypress(function (e){ .keypress(function (e){
if(e.which == 13){ if(e.which == 13){
$("#url").change(); $("#url").change();
}; };
}); });
$("#toolbar-button-search").click(function(){ $("#toolbar-button-search").click(function(){
$("#url").trigger("change"); $("#url").trigger("change");
}); });
$("#toolbar-button-search").mouseover(function(evt){ $("#toolbar-button-search").mouseover(function(evt){
popupFlag = true; popupFlag = true;
popupText.text(sankoreLang[syslang].search) popupText.text(sankoreLang[syslang].search)
.css("top", evt.pageY + 5) .css("top", evt.pageY + 5)
.css("left", evt.pageX + 13) .css("left", evt.pageX + 13)
.css({width:"100px"}) .css({width:"100px"})
.show("fast", function(){ .show("fast", function(){
if(!popupFlag) if(!popupFlag)
popupText.hide(); popupText.hide();
}); });
}); });
$("#toolbar-button-search, #toolbar-button-back, #toolbar-button-forward").mousemove(function(evt){ $("#toolbar-button-search, #toolbar-button-back, #toolbar-button-forward").mousemove(function(evt){
popupText.css("top", evt.pageY + 5) popupText.css("top", evt.pageY + 5)
.css("left", evt.pageX + 13); .css("left", evt.pageX + 13);
}); });
$("#toolbar-button-search, #toolbar-button-back, #toolbar-button-forward").mouseout(function(evt){ $("#toolbar-button-search, #toolbar-button-back, #toolbar-button-forward").mouseout(function(evt){
popupFlag = false; popupFlag = false;
popupText.hide(); popupText.hide();
}); });
$("#url").val(appHistory.list[appHistory.index]); $("#url").val(appHistory.list[appHistory.index]);
if($("#url").val().length > 0) if($("#url").val().length > 0)
$("#url").change(); $("#url").change();
$("#toolbar-button-back").click(function(){ $("#toolbar-button-back").click(function(){
browsing = true; browsing = true;
appHistory.back(); appHistory.back();
}); });
$("#toolbar-button-back").mouseover(function(evt){ $("#toolbar-button-back").mouseover(function(evt){
popupFlag = true; popupFlag = true;
popupText.text(sankoreLang[syslang].prev_word) popupText.text(sankoreLang[syslang].prev_word)
.css("top", evt.pageY + 5) .css("top", evt.pageY + 5)
.css("left", evt.pageX + 13) .css("left", evt.pageX + 13)
.css({width:"110px"}) .css({width:"110px"})
.show("fast", function(){ .show("fast", function(){
if(!popupFlag) if(!popupFlag)
popupText.hide(); popupText.hide();
}); });
}); });
$("#toolbar-button-forward").click(function(){ $("#toolbar-button-forward").click(function(){
browsing = true; browsing = true;
appHistory.forward(); appHistory.forward();
}); });
$("#toolbar-button-forward").mouseover(function(evt){ $("#toolbar-button-forward").mouseover(function(evt){
popupFlag = true; popupFlag = true;
popupText.text(sankoreLang[syslang].next_word) popupText.text(sankoreLang[syslang].next_word)
.css("top", evt.pageY + 5) .css("top", evt.pageY + 5)
.css("left", evt.pageX + 13) .css("left", evt.pageX + 13)
.css({width:"100px"}) .css({width:"100px"})
.show("fast", function(){ .show("fast", function(){
if(!popupFlag) if(!popupFlag)
popupText.hide(); popupText.hide();
}); });
}); });
$("#toolbar-button-home").click(function(){ $("#toolbar-button-home").click(function(){
}); });
}); });
$(window).resize(function(){ $(window).resize(function(){
$("#web-browser").height($(window).height() - $("#toolbar").height() - 2); $("#web-browser").height($(window).height() - $("#toolbar").height() - 2);
$("#web-browser").width($(window).width() - 2); $("#web-browser").width($(window).width() - 2);
});
if($(window).width() < 370)
window.resizeTo(370, $(window).height()); function wikiReq(kword){
if($(window).height() < 150) var textBoxInput = "";
window.resizeTo($(window).width(), 150);
textBoxInput = remacc(kword.replace(/ /g,'+'));
});
textBoxInput = textBoxInput.replace(textBoxInput.charAt(0),textBoxInput.charAt(0).toUpperCase());
function wikiReq(kword){ if(toolbar.state == "begin"){
$('#web-browser').attr('src',"");
var textBoxInput = ""; toolbar.state = "started";
}
textBoxInput = remacc(kword.replace(/ /g,'+')); else
$('#web-browser').attr('src',"http://" + lang + ".mobile.wikipedia.org/wiki/" + textBoxInput);
textBoxInput = textBoxInput.replace(textBoxInput.charAt(0),textBoxInput.charAt(0).toUpperCase()); $('#url').val(kword);
if(toolbar.state == "begin"){ $('#toolbar-button-search').css("background-image", "url(images/toolbarLoading.jpg)");
$('#web-browser').attr('src',""); toolbar.loading = true;
toolbar.state = "started"; }
}
else function hideLoading(){
$('#web-browser').attr('src',"http://" + lang + ".mobile.wikipedia.org/wiki/" + textBoxInput); $('#toolbar-button-search').css("background-image", "url(images/toolbarButtonSearch.png)");
$('#url').val(kword); toolbar.loading = false;
$('#toolbar-button-search').css("background-image", "url(images/toolbarLoading.jpg)");
toolbar.loading = true; // History
} if(appHistory.list[appHistory.index] !== $("#url").val() && !browsing && $("#url").val().length > 0){
appHistory.list = appHistory.list.slice(0, appHistory.index+1);
function hideLoading(){ appHistory.list[appHistory.index+1] = $("#url").val();
$('#toolbar-button-search').css("background-image", "url(images/toolbarButtonSearch.png)"); appHistory.index = appHistory.list.length-1;
toolbar.loading = false; }
// History if(window.sankore && $("#web-browser").attr("src") !== ""){
if(appHistory.list[appHistory.index] !== $("#url").val() && !browsing && $("#url").val().length > 0){ savePref("historyState", "started");
appHistory.list = appHistory.list.slice(0, appHistory.index+1); savePref("historyList", appHistory.list.toString());
appHistory.list[appHistory.index+1] = $("#url").val(); savePref("historyIndex", appHistory.index)
appHistory.index = appHistory.list.length-1; }
} }
if(window.sankore && $("#web-browser").attr("src") !== ""){ String.prototype.accnt = function(){
savePref("historyState", "started"); var cnt = 0;
savePref("historyList", appHistory.list.toString()); var acnt = this;
savePref("historyIndex", appHistory.index) acnt = acnt.split('');
} var sec = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
} var rep = ['A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','e','C','c','D','I','I','I','I','i','i','i','i','U','U','U','U','u','u','u','u','N','n','S','s','Y','y','y','Z','z'];
for (var y = 0; y < acnt.length; y++)
String.prototype.accnt = function(){ if (sec.indexOf(acnt[y]) != -1)
var cnt = 0; cnt++;
var acnt = this; return cnt;
acnt = acnt.split(''); }
var sec = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var rep = ['A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','e','C','c','D','I','I','I','I','i','i','i','i','U','U','U','U','u','u','u','u','N','n','S','s','Y','y','y','Z','z']; String.prototype.renlacc = function(){
for (var y = 0; y < acnt.length; y++) var torem = this;
if (sec.indexOf(acnt[y]) != -1) torem = torem.split('');
cnt++; var toremout = new Array();
return cnt; var sec = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
} var rep = ['A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','e','C','c','D','I','I','I','I','i','i','i','i','U','U','U','U','u','u','u','u','N','n','S','s','Y','y','y','Z','z'];
for (var y = 0; y < torem.length; y++){
String.prototype.renlacc = function(){ if (sec.indexOf(torem[y]) != -1)
var torem = this; toremout[y] = rep[sec.indexOf(torem[y])];
torem = torem.split(''); else
var toremout = new Array(); toremout[y] = torem[y];
var sec = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž'; }
var rep = ['A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','e','C','c','D','I','I','I','I','i','i','i','i','U','U','U','U','u','u','u','u','N','n','S','s','Y','y','y','Z','z']; var toascout = toremout.join('');
for (var y = 0; y < torem.length; y++){ document.title = toascout;
if (sec.indexOf(torem[y]) != -1) return toascout;
toremout[y] = rep[sec.indexOf(torem[y])]; }
else
toremout[y] = torem[y]; function remacc(kword){
}
var toascout = toremout.join(''); var countarr = new Array();
document.title = toascout; var c = '';
return toascout; var text=kword;
} var textout = new Array();
text = text.replace(/\r/g,'');
function remacc(kword){ text = text.split('\n');
var linecnt = text.length;
var countarr = new Array(); for (var x = 0; x < linecnt; x++){
var c = ''; countarr[x] = Math.abs(text[x].accnt());
var text=kword; textout[x] = text[x].renlacc();
var textout = new Array(); }
text = text.replace(/\r/g,''); textout = textout.join('\n');
text = text.split('\n'); return textout;
var linecnt = text.length; }
for (var x = 0; x < linecnt; x++){
countarr[x] = Math.abs(text[x].accnt()); function loadPref(name, defaultValue){
textout[x] = text[x].renlacc(); var pref = defaultValue;
}
textout = textout.join('\n'); if (sankore.preference(name) !== "") {
return textout; pref = sankore.preference(name);
} };
function loadPref(name, defaultValue){ return pref;
var pref = defaultValue; };
if (sankore.preference(name) !== "") { function savePref(name, value){
pref = sankore.preference(name); sankore.setPreference(name, String(value));
}; };
return pref; function languagesHandler(language){
}; switch(language){
case "Deutsch":
function savePref(name, value){ lang = 'de'
sankore.setPreference(name, String(value)); break;
}; case "English":
lang = 'en'
function languagesHandler(language){ break;
switch(language){ case "Español":
case "Deutsch": lang = 'es'
lang = 'de' break;
break; case "Français":
case "English": lang = 'fr'
lang = 'en' break;
break; case "Italiano":
case "Español": lang = 'it'
lang = 'es' break;
break; case "Nederlands":
case "Français": lang = 'nl'
lang = 'fr' break;
break; case "Polski":
case "Italiano": lang = 'pl'
lang = 'it' break;
break; case "Português":
case "Nederlands": lang = 'pt'
lang = 'nl' break;
break; case "Русский":
case "Polski": lang = 'ru'
lang = 'pl' break;
break; case "日本語":
case "Português": lang = 'ja'
lang = 'pt' break;
break; }
case "Русский": };
lang = 'ru'
break; </script>
case "日本語": </head>
lang = 'ja' <body style="overflow:hidden; margin: 0px; width:100%; height:100%; position:absolute; background:#ffffff">
break;
} <div id="toolbar">
};
<div class="toolbar-body">
</script>
</head> <div id="toolbar-down" class="toolbar">
<body style="overflow:hidden; margin: 0px; width:100%; height:100%; position:absolute; background:#ffffff"> Wikipedia
</div> <!--toolbar-down-->
<div id="toolbar">
</div> <!--toolbar-body-->
<div class="toolbar-body">
<div class="toolbar-body">
<div id="toolbar-down" class="toolbar">
Wikipedia <div id="toolbar-up" class="toolbar">
</div> <!--toolbar-down--> <div id="left-field">
<div id="toolbar-button-back" class="button" alt="back button"></div>
</div> <!--toolbar-body--> <div id="toolbar-button-forward" class="button" alt="forward button"></div>
</div>
<div class="toolbar-body"> <div id="center-field" class="full">
<input type="text" id="url" alt="url"/>
<div id="toolbar-up" class="toolbar"> <div class="on-the-right">
<div id="left-field"> <div id="toolbar-button-search"></div>
<div id="toolbar-button-back" class="button" alt="back button"></div> </div>
<div id="toolbar-button-forward" class="button" alt="forward button"></div> </div> <!--center-field-->
</div> <div id="right-field">
<div id="center-field" class="full"> <div id="toolbar-button-languages" class="button" alt="languages button">
<input type="text" id="url" alt="url"/> <ul id='languages-dropdown' class='sf-menu'>
<div class="on-the-right"> <li class='current'><a id='current-language' class='selected' href='#a'></a>
<div id="toolbar-button-search"></div> <ul>
</div> <li><a class="sf-sl-first" href="#">Deutsch</a></li>
</div> <!--center-field--> <li><a>English</a></li>
<div id="right-field"> <li><a>Español</a></li>
<div id="toolbar-button-languages" class="button" alt="languages button"> <li><a>Français</a></li>
<ul id='languages-dropdown' class='sf-menu'> <li><a>Italiano</a></li>
<li class='current'><a id='current-language' class='selected' href='#a'></a> <li><a>Nederlands</a></li>
<ul> <li><a>Polski</a></li>
<li><a class="sf-sl-first" href="#">Deutsch</a></li> <li><a>Português</a></li>
<li><a href="#">English</a></li> <li><a>Русский</a></li>
<li><a href="#">Español</a></li> <li><a class="sf-sl-last">日本語</a></li>
<li><a href="#">Français</a></li> </ul>
<li><a href="#">Italiano</a></li> </li>
<li><a href="#">Nederlands</a></li> </ul>
<li><a href="#">Polski</a></li> </div>
<li><a href="#">Português</a></li> </div>
<li><a href="#">Русский</a></li> </div> <!--toolbar-up-->
<li><a class="sf-sl-last" href="#">日本語</a></li>
</ul> </div> <!--toolbar-body-->
</li>
</ul> </div> <!--toolbar-->
</div> <div id="web-canevas">
</div> <iframe id="web-browser" name="web-browser" src="" onload="hideLoading()"></iframe>
</div> <!--toolbar-up--> </div>
</body>
</div> <!--toolbar-body-->
</div> <!--toolbar-->
<div id="web-canevas">
<iframe id="web-browser" name="web-browser" src="" onload="hideLoading()"></iframe>
</div>
</body>
</html> </html>

@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" <widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets" xmlns:ub="http://uniboard.mnemis.com/widgets"
identifier="http://uniboard.mnemis.com/widgets/wikipedia" identifier="http://uniboard.mnemis.com/widgets/wikipedia"
version="1.2" version="1.2"
width="755" minimum_height="300"
height="450" minimum_width="360"
ub:resizable = "true"> width="755"
height="450"
<name>Wikipedia</name> ub:resizable = "true">
<author href="http://www.getuniboard.com"
email="info@mnemis.com">Mnemis SA</author> <name>Wikipedia</name>
<description>Wikipedia, the free encyclopedia</description> <author href="http://www.getuniboard.com"
email="info@mnemis.com">Mnemis SA</author>
<content src="index.html"/> <description>Wikipedia, the free encyclopedia</description>
</widget>
<content src="index.html"/>
</widget>

@ -1,384 +1,380 @@
<!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" xmlns:v="urn:schemas-microsoft-com:vml"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<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>Wikipedia</title> <title>Wikipedia</title>
<link rel="stylesheet" type="text/css" href="css/master.css"/> <link rel="stylesheet" type="text/css" href="css/master.css"/>
<link rel="stylesheet" type="text/css" href="css/superfish.css"/> <link rel="stylesheet" type="text/css" href="css/superfish.css"/>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="script/jquery.min.js"></script> <script type="text/javascript" src="script/jquery.min.js"></script>
<script type="text/javascript" src="script/superfish.js"></script> <script type="text/javascript" src="script/superfish.js"></script>
<script type="text/javascript" src="script/languages.js"></script> <script type="text/javascript" src="script/languages.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var popupFlag = false; var popupFlag = false;
var browsing = false; var browsing = false;
var mode = 'wiki'; var mode = 'wiki';
var lang = 'en'; var lang = 'en';
var internalChange = false; var internalChange = false;
var syslang = "en"; var syslang = "en";
if(window.sankore){ if(window.sankore){
try{ try{
syslang = sankore.locale().substr(0,2); syslang = sankore.locale().substr(0,2);
sankoreLang[syslang].search; sankoreLang[syslang].search;
} catch(e){ } catch(e){
syslang = "en"; syslang = "en";
} }
} else } else
syslang = "en"; syslang = "en";
var toolbar = { var toolbar = {
state:"", state:"",
loading:false loading:false
}; };
var appHistory = { var appHistory = {
list:[], list:[],
back:function(){ back:function(){
if(typeof(appHistory.list[appHistory.index-1]) !== "undefined"){ if(typeof(appHistory.list[appHistory.index-1]) !== "undefined"){
appHistory.index--; appHistory.index--;
wikiReq(appHistory.list[appHistory.index]); wikiReq(appHistory.list[appHistory.index]);
} }
}, },
forward:function(){ forward:function(){
if(typeof(appHistory.list[appHistory.index+1]) !== "undefined"){ if(typeof(appHistory.list[appHistory.index+1]) !== "undefined"){
appHistory.index++; appHistory.index++;
wikiReq(appHistory.list[appHistory.index]); wikiReq(appHistory.list[appHistory.index]);
} }
}, },
index:-1 index:-1
} }
$(document).ready(function() { $(document).ready(function() {
var ubHistoryList = ""; var ubHistoryList = "";
var ubHistoryIndex = ""; var ubHistoryIndex = "";
$("#toolbar-down").html(sankoreLang[syslang].wikipedia); $("#toolbar-down").html(sankoreLang[syslang].wikipedia);
var popupText = $("<div id='popupWordInfo' class='popupWordInfo'></div>").appendTo("body"); var popupText = $("<div id='popupWordInfo' class='popupWordInfo'></div>").appendTo("body");
lang = navigator.userAgent.split(";"); lang = navigator.userAgent.split(";");
lang = (navigator.language || navigator.systemLanguage || lang = (navigator.language || navigator.systemLanguage ||
navigator.userLanguage || 'en').substr(0, 2).toLowerCase(); navigator.userLanguage || 'en').substr(0, 2).toLowerCase();
$("#current-language").text(lang.charAt(0).toUpperCase() + lang.substr(1)); $("#current-language").text(lang.charAt(0).toUpperCase() + lang.substr(1));
if(window.sankore){ if(window.sankore){
toolbar.state = loadPref("historyState", "begin"); toolbar.state = loadPref("historyState", "begin");
ubHistoryList = loadPref("historyList", ""); ubHistoryList = loadPref("historyList", "");
ubHistoryIndex = loadPref("historyIndex", "-1"); ubHistoryIndex = loadPref("historyIndex", "-1");
//window.resizeTo(350, 450); //window.resizeTo(350, 450);
} }
if(ubHistoryList !== "") { if(ubHistoryList !== "") {
appHistory.list = ubHistoryList.split(","); appHistory.list = ubHistoryList.split(",");
appHistory.index = parseInt(ubHistoryIndex); appHistory.index = parseInt(ubHistoryIndex);
wikiReq(appHistory.list[appHistory.index]); wikiReq(appHistory.list[appHistory.index]);
} else { } else {
wikiReq(""); wikiReq("");
} }
$(window).resize(); $(window).resize();
$("#languages-dropdown>li>ul>li").each(function(){ $("#languages-dropdown>li>ul>li").each(function(){
$(this).click(function(){ $(this).click(function(){
languagesHandler($(this).text()); languagesHandler($(this).text());
$("#current-language").text(lang.charAt(0).toUpperCase() + lang.substr(1)); $("#current-language").text(lang.charAt(0).toUpperCase() + lang.substr(1));
}); });
}); });
$("#languages-dropdown").superfish({ $("#languages-dropdown").superfish({
dropShadows:false, dropShadows:false,
speed:1, speed:1,
delay:100 delay:100
}); });
$("#url") $("#url")
.change(function(){ .change(function(){
if(!toolbar.loading){ if(!toolbar.loading){
browsing = false; browsing = false;
wikiReq($("#url").val()); wikiReq($("#url").val());
} }
}) })
.keypress(function (e){ .keypress(function (e){
if(e.which == 13){ if(e.which == 13){
$("#url").change(); $("#url").change();
}; };
}); });
$("#url").val(appHistory.list[appHistory.index]); $("#url").val(appHistory.list[appHistory.index]);
if($("#url").val().length > 0) if($("#url").val().length > 0)
$("#url").change(); $("#url").change();
$("#toolbar-button-search").click(function(){ $("#toolbar-button-search").click(function(){
$("#url").trigger("change"); $("#url").trigger("change");
}); });
$("#toolbar-button-search").mouseover(function(evt){ $("#toolbar-button-search").mouseover(function(evt){
popupFlag = true; popupFlag = true;
popupText.text(sankoreLang[syslang].search) popupText.text(sankoreLang[syslang].search)
.css("top", evt.pageY + 5) .css("top", evt.pageY + 5)
.css("left", evt.pageX + 13) .css("left", evt.pageX + 13)
.css({width:"70px"}) .css({width:"70px"})
.show("fast", function(){ .show("fast", function(){
if(!popupFlag) if(!popupFlag)
popupText.hide(); popupText.hide();
}); });
}); });
$("#toolbar-button-search, #toolbar-button-back, #toolbar-button-forward").mousemove(function(evt){ $("#toolbar-button-search, #toolbar-button-back, #toolbar-button-forward").mousemove(function(evt){
popupText.css("top", evt.pageY + 5) popupText.css("top", evt.pageY + 5)
.css("left", evt.pageX + 13); .css("left", evt.pageX + 13);
}); });
$("#toolbar-button-search, #toolbar-button-back, #toolbar-button-forward").mouseout(function(evt){ $("#toolbar-button-search, #toolbar-button-back, #toolbar-button-forward").mouseout(function(evt){
popupFlag = false; popupFlag = false;
popupText.hide(); popupText.hide();
}); });
$("#toolbar-button-back").click(function(){ $("#toolbar-button-back").click(function(){
browsing = true; browsing = true;
appHistory.back(); appHistory.back();
}); });
$("#toolbar-button-back").mouseover(function(evt){ $("#toolbar-button-back").mouseover(function(evt){
popupFlag = true; popupFlag = true;
popupText.text(sankoreLang[syslang].prev_word) popupText.text(sankoreLang[syslang].prev_word)
.css("top", evt.pageY + 5) .css("top", evt.pageY + 5)
.css("left", evt.pageX + 13) .css("left", evt.pageX + 13)
.css({width:"100px"}) .css({width:"100px"})
.show("fast", function(){ .show("fast", function(){
if(!popupFlag) if(!popupFlag)
popupText.hide(); popupText.hide();
}); });
}); });
$("#toolbar-button-forward").click(function(){ $("#toolbar-button-forward").click(function(){
browsing = true; browsing = true;
appHistory.forward(); appHistory.forward();
}); });
$("#toolbar-button-forward").mouseover(function(evt){ $("#toolbar-button-forward").mouseover(function(evt){
popupFlag = true; popupFlag = true;
popupText.text(sankoreLang[syslang].next_word) popupText.text(sankoreLang[syslang].next_word)
.css("top", evt.pageY + 5) .css("top", evt.pageY + 5)
.css("left", evt.pageX + 13) .css("left", evt.pageX + 13)
.css({width:"70px"}) .css({width:"70px"})
.show("fast", function(){ .show("fast", function(){
if(!popupFlag) if(!popupFlag)
popupText.hide(); popupText.hide();
}); });
}); });
$("#toolbar-button-home").click(function(){ $("#toolbar-button-home").click(function(){
}); });
}); });
$(window).resize(function(){ $(window).resize(function(){
if($(window).width() < 370){ if($(window).width() > 755){
window.resizeTo(370, $(window).height()); $("#web-browser").height($(window).height() - $("#toolbar").height() - 2);
} else if($(window).width() > 755){ $("#web-browser").width($(window).width() - 2);
$("#web-browser").height($(window).height() - $("#toolbar").height() - 2); } else
$("#web-browser").width($(window).width() - 2); $("#web-browser").height($(window).height() - $("#toolbar").height() - 2);
} else
$("#web-browser").height($(window).height() - $("#toolbar").height() - 2);
});
if($(window).height() < 150)
window.resizeTo($(window).width(), 150); function wikiReq(kword){
}); var textBoxInput = "";
function wikiReq(kword){ textBoxInput = remacc(kword.replace(/ /g,'_'));
var textBoxInput = ""; textBoxInput = textBoxInput.replace(textBoxInput.charAt(0),textBoxInput.charAt(0).toLowerCase());
if(toolbar.state == "begin"){
textBoxInput = remacc(kword.replace(/ /g,'_')); $('#web-browser').attr('src',"");
toolbar.state = "started";
textBoxInput = textBoxInput.replace(textBoxInput.charAt(0),textBoxInput.charAt(0).toLowerCase()); }
if(toolbar.state == "begin"){ else
$('#web-browser').attr('src',""); $('#web-browser').attr('src',"http://" + lang + ".wiktionary.org/wiki/" + textBoxInput);
toolbar.state = "started"; $('#url').val(kword);
} $('#toolbar-button-search').css("background-image", "url(images/toolbarLoading.jpg)");
else toolbar.loading = true;
$('#web-browser').attr('src',"http://" + lang + ".wiktionary.org/wiki/" + textBoxInput); }
$('#url').val(kword);
$('#toolbar-button-search').css("background-image", "url(images/toolbarLoading.jpg)"); function hideLoading(){
toolbar.loading = true; $('#toolbar-button-search').css("background-image", "url(images/toolbarButtonSearch.png)");
} toolbar.loading = false;
function hideLoading(){ // History
$('#toolbar-button-search').css("background-image", "url(images/toolbarButtonSearch.png)"); if(appHistory.list[appHistory.index] !== $("#url").val() && !browsing && $("#url").val().length > 0){
toolbar.loading = false; appHistory.list = appHistory.list.slice(0, appHistory.index+1);
appHistory.list[appHistory.index+1] = $("#url").val();
// History appHistory.index = appHistory.list.length-1;
if(appHistory.list[appHistory.index] !== $("#url").val() && !browsing && $("#url").val().length > 0){ }
appHistory.list = appHistory.list.slice(0, appHistory.index+1);
appHistory.list[appHistory.index+1] = $("#url").val(); if(window.sankore && $("#web-browser").attr("src") !== ""){
appHistory.index = appHistory.list.length-1; savePref("historyState", "started");
} savePref("historyList", appHistory.list.toString());
savePref("historyIndex", appHistory.index)
if(window.sankore && $("#web-browser").attr("src") !== ""){ }
savePref("historyState", "started"); }
savePref("historyList", appHistory.list.toString());
savePref("historyIndex", appHistory.index) String.prototype.accnt = function(){
} var cnt = 0;
} var acnt = this;
acnt = acnt.split('');
String.prototype.accnt = function(){ var sec = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var cnt = 0; var rep = ['A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','e','C','c','D','I','I','I','I','i','i','i','i','U','U','U','U','u','u','u','u','N','n','S','s','Y','y','y','Z','z'];
var acnt = this; for (var y = 0; y < acnt.length; y++)
acnt = acnt.split(''); if (sec.indexOf(acnt[y]) != -1)
var sec = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž'; cnt++;
var rep = ['A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','e','C','c','D','I','I','I','I','i','i','i','i','U','U','U','U','u','u','u','u','N','n','S','s','Y','y','y','Z','z']; return cnt;
for (var y = 0; y < acnt.length; y++) }
if (sec.indexOf(acnt[y]) != -1)
cnt++; String.prototype.renlacc = function(){
return cnt; var torem = this;
} torem = torem.split('');
var toremout = new Array();
String.prototype.renlacc = function(){ var sec = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var torem = this; var rep = ['A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','e','C','c','D','I','I','I','I','i','i','i','i','U','U','U','U','u','u','u','u','N','n','S','s','Y','y','y','Z','z'];
torem = torem.split(''); for (var y = 0; y < torem.length; y++){
var toremout = new Array(); if (sec.indexOf(torem[y]) != -1)
var sec = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž'; toremout[y] = rep[sec.indexOf(torem[y])];
var rep = ['A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','e','C','c','D','I','I','I','I','i','i','i','i','U','U','U','U','u','u','u','u','N','n','S','s','Y','y','y','Z','z']; else
for (var y = 0; y < torem.length; y++){ toremout[y] = torem[y];
if (sec.indexOf(torem[y]) != -1) }
toremout[y] = rep[sec.indexOf(torem[y])]; var toascout = toremout.join('');
else document.title = toascout;
toremout[y] = torem[y]; return toascout;
} }
var toascout = toremout.join('');
document.title = toascout; function remacc(kword){
return toascout;
} var countarr = new Array();
var c = '';
function remacc(kword){ var text=kword;
var textout = new Array();
var countarr = new Array(); text = text.replace(/\r/g,'');
var c = ''; text = text.split('\n');
var text=kword; var linecnt = text.length;
var textout = new Array(); for (var x = 0; x < linecnt; x++){
text = text.replace(/\r/g,''); countarr[x] = Math.abs(text[x].accnt());
text = text.split('\n'); textout[x] = text[x].renlacc();
var linecnt = text.length; }
for (var x = 0; x < linecnt; x++){ textout = textout.join('\n');
countarr[x] = Math.abs(text[x].accnt()); return textout;
textout[x] = text[x].renlacc(); }
}
textout = textout.join('\n'); function loadPref(name, defaultValue){
return textout; var pref = defaultValue;
}
if (sankore.preference(name) !== "") {
function loadPref(name, defaultValue){ pref = sankore.preference(name);
var pref = defaultValue; };
if (sankore.preference(name) !== "") { return pref;
pref = sankore.preference(name); };
};
function savePref(name, value){
return pref; sankore.setPreference(name, String(value));
}; };
function savePref(name, value){ function languagesHandler(language){
sankore.setPreference(name, String(value)); switch(language){
}; case "Deutsch":
lang = 'de'
function languagesHandler(language){ break;
switch(language){ case "English":
case "Deutsch": lang = 'en'
lang = 'de' break;
break; case "Español":
case "English": lang = 'es'
lang = 'en' break;
break; case "Français":
case "Español": lang = 'fr'
lang = 'es' break;
break; case "Italiano":
case "Français": lang = 'it'
lang = 'fr' break;
break; case "Nederlands":
case "Italiano": lang = 'nl'
lang = 'it' break;
break; case "Polski":
case "Nederlands": lang = 'pl'
lang = 'nl' break;
break; case "Português":
case "Polski": lang = 'pt'
lang = 'pl' break;
break; case "Русский":
case "Português": lang = 'ru'
lang = 'pt' break;
break; case "日本語":
case "Русский": lang = 'ja'
lang = 'ru' break;
break; }
case "日本語": };
lang = 'ja'
break; </script>
} </head>
}; <body style="overflow:hidden; margin: 0px; width:100%; height:100%; position:absolute; background:#ffffff">
</script> <div id="toolbar">
</head>
<body style="overflow:hidden; margin: 0px; width:100%; height:100%; position:absolute; background:#ffffff"> <div class="toolbar-body">
<div id="toolbar"> <div id="toolbar-down" class="toolbar">
Wiktionary
<div class="toolbar-body"> </div> <!--toolbar-down-->
<div id="toolbar-down" class="toolbar"> </div> <!--toolbar-body-->
Wiktionary
</div> <!--toolbar-down--> <div class="toolbar-body">
</div> <!--toolbar-body--> <div id="toolbar-up" class="toolbar">
<div id="left-field">
<div class="toolbar-body"> <div id="toolbar-button-back" class="button" alt="back button"></div>
<div id="toolbar-button-forward" class="button" alt="forward button"></div>
<div id="toolbar-up" class="toolbar"> </div>
<div id="left-field"> <div id="center-field" class="full">
<div id="toolbar-button-back" class="button" alt="back button"></div> <input type="text" id="url" alt="url"/>
<div id="toolbar-button-forward" class="button" alt="forward button"></div> <div class="on-the-right">
</div> <div id="toolbar-button-search"></div>
<div id="center-field" class="full"> </div>
<input type="text" id="url" alt="url"/> </div> <!--center-field-->
<div class="on-the-right"> <div id="right-field">
<div id="toolbar-button-search"></div> <div id="toolbar-button-languages" class="button" alt="languages button">
</div> <ul id='languages-dropdown' class='sf-menu'>
</div> <!--center-field--> <li class='current'><a id='current-language' class='selected' href='#a'></a>
<div id="right-field"> <ul>
<div id="toolbar-button-languages" class="button" alt="languages button"> <li><a class="sf-sl-first" href="#">Deutsch</a></li>
<ul id='languages-dropdown' class='sf-menu'> <li><a>English</a></li>
<li class='current'><a id='current-language' class='selected' href='#a'></a> <li><a>Español</a></li>
<ul> <li><a>Français</a></li>
<li><a class="sf-sl-first" href="#">Deutsch</a></li> <li><a>Italiano</a></li>
<li><a href="#">English</a></li> <li><a>Nederlands</a></li>
<li><a href="#">Español</a></li> <li><a>Polski</a></li>
<li><a href="#">Français</a></li> <li><a>Português</a></li>
<li><a href="#">Italiano</a></li> <li><a>Русский</a></li>
<li><a href="#">Nederlands</a></li> <li><a class="sf-sl-last">日本語</a></li>
<li><a href="#">Polski</a></li> </ul>
<li><a href="#">Português</a></li> </li>
<li><a href="#">Русский</a></li> </ul>
<li><a class="sf-sl-last" href="#">日本語</a></li> </div>
</ul> </div>
</li> </div> <!--toolbar-up-->
</ul>
</div> </div> <!--toolbar-body-->
</div>
</div> <!--toolbar-up--> </div> <!--toolbar-->
<div id="web-canevas">
</div> <!--toolbar-body--> <iframe id="web-browser" name="web-browser" src="" onload="hideLoading()"></iframe>
</div>
</div> <!--toolbar--> </body>
<div id="web-canevas">
<iframe id="web-browser" name="web-browser" src="" onload="hideLoading()"></iframe>
</div>
</body>
</html> </html>
Loading…
Cancel
Save