';
str += '';
document.getElementById("HDD_slider_link").innerHTML = str;
}
function UpdateHDDSlider(elemID, value, startSize, endSize, style)
{
var reg = /^[0-9]*$/;
if (!reg.test(value)) {
value = $("#slider-range-HDDmin").slider("value");
}
if (value < startSize) {
value = startSize;
} else if (value > endSize) {
value = endSize;
}
$("#slider-range-HDDmin").slider("value", value);
if (document.getElementById(elemID).value != value) {
document.getElementById(elemID).value = value;
}
if(style=='exMode'){
document.getElementById("Hddresize_id").value = value-startSize;
}
}
function FL_CreateHDDSliderElement(elem_id,startSize,endSize)
{
startSize=parseInt(startSize);
endSize=parseInt(endSize);
var sizeRange=endSize-startSize;
var level_1=1024;
var level_2=2048;
var level_3=3072;
/*
var level_1=Math.round((startSize+sizeRange/4)/50)*50;
var level_2=Math.round((startSize+sizeRange/2)/50)*50;
var level_3=Math.round((startSize+sizeRange*3/4)/50)*50;
*/
var link = [startSize, level_1, level_2, level_3, endSize];
var str = '';
for (var i=0; i'+str2+'';
}
str += '
';
str += '';
document.getElementById("FL_HDD_slider_link").innerHTML = str;
}
function FL_UpdateHDDSlider(elemID, value, startSize, endSize)
{
var reg = /^[0-9]*$/;
if (!reg.test(value)) {
value = $("#FL_slider-range-HDDmin").slider("value");
}
if (value < startSize) {
value = startSize;
} else if (value > endSize) {
value = endSize;
}
$("#FL_slider-range-HDDmin").slider("value", value);
if (document.getElementById(elemID).value != value) {
document.getElementById(elemID).value = value;
}
}
function ReloadShareList(func, params)
{
url = "/sharelist/";
makeRequest(url, '', _callbk_reload_sharelist, {'func':func, 'params':params});
}
function _callbk_reload_sharelist(http_request, data)
{
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var json = JSON.parse(http_request.responseText);
if (json.success) {
if (data.params) {
data.func(json.list_data, data.params);
} else {
data.func(json.list_data);
}
} else {
func(null, []);
}
} else {
func(null, []);
}
}
}
function decodeHTMLEntities(text) {
var entities = [
['apos', '\''],
['amp', '&'],
['lt', '<'],
['gt', '>']
];
for (var i = 0, max = entities.length; i < max; ++i) {
text = text.replace(new RegExp('&'+entities[i][0]+';', 'g'), entities[i][1]);
}
return text;
}
function FileSizeFormat(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return 'n/a';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
};
function onMultiCkboxChange(elem, prefix, totalCnt,openBtn)
{
if (elem.id == (prefix+'all')) {
for (var i=0; i').attr('id','helpTip').addClass('helpTip').appendTo($('#rightDiv'));
var helpTipBody = $('').addClass('helpTipBody').css({'width':baseWidth}).appendTo(helpTip);
var helpTipHeadBg = $('').addClass('helpTipHeadBg').appendTo(helpTip);
var helpTipHead = $('').addClass('helpTipHead').appendTo(helpTip);
$(helpContent).appendTo(helpTipBody);
var detectUserAgent = navigator.userAgent;
if (detectUserAgent.match(/(iPhone|iPod|iPad|Android)/)){
$('#help-window').on('touchstart click',function(e){
e.preventDefault();
var rect = document.getElementById('help-window').getBoundingClientRect();
var baseLeft=rect.left+11;
var baseTop=rect.top+30;
helpTipBody.css({'left':baseLeft-baseWidth,'top':baseTop});
helpTipHeadBg.css({'left':baseLeft-5,'top':baseTop-6});
helpTipHead.css({'left':baseLeft-5,'top':baseTop-5});
helpTip.show();
helpTip.before($('
'));
$('#closeMask').on('touchstart click',closeTip);
});
}
else{
$('#help-window').mouseover(function(){
var rect = document.getElementById('help-window').getBoundingClientRect();
var baseLeft=rect.left+11;
var baseTop=rect.top+30;
helpTipBody.css({'left':baseLeft-baseWidth,'top':baseTop});
helpTipHeadBg.css({'left':baseLeft-5,'top':baseTop-6});
helpTipHead.css({'left':baseLeft-5,'top':baseTop-5});
helpTip.show();
$('#help-window').click(function(e){
if(!$('#closeMask').attr('id'))
helpTip.before($('
'));
$('#help-window').off('mouseout');
$('#closeMask').on('click',closeTip);
});
$('#help-window').mouseout(function(){
$('.helpTip').hide();
});
function closeTip(e){
e.preventDefault();
$('.helpTip').hide();
$('#closeMask').remove();
}
});
}
}
function closeTip(e){
e.preventDefault();
$('.helpTip').hide();
$('#closeMask').remove();
}
//account function start
function accountMenu(userName,lastLoginTime,page){
if($('#accountMenu').attr('id')!=undefined){
$('#accountMenu').remove();
$('#closeMask').remove();
}
else{
var rect = $('.account')[0].getBoundingClientRect();
var baseTop=rect.top+28;
var scrollWidth=18;
if (oBrowser.isCh){
scrollWidth=4;
}
if($('#rightDiv')[0].scrollHeight > $('#rightDiv')[0].clientHeight){
scrollWidth=0;
}
if(page=='vm'){
baseTop = 60;
}
$('
').appendTo($('#rightDiv'));
var accountMenu = $('').appendTo($('#rightDiv'));
if (oBrowser.isCh){
var accountMenuContent = $('').addClass('accountContent').css({'right':15-scrollWidth,'top':baseTop}).appendTo(accountMenu);
var accountHeadBg = $('').addClass('accountHeadBg').css({'right':33-scrollWidth,'top':baseTop-7}).appendTo(accountMenu);
var accountHead = $('').addClass('accountHead').css({'right':33-scrollWidth,'top':baseTop-5}).appendTo(accountMenu);
}
else{
var accountMenuContent = $('').addClass('accountContent').css({'right':30-scrollWidth,'top':baseTop}).appendTo(accountMenu);
var accountHeadBg = $('').addClass('accountHeadBg').css({'right':48-scrollWidth,'top':baseTop-7}).appendTo(accountMenu);
var accountHead = $('').addClass('accountHead').css({'right':48-scrollWidth,'top':baseTop-5}).appendTo(accountMenu);
}
if(userName=='admin'){
if(window.parent != window.self){
accountMenuContent.append('