|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
var sankoreLang = { |
|
|
|
|
display: "Показать",
|
|
|
|
|
display: "Закрыть",
|
|
|
|
|
edit: "Изменить",
|
|
|
|
|
first_desc: "Нечетные числа",
|
|
|
|
|
second_desc: "Четные числа",
|
|
|
|
@ -11,7 +11,8 @@ var sankoreLang = { |
|
|
|
|
pad: "Планшет", |
|
|
|
|
none: "Нет", |
|
|
|
|
help: "Помощь", |
|
|
|
|
help_content: "Пример текста помощи ..." |
|
|
|
|
help_content: "Пример текста помощи ...", |
|
|
|
|
theme: "Тема" |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
//main function
|
|
|
|
@ -23,9 +24,11 @@ function start(){ |
|
|
|
|
$("#wgt_reload").text(sankoreLang.reload); |
|
|
|
|
$("#wgt_help").text(sankoreLang.help); |
|
|
|
|
$("#help").html(sankoreLang.help_content); |
|
|
|
|
$(".style_select option[value='1']").text(sankoreLang.slate); |
|
|
|
|
$(".style_select option[value='2']").text(sankoreLang.pad); |
|
|
|
|
$(".style_select option[value='3']").text(sankoreLang.none); |
|
|
|
|
$("#style_select option[value='1']").text(sankoreLang.slate); |
|
|
|
|
$("#style_select option[value='2']").text(sankoreLang.pad); |
|
|
|
|
$("#style_select option[value='3']").text(sankoreLang.none); |
|
|
|
|
var tmpl = $("div.inline label").html(); |
|
|
|
|
$("div.inline label").html(sankoreLang.theme + tmpl) |
|
|
|
|
|
|
|
|
|
if(window.sankore){ |
|
|
|
|
if(sankore.preference("categoriser_images","")){ |
|
|
|
@ -47,11 +50,13 @@ function start(){ |
|
|
|
|
$("#wgt_help").click(function(){ |
|
|
|
|
var tmp = $(this); |
|
|
|
|
if($(this).hasClass("open")){ |
|
|
|
|
$(this).removeClass("help_pad").removeClass("help_wood") |
|
|
|
|
$("#help").slideUp("100", function(){ |
|
|
|
|
tmp.removeClass("open"); |
|
|
|
|
$("#data").show(); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
($("#style_select").val() == 1)?$(this).removeClass("help_pad").addClass("help_wood"):$(this).removeClass("help_wood").addClass("help_pad"); |
|
|
|
|
$("#data").hide(); |
|
|
|
|
$("#help").slideDown("100", function(){ |
|
|
|
|
tmp.addClass("open"); |
|
|
|
@ -72,7 +77,7 @@ function start(){ |
|
|
|
|
exportData(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$(".style_select").change(function (event){ |
|
|
|
|
$("#style_select").change(function (event){ |
|
|
|
|
changeStyle($(this).find("option:selected").val()); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
@ -81,7 +86,7 @@ function start(){ |
|
|
|
|
if(!$(this).hasClass("selected")){ |
|
|
|
|
$(this).addClass("selected"); |
|
|
|
|
$("#wgt_edit").removeClass("selected"); |
|
|
|
|
$(".style_select").css("display","none"); |
|
|
|
|
$("#parameters").css("display","none"); |
|
|
|
|
sankore.enableDropOnWidget(false); |
|
|
|
|
$(".add_block").remove(); |
|
|
|
|
$(".cont").each(function(){ |
|
|
|
@ -151,7 +156,7 @@ function start(){ |
|
|
|
|
if(!$(this).hasClass("selected")){ |
|
|
|
|
$(this).addClass("selected"); |
|
|
|
|
$("#wgt_display").removeClass("selected"); |
|
|
|
|
$(".style_select").css("display","block"); |
|
|
|
|
$("#parameters").css("display","block"); |
|
|
|
|
sankore.enableDropOnWidget(true); |
|
|
|
|
$(".cont").each(function(){ |
|
|
|
|
var container = $(this); |
|
|
|
@ -232,7 +237,7 @@ function exportData(){ |
|
|
|
|
if($("#wgt_edit").hasClass("selected")){ |
|
|
|
|
$(".cont").each(function(){ |
|
|
|
|
var cont_obj = new Object(); |
|
|
|
|
cont_obj.style = $(".style_select").find("option:selected").val(); |
|
|
|
|
cont_obj.style = $("#style_select").find("option:selected").val(); |
|
|
|
|
cont_obj.mode = "edit"; |
|
|
|
|
cont_obj.conts = []; |
|
|
|
|
$(this).find(".imgs_cont").each(function(){ |
|
|
|
@ -245,7 +250,6 @@ function exportData(){ |
|
|
|
|
var img_obj = new Object(); |
|
|
|
|
img_obj.value = $(this).find("input").val(); |
|
|
|
|
img_obj.link = $(this).find("img").attr("src").replace("../../","");
|
|
|
|
|
; |
|
|
|
|
img_obj.ht = $(this).find("img").height(); |
|
|
|
|
img_obj.wd = $(this).find("img").width(); |
|
|
|
|
img_cont.imgs.push(img_obj); |
|
|
|
@ -257,7 +261,7 @@ function exportData(){ |
|
|
|
|
} else { |
|
|
|
|
$(".cont").each(function(){ |
|
|
|
|
var cont_obj = new Object(); |
|
|
|
|
cont_obj.style = $(".style_select").find("option:selected").val(); |
|
|
|
|
cont_obj.style = $("#style_select").find("option:selected").val(); |
|
|
|
|
cont_obj.mode = "display"; |
|
|
|
|
cont_obj.conts = []; |
|
|
|
|
$(this).find(".imgs_cont").each(function(){ |
|
|
|
@ -270,7 +274,6 @@ function exportData(){ |
|
|
|
|
var img_obj = new Object(); |
|
|
|
|
img_obj.value = $(this).find("input").val(); |
|
|
|
|
img_obj.link = $(this).find("img").attr("src").replace("../../","");
|
|
|
|
|
; |
|
|
|
|
img_obj.ht = $(this).find("img").height(); |
|
|
|
|
img_obj.wd = $(this).find("img").width(); |
|
|
|
|
img_cont.imgs.push(img_obj); |
|
|
|
@ -282,7 +285,6 @@ function exportData(){ |
|
|
|
|
var img = new Object(); |
|
|
|
|
img.value = $(this).find("input").val(); |
|
|
|
|
img.link = $(this).find("img").attr("src").replace("../../","");
|
|
|
|
|
; |
|
|
|
|
img.ht = $(this).find("img").height(); |
|
|
|
|
img.wd = $(this).find("img").width(); |
|
|
|
|
cont_obj.all_imgs.push(img); |
|
|
|
@ -293,7 +295,7 @@ function exportData(){ |
|
|
|
|
|
|
|
|
|
if($(".cont").size() == 0){ |
|
|
|
|
var cont_obj = new Object(); |
|
|
|
|
cont_obj.style = $(".style_select").find("option:selected").val(); |
|
|
|
|
cont_obj.style = $("#style_select").find("option:selected").val(); |
|
|
|
|
cont_obj.tmp = "clear"; |
|
|
|
|
array_to_export.push(cont_obj); |
|
|
|
|
} |
|
|
|
@ -308,11 +310,11 @@ function importData(data){ |
|
|
|
|
for(var i in data){ |
|
|
|
|
if(data[i].tmp){ |
|
|
|
|
changeStyle(data[i].style); |
|
|
|
|
$(".style_select").val(data[i].style); |
|
|
|
|
$("#style_select").val(data[i].style); |
|
|
|
|
} else { |
|
|
|
|
if(i == 0){ |
|
|
|
|
changeStyle(data[i].style); |
|
|
|
|
$(".style_select").val(data[i].style); |
|
|
|
|
$("#style_select").val(data[i].style); |
|
|
|
|
} |
|
|
|
|
if(data[i].mode == "edit"){
|
|
|
|
|
var tmp_array = []; |
|
|
|
@ -640,10 +642,10 @@ function changeStyle(val){ |
|
|
|
|
$("#wgt_reload").removeClass("pad_color").removeClass("pad_reload"); |
|
|
|
|
$("#wgt_help").removeClass("pad_color").removeClass("pad_help"); |
|
|
|
|
$("#wgt_edit").removeClass("pad_color").removeClass("pad_edit"); |
|
|
|
|
$("#wgt_display").removeClass("pad_color").removeClass("pad_edit"); |
|
|
|
|
$("#wgt_name").removeClass("pad_color"); |
|
|
|
|
$(".style_select").removeClass("pad_select").removeClass("none_select").val(val); |
|
|
|
|
$("body, html").removeClass("without_radius"); |
|
|
|
|
$("#wgt_display").addClass("display_wood"); |
|
|
|
|
$("#style_select").val(val); |
|
|
|
|
$("body, html").removeClass("without_radius").addClass("radius_ft"); |
|
|
|
|
break; |
|
|
|
|
case "2": |
|
|
|
|
$(".b_top_left").addClass("btl_pad").removeClass("without_back"); |
|
|
|
@ -657,10 +659,10 @@ function changeStyle(val){ |
|
|
|
|
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); |
|
|
|
|
$("#wgt_help").addClass("pad_color").addClass("pad_help"); |
|
|
|
|
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); |
|
|
|
|
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); |
|
|
|
|
$("#wgt_name").addClass("pad_color"); |
|
|
|
|
$(".style_select").addClass("pad_select").removeClass("none_select").val(val); |
|
|
|
|
$("body, html").removeClass("without_radius"); |
|
|
|
|
$("#wgt_display").removeClass("display_wood"); |
|
|
|
|
$("#style_select").val(val); |
|
|
|
|
$("body, html").removeClass("without_radius").removeClass("radius_ft"); |
|
|
|
|
break; |
|
|
|
|
case "3": |
|
|
|
|
$(".b_top_left").addClass("without_back").removeClass("btl_pad"); |
|
|
|
@ -674,10 +676,10 @@ function changeStyle(val){ |
|
|
|
|
$("#wgt_help").addClass("pad_color").addClass("pad_help"); |
|
|
|
|
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); |
|
|
|
|
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); |
|
|
|
|
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); |
|
|
|
|
$("#wgt_name").addClass("pad_color"); |
|
|
|
|
$(".style_select").addClass("none_select").val(val); |
|
|
|
|
$("body, html").addClass("without_radius"); |
|
|
|
|
$("#wgt_display").removeClass("display_wood"); |
|
|
|
|
$("#style_select").val(val); |
|
|
|
|
$("body, html").addClass("without_radius").removeClass("radius_ft"); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|