You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
384 lines
16 KiB
384 lines
16 KiB
14 years ago
|
<!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">
|
||
|
<head>
|
||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
||
|
<title>Wikipedia</title>
|
||
|
|
||
|
<link rel="stylesheet" type="text/css" href="css/master.css"/>
|
||
|
<link rel="stylesheet" type="text/css" href="css/superfish.css"/>
|
||
|
|
||
|
<!-- jQuery -->
|
||
|
<script type="text/javascript" src="script/jquery.min.js"></script>
|
||
|
<script type="text/javascript" src="script/superfish.js"></script>
|
||
13 years ago
|
<script type="text/javascript" src="script/languages.js"></script>
|
||
14 years ago
|
|
||
|
<script type="text/javascript">
|
||
13 years ago
|
|
||
|
var popupFlag = false;
|
||
14 years ago
|
var browsing = false;
|
||
|
var mode = 'wiki';
|
||
|
var lang = 'en';
|
||
13 years ago
|
var internalChange = false;
|
||
|
var syslang = "en";
|
||
|
|
||
|
if(window.sankore){
|
||
|
try{
|
||
|
syslang = sankore.locale().substr(0,2);
|
||
|
sankoreLang[syslang].search;
|
||
|
} catch(e){
|
||
|
syslang = "en";
|
||
|
}
|
||
|
} else
|
||
|
syslang = "en";
|
||
|
|
||
14 years ago
|
var toolbar = {
|
||
|
state:"",
|
||
|
loading:false
|
||
|
};
|
||
|
var appHistory = {
|
||
|
list:[],
|
||
|
back:function(){
|
||
|
if(typeof(appHistory.list[appHistory.index-1]) !== "undefined"){
|
||
|
appHistory.index--;
|
||
|
wikiReq(appHistory.list[appHistory.index]);
|
||
|
}
|
||
|
},
|
||
|
forward:function(){
|
||
|
if(typeof(appHistory.list[appHistory.index+1]) !== "undefined"){
|
||
|
appHistory.index++;
|
||
|
wikiReq(appHistory.list[appHistory.index]);
|
||
|
}
|
||
|
},
|
||
|
index:-1
|
||
|
}
|
||
13 years ago
|
|
||
14 years ago
|
$(document).ready(function() {
|
||
13 years ago
|
|
||
14 years ago
|
var ubHistoryList = "";
|
||
|
var ubHistoryIndex = "";
|
||
13 years ago
|
|
||
|
$("#toolbar-down").html(sankoreLang[syslang].wikipedia);
|
||
13 years ago
|
|
||
|
var popupText = $("<div id='popupWordInfo' class='popupWordInfo'></div>").appendTo("body");
|
||
|
|
||
14 years ago
|
lang = navigator.userAgent.split(";");
|
||
|
|
||
|
lang = (navigator.language || navigator.systemLanguage ||
|
||
|
navigator.userLanguage || 'en').substr(0, 2).toLowerCase();
|
||
|
$("#current-language").text(lang.charAt(0).toUpperCase() + lang.substr(1));
|
||
13 years ago
|
|
||
14 years ago
|
if(window.sankore){
|
||
|
toolbar.state = loadPref("historyState", "begin");
|
||
|
ubHistoryList = loadPref("historyList", "");
|
||
|
ubHistoryIndex = loadPref("historyIndex", "-1");
|
||
|
//window.resizeTo(350, 450);
|
||
|
}
|
||
13 years ago
|
|
||
14 years ago
|
if(ubHistoryList !== "") {
|
||
|
appHistory.list = ubHistoryList.split(",");
|
||
|
appHistory.index = parseInt(ubHistoryIndex);
|
||
|
wikiReq(appHistory.list[appHistory.index]);
|
||
|
} else {
|
||
|
wikiReq("");
|
||
|
}
|
||
13 years ago
|
|
||
14 years ago
|
$(window).resize();
|
||
13 years ago
|
|
||
14 years ago
|
$("#languages-dropdown>li>ul>li").each(function(){
|
||
|
$(this).click(function(){
|
||
|
languagesHandler($(this).text());
|
||
|
$("#current-language").text(lang.charAt(0).toUpperCase() + lang.substr(1));
|
||
|
});
|
||
|
});
|
||
13 years ago
|
|
||
14 years ago
|
$("#languages-dropdown").superfish({
|
||
|
dropShadows:false,
|
||
|
speed:1,
|
||
|
delay:100
|
||
|
});
|
||
13 years ago
|
|
||
14 years ago
|
$("#url")
|
||
|
.change(function(){
|
||
|
if(!toolbar.loading){
|
||
|
browsing = false;
|
||
|
wikiReq($("#url").val());
|
||
|
}
|
||
|
})
|
||
|
.keypress(function (e){
|
||
|
if(e.which == 13){
|
||
|
$("#url").change();
|
||
|
};
|
||
|
});
|
||
13 years ago
|
|
||
14 years ago
|
$("#url").val(appHistory.list[appHistory.index]);
|
||
13 years ago
|
|
||
14 years ago
|
if($("#url").val().length > 0)
|
||
|
$("#url").change();
|
||
13 years ago
|
|
||
|
$("#toolbar-button-search").click(function(){
|
||
|
$("#url").trigger("change");
|
||
|
});
|
||
|
|
||
|
$("#toolbar-button-search").mouseover(function(evt){
|
||
|
popupFlag = true;
|
||
13 years ago
|
popupText.text(sankoreLang[syslang].search)
|
||
13 years ago
|
.css("top", evt.pageY + 5)
|
||
|
.css("left", evt.pageX + 13)
|
||
|
.css({width:"70px"})
|
||
|
.show("fast", function(){
|
||
|
if(!popupFlag)
|
||
|
popupText.hide();
|
||
|
});
|
||
|
});
|
||
|
|
||
|
$("#toolbar-button-search, #toolbar-button-back, #toolbar-button-forward").mousemove(function(evt){
|
||
|
popupText.css("top", evt.pageY + 5)
|
||
|
.css("left", evt.pageX + 13);
|
||
|
});
|
||
|
|
||
|
$("#toolbar-button-search, #toolbar-button-back, #toolbar-button-forward").mouseout(function(evt){
|
||
|
popupFlag = false;
|
||
|
popupText.hide();
|
||
|
});
|
||
|
|
||
14 years ago
|
$("#toolbar-button-back").click(function(){
|
||
|
browsing = true;
|
||
|
appHistory.back();
|
||
|
});
|
||
13 years ago
|
|
||
|
$("#toolbar-button-back").mouseover(function(evt){
|
||
|
popupFlag = true;
|
||
13 years ago
|
popupText.text(sankoreLang[syslang].prev_word)
|
||
13 years ago
|
.css("top", evt.pageY + 5)
|
||
|
.css("left", evt.pageX + 13)
|
||
|
.css({width:"100px"})
|
||
|
.show("fast", function(){
|
||
|
if(!popupFlag)
|
||
|
popupText.hide();
|
||
|
});
|
||
|
});
|
||
|
|
||
14 years ago
|
$("#toolbar-button-forward").click(function(){
|
||
|
browsing = true;
|
||
|
appHistory.forward();
|
||
|
});
|
||
13 years ago
|
|
||
|
$("#toolbar-button-forward").mouseover(function(evt){
|
||
|
popupFlag = true;
|
||
13 years ago
|
popupText.text(sankoreLang[syslang].next_word)
|
||
13 years ago
|
.css("top", evt.pageY + 5)
|
||
|
.css("left", evt.pageX + 13)
|
||
|
.css({width:"70px"})
|
||
|
.show("fast", function(){
|
||
|
if(!popupFlag)
|
||
|
popupText.hide();
|
||
|
});
|
||
|
});
|
||
|
|
||
14 years ago
|
$("#toolbar-button-home").click(function(){
|
||
|
});
|
||
|
});
|
||
13 years ago
|
|
||
14 years ago
|
$(window).resize(function(){
|
||
|
|
||
13 years ago
|
if($(window).width() < 370){
|
||
|
window.resizeTo(370, $(window).height());
|
||
14 years ago
|
} else if($(window).width() > 755){
|
||
|
$("#web-browser").height($(window).height() - $("#toolbar").height() - 2);
|
||
|
$("#web-browser").width($(window).width() - 2);
|
||
|
} else
|
||
|
$("#web-browser").height($(window).height() - $("#toolbar").height() - 2);
|
||
13 years ago
|
|
||
|
if($(window).height() < 150)
|
||
|
window.resizeTo($(window).width(), 150);
|
||
13 years ago
|
|
||
14 years ago
|
});
|
||
13 years ago
|
|
||
14 years ago
|
function wikiReq(kword){
|
||
13 years ago
|
|
||
14 years ago
|
var textBoxInput = "";
|
||
13 years ago
|
|
||
14 years ago
|
textBoxInput = remacc(kword.replace(/ /g,'_'));
|
||
13 years ago
|
|
||
14 years ago
|
textBoxInput = textBoxInput.replace(textBoxInput.charAt(0),textBoxInput.charAt(0).toLowerCase());
|
||
|
if(toolbar.state == "begin"){
|
||
|
$('#web-browser').attr('src',"");
|
||
|
toolbar.state = "started";
|
||
|
}
|
||
|
else
|
||
|
$('#web-browser').attr('src',"http://" + lang + ".wiktionary.org/wiki/" + textBoxInput);
|
||
|
$('#url').val(kword);
|
||
|
$('#toolbar-button-search').css("background-image", "url(images/toolbarLoading.jpg)");
|
||
|
toolbar.loading = true;
|
||
|
}
|
||
13 years ago
|
|
||
14 years ago
|
function hideLoading(){
|
||
|
$('#toolbar-button-search').css("background-image", "url(images/toolbarButtonSearch.png)");
|
||
|
toolbar.loading = false;
|
||
13 years ago
|
|
||
14 years ago
|
// History
|
||
|
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();
|
||
|
appHistory.index = appHistory.list.length-1;
|
||
|
}
|
||
13 years ago
|
|
||
14 years ago
|
if(window.sankore && $("#web-browser").attr("src") !== ""){
|
||
|
savePref("historyState", "started");
|
||
|
savePref("historyList", appHistory.list.toString());
|
||
|
savePref("historyIndex", appHistory.index)
|
||
|
}
|
||
|
}
|
||
13 years ago
|
|
||
14 years ago
|
String.prototype.accnt = function(){
|
||
|
var cnt = 0;
|
||
|
var acnt = this;
|
||
|
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++)
|
||
|
if (sec.indexOf(acnt[y]) != -1)
|
||
|
cnt++;
|
||
|
return cnt;
|
||
|
}
|
||
13 years ago
|
|
||
14 years ago
|
String.prototype.renlacc = function(){
|
||
|
var torem = this;
|
||
|
torem = torem.split('');
|
||
|
var toremout = new Array();
|
||
|
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++){
|
||
|
if (sec.indexOf(torem[y]) != -1)
|
||
|
toremout[y] = rep[sec.indexOf(torem[y])];
|
||
|
else
|
||
|
toremout[y] = torem[y];
|
||
|
}
|
||
|
var toascout = toremout.join('');
|
||
|
document.title = toascout;
|
||
|
return toascout;
|
||
|
}
|
||
13 years ago
|
|
||
14 years ago
|
function remacc(kword){
|
||
13 years ago
|
|
||
14 years ago
|
var countarr = new Array();
|
||
|
var c = '';
|
||
|
var text=kword;
|
||
|
var textout = new Array();
|
||
|
text = text.replace(/\r/g,'');
|
||
|
text = text.split('\n');
|
||
|
var linecnt = text.length;
|
||
|
for (var x = 0; x < linecnt; x++){
|
||
|
countarr[x] = Math.abs(text[x].accnt());
|
||
|
textout[x] = text[x].renlacc();
|
||
|
}
|
||
|
textout = textout.join('\n');
|
||
|
return textout;
|
||
|
}
|
||
13 years ago
|
|
||
14 years ago
|
function loadPref(name, defaultValue){
|
||
|
var pref = defaultValue;
|
||
13 years ago
|
|
||
14 years ago
|
if (sankore.preference(name) !== "") {
|
||
|
pref = sankore.preference(name);
|
||
|
};
|
||
13 years ago
|
|
||
14 years ago
|
return pref;
|
||
|
};
|
||
13 years ago
|
|
||
14 years ago
|
function savePref(name, value){
|
||
|
sankore.setPreference(name, String(value));
|
||
|
};
|
||
13 years ago
|
|
||
14 years ago
|
function languagesHandler(language){
|
||
|
switch(language){
|
||
|
case "Deutsch":
|
||
|
lang = 'de'
|
||
|
break;
|
||
|
case "English":
|
||
|
lang = 'en'
|
||
|
break;
|
||
|
case "Español":
|
||
|
lang = 'es'
|
||
|
break;
|
||
|
case "Français":
|
||
|
lang = 'fr'
|
||
|
break;
|
||
|
case "Italiano":
|
||
|
lang = 'it'
|
||
|
break;
|
||
|
case "Nederlands":
|
||
|
lang = 'nl'
|
||
|
break;
|
||
|
case "Polski":
|
||
|
lang = 'pl'
|
||
|
break;
|
||
|
case "Português":
|
||
|
lang = 'pt'
|
||
|
break;
|
||
|
case "Русский":
|
||
|
lang = 'ru'
|
||
|
break;
|
||
|
case "日本語":
|
||
|
lang = 'ja'
|
||
|
break;
|
||
|
}
|
||
|
};
|
||
13 years ago
|
|
||
14 years ago
|
</script>
|
||
|
</head>
|
||
|
<body style="overflow:hidden; margin: 0px; width:100%; height:100%; position:absolute; background:#ffffff">
|
||
|
|
||
|
<div id="toolbar">
|
||
|
|
||
|
<div class="toolbar-body">
|
||
|
|
||
|
<div id="toolbar-down" class="toolbar">
|
||
|
Wiktionary
|
||
|
</div> <!--toolbar-down-->
|
||
|
|
||
|
</div> <!--toolbar-body-->
|
||
|
|
||
|
<div class="toolbar-body">
|
||
|
|
||
|
<div id="toolbar-up" class="toolbar">
|
||
|
<div id="left-field">
|
||
|
<div id="toolbar-button-back" class="button" alt="back button"></div>
|
||
|
<div id="toolbar-button-forward" class="button" alt="forward button"></div>
|
||
|
</div>
|
||
|
<div id="center-field" class="full">
|
||
|
<input type="text" id="url" alt="url"/>
|
||
13 years ago
|
<div class="on-the-right">
|
||
|
<div id="toolbar-button-search"></div>
|
||
|
</div>
|
||
14 years ago
|
</div> <!--center-field-->
|
||
|
<div id="right-field">
|
||
|
<div id="toolbar-button-languages" class="button" alt="languages button">
|
||
|
<ul id='languages-dropdown' class='sf-menu'>
|
||
|
<li class='current'><a id='current-language' class='selected' href='#a'></a>
|
||
|
<ul>
|
||
|
<li><a class="sf-sl-first" href="#">Deutsch</a></li>
|
||
|
<li><a href="#">English</a></li>
|
||
|
<li><a href="#">Español</a></li>
|
||
|
<li><a href="#">Français</a></li>
|
||
|
<li><a href="#">Italiano</a></li>
|
||
|
<li><a href="#">Nederlands</a></li>
|
||
|
<li><a href="#">Polski</a></li>
|
||
|
<li><a href="#">Português</a></li>
|
||
|
<li><a href="#">Русский</a></li>
|
||
|
<li><a class="sf-sl-last" href="#">日本語</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div> <!--toolbar-up-->
|
||
|
|
||
|
</div> <!--toolbar-body-->
|
||
|
|
||
|
</div> <!--toolbar-->
|
||
|
<div id="web-canevas">
|
||
|
<iframe id="web-browser" name="web-browser" src="" onload="hideLoading()"></iframe>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|