diff --git a/resources/library/interactivities/Etudier.wgt/css/basic.css b/resources/library/interactivities/Etudier.wgt/css/basic.css index e87791c8..0c107f14 100644 --- a/resources/library/interactivities/Etudier.wgt/css/basic.css +++ b/resources/library/interactivities/Etudier.wgt/css/basic.css @@ -4,6 +4,7 @@ html, body{ margin: 0; padding: 0; border-radius: 50px; + overflow: hidden; } body{ @@ -212,6 +213,7 @@ li>div{ .real_text{ width: 100%; height: 100%; + word-wrap: break-word; } .block_border{ @@ -357,7 +359,6 @@ li>div{ #wgt_name{ height: 44px; - width: 200px; margin: 10px 10px 0 10px; padding: 0; float: left; @@ -366,9 +367,8 @@ li>div{ color: #8c5730; } -#wgt_reload, #wgt_edit, #wgt_display{ +#wgt_reload, #wgt_edit, #wgt_display, #wgt_help{ cursor: pointer; - width: 80px; height: 44px; margin: 10px 10px 0 0; float: right; @@ -378,7 +378,6 @@ li>div{ } #wgt_display{ - width: 100px; padding-left: 40px; background-image: url(../img/slate-edit.png); background-repeat: no-repeat; @@ -387,7 +386,6 @@ li>div{ } #wgt_edit{ - width: 100px; padding-left: 40px; background-image: url(../img/slate-edit.png); background-repeat: no-repeat; @@ -479,4 +477,28 @@ li>div{ background-color: #333 !important; color: white !important; background-image: url(../img/ar_down_white.png) !important; +} + +.pad_help{ + background-image: url(../img/slate-help-white.png) !important; +} + +#wgt_help{ + padding-left: 32px; + background-image: url(../img/slate-help.png); + background-repeat: no-repeat; + background-position: top 0; +} + +#help{ + width: 100%; + height: 100%; + overflow: auto; + display: none; + background-color: #ccc; + padding: 5px 0 5px 5px; +} + +.open{ + } \ No newline at end of file diff --git a/resources/library/interactivities/Etudier.wgt/index.html b/resources/library/interactivities/Etudier.wgt/index.html index cfd57663..c21be121 100644 --- a/resources/library/interactivities/Etudier.wgt/index.html +++ b/resources/library/interactivities/Etudier.wgt/index.html @@ -48,7 +48,8 @@   -
+
+
@@ -33,10 +34,11 @@   - +   +
@@ -46,7 +48,7 @@   - +     diff --git a/resources/library/interactivities/Etudier.wgt/locales/fr/js/script.js b/resources/library/interactivities/Etudier.wgt/locales/fr/js/script.js index 2c378bdb..0a7b1b37 100644 --- a/resources/library/interactivities/Etudier.wgt/locales/fr/js/script.js +++ b/resources/library/interactivities/Etudier.wgt/locales/fr/js/script.js @@ -7,7 +7,9 @@ var sankoreLang = { wgt_name: "Etudier", slate: "Bois", pad: "Pad", - none: "Aucun" + none: "Aucun", + help: "Aide", + help_content: "Ceci est un exemple de contenu de l'aide ..." }; //some flags @@ -27,6 +29,8 @@ function start(){ $("#wgt_display").text(sankoreLang.display); $("#wgt_edit").text(sankoreLang.edit); $("#wgt_name").text(sankoreLang.wgt_name); + $("#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); @@ -50,11 +54,13 @@ function start(){ //events if (window.widget) { window.widget.onleave = function(){ - exportData(); - 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")); + if(!$("#wgt_help").hasClass("open")){ + exportData(); + 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")); + } } } @@ -62,6 +68,24 @@ function start(){ changeStyle($(this).find("option:selected").val()); }) + $("#wgt_help").click(function(){ + var tmp = $(this); + if($(this).hasClass("open")){ + $("#help").hide(); + tmp.removeClass("open"); + $("#slider").show(); + } else { + exportData(); + 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")); + $("#slider").hide(); + $("#help").show(); + tmp.addClass("open"); + } + }); + $("#wgt_display, #wgt_edit").click(function(event){ if(this.id == "wgt_display"){ if(!$(this).hasClass("selected")){ @@ -124,9 +148,9 @@ function start(){ $("#slider li>div").each(function(){ var container = $(this); container.attr("ondragenter", "return false;") - .attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;") + .attr("ondragleave", "$(this).css(\"background\",\"none\"); return false;") .attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;") - .attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);"); + .attr("ondrop", "$(this).css(\"background\",\"none\"); return onDropTarget(this,event);"); container.find(".text_block").each(function(){ $(this).draggable("destroy"); @@ -156,6 +180,7 @@ function start(){ $("
").appendTo(container); $("
").appendTo(container); $("
").appendTo(container); + $(window).trigger("resize") }); $(this).css("display", "none"); $("#wgt_display").css("display", "block"); @@ -266,13 +291,13 @@ function start(){ if(resize_obj.clicked){ if(resize_obj.object.parent().hasClass("text_block")){ var width = resize_obj.object.parent().width() - resize_obj.left + event.clientX; - 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.top = event.clientY; - resize_obj.object.parent().width(width).height(height); + resize_obj.object.parent().width(width); } else { width = resize_obj.object.parent().width() - resize_obj.left + event.clientX; - height = resize_obj.object.parent().height() - resize_obj.top + event.clientY; + var height = resize_obj.object.parent().height() - resize_obj.top + event.clientY; var img_width = resize_obj.object.parent().find("img").width() - resize_obj.left + event.clientX; var img_height = resize_obj.object.parent().find("img").height() - resize_obj.top + event.clientY; resize_obj.left = event.clientX; @@ -296,12 +321,15 @@ function start(){ new_li.width(cur_li.width()).height(cur_li.height()).css("float","left"); var new_div = $("
").appendTo(new_li); new_div.attr("ondragenter", "return false;") - .attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;") + .attr("ondragleave", "$(this).css(\"background-color\",\"\"); return false;") .attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;") - .attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);"); - var example = $("
" + sankoreLang.new_slide + "
").addClass("block_border"); + .attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);"); + var example = $("
").addClass("block_border"); + $("
" + sankoreLang.new_slide + "
").appendTo(example); $("
").appendTo(example); $("
").appendTo(example); + $("
").appendTo(example); + $("
").appendTo(example); $("
").appendTo(example); example.css("top","40%").css("left","40%"); new_div.append(example); @@ -319,12 +347,15 @@ function start(){ new_li.width(cur_li.width()).height(cur_li.height()).css("float","left"); var new_div = $("
").appendTo(new_li); new_div.attr("ondragenter", "return false;") - .attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;") + .attr("ondragleave", "$(this).css(\"background-color\",\"\"); return false;") .attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;") - .attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);"); - var example = $("
" + sankoreLang.new_slide + "
").addClass("block_border"); + .attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);"); + var example = $("
").addClass("block_border"); + $("
" + sankoreLang.new_slide + "
").appendTo(example); $("
").appendTo(example); $("
").appendTo(example); + $("
").appendTo(example); + $("
").appendTo(example); $("
").appendTo(example); example.css("top","40%").css("left","40%"); new_div.append(example); @@ -360,7 +391,6 @@ function exportData(){ var txt_block = new Object(); txt_block.top = $(this).position().top; txt_block.left = $(this).position().left; - txt_block.h = $(this).height(); txt_block.w = $(this).width(); txt_block.fz = $(this).css("font-size"); txt_block.val = $(this).find(".real_text").html(); @@ -408,7 +438,6 @@ function importData(data){ var text_div = $("
" + data[i].text[j].val + "
"); text_div.draggable().css("position","absolute") .width(data[i].text[j].w) - .height(data[i].text[j].h) .css("top", data[i].text[j].top) .css("left", data[i].text[j].left) .css("font-size", data[i].text[j].fz) @@ -526,7 +555,7 @@ function changeStyle(val){ $(".b_bottom_right").removeClass("bbr_pad").removeClass("without_back"); $(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back"); $(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back"); - $("#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"); @@ -542,7 +571,7 @@ function changeStyle(val){ $(".b_bottom_right").addClass("bbr_pad").removeClass("without_back"); $(".b_bottom_left").addClass("bbl_pad").removeClass("without_back"); $(".b_bottom_center").addClass("bbc_pad").removeClass("without_back"); - $("#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"); @@ -558,7 +587,7 @@ function changeStyle(val){ $(".b_bottom_right").addClass("without_back").removeClass("bbr_pad"); $(".b_bottom_left").addClass("without_back").removeClass("bbl_pad"); $(".b_bottom_center").addClass("without_back").removeClass("bbc_pad"); - $("#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"); @@ -581,7 +610,7 @@ function onDropTarget(obj, event) { var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent; if(tmp_type.substr(0, 5) == "audio"){ var audio_block = $("
").draggable().appendTo($(obj)); - audio_block.css("position","absolute").css("top",event.clientY).css("left",event.clientX); + audio_block.css("position","absolute").css("top",event.clientY - 54).css("left",event.clientX - 54); $("
").appendTo(audio_block); audio_block.addClass("block_border"); $("
").appendTo(audio_block); @@ -591,7 +620,7 @@ function onDropTarget(obj, event) { audio.append(source); } else { var img_block = $("
").appendTo($(obj)); - img_block.css("top",event.clientY).css("left",event.clientX); + img_block.css("top",event.clientY - 54).css("left",event.clientX - 54); $("
").appendTo(img_block); $("
").appendTo(img_block); $("
").appendTo(img_block); diff --git a/resources/library/interactivities/Etudier.wgt/locales/ru/index.html b/resources/library/interactivities/Etudier.wgt/locales/ru/index.html index 72ab9627..a33496df 100644 --- a/resources/library/interactivities/Etudier.wgt/locales/ru/index.html +++ b/resources/library/interactivities/Etudier.wgt/locales/ru/index.html @@ -22,7 +22,8 @@   -
+
+