fixed etudier widget

preferencesAboutTextFull
unknown 13 years ago
parent c5c30bd218
commit f7a5176c18
  1. 24
      resources/nonDistributedWidgets/Etudier.wgt/css/basic.css
  2. BIN
      resources/nonDistributedWidgets/Etudier.wgt/img/size_down.png
  3. BIN
      resources/nonDistributedWidgets/Etudier.wgt/img/size_up.png
  4. BIN
      resources/nonDistributedWidgets/Etudier.wgt/img/turn_left.png
  5. BIN
      resources/nonDistributedWidgets/Etudier.wgt/img/turn_right.png
  6. 1
      resources/nonDistributedWidgets/Etudier.wgt/index.html
  7. 20
      resources/nonDistributedWidgets/Etudier.wgt/js/easySlider1.5.js
  8. 44
      resources/nonDistributedWidgets/Etudier.wgt/js/script.js
  9. 1
      resources/nonDistributedWidgets/Etudier.wgt/locales/fr/index.html
  10. 44
      resources/nonDistributedWidgets/Etudier.wgt/locales/fr/js/script.js
  11. 1
      resources/nonDistributedWidgets/Etudier.wgt/locales/ru/index.html
  12. 44
      resources/nonDistributedWidgets/Etudier.wgt/locales/ru/js/script.js

@ -76,6 +76,28 @@ body{
cursor: pointer; cursor: pointer;
} }
.size_up{
width: 20px;
height: 20px;
background-repeat: no-repeat;
position: absolute;
background-image: url(../img/size_up.png);
top: -15px;
right: 20px;
cursor: pointer;
}
.size_down{
width: 20px;
height: 20px;
background-repeat: no-repeat;
position: absolute;
background-image: url(../img/size_down.png);
top: -15px;
right: 45px;
cursor: pointer;
}
.dropHere{ .dropHere{
background-color: #ccc; background-color: #ccc;
} }
@ -183,6 +205,8 @@ li>div{
position: absolute; position: absolute;
top: 50px; top: 50px;
left: 100px; left: 100px;
background-color: white;
border-radius: 10px;
} }
.block_border{ .block_border{

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -49,7 +49,6 @@
<td class="b_top_left">&nbsp;</td> <td class="b_top_left">&nbsp;</td>
<td class="b_top_center"> <td class="b_top_center">
<div id="wgt_name"></div> <div id="wgt_name"></div>
<div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div> <div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div> <div id="wgt_edit"></div>
<select class="style_select"> <select class="style_select">

@ -32,6 +32,21 @@
$("a","#nextBtn").trigger("click"); $("a","#nextBtn").trigger("click");
} }
$.fn.goToSlide = function(dest){
t = dest;
p = (t*w*-1);
$("ul",$(this)).animate(
{
marginLeft: p
},
0
);
}
$.fn.getPage = function(){
return t;
}
$.fn.easySlider = function(options){ $.fn.easySlider = function(options){
// default configuration properties // default configuration properties
@ -99,10 +114,10 @@
var ot = t; var ot = t;
switch(dir){ switch(dir){
case "next": case "next":
t = (ot>=ts) ? (options.continuous ? 0 : ts) : t+1; t = (ot>=ts) ? (options.continuous ? 0 : ts) : ++t;
break; break;
case "prev": case "prev":
t = (t<=0) ? (options.continuous ? ts : 0) : t-1; t = (t<=0) ? (options.continuous ? ts : 0) : --t;
break; break;
case "first": case "first":
t = 0; t = 0;
@ -118,7 +133,6 @@
var speed = diff*options.speed; var speed = diff*options.speed;
if(!options.vertical) { if(!options.vertical) {
p = (t*w*-1); p = (t*w*-1);
console.log(w + " | " + h + " | " + p);
$("ul",obj).animate( $("ul",obj).animate(
{ {
marginLeft: p marginLeft: p

@ -5,7 +5,6 @@ var sankoreLang = {
new_txt: "New text block", new_txt: "New text block",
new_slide: "This is new slide.", new_slide: "This is new slide.",
wgt_name: "Slider", wgt_name: "Slider",
reload: "Reload",
slate: "Wood", slate: "Wood",
pad: "Pad" pad: "Pad"
}; };
@ -27,7 +26,6 @@ function start(){
$("#wgt_display").text(sankoreLang.display); $("#wgt_display").text(sankoreLang.display);
$("#wgt_edit").text(sankoreLang.edit); $("#wgt_edit").text(sankoreLang.edit);
$("#wgt_name").text(sankoreLang.wgt_name); $("#wgt_name").text(sankoreLang.wgt_name);
$("#wgt_reload").text(sankoreLang.reload);
$(".style_select option[value='1']").text(sankoreLang.slate); $(".style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $(".style_select option[value='2']").text(sankoreLang.pad);
@ -52,13 +50,12 @@ function start(){
window.widget.onleave = function(){ window.widget.onleave = function(){
exportData(); exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val()); sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
sankore.setPreference("etudier_left_nav", $("#prevBtn a").css("display"));
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
} }
} }
$("#wgt_reload").click(function(){
window.location.reload();
});
$(".style_select").change(function (event){ $(".style_select").change(function (event){
changeStyle($(this).find("option:selected").val()); changeStyle($(this).find("option:selected").val());
}) })
@ -83,6 +80,8 @@ function start(){
$(this).draggable(); $(this).draggable();
$(this).find(".move_block").remove(); $(this).find(".move_block").remove();
$(this).find(".close_img").remove(); $(this).find(".close_img").remove();
$(this).find(".size_up").remove();
$(this).find(".size_down").remove();
$(this).find(".resize_block").remove(); $(this).find(".resize_block").remove();
$(this).removeAttr("contenteditable").removeClass("block_border"); $(this).removeAttr("contenteditable").removeClass("block_border");
$(this).css("position","absolute"); $(this).css("position","absolute");
@ -130,6 +129,8 @@ function start(){
$(this).draggable("destroy"); $(this).draggable("destroy");
$("<div class='move_block' contenteditable='false'>").appendTo($(this)); $("<div class='move_block' contenteditable='false'>").appendTo($(this));
$("<div class='close_img' contenteditable='false'>").appendTo($(this)); $("<div class='close_img' contenteditable='false'>").appendTo($(this));
$("<div class='size_up' contenteditable='false'>").appendTo($(this));
$("<div class='size_down' contenteditable='false'>").appendTo($(this));
$("<div class='resize_block' contenteditable='false'>").appendTo($(this)); $("<div class='resize_block' contenteditable='false'>").appendTo($(this));
$(this).attr("contenteditable", "true").addClass("block_border"); $(this).attr("contenteditable", "true").addClass("block_border");
}); });
@ -169,6 +170,20 @@ function start(){
$(this).parent().remove(); $(this).parent().remove();
}); });
//increase a size of text
$(".size_up").live("click", function(){
$(this).parent().height("");
var fz = parseInt($(this).parent().css("font-size").replace("px", ""));
$(this).parent().css("font-size", fz+1 + "px");
});
//decrease a size of text
$(".size_down").live("click", function(){
var fz = parseInt($(this).parent().css("font-size").replace("px", ""));
fz = ((fz - 1) < 8)?8:fz-1;
$(this).parent().css("font-size", fz + "px");
});
//play/pause event //play/pause event
$(".play, .stop").live("click", function(){ $(".play, .stop").live("click", function(){
var tmp_audio = $(this); var tmp_audio = $(this);
@ -250,7 +265,7 @@ function start(){
var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY; var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX; resize_obj.left = event.clientX;
resize_obj.top = event.clientY; resize_obj.top = event.clientY;
resize_obj.object.parent().css("width", width).css("height",height); resize_obj.object.parent().width(width).height(height);
} else { } else {
width = resize_obj.object.parent().width() - resize_obj.left + event.clientX; width = resize_obj.object.parent().width() - resize_obj.left + event.clientX;
height = resize_obj.object.parent().height() - resize_obj.top + event.clientY; height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
@ -258,8 +273,8 @@ function start(){
var img_height = resize_obj.object.parent().find("img").height() - resize_obj.top + event.clientY; var img_height = resize_obj.object.parent().find("img").height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX; resize_obj.left = event.clientX;
resize_obj.top = event.clientY; resize_obj.top = event.clientY;
resize_obj.object.parent().css("width", width).css("height",height); resize_obj.object.parent().width(width).height(height);
resize_obj.object.parent().find("img").css("width", img_width).css("height", img_height); resize_obj.object.parent().find("img").width(img_width).height(img_height);
} }
} }
}); });
@ -322,6 +337,8 @@ function start(){
var text_block = $("<div class='text_block'>" + sankoreLang.new_txt + "</div>").appendTo(container); var text_block = $("<div class='text_block'>" + sankoreLang.new_txt + "</div>").appendTo(container);
$("<div class='move_block' contenteditable='false'>").appendTo(text_block); $("<div class='move_block' contenteditable='false'>").appendTo(text_block);
$("<div class='close_img' contenteditable='false'>").appendTo(text_block); $("<div class='close_img' contenteditable='false'>").appendTo(text_block);
$("<div class='size_up' contenteditable='false'>").appendTo(text_block);
$("<div class='size_down' contenteditable='false'>").appendTo(text_block);
$("<div class='resize_block' contenteditable='false'>").appendTo(text_block); $("<div class='resize_block' contenteditable='false'>").appendTo(text_block);
text_block.attr("contenteditable", "true").addClass("block_border"); text_block.attr("contenteditable", "true").addClass("block_border");
}); });
@ -341,6 +358,7 @@ function exportData(){
txt_block.left = $(this).position().left; txt_block.left = $(this).position().left;
txt_block.h = $(this).height(); txt_block.h = $(this).height();
txt_block.w = $(this).width(); txt_block.w = $(this).width();
txt_block.fz = $(this).css("font-size");
txt_block.val = $(this).text(); txt_block.val = $(this).text();
cont_obj.text.push(txt_block); cont_obj.text.push(txt_block);
}); });
@ -389,6 +407,7 @@ function importData(data){
.height(data[i].text[j].h) .height(data[i].text[j].h)
.css("top", data[i].text[j].top) .css("top", data[i].text[j].top)
.css("left", data[i].text[j].left) .css("left", data[i].text[j].left)
.css("font-size", data[i].text[j].fz)
.appendTo(div); .appendTo(div);
} }
@ -418,11 +437,15 @@ function importData(data){
$("#slider ul").append(li); $("#slider ul").append(li);
} }
$(window).trigger("resize")
$("#slider").width(width).height(height).easySlider({ $("#slider").width(width).height(height).easySlider({
prevText: '', prevText: '',
nextText: '', nextText: '',
controlsShow: false controlsShow: false
}); });
$("#slider").goToSlide(sankore.preference("etudier_cur_page",""));
$("#prevBtn a").css("display", sankore.preference("etudier_left_nav",""));
$("#nextBtn a").css("display", sankore.preference("etudier_right_nav",""));
} }
//example //example
@ -442,6 +465,7 @@ function showExample(){
var li3 = $("<li>"); var li3 = $("<li>");
var div3 = $("<div>").appendTo(li3); var div3 = $("<div>").appendTo(li3);
li3.width($("#slider").width()).height($("#slider").height()); li3.width($("#slider").width()).height($("#slider").height());
$("<div class='text_block'>ololo</div>").draggable().appendTo(div3);
var audio_block = $("<div class='audio_block'>").draggable().appendTo(div3); var audio_block = $("<div class='audio_block'>").draggable().appendTo(div3);
$("<div class='play'>").appendTo(audio_block); $("<div class='play'>").appendTo(audio_block);
$("<div class='replay'>").appendTo(audio_block); $("<div class='replay'>").appendTo(audio_block);
@ -496,7 +520,6 @@ function changeStyle(val){
$(".b_bottom_right").removeClass("bbr_pad"); $(".b_bottom_right").removeClass("bbr_pad");
$(".b_bottom_left").removeClass("bbl_pad"); $(".b_bottom_left").removeClass("bbl_pad");
$(".b_bottom_center").removeClass("bbc_pad"); $(".b_bottom_center").removeClass("bbc_pad");
$("#wgt_reload").removeClass("pad_color").removeClass("pad_reload");
$("#wgt_edit").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_display").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_display").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_name").removeClass("pad_color"); $("#wgt_name").removeClass("pad_color");
@ -510,7 +533,6 @@ function changeStyle(val){
$(".b_bottom_right").addClass("bbr_pad"); $(".b_bottom_right").addClass("bbr_pad");
$(".b_bottom_left").addClass("bbl_pad"); $(".b_bottom_left").addClass("bbl_pad");
$(".b_bottom_center").addClass("bbc_pad"); $(".b_bottom_center").addClass("bbc_pad");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");

@ -23,7 +23,6 @@
<td class="b_top_left">&nbsp;</td> <td class="b_top_left">&nbsp;</td>
<td class="b_top_center"> <td class="b_top_center">
<div id="wgt_name"></div> <div id="wgt_name"></div>
<div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div> <div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div> <div id="wgt_edit"></div>
<select class="style_select"> <select class="style_select">

@ -5,7 +5,6 @@ var sankoreLang = {
new_txt: "Nouveau bloc de texte", new_txt: "Nouveau bloc de texte",
new_slide: "Ceci est une nouvelle diapositive.", new_slide: "Ceci est une nouvelle diapositive.",
wgt_name: "Etudier", wgt_name: "Etudier",
reload: "Recharger",
slate: "Bois", slate: "Bois",
pad: "Pad" pad: "Pad"
}; };
@ -27,7 +26,6 @@ function start(){
$("#wgt_display").text(sankoreLang.display); $("#wgt_display").text(sankoreLang.display);
$("#wgt_edit").text(sankoreLang.edit); $("#wgt_edit").text(sankoreLang.edit);
$("#wgt_name").text(sankoreLang.wgt_name); $("#wgt_name").text(sankoreLang.wgt_name);
$("#wgt_reload").text(sankoreLang.reload);
$(".style_select option[value='1']").text(sankoreLang.slate); $(".style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $(".style_select option[value='2']").text(sankoreLang.pad);
@ -52,13 +50,12 @@ function start(){
window.widget.onleave = function(){ window.widget.onleave = function(){
exportData(); exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val()); sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
sankore.setPreference("etudier_left_nav", $("#prevBtn a").css("display"));
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
} }
} }
$("#wgt_reload").click(function(){
window.location.reload();
});
$(".style_select").change(function (event){ $(".style_select").change(function (event){
changeStyle($(this).find("option:selected").val()); changeStyle($(this).find("option:selected").val());
}) })
@ -83,6 +80,8 @@ function start(){
$(this).draggable(); $(this).draggable();
$(this).find(".move_block").remove(); $(this).find(".move_block").remove();
$(this).find(".close_img").remove(); $(this).find(".close_img").remove();
$(this).find(".size_up").remove();
$(this).find(".size_down").remove();
$(this).find(".resize_block").remove(); $(this).find(".resize_block").remove();
$(this).removeAttr("contenteditable").removeClass("block_border"); $(this).removeAttr("contenteditable").removeClass("block_border");
$(this).css("position","absolute"); $(this).css("position","absolute");
@ -130,6 +129,8 @@ function start(){
$(this).draggable("destroy"); $(this).draggable("destroy");
$("<div class='move_block' contenteditable='false'>").appendTo($(this)); $("<div class='move_block' contenteditable='false'>").appendTo($(this));
$("<div class='close_img' contenteditable='false'>").appendTo($(this)); $("<div class='close_img' contenteditable='false'>").appendTo($(this));
$("<div class='size_up' contenteditable='false'>").appendTo($(this));
$("<div class='size_down' contenteditable='false'>").appendTo($(this));
$("<div class='resize_block' contenteditable='false'>").appendTo($(this)); $("<div class='resize_block' contenteditable='false'>").appendTo($(this));
$(this).attr("contenteditable", "true").addClass("block_border"); $(this).attr("contenteditable", "true").addClass("block_border");
}); });
@ -169,6 +170,20 @@ function start(){
$(this).parent().remove(); $(this).parent().remove();
}); });
//increase a size of text
$(".size_up").live("click", function(){
$(this).parent().height("");
var fz = parseInt($(this).parent().css("font-size").replace("px", ""));
$(this).parent().css("font-size", fz+1 + "px");
});
//decrease a size of text
$(".size_down").live("click", function(){
var fz = parseInt($(this).parent().css("font-size").replace("px", ""));
fz = ((fz - 1) < 8)?8:fz-1;
$(this).parent().css("font-size", fz + "px");
});
//play/pause event //play/pause event
$(".play, .stop").live("click", function(){ $(".play, .stop").live("click", function(){
var tmp_audio = $(this); var tmp_audio = $(this);
@ -250,7 +265,7 @@ function start(){
var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY; var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX; resize_obj.left = event.clientX;
resize_obj.top = event.clientY; resize_obj.top = event.clientY;
resize_obj.object.parent().css("width", width).css("height",height); resize_obj.object.parent().width(width).height(height);
} else { } else {
width = resize_obj.object.parent().width() - resize_obj.left + event.clientX; width = resize_obj.object.parent().width() - resize_obj.left + event.clientX;
height = resize_obj.object.parent().height() - resize_obj.top + event.clientY; height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
@ -258,8 +273,8 @@ function start(){
var img_height = resize_obj.object.parent().find("img").height() - resize_obj.top + event.clientY; var img_height = resize_obj.object.parent().find("img").height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX; resize_obj.left = event.clientX;
resize_obj.top = event.clientY; resize_obj.top = event.clientY;
resize_obj.object.parent().css("width", width).css("height",height); resize_obj.object.parent().width(width).height(height);
resize_obj.object.parent().find("img").css("width", img_width).css("height", img_height); resize_obj.object.parent().find("img").width(img_width).height(img_height);
} }
} }
}); });
@ -322,6 +337,8 @@ function start(){
var text_block = $("<div class='text_block'>" + sankoreLang.new_txt + "</div>").appendTo(container); var text_block = $("<div class='text_block'>" + sankoreLang.new_txt + "</div>").appendTo(container);
$("<div class='move_block' contenteditable='false'>").appendTo(text_block); $("<div class='move_block' contenteditable='false'>").appendTo(text_block);
$("<div class='close_img' contenteditable='false'>").appendTo(text_block); $("<div class='close_img' contenteditable='false'>").appendTo(text_block);
$("<div class='size_up' contenteditable='false'>").appendTo(text_block);
$("<div class='size_down' contenteditable='false'>").appendTo(text_block);
$("<div class='resize_block' contenteditable='false'>").appendTo(text_block); $("<div class='resize_block' contenteditable='false'>").appendTo(text_block);
text_block.attr("contenteditable", "true").addClass("block_border"); text_block.attr("contenteditable", "true").addClass("block_border");
}); });
@ -341,6 +358,7 @@ function exportData(){
txt_block.left = $(this).position().left; txt_block.left = $(this).position().left;
txt_block.h = $(this).height(); txt_block.h = $(this).height();
txt_block.w = $(this).width(); txt_block.w = $(this).width();
txt_block.fz = $(this).css("font-size");
txt_block.val = $(this).text(); txt_block.val = $(this).text();
cont_obj.text.push(txt_block); cont_obj.text.push(txt_block);
}); });
@ -389,6 +407,7 @@ function importData(data){
.height(data[i].text[j].h) .height(data[i].text[j].h)
.css("top", data[i].text[j].top) .css("top", data[i].text[j].top)
.css("left", data[i].text[j].left) .css("left", data[i].text[j].left)
.css("font-size", data[i].text[j].fz)
.appendTo(div); .appendTo(div);
} }
@ -419,11 +438,16 @@ function importData(data){
} }
$(window).trigger("resize")
$("#slider").width(width).height(height).easySlider({ $("#slider").width(width).height(height).easySlider({
prevText: '', prevText: '',
nextText: '', nextText: '',
controlsShow: false controlsShow: false
}); });
$("#slider").goToSlide(sankore.preference("etudier_cur_page",""));
$("#prevBtn a").css("display", sankore.preference("etudier_left_nav",""));
$("#nextBtn a").css("display", sankore.preference("etudier_right_nav",""));
} }
//example //example
@ -497,7 +521,6 @@ function changeStyle(val){
$(".b_bottom_right").removeClass("bbr_pad"); $(".b_bottom_right").removeClass("bbr_pad");
$(".b_bottom_left").removeClass("bbl_pad"); $(".b_bottom_left").removeClass("bbl_pad");
$(".b_bottom_center").removeClass("bbc_pad"); $(".b_bottom_center").removeClass("bbc_pad");
$("#wgt_reload").removeClass("pad_color").removeClass("pad_reload");
$("#wgt_edit").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_display").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_display").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_name").removeClass("pad_color"); $("#wgt_name").removeClass("pad_color");
@ -511,7 +534,6 @@ function changeStyle(val){
$(".b_bottom_right").addClass("bbr_pad"); $(".b_bottom_right").addClass("bbr_pad");
$(".b_bottom_left").addClass("bbl_pad"); $(".b_bottom_left").addClass("bbl_pad");
$(".b_bottom_center").addClass("bbc_pad"); $(".b_bottom_center").addClass("bbc_pad");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");

@ -23,7 +23,6 @@
<td class="b_top_left">&nbsp;</td> <td class="b_top_left">&nbsp;</td>
<td class="b_top_center"> <td class="b_top_center">
<div id="wgt_name"></div> <div id="wgt_name"></div>
<div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div> <div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div> <div id="wgt_edit"></div>
<select class="style_select"> <select class="style_select">

@ -5,7 +5,6 @@ var sankoreLang = {
new_txt: "Новый текстовый блок.", new_txt: "Новый текстовый блок.",
new_slide: "Это - новый слайд.", new_slide: "Это - новый слайд.",
wgt_name: "Слайдер", wgt_name: "Слайдер",
reload: "Обновить",
slate: "Узор", slate: "Узор",
pad: "Планшет" pad: "Планшет"
}; };
@ -27,7 +26,6 @@ function start(){
$("#wgt_display").text(sankoreLang.display); $("#wgt_display").text(sankoreLang.display);
$("#wgt_edit").text(sankoreLang.edit); $("#wgt_edit").text(sankoreLang.edit);
$("#wgt_name").text(sankoreLang.wgt_name); $("#wgt_name").text(sankoreLang.wgt_name);
$("#wgt_reload").text(sankoreLang.reload);
$(".style_select option[value='1']").text(sankoreLang.slate); $(".style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $(".style_select option[value='2']").text(sankoreLang.pad);
@ -52,13 +50,12 @@ function start(){
window.widget.onleave = function(){ window.widget.onleave = function(){
exportData(); exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val()); sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
sankore.setPreference("etudier_left_nav", $("#prevBtn a").css("display"));
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
} }
} }
$("#wgt_reload").click(function(){
window.location.reload();
});
$(".style_select").change(function (event){ $(".style_select").change(function (event){
changeStyle($(this).find("option:selected").val()); changeStyle($(this).find("option:selected").val());
}) })
@ -83,6 +80,8 @@ function start(){
$(this).draggable(); $(this).draggable();
$(this).find(".move_block").remove(); $(this).find(".move_block").remove();
$(this).find(".close_img").remove(); $(this).find(".close_img").remove();
$(this).find(".size_up").remove();
$(this).find(".size_down").remove();
$(this).find(".resize_block").remove(); $(this).find(".resize_block").remove();
$(this).removeAttr("contenteditable").removeClass("block_border"); $(this).removeAttr("contenteditable").removeClass("block_border");
$(this).css("position","absolute"); $(this).css("position","absolute");
@ -130,6 +129,8 @@ function start(){
$(this).draggable("destroy"); $(this).draggable("destroy");
$("<div class='move_block' contenteditable='false'>").appendTo($(this)); $("<div class='move_block' contenteditable='false'>").appendTo($(this));
$("<div class='close_img' contenteditable='false'>").appendTo($(this)); $("<div class='close_img' contenteditable='false'>").appendTo($(this));
$("<div class='size_up' contenteditable='false'>").appendTo($(this));
$("<div class='size_down' contenteditable='false'>").appendTo($(this));
$("<div class='resize_block' contenteditable='false'>").appendTo($(this)); $("<div class='resize_block' contenteditable='false'>").appendTo($(this));
$(this).attr("contenteditable", "true").addClass("block_border"); $(this).attr("contenteditable", "true").addClass("block_border");
}); });
@ -169,6 +170,20 @@ function start(){
$(this).parent().remove(); $(this).parent().remove();
}); });
//increase a size of text
$(".size_up").live("click", function(){
$(this).parent().height("");
var fz = parseInt($(this).parent().css("font-size").replace("px", ""));
$(this).parent().css("font-size", fz+1 + "px");
});
//decrease a size of text
$(".size_down").live("click", function(){
var fz = parseInt($(this).parent().css("font-size").replace("px", ""));
fz = ((fz - 1) < 8)?8:fz-1;
$(this).parent().css("font-size", fz + "px");
});
//play/pause event //play/pause event
$(".play, .stop").live("click", function(){ $(".play, .stop").live("click", function(){
var tmp_audio = $(this); var tmp_audio = $(this);
@ -250,7 +265,7 @@ function start(){
var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY; var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX; resize_obj.left = event.clientX;
resize_obj.top = event.clientY; resize_obj.top = event.clientY;
resize_obj.object.parent().css("width", width).css("height",height); resize_obj.object.parent().width(width).height(height);
} else { } else {
width = resize_obj.object.parent().width() - resize_obj.left + event.clientX; width = resize_obj.object.parent().width() - resize_obj.left + event.clientX;
height = resize_obj.object.parent().height() - resize_obj.top + event.clientY; height = resize_obj.object.parent().height() - resize_obj.top + event.clientY;
@ -258,8 +273,8 @@ function start(){
var img_height = resize_obj.object.parent().find("img").height() - resize_obj.top + event.clientY; var img_height = resize_obj.object.parent().find("img").height() - resize_obj.top + event.clientY;
resize_obj.left = event.clientX; resize_obj.left = event.clientX;
resize_obj.top = event.clientY; resize_obj.top = event.clientY;
resize_obj.object.parent().css("width", width).css("height",height); resize_obj.object.parent().width(width).height(height);
resize_obj.object.parent().find("img").css("width", img_width).css("height", img_height); resize_obj.object.parent().find("img").width(img_width).height(img_height);
} }
} }
}); });
@ -322,6 +337,8 @@ function start(){
var text_block = $("<div class='text_block'>" + sankoreLang.new_txt + "</div>").appendTo(container); var text_block = $("<div class='text_block'>" + sankoreLang.new_txt + "</div>").appendTo(container);
$("<div class='move_block' contenteditable='false'>").appendTo(text_block); $("<div class='move_block' contenteditable='false'>").appendTo(text_block);
$("<div class='close_img' contenteditable='false'>").appendTo(text_block); $("<div class='close_img' contenteditable='false'>").appendTo(text_block);
$("<div class='size_up' contenteditable='false'>").appendTo(text_block);
$("<div class='size_down' contenteditable='false'>").appendTo(text_block);
$("<div class='resize_block' contenteditable='false'>").appendTo(text_block); $("<div class='resize_block' contenteditable='false'>").appendTo(text_block);
text_block.attr("contenteditable", "true").addClass("block_border"); text_block.attr("contenteditable", "true").addClass("block_border");
}); });
@ -341,6 +358,7 @@ function exportData(){
txt_block.left = $(this).position().left; txt_block.left = $(this).position().left;
txt_block.h = $(this).height(); txt_block.h = $(this).height();
txt_block.w = $(this).width(); txt_block.w = $(this).width();
txt_block.fz = $(this).css("font-size");
txt_block.val = $(this).text(); txt_block.val = $(this).text();
cont_obj.text.push(txt_block); cont_obj.text.push(txt_block);
}); });
@ -389,6 +407,7 @@ function importData(data){
.height(data[i].text[j].h) .height(data[i].text[j].h)
.css("top", data[i].text[j].top) .css("top", data[i].text[j].top)
.css("left", data[i].text[j].left) .css("left", data[i].text[j].left)
.css("font-size", data[i].text[j].fz)
.appendTo(div); .appendTo(div);
} }
@ -419,11 +438,16 @@ function importData(data){
} }
$(window).trigger("resize")
$("#slider").width(width).height(height).easySlider({ $("#slider").width(width).height(height).easySlider({
prevText: '', prevText: '',
nextText: '', nextText: '',
controlsShow: false controlsShow: false
}); });
$("#slider").goToSlide(sankore.preference("etudier_cur_page",""));
$("#prevBtn a").css("display", sankore.preference("etudier_left_nav",""));
$("#nextBtn a").css("display", sankore.preference("etudier_right_nav",""));
} }
//example //example
@ -497,7 +521,6 @@ function changeStyle(val){
$(".b_bottom_right").removeClass("bbr_pad"); $(".b_bottom_right").removeClass("bbr_pad");
$(".b_bottom_left").removeClass("bbl_pad"); $(".b_bottom_left").removeClass("bbl_pad");
$(".b_bottom_center").removeClass("bbc_pad"); $(".b_bottom_center").removeClass("bbc_pad");
$("#wgt_reload").removeClass("pad_color").removeClass("pad_reload");
$("#wgt_edit").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_display").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_display").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_name").removeClass("pad_color"); $("#wgt_name").removeClass("pad_color");
@ -511,7 +534,6 @@ function changeStyle(val){
$(".b_bottom_right").addClass("bbr_pad"); $(".b_bottom_right").addClass("bbr_pad");
$(".b_bottom_left").addClass("bbl_pad"); $(".b_bottom_left").addClass("bbl_pad");
$(".b_bottom_center").addClass("bbc_pad"); $(".b_bottom_center").addClass("bbc_pad");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");

Loading…
Cancel
Save