setting factorydef







Spark Webserver





submitResult();


























Load From Factory Default




Factory Reset




Save As Factory Default




Delete All Channel










Yes


No







OK











var confirmType = 1; //1:Load From Factory Default 2:Factory Reset .......
var bsmallWindDisplay = false;
var bOkInfoWindDisplay = false;
var focusItem = 1; //1:yes. 2:no

function saveInfoShow(info){
$('#okInfo').text(info);
$('#infoOk').show();
$('#ok').focus();
bOkInfoWindDisplay = true;
}

function loadDefault(){
confirmType = 1;
$("#info").text("Be careful! Factory default will be reset!");
//$("#infoConfirm").animate({height:'show', width: 'show', opacity: 'show'}, 'fast');
$("#infoConfirm").show();
// document.getElementById("yes").focus();
bsmallWindDisplay = true;
}

function factoryDefault(){
confirmType = 2;
$("#info").text("Be careful! All user data will be erased.");
//$("#infoConfirm").animate({height:'show', width: 'show', opacity: 'show'}, 'fast');
$("#infoConfirm").show();
// document.getElementById("yes").focus();
bsmallWindDisplay = true;
}

function saveAsFactoryDefault(){
confirmType = 3;
$("#info").text("Be careful! Current setting will be save as Factory default!");
//$("#infoConfirm").animate({height:'show', width: 'show', opacity: 'show'}, 'fast');
$("#infoConfirm").show();
//document.getElementById("yes").focus();
bsmallWindDisplay = true;
}

function deleteAllChannel(){
confirmType = 4;
$("#info").text("Be careful! All channels will be deleted!");
//$("#infoConfirm").animate({height:'show', width: 'show', opacity: 'show'}, 'fast');
$("#infoConfirm").show();
//document.getElementById("yes").focus();
bsmallWindDisplay = true;
}

function boot2E2(){
confirmType = 5;
$("#info").text("Attention! Are you sure already install E2? Otherwise, please don't do this!");
//$("#infoConfirm").animate({height:'show', width: 'show', opacity: 'show'}, 'fast');
$("#infoConfirm").show();
//document.getElementById("yes").focus();
bsmallWindDisplay = true;
}

function yes(){
if(confirmType == 1){
$.ajax({
url: 'setting_factorydef.html',
type: 'get',
data: "load_default=1",
dataType: 'text',
success:function(data){
saveInfoShow("save success");
},
error:function(data){
saveInfoShow("save failed");
}
});
}else if(confirmType == 2){
$.ajax({
url: 'setting_factorydef.html',
type: 'get',
data: "factory_reset=1",
dataType: 'text',
success:function(data){
saveInfoShow("save success");
},
error:function(data){
saveInfoShow("save failed");
}
});
}
else if(confirmType == 3){
$.ajax({
url: 'setting_factorydef.html',
type: 'get',
data: "save_as_default=1",
dataType: 'text',
success:function(data){
saveInfoShow("save success");
},
error:function(data){
saveInfoShow("save failed");
}
});
}
else if(confirmType == 4){
$.ajax({
url: 'setting_factorydef.html',
type: 'get',
data: "delete_all_channel=1",
dataType: 'text',
success:function(data){
saveInfoShow("save success");
},
error:function(data){
saveInfoShow("save failed");
}
});
}
else if(confirmType == 5){
$.ajax({
url: 'setting_factorydef.html',
type: 'get',
data: "boot2e2=1",
dataType: 'text',
success:function(data){
saveInfoShow("save success");
},
error:function(data){
saveInfoShow("save failed");
}
});
}
$("#infoConfirm").hide();
bsmallWindDisplay = false;
}
function no(){
$("#infoConfirm").hide();
bsmallWindDisplay = false;
}

$(document).ready(function(){
displaynetstatus();
$('#infoEdit').hide();
$('#infoOk').hide();
bOkInfoWindDisplay = false;
bsmallWindDisplay = false;

//okInfo hide
$('#ok').click(function(){
$('#infoOk').hide();
bOkInfoWindDisplay = false;
});

$(document).keydown(function(event)
{
if(bOkInfoWindDisplay)
{
event.preventDefault();
switch(event.keyCode)
{
case 13: // enter /ok
{
$('#infoOk').hide();
bOkInfoWindDisplay = false;
}
break;
case 5: //menu
break;

default:
{
break;
}
}
}
else if (bsmallWindDisplay)
{
event.preventDefault();
// alert(event.keyCode);

switch(event.keyCode)
{
case 38: // up
case 37://left
{
document.getElementById("yes").focus();
focusItem = 1;
}
return;
case 40: // down
case 39: //right
{
document.getElementById("no").focus();
focusItem = 2;
}
return;
case 13: // enter
{
if(focusItem == 1)
{
yes();
}
else if(focusItem == 2)
{
no();
}
}
return;
case 5: //menu
return;

default:
{
return;
}
}
}
});

});




Wyszukiwarka

Podobne podstrony:
garmin online settings
display settings
display settings
map settings
setting
audio settings
settings
map settings
t news?vanced settings (2)
settings left groups
settings
garmin online settings
MLP FIM Fanfic Rainbow Factory
route settings
Year II SLA #10 The Age Factor in SLA

więcej podobnych podstron