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.
303 lines
12 KiB
303 lines
12 KiB
14 years ago
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||
14 years ago
|
"http://www.w3.org/TR/html4/loose.dtd">
|
||
14 years ago
|
|
||
|
<html>
|
||
|
|
||
14 years ago
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<title>Web Browser</title>
|
||
|
<link rel="stylesheet" type="text/css" href="css/main.css">
|
||
|
<script src="scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
|
||
13 years ago
|
<script src="scripts/languages.js" type="text/javascript"></script>
|
||
14 years ago
|
<script type="text/javascript">
|
||
14 years ago
|
|
||
14 years ago
|
var loadingState = false;
|
||
13 years ago
|
var lang = "en";
|
||
|
if(window.sankore){
|
||
|
try{
|
||
|
lang = sankore.locale().substr(0,2);
|
||
|
sankoreLang[lang].next;
|
||
|
} catch(e){
|
||
|
lang = "en";
|
||
|
}
|
||
|
} else
|
||
|
lang = "en";
|
||
14 years ago
|
|
||
|
function changeLoadingState(){
|
||
|
loadingState = true;
|
||
|
}
|
||
|
|
||
|
$(document).ready(function(){
|
||
13 years ago
|
|
||
13 years ago
|
$("body").css({height: $(window).height() - 40});
|
||
|
|
||
13 years ago
|
$("#back-button").html(sankoreLang[lang].previous);
|
||
|
$("#forward-button").html(sankoreLang[lang].next);
|
||
|
$("#search-button").html(sankoreLang[lang].show);
|
||
|
|
||
13 years ago
|
var popupFlag = false;
|
||
14 years ago
|
var currentHistory = 0;
|
||
|
var references = new Array();
|
||
|
var globalWidth = 850;
|
||
|
var globalHeight = 700;
|
||
|
var url = "";
|
||
|
var margins = {
|
||
|
top: cssToInt($("body").css("margin-top")),
|
||
|
right: cssToInt($("body").css("margin-right")),
|
||
|
bottom: cssToInt($("body").css("margin-bottom")),
|
||
|
left: cssToInt($("body").css("margin-left"))
|
||
|
};
|
||
14 years ago
|
|
||
14 years ago
|
var resizer; // Timer
|
||
|
var resizerIndex;
|
||
|
|
||
13 years ago
|
var popupText = $("<div id='popupWordInfo' class='popupWordInfo'></div>").appendTo("body");
|
||
|
|
||
14 years ago
|
resizerIndex = 0;
|
||
14 years ago
|
|
||
14 years ago
|
if(window.sankore){
|
||
|
url = window.sankore.preference("url", "");
|
||
14 years ago
|
if(sankore.preference("browserHistory", ""))
|
||
|
references = sankore.preference("browserHistory", "").split(",");
|
||
|
currentHistory = parseInt(sankore.preference("browserIndex", "0"));
|
||
14 years ago
|
}else{
|
||
|
url = "";
|
||
14 years ago
|
};
|
||
14 years ago
|
|
||
14 years ago
|
$("#back-button")
|
||
|
.click(function(){
|
||
|
loadingState = false;
|
||
|
if((currentHistory - 1) > 0){
|
||
|
$("#textbox").val(references[--currentHistory-1]);
|
||
|
$("#search-button").trigger("click");
|
||
|
}
|
||
|
});
|
||
14 years ago
|
|
||
14 years ago
|
$("#forward-button")
|
||
|
.click(function(){
|
||
|
loadingState = false;
|
||
|
if(currentHistory < references.length) {
|
||
|
$("#textbox").val(references[currentHistory++]);
|
||
|
$("#search-button").trigger("click");
|
||
|
}
|
||
|
});
|
||
13 years ago
|
|
||
|
$("#search-button").mouseover(function(evt){
|
||
|
popupFlag = true;
|
||
|
popupText.css("top", evt.pageY + 5)
|
||
|
.css("left", evt.pageX + 13)
|
||
13 years ago
|
.css({width:"110px"})
|
||
|
.text(sankoreLang[lang].open)
|
||
13 years ago
|
.show("fast", function(){
|
||
|
if(!popupFlag)
|
||
|
popupText.hide();
|
||
|
});
|
||
|
});
|
||
|
|
||
|
$("#back-button").mouseover(function(evt){
|
||
|
popupFlag = true;
|
||
|
popupText.css("top", evt.pageY + 5)
|
||
|
.css("left", evt.pageX + 13)
|
||
13 years ago
|
.css({width:"130px"})
|
||
|
.text(sankoreLang[lang].prev_page)
|
||
13 years ago
|
.show("fast", function(){
|
||
|
if(!popupFlag)
|
||
|
popupText.hide();
|
||
|
});
|
||
|
});
|
||
|
|
||
|
$("#forward-button").mouseover(function(evt){
|
||
|
popupFlag = true;
|
||
|
popupText.css("top", evt.pageY + 5)
|
||
|
.css("left", evt.pageX + 13)
|
||
13 years ago
|
.css({width:"130px"})
|
||
|
.text(sankoreLang[lang].next_page)
|
||
13 years ago
|
.show("fast", function(){
|
||
|
if(!popupFlag)
|
||
|
popupText.hide();
|
||
|
});
|
||
|
});
|
||
|
|
||
|
$("#search-button, #back-button, #forward-button").mousemove(function(evt){
|
||
|
popupText.css("top", evt.pageY + 5)
|
||
|
.css("left", evt.pageX + 13);
|
||
|
});
|
||
|
|
||
|
$("#search-button, #back-button, #forward-button").mouseout(function(evt){
|
||
|
popupText.hide();
|
||
|
popupFlag = false;
|
||
|
});
|
||
|
|
||
14 years ago
|
$("#textbox").keypress(function(e) {
|
||
|
if(e.keyCode == 13) {
|
||
|
$("#search-button").trigger("click");
|
||
|
}
|
||
|
});
|
||
14 years ago
|
|
||
14 years ago
|
$("#search-button").click(function(){
|
||
|
if($("#textbox").val().length > 0){
|
||
|
loadingState = false;
|
||
|
var url = $("#textbox").val();
|
||
|
var urlStart = url.split("://");
|
||
14 years ago
|
|
||
14 years ago
|
if(urlStart[0]!="http"){
|
||
|
url = "http://" + url;
|
||
|
};
|
||
14 years ago
|
|
||
14 years ago
|
if(checkURLs(references, url)){
|
||
|
if(currentHistory == references.length)
|
||
|
references[currentHistory++] = url;
|
||
|
else
|
||
|
references = insertInto(references, currentHistory++, url);
|
||
|
}
|
||
|
window.resizeTo(globalWidth, globalHeight);
|
||
14 years ago
|
|
||
14 years ago
|
$("#container").removeClass("welcome").removeClass("change")
|
||
|
.removeClass("error").addClass("load");
|
||
|
$("#container-shadow").hide();
|
||
|
$("#arrow").hide();
|
||
|
$("#embeded-content").hide();
|
||
14 years ago
|
$("#web-content").hide();
|
||
14 years ago
|
$('#web-content').attr('src',url);
|
||
14 years ago
|
|
||
14 years ago
|
checkcontent();
|
||
|
checkLoading();
|
||
|
} else {
|
||
13 years ago
|
$("#embeded-content").load("locales/" + lang + "/howto.html"); // Welcome screen with some explanations
|
||
14 years ago
|
$("#container")
|
||
|
.addClass("welcome")
|
||
|
.addClass("change")
|
||
|
.addClass("error")
|
||
|
.removeClass("load");
|
||
|
$("#container-shadow").show();
|
||
|
$("#arrow").show();
|
||
|
$("#embeded-content").show();
|
||
|
$("#web-content").hide();
|
||
|
window.resizeTo(550, 280);
|
||
|
}
|
||
|
})
|
||
|
.mouseenter(function(){
|
||
|
$(this)
|
||
|
.addClass("over");
|
||
|
})
|
||
|
.mouseleave(function(){
|
||
|
$(this)
|
||
|
.removeClass("over");
|
||
|
});
|
||
14 years ago
|
|
||
14 years ago
|
if(url.length > 0){
|
||
|
$("#textbox").val(url);
|
||
|
$("#search-button").trigger("click");
|
||
|
}else{
|
||
13 years ago
|
$("#embeded-content").load("locales/" + lang + "/howto.html"); // Welcome screen with some explanations
|
||
14 years ago
|
};
|
||
|
|
||
|
$(window).resize(function(){
|
||
13 years ago
|
$("body").css({height: $(window).height() - 40});
|
||
14 years ago
|
globalWidth = $(window).width();
|
||
|
globalHeight = $(window).height();
|
||
|
$("#web-content")
|
||
13 years ago
|
.attr("width", globalWidth - 60)
|
||
|
.attr("height", globalHeight - 120);
|
||
14 years ago
|
});
|
||
14 years ago
|
|
||
13 years ago
|
function checkcontent(){
|
||
14 years ago
|
if(window.sankore){
|
||
|
window.sankore.setPreference("url", $("#textbox").val());
|
||
14 years ago
|
window.sankore.setPreference("browserHistory", references.toString());
|
||
|
window.sankore.setPreference("browserIndex", currentHistory);
|
||
14 years ago
|
};
|
||
14 years ago
|
|
||
14 years ago
|
$("#embeded-content").hide();
|
||
|
$("#container").removeClass("load").addClass("show");
|
||
|
};
|
||
14 years ago
|
|
||
14 years ago
|
function checkLoading(){
|
||
|
if(loadingState){
|
||
|
clearTimeout(resizer);
|
||
14 years ago
|
resizerIndex = 0;
|
||
14 years ago
|
$("#web-content")
|
||
|
.attr("width", globalWidth - 25)
|
||
13 years ago
|
.attr("height", globalHeight - 90)
|
||
|
.show();
|
||
13 years ago
|
$(window).trigger("resize");
|
||
14 years ago
|
return false;
|
||
|
};
|
||
13 years ago
|
if(resizerIndex > 80){
|
||
14 years ago
|
resizerIndex = 0;
|
||
13 years ago
|
console.log("error on loading page");
|
||
13 years ago
|
$("#back-button").trigger("click");
|
||
13 years ago
|
$("#textbox").val($("#textbox").val().replace("http://", ""));
|
||
|
$("#textbox").val("http://www.metacrawler.com/search/web?&q=" + $("#textbox").val().replace("http://", "")+"&ql=");
|
||
13 years ago
|
$("#search-button").trigger("click");
|
||
14 years ago
|
}else{
|
||
|
resizer = setTimeout(function(){checkLoading()}, 100);
|
||
|
resizerIndex++;
|
||
|
};
|
||
|
};
|
||
14 years ago
|
|
||
14 years ago
|
function cssToInt(cssvalue){
|
||
|
return(parseInt(cssvalue.replace("px", "")));
|
||
|
}
|
||
14 years ago
|
|
||
14 years ago
|
function checkURLs(arr, value){
|
||
|
for(var i = 0; i < arr.length; i++)
|
||
|
if(arr[i] == value)
|
||
|
return false;
|
||
|
return true;
|
||
|
}
|
||
14 years ago
|
|
||
14 years ago
|
function insertInto(arr, index, url){
|
||
|
var newArr = new Array();
|
||
|
for(var i = 0, j = 0; i < arr.length; i++, j++)
|
||
|
if(i == index - 1){
|
||
|
newArr[j] = arr[i];
|
||
|
newArr[++j] = url;
|
||
|
} else
|
||
|
newArr[j] = arr[i];
|
||
|
return newArr;
|
||
13 years ago
|
}
|
||
|
|
||
|
if (window.widget) {
|
||
|
window.widget.onremove = function(){
|
||
|
$("#web-content").empty();
|
||
|
}
|
||
|
}
|
||
14 years ago
|
|
||
14 years ago
|
});
|
||
|
</script>
|
||
13 years ago
|
</head>
|
||
14 years ago
|
|
||
13 years ago
|
<body>
|
||
14 years ago
|
<div id="ubwidget">
|
||
|
<div id="shadow"></div>
|
||
14 years ago
|
|
||
14 years ago
|
<div id="inputfield">
|
||
|
<div id="back-button" class="button">Previous</div>
|
||
|
<div id="forward-button" class="button">Next</div>
|
||
|
<input id="textbox" type="text">
|
||
|
<div id="search-button" class="button">Show</div>
|
||
|
</div>
|
||
|
|
||
|
<div id="container" class="welcome">
|
||
|
<div id="arrow"><img src="imgs/arrow.png" alt="arrow-top"></div>
|
||
|
|
||
|
<div id="show-container">
|
||
|
<div id="embeded-content"></div>
|
||
|
<iframe id="web-content" name="web-content" src="" scrolling=auto frameborder=1 onload="changeLoadingState()"></iframe>
|
||
|
</div>
|
||
|
|
||
|
<table cellspacing="0" cellpadding="0" id="container-shadow">
|
||
|
<tr>
|
||
|
<td id="shadow-left"></td>
|
||
|
<td id="shadow-center"> </td>
|
||
|
<td id="shadow-right"></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
</body>
|
||
14 years ago
|
|
||
13 years ago
|
</html>
|