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.
228 lines
9.0 KiB
228 lines
9.0 KiB
14 years ago
|
<!--
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
-->
|
||
14 years ago
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||
13 years ago
|
"http://www.w3.org/TR/html4/loose.dtd">
|
||
14 years ago
|
|
||
|
<html>
|
||
|
|
||
13 years ago
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<title>Video Picker</title>
|
||
|
<link rel="stylesheet" type="text/css" href="css/main.css">
|
||
|
<script src="scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
|
||
|
<script src="scripts/languages.js" type="text/javascript"></script>
|
||
|
<script src="scripts/jquery.oembed.js" type="text/javascript"></script>
|
||
|
<!--DEFAULT FR-->
|
||
|
</head>
|
||
14 years ago
|
|
||
13 years ago
|
<body>
|
||
|
<script type="text/javascript">
|
||
14 years ago
|
|
||
13 years ago
|
var oembedUrl = "";
|
||
|
var lang = "en";
|
||
|
|
||
|
if(window.sankore){
|
||
|
try{
|
||
|
lang = sankore.locale().substr(0,2);
|
||
|
sankoreLang[lang].show;
|
||
|
} catch(e){
|
||
|
lang = "en";
|
||
|
}
|
||
|
} else
|
||
|
lang = "en";
|
||
14 years ago
|
|
||
13 years ago
|
function initialize() {
|
||
|
if(window.sankore){
|
||
|
oembedUrl = window.sankore.preference("oembedUrl", "");
|
||
|
}
|
||
14 years ago
|
|
||
13 years ago
|
window.resizeTo(426, 630);
|
||
|
if(oembedUrl.length > 0){
|
||
|
$("#textbox").val(oembedUrl);
|
||
|
$("#search-button").trigger("click");
|
||
|
}else{
|
||
|
$("#embeded-content").load("locales/" + lang + "/howto.html"); // Welcome note with some explanations
|
||
|
};
|
||
|
};
|
||
14 years ago
|
|
||
13 years ago
|
$(document).ready(function(){
|
||
|
var resizer; // Timer
|
||
|
var resizerIndex;
|
||
14 years ago
|
|
||
13 years ago
|
resizerIndex = 0;
|
||
14 years ago
|
|
||
13 years ago
|
$("#search-button")
|
||
|
.click(function(){
|
||
13 years ago
|
if($("#textbox").val()){
|
||
|
window.resizeTo(385, 80);
|
||
|
$("#container").removeClass("welcome").removeClass("change").removeClass("error").addClass("load");
|
||
|
$("#container-shadow").hide();
|
||
|
$("#arrow").hide();
|
||
|
$("#embeded-content").css({
|
||
|
marginLeft:-9000,
|
||
|
marginTop:-9000
|
||
|
}).empty().oembed($("#textbox").val());
|
||
|
checkcontent();
|
||
|
} else {
|
||
|
var sleepTime = 100;
|
||
|
var counter = 0;
|
||
|
var id = setInterval(function(){
|
||
|
$("#textbox").toggleClass("bordered1").toggleClass("bordered2");
|
||
|
counter ++;
|
||
|
if(counter == 10)
|
||
|
clearInterval(id);
|
||
|
}, sleepTime);
|
||
|
}
|
||
13 years ago
|
})
|
||
|
.mouseenter(function(){
|
||
|
$(this)
|
||
|
.addClass("over");
|
||
|
})
|
||
|
.mouseleave(function(){
|
||
|
$(this)
|
||
|
.removeClass("over");
|
||
|
});
|
||
14 years ago
|
|
||
13 years ago
|
$('#textbox').keypress(function(e){
|
||
|
if (e.which == 13){
|
||
|
$('#search-button').click();
|
||
|
};
|
||
|
});
|
||
14 years ago
|
|
||
13 years ago
|
$("#show-inputfield-button")
|
||
|
.click(
|
||
|
function(){
|
||
|
$("#show-area").fadeOut(0);
|
||
|
$("#inputfield").show();
|
||
|
$("#shadow").show();
|
||
|
$("#container").removeClass("show").addClass("change");
|
||
|
adaptWidgetSize(18, 88);
|
||
|
})
|
||
|
.mouseenter(function(){
|
||
|
$(this).addClass("over");
|
||
|
})
|
||
|
.mouseleave(function(){
|
||
|
$(this).removeClass("over");
|
||
|
});
|
||
14 years ago
|
|
||
13 years ago
|
function checkcontent(){
|
||
|
if($("#embeded-content").html().length != 0 && $("#embeded-content").children(":first").width() > 0){
|
||
|
$("#embeded-content embed").attr("wmode", "opaque");
|
||
|
var embeded_content_html = $("#embeded-content").html();
|
||
|
$("#embeded-content").empty().html(embeded_content_html);
|
||
|
clearTimeout(resizer);
|
||
|
resizerIndex = 0;
|
||
14 years ago
|
|
||
13 years ago
|
if(window.sankore){
|
||
|
window.sankore.setPreference("oembedUrl", $("#textbox").val());
|
||
|
};
|
||
14 years ago
|
|
||
13 years ago
|
$("#inputfield").hide();
|
||
|
$("#shadow").hide();
|
||
|
$("#embeded-content").css({
|
||
|
marginLeft:0,
|
||
|
marginTop:0
|
||
|
})
|
||
|
.width($("#embeded-content").children(":first").width())
|
||
|
.height($("#embeded-content").children(":first").height());
|
||
|
$("#container").removeClass("load").addClass("show");
|
||
|
$("#show-area").fadeIn(2000).css({
|
||
|
left:$("#embeded-content").children(":first").width()-25,
|
||
|
top:($("#embeded-content").children(":first").height()-35)/2
|
||
|
});
|
||
14 years ago
|
|
||
13 years ago
|
adaptWidgetSize(3, 0);
|
||
13 years ago
|
return false;
|
||
|
};
|
||
14 years ago
|
|
||
13 years ago
|
if(resizerIndex > 50){
|
||
|
resizerIndex = 0;
|
||
|
$("#container").removeClass("show").addClass("error");
|
||
|
$("#arrow").show();
|
||
|
$("#embeded-content").css({
|
||
|
marginTop:0,
|
||
|
marginLeft:0
|
||
|
}).width(395)
|
||
|
.load("locales/" + lang + "/error.html",
|
||
|
function(){
|
||
|
adaptWidgetSize(20, 125);
|
||
|
});
|
||
|
$("#container-shadow").show();
|
||
|
}else{
|
||
|
resizer = setTimeout(function(){checkcontent()}, 100);
|
||
|
resizerIndex++;
|
||
|
};
|
||
|
};
|
||
14 years ago
|
|
||
13 years ago
|
function adaptWidgetSize(adjustmentX, adjustmentY){
|
||
|
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"))
|
||
|
};
|
||
|
var widgetWidth = $("#embeded-content").width() + margins.right + margins.left + adjustmentX;
|
||
|
var widgetHeight = $("#embeded-content").position().top + $("#embeded-content").height() + margins.bottom + adjustmentY;
|
||
14 years ago
|
|
||
13 years ago
|
window.resizeTo(widgetWidth, widgetHeight);
|
||
|
window.sankore.resize(widgetWidth, widgetHeight);
|
||
|
};
|
||
14 years ago
|
|
||
13 years ago
|
function cssToInt(cssvalue){
|
||
|
return(parseInt(cssvalue.replace("px", "")));
|
||
|
};
|
||
14 years ago
|
|
||
13 years ago
|
if (window.widget) {
|
||
|
window.widget.onremove = function(){
|
||
|
$("#embeded-content").empty();
|
||
|
}
|
||
|
}
|
||
|
$("#search-button").html(sankoreLang[lang].show);
|
||
|
initialize();
|
||
|
});
|
||
|
</script>
|
||
13 years ago
|
|
||
13 years ago
|
<div id="ubwidget">
|
||
|
<div id="shadow"></div>
|
||
14 years ago
|
|
||
13 years ago
|
<div id="inputfield">
|
||
13 years ago
|
<input id="textbox" type="text" class="bordered2">
|
||
13 years ago
|
<div id="search-button" class="button">Show</div>
|
||
|
</div>
|
||
14 years ago
|
|
||
13 years ago
|
<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>
|
||
|
|
||
|
<div id="show-area">
|
||
|
<img id="show-inputfield-button" src="imgs/bts.png">
|
||
|
</div>
|
||
|
</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
|
|
||
|
</html>
|