diff --git a/resources/library/interactivities/Cat text.wgt/css/basic.css b/resources/library/interactivities/Cat text.wgt/css/basic.css index e73ae42c..849093d5 100644 --- a/resources/library/interactivities/Cat text.wgt/css/basic.css +++ b/resources/library/interactivities/Cat text.wgt/css/basic.css @@ -3,7 +3,7 @@ html, body{ height: 100%; margin: 0; padding: 0; - border-radius: 50px; + border-radius: 35px; overflow: hidden; } @@ -28,14 +28,6 @@ body{ margin: 5px 10px; } -.green_point{ - background-image: url(../img/green_point.png); -} - -.red_point{ - background-image: url(../img/red_point.png); -} - #display_text, #edit_text{ height: 19px; padding: 3px 0 0 0; @@ -286,57 +278,40 @@ body{ margin: 10px 10px 0 10px; padding: 0; float: left; - /*font-family: "Lobster13Regular";*/ + font-family: Arial,Helvetica,sans-serif; font-size: 24px; - color: #8c5730; + color: #7F613F; + text-shadow: #FFDCA9 0 1px 0; } #wgt_reload, #wgt_edit, #wgt_display, #wgt_help{ cursor: pointer; - height: 44px; margin: 10px 10px 0 0; float: right; - /*font-family: "Lobster13Regular";*/ - font-size: 24px; - color: #8c5730; + font-family: Arial,Helvetica,sans-serif; + font-size: 24px; + line-height: 32px; } #wgt_display{ - padding-left: 40px; - background-image: url(../img/slate-edit.png); - background-repeat: no-repeat; - background-position: top 0; + padding-left: 35px; + background: url(../img/toolbar-edit.png) left -32px no-repeat; + color: white; display: none; } #wgt_edit{ - padding-left: 40px; - background-image: url(../img/slate-edit.png); - background-repeat: no-repeat; - background-position: top 0; + padding-left: 35px; + background: url(../img/slate-toolbar-edit.png) left top no-repeat; + color: #7F613F; + text-shadow: #FFDCA9 0 1px 0; } #wgt_reload{ - padding-left: 40px; - background-image: url(../img/slate-toolbar-reload.png); - background-repeat: no-repeat; - background-position: top 0; -} - -.style_select{ - width: 120px; - /*font-family: "Lobster13Regular";*/ - font-size: 24px; - float: right; - margin: 10px 20px 0 0; - border-radius: 10px; - background-image: url(../img/ar_down.png); - background-color: #d4aa79; - color: #8c5730; - background-position: 105px 11px; - background-repeat: no-repeat; - -webkit-appearance: menulist-text; - display: none; + padding-left: 35px; + background: url(../img/slate-toolbar-reload.png) left top no-repeat; + color: #7F613F; + text-shadow: #FFDCA9 0 1px 0; } .btl_pad{ @@ -371,51 +346,50 @@ body{ background-image: url(../img/pad-bottom-right.png) !important; } -.pad_color{ - color: white !important; +.without_radius{ + border-radius: 0 !important; } -.pad_reload{ - background-image: url(../img/slate-toolbar-reload-white.png) !important; +.without_back{ + background: none !important; } -.pad_edit{ - background-image: url(../img/slate-display.png) !important; +.pad_color{ + color: #FC9 !important; + text-shadow: none !important; } -.pad_select{ - background-color: black !important; - color: white !important; - background-image: url(../img/ar_down_white.png) !important; +.pad_reload{ + background: url(../img/toolbar-reload.png) left top no-repeat !important; } -.without_radius{ - border-radius: 0 !important; +.pad_edit{ + background: url(../img/toolbar-edit.png) left top no-repeat !important; } -.without_back{ - background: none !important; +.pad_help{ + background: url(../img/toolbar-help.png) left top no-repeat !important; } -.none_select{ - background-color: #333 !important; +.help_wood{ + background: url(../img/slate-toolbar-help.png) left -32px no-repeat !important; color: white !important; - background-image: url(../img/ar_down_white.png) !important; + text-shadow: #7F613F 0 -1px 0 !important; } -.pad_help{ - background-image: url(../img/slate-help-white.png) !important; +.help_pad{ + background: url(../img/toolbar-help.png) left -32px no-repeat !important; + color: white !important; } #wgt_help{ - padding-left: 32px; - background-image: url(../img/slate-help.png); - background-repeat: no-repeat; - background-position: top 0; + padding-left: 35px; + background: url(../img/slate-toolbar-help.png) left top no-repeat; + color: #7F613F; + text-shadow: #FFDCA9 0 1px 0; } #help{ - width: 100%; height: 100%; overflow: auto; display: none; @@ -424,5 +398,36 @@ body{ } .open{ - + +} + +#parameters{ + display: none; + padding: 10px 20px; + background: url("../img/parameters-bg.png"); + border-radius: 4px 4px 0 0; +} + +.inline{ + display: inline-block; + font-family: "helvetica neue"; + font-size: 14px; + color: #666; +} + +#parameters label { + font-style: italic; +} + +#style_select{ + margin-left: 10px; +} + +.display_wood{ + background: url(../img/slate-toolbar-edit.png) left -32px no-repeat !important; + text-shadow: #7F613F 0 -1px 0; +} + +.radius_ft{ + border-radius: 45px !important; } \ No newline at end of file diff --git a/resources/library/interactivities/Cat text.wgt/img/ar_down.png b/resources/library/interactivities/Cat text.wgt/img/ar_down.png deleted file mode 100644 index a20fab4f..00000000 Binary files a/resources/library/interactivities/Cat text.wgt/img/ar_down.png and /dev/null differ diff --git a/resources/library/interactivities/Cat text.wgt/img/ar_down_white.png b/resources/library/interactivities/Cat text.wgt/img/ar_down_white.png deleted file mode 100644 index 4a1d133b..00000000 Binary files a/resources/library/interactivities/Cat text.wgt/img/ar_down_white.png and /dev/null differ diff --git a/resources/library/interactivities/Cat text.wgt/img/green_point.png b/resources/library/interactivities/Cat text.wgt/img/green_point.png deleted file mode 100644 index a2a44680..00000000 Binary files a/resources/library/interactivities/Cat text.wgt/img/green_point.png and /dev/null differ diff --git a/resources/library/interactivities/Cat text.wgt/img/parameters-bg.png b/resources/library/interactivities/Cat text.wgt/img/parameters-bg.png new file mode 100644 index 00000000..36f648e1 Binary files /dev/null and b/resources/library/interactivities/Cat text.wgt/img/parameters-bg.png differ diff --git a/resources/library/interactivities/Cat text.wgt/img/red_point.png b/resources/library/interactivities/Cat text.wgt/img/red_point.png deleted file mode 100644 index f6daa19a..00000000 Binary files a/resources/library/interactivities/Cat text.wgt/img/red_point.png and /dev/null differ diff --git a/resources/library/interactivities/Cat text.wgt/img/slate-display.png b/resources/library/interactivities/Cat text.wgt/img/slate-display.png deleted file mode 100644 index 96166143..00000000 Binary files a/resources/library/interactivities/Cat text.wgt/img/slate-display.png and /dev/null differ diff --git a/resources/library/interactivities/Cat text.wgt/img/slate-edit.png b/resources/library/interactivities/Cat text.wgt/img/slate-edit.png deleted file mode 100644 index 17f5fc5c..00000000 Binary files a/resources/library/interactivities/Cat text.wgt/img/slate-edit.png and /dev/null differ diff --git a/resources/library/interactivities/Cat text.wgt/img/slate-help-white.png b/resources/library/interactivities/Cat text.wgt/img/slate-help-white.png deleted file mode 100644 index 7b5ebfd8..00000000 Binary files a/resources/library/interactivities/Cat text.wgt/img/slate-help-white.png and /dev/null differ diff --git a/resources/library/interactivities/Cat text.wgt/img/slate-help.png b/resources/library/interactivities/Cat text.wgt/img/slate-help.png deleted file mode 100644 index 069052d0..00000000 Binary files a/resources/library/interactivities/Cat text.wgt/img/slate-help.png and /dev/null differ diff --git a/resources/library/interactivities/Cat text.wgt/img/slate-toolbar-help.png b/resources/library/interactivities/Cat text.wgt/img/slate-toolbar-help.png new file mode 100644 index 00000000..fb7cdeba Binary files /dev/null and b/resources/library/interactivities/Cat text.wgt/img/slate-toolbar-help.png differ diff --git a/resources/library/interactivities/Cat text.wgt/img/slate-toolbar-reload-white.png b/resources/library/interactivities/Cat text.wgt/img/slate-toolbar-reload-white.png deleted file mode 100644 index 78d146ec..00000000 Binary files a/resources/library/interactivities/Cat text.wgt/img/slate-toolbar-reload-white.png and /dev/null differ diff --git a/resources/library/interactivities/Cat text.wgt/img/slate-toolbar-reload.png b/resources/library/interactivities/Cat text.wgt/img/slate-toolbar-reload.png index 685a5cb2..844169a9 100644 Binary files a/resources/library/interactivities/Cat text.wgt/img/slate-toolbar-reload.png and b/resources/library/interactivities/Cat text.wgt/img/slate-toolbar-reload.png differ diff --git a/resources/library/interactivities/Cat text.wgt/img/toolbar-edit.png b/resources/library/interactivities/Cat text.wgt/img/toolbar-edit.png new file mode 100644 index 00000000..daa338cd Binary files /dev/null and b/resources/library/interactivities/Cat text.wgt/img/toolbar-edit.png differ diff --git a/resources/library/interactivities/Cat text.wgt/img/toolbar-help.png b/resources/library/interactivities/Cat text.wgt/img/toolbar-help.png new file mode 100644 index 00000000..6c4454c0 Binary files /dev/null and b/resources/library/interactivities/Cat text.wgt/img/toolbar-help.png differ diff --git a/resources/library/interactivities/Cat text.wgt/img/toolbar-reload.png b/resources/library/interactivities/Cat text.wgt/img/toolbar-reload.png new file mode 100644 index 00000000..340d7371 Binary files /dev/null and b/resources/library/interactivities/Cat text.wgt/img/toolbar-reload.png differ diff --git a/resources/library/interactivities/Cat text.wgt/index.html b/resources/library/interactivities/Cat text.wgt/index.html index 688bb52f..9dddb48e 100644 --- a/resources/library/interactivities/Cat text.wgt/index.html +++ b/resources/library/interactivities/Cat text.wgt/index.html @@ -16,6 +16,7 @@ lang = sankore.locale().substr(0,2); } else lang = "en"; + lang = "fr"; if(lang == "en"){ if(window.sankore) sankore.enableDropOnWidget(false); @@ -51,12 +52,7 @@
-
- +
  @@ -66,7 +62,17 @@
- +
+
+ +
+
  diff --git a/resources/library/interactivities/Cat text.wgt/js/script.js b/resources/library/interactivities/Cat text.wgt/js/script.js index 0dededfa..a53fc178 100644 --- a/resources/library/interactivities/Cat text.wgt/js/script.js +++ b/resources/library/interactivities/Cat text.wgt/js/script.js @@ -1,5 +1,5 @@ var sankoreLang = { - display: "Display", + display: "Close", edit: "Edit", first_desc: "Fruits", second_desc: "Vegetables", @@ -17,7 +17,8 @@ var sankoreLang = { pad: "Pad", none: "None", help: "Help", - help_content: "This is an example of help content ..." + help_content: "This is an example of help content ...", + theme: "Theme" }; //main function @@ -29,9 +30,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_text","")){ @@ -53,11 +56,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 { + } 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"); @@ -78,7 +83,7 @@ function start(){ exportData(); }); - $(".style_select").change(function (event){ + $("#style_select").change(function (event){ changeStyle($(this).find("option:selected").val()); }) @@ -87,7 +92,7 @@ function start(){ if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_edit").removeClass("selected"); - $(".style_select").css("display","none"); + $("#parameters").css("display","none"); $(".add_block").remove(); $(".cont").each(function(){ var container = $(this); @@ -160,7 +165,7 @@ function start(){ if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_display").removeClass("selected"); - $(".style_select").css("display","block"); + $("#parameters").css("display","block"); $(".cont").each(function(){ var container = $(this); @@ -244,7 +249,7 @@ function exportData(){ cont_obj.conts = []; $(this).find(".imgs_cont").each(function(){ var img_cont = new Object(); - cont_obj.style = $(".style_select").find("option:selected").val(); + cont_obj.style = $("#style_select").find("option:selected").val(); img_cont.mask = $(this).find("input[name='mask']").val(); img_cont.count = $(this).find(".img_block").size(); img_cont.text = $(this).find(".cat_desc").val(); @@ -266,7 +271,7 @@ function exportData(){ cont_obj.conts = []; $(this).find(".imgs_cont").each(function(){ var img_cont = new Object(); - cont_obj.style = $(".style_select").find("option:selected").val(); + cont_obj.style = $("#style_select").find("option:selected").val(); img_cont.mask = $(this).find("input[name='mask']").val(); img_cont.count = $(this).find("input[name='count']").val(); img_cont.text = $(this).find(".cat_desc").val(); @@ -292,7 +297,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); } @@ -307,12 +312,12 @@ 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 = []; @@ -642,10 +647,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"); @@ -659,10 +664,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"); @@ -676,10 +681,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; } } diff --git a/resources/library/interactivities/Cat text.wgt/locales/fr/index.html b/resources/library/interactivities/Cat text.wgt/locales/fr/index.html index 3636c4ab..d8651420 100644 --- a/resources/library/interactivities/Cat text.wgt/locales/fr/index.html +++ b/resources/library/interactivities/Cat text.wgt/locales/fr/index.html @@ -25,12 +25,7 @@
-
- +
  @@ -40,7 +35,17 @@
- +
+
+ +
+
  diff --git a/resources/library/interactivities/Cat text.wgt/locales/fr/js/script.js b/resources/library/interactivities/Cat text.wgt/locales/fr/js/script.js index 606f4a4a..90cbd71c 100644 --- a/resources/library/interactivities/Cat text.wgt/locales/fr/js/script.js +++ b/resources/library/interactivities/Cat text.wgt/locales/fr/js/script.js @@ -1,5 +1,5 @@ var sankoreLang = { - display: "Afficher", + display: "Fermer", edit: "Modifier", first_desc: "Fruits", second_desc: "Légumes", @@ -18,27 +18,28 @@ var sankoreLang = { none: "aucun", help: "Aide", help_content: "

Catégoriser des textes

"+ -"

Classer des étiquettes de mots en fonction de la dénomination de la catégorie.

"+ + "

Classer des étiquettes de mots en fonction de la dénomination de la catégorie.

"+ -"

L’activité s’effectue par un glisser-déposer de l’étiquette de mots dans la catégorie correspondante. Tant que toutes les étiquettes de mots ne sont pas classées, la zone reste rouge. Une fois que toutes les étiquettes de mots sont classées dans la bonne catégorie, la zone se colore en vert.

"+ + "

L’activité s’effectue par un glisser-déposer de l’étiquette de mots dans la catégorie correspondante. Tant que toutes les étiquettes de mots ne sont pas classées, la zone reste rouge. Une fois que toutes les étiquettes de mots sont classées dans la bonne catégorie, la zone se colore en vert.

"+ -"

Le bouton “Recharger” réinitialise les exercices.

"+ + "

Le bouton “Recharger” réinitialise les exercices.

"+ -"

Le bouton “Modifier” vous permet :

"+ -""+ + "

Le bouton “Modifier” vous permet :

"+ + ""+ -"

En mode édition, pour créer un nouvel exercice, cliquez sur “Nouveau bloc” en bas, une zone bleue apparaît, c’est une catégorie, puis.

"+ -""+ -"

Pour supprimer une étiquette de mots, cliquez sur la croix située dans le coin supérieur droit de celle-ci.

"+ -"

Pour supprimer une catégorie, cliquez sur le signe “-” situé à droite de celle-ci.

"+ + "

En mode édition, pour créer un nouvel exercice, cliquez sur “Nouveau bloc” en bas, une zone bleue apparaît, c’est une catégorie, puis.

"+ + ""+ + "

Pour supprimer une étiquette de mots, cliquez sur la croix située dans le coin supérieur droit de celle-ci.

"+ + "

Pour supprimer une catégorie, cliquez sur le signe “-” situé à droite de celle-ci.

"+ -"

Pour supprimer un exercice, cliquez sur la croix à gauche du numéro de l’exercice.

"+ + "

Pour supprimer un exercice, cliquez sur la croix à gauche du numéro de l’exercice.

"+ -"

Le bouton “Afficher” vous permet d’utiliser l’activité.

" + "

Le bouton “Afficher” vous permet d’utiliser l’activité.

", + theme: "Thème" }; //main function @@ -50,9 +51,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_text","")){ @@ -74,11 +77,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 { + } 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"); @@ -99,7 +104,7 @@ function start(){ exportData(); }); - $(".style_select").change(function (event){ + $("#style_select").change(function (event){ changeStyle($(this).find("option:selected").val()); }) @@ -108,7 +113,7 @@ function start(){ if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_edit").removeClass("selected"); - $(".style_select").css("display","none"); + $("#parameters").css("display","none"); $(".add_block").remove(); $(".cont").each(function(){ var container = $(this); @@ -181,7 +186,7 @@ function start(){ if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_display").removeClass("selected"); - $(".style_select").css("display","block"); + $("#parameters").css("display","block"); $(".cont").each(function(){ var container = $(this); @@ -265,7 +270,7 @@ function exportData(){ cont_obj.conts = []; $(this).find(".imgs_cont").each(function(){ var img_cont = new Object(); - cont_obj.style = $(".style_select").find("option:selected").val(); + cont_obj.style = $("#style_select").find("option:selected").val(); img_cont.mask = $(this).find("input[name='mask']").val(); img_cont.count = $(this).find(".img_block").size(); img_cont.text = $(this).find(".cat_desc").val(); @@ -287,7 +292,7 @@ function exportData(){ cont_obj.conts = []; $(this).find(".imgs_cont").each(function(){ var img_cont = new Object(); - cont_obj.style = $(".style_select").find("option:selected").val(); + cont_obj.style = $("#style_select").find("option:selected").val(); img_cont.mask = $(this).find("input[name='mask']").val(); img_cont.count = $(this).find("input[name='count']").val(); img_cont.text = $(this).find(".cat_desc").val(); @@ -313,7 +318,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); } @@ -328,12 +333,12 @@ 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 = []; @@ -664,10 +669,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"); @@ -681,10 +686,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"); @@ -698,10 +703,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; } } diff --git a/resources/library/interactivities/Cat text.wgt/locales/ru/index.html b/resources/library/interactivities/Cat text.wgt/locales/ru/index.html index 27c62f8d..561bec51 100644 --- a/resources/library/interactivities/Cat text.wgt/locales/ru/index.html +++ b/resources/library/interactivities/Cat text.wgt/locales/ru/index.html @@ -25,12 +25,7 @@
-
- +
  @@ -40,7 +35,17 @@
- +
+
+ +
+
  diff --git a/resources/library/interactivities/Cat text.wgt/locales/ru/js/script.js b/resources/library/interactivities/Cat text.wgt/locales/ru/js/script.js index 86bef6bd..7a4ac961 100644 --- a/resources/library/interactivities/Cat text.wgt/locales/ru/js/script.js +++ b/resources/library/interactivities/Cat text.wgt/locales/ru/js/script.js @@ -1,5 +1,5 @@ var sankoreLang = { - display: "Показать", + display: "Закрыть", edit: "Изменить", first_desc: "Фрукты", second_desc: "Овощи", @@ -17,7 +17,8 @@ var sankoreLang = { pad: "Планшет", none: "Нет", help: "Помощь", - help_content: "Пример текста помощи ..." + help_content: "Пример текста помощи ...", + theme: "Тема" }; //main function @@ -29,9 +30,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_text","")){ @@ -53,11 +56,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 { + } 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"); @@ -78,7 +83,7 @@ function start(){ exportData(); }); - $(".style_select").change(function (event){ + $("#style_select").change(function (event){ changeStyle($(this).find("option:selected").val()); }) @@ -87,7 +92,7 @@ function start(){ if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_edit").removeClass("selected"); - $(".style_select").css("display","none"); + $("#parameters").css("display","none"); $(".add_block").remove(); $(".cont").each(function(){ var container = $(this); @@ -160,7 +165,7 @@ function start(){ if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_display").removeClass("selected"); - $(".style_select").css("display","block"); + $("#parameters").css("display","block"); $(".cont").each(function(){ var container = $(this); @@ -244,7 +249,7 @@ function exportData(){ cont_obj.conts = []; $(this).find(".imgs_cont").each(function(){ var img_cont = new Object(); - cont_obj.style = $(".style_select").find("option:selected").val(); + cont_obj.style = $("#style_select").find("option:selected").val(); img_cont.mask = $(this).find("input[name='mask']").val(); img_cont.count = $(this).find(".img_block").size(); img_cont.text = $(this).find(".cat_desc").val(); @@ -266,7 +271,7 @@ function exportData(){ cont_obj.conts = []; $(this).find(".imgs_cont").each(function(){ var img_cont = new Object(); - cont_obj.style = $(".style_select").find("option:selected").val(); + cont_obj.style = $("#style_select").find("option:selected").val(); img_cont.mask = $(this).find("input[name='mask']").val(); img_cont.count = $(this).find("input[name='count']").val(); img_cont.text = $(this).find(".cat_desc").val(); @@ -292,7 +297,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); } @@ -307,12 +312,12 @@ 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 = []; @@ -452,7 +457,7 @@ function importData(data){ } } } - }); + }); checkCorrectness(all_imgs); } } @@ -643,10 +648,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"); @@ -660,10 +665,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"); @@ -677,10 +682,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; } } diff --git a/resources/library/interactivities/Choisir.wgt/css/basic.css b/resources/library/interactivities/Choisir.wgt/css/basic.css index b40b8bb7..ad7c7371 100644 --- a/resources/library/interactivities/Choisir.wgt/css/basic.css +++ b/resources/library/interactivities/Choisir.wgt/css/basic.css @@ -16,7 +16,7 @@ html, body{ height: 100%; margin: 0; padding: 0; - border-radius: 50px; + border-radius: 35px; overflow: hidden; } @@ -471,57 +471,40 @@ body{ margin: 10px 10px 0 10px; padding: 0; float: left; - font-family: "Lobster13Regular"; + font-family: Arial,Helvetica,sans-serif; font-size: 24px; - color: #8c5730; + color: #7F613F; + text-shadow: #FFDCA9 0 1px 0; } #wgt_reload, #wgt_edit, #wgt_display, #wgt_help{ cursor: pointer; - height: 44px; margin: 10px 10px 0 0; float: right; - font-family: "Lobster13Regular"; - font-size: 24px; - color: #8c5730; + font-family: Arial,Helvetica,sans-serif; + font-size: 24px; + line-height: 32px; } #wgt_display{ - padding-left: 40px; - background-image: url(../images/slate-edit.png); - background-repeat: no-repeat; - background-position: top 0; + padding-left: 35px; + background: url(../images/toolbar-edit.png) left -32px no-repeat; + color: white; display: none; } #wgt_edit{ - padding-left: 40px; - background-image: url(../images/slate-edit.png); - background-repeat: no-repeat; - background-position: top 0; + padding-left: 35px; + background: url(../images/slate-toolbar-edit.png) left top no-repeat; + color: #7F613F; + text-shadow: #FFDCA9 0 1px 0; } #wgt_reload{ - padding-left: 40px; - background-image: url(../images/slate-toolbar-reload.png); - background-repeat: no-repeat; - background-position: top 0; -} - -.style_select{ - width: 120px; - font-family: "Lobster13Regular"; - font-size: 24px; - float: right; - margin: 10px 20px 0 0; - border-radius: 10px; - background-image: url(../images/ar_down.png); - background-color: #d4aa79; - color: #8c5730; - background-position: 105px 11px; - background-repeat: no-repeat; - -webkit-appearance: menulist-text; - display: none; + padding-left: 35px; + background: url(../images/slate-toolbar-reload.png) left top no-repeat; + color: #7F613F; + text-shadow: #FFDCA9 0 1px 0; } .btl_pad{ @@ -556,51 +539,50 @@ body{ background-image: url(../images/pad-bottom-right.png) !important; } -.pad_color{ - color: white !important; +.without_radius{ + border-radius: 0 !important; } -.pad_reload{ - background-image: url(../images/slate-toolbar-reload-white.png) !important; +.without_back{ + background: none !important; } -.pad_edit{ - background-image: url(../images/slate-display.png) !important; +.pad_color{ + color: #FC9 !important; + text-shadow: none !important; } -.pad_select{ - background-color: black !important; - color: white !important; - background-image: url(../images/ar_down_white.png) !important; +.pad_reload{ + background: url(../images/toolbar-reload.png) left top no-repeat !important; } -.without_radius{ - border-radius: 0 !important; +.pad_edit{ + background: url(../images/toolbar-edit.png) left top no-repeat !important; } -.without_back{ - background: none !important; +.pad_help{ + background: url(../images/toolbar-help.png) left top no-repeat !important; } -.none_select{ - background-color: #333 !important; +.help_wood{ + background: url(../images/slate-toolbar-help.png) left -32px no-repeat !important; color: white !important; - background-image: url(../images/ar_down_white.png) !important; + text-shadow: #7F613F 0 -1px 0 !important; } -.pad_help{ - background-image: url(../images/slate-help-white.png) !important; +.help_pad{ + background: url(../images/toolbar-help.png) left -32px no-repeat !important; + color: white !important; } #wgt_help{ - padding-left: 32px; - background-image: url(../images/slate-help.png); - background-repeat: no-repeat; - background-position: top 0; + padding-left: 35px; + background: url(../images/slate-toolbar-help.png) left top no-repeat; + color: #7F613F; + text-shadow: #FFDCA9 0 1px 0; } #help{ - width: 100%; height: 100%; overflow: auto; display: none; @@ -609,5 +591,36 @@ body{ } .open{ - + +} + +#parameters{ + display: none; + padding: 10px 20px; + background: url("../images/parameters-bg.png"); + border-radius: 4px 4px 0 0; +} + +.inline{ + display: inline-block; + font-family: "helvetica neue"; + font-size: 14px; + color: #666; +} + +#parameters label { + font-style: italic; +} + +#style_select{ + margin-left: 10px; +} + +.display_wood{ + background: url(../images/slate-toolbar-edit.png) left -32px no-repeat !important; + text-shadow: #7F613F 0 -1px 0; +} + +.radius_ft{ + border-radius: 45px !important; } \ No newline at end of file diff --git a/resources/library/interactivities/Choisir.wgt/images/ar_down.png b/resources/library/interactivities/Choisir.wgt/images/ar_down.png deleted file mode 100644 index a20fab4f..00000000 Binary files a/resources/library/interactivities/Choisir.wgt/images/ar_down.png and /dev/null differ diff --git a/resources/library/interactivities/Choisir.wgt/images/ar_down_white.png b/resources/library/interactivities/Choisir.wgt/images/ar_down_white.png deleted file mode 100644 index 4a1d133b..00000000 Binary files a/resources/library/interactivities/Choisir.wgt/images/ar_down_white.png and /dev/null differ diff --git a/resources/library/interactivities/Choisir.wgt/images/parameters-bg.png b/resources/library/interactivities/Choisir.wgt/images/parameters-bg.png new file mode 100644 index 00000000..36f648e1 Binary files /dev/null and b/resources/library/interactivities/Choisir.wgt/images/parameters-bg.png differ diff --git a/resources/library/interactivities/Choisir.wgt/images/slate-display.png b/resources/library/interactivities/Choisir.wgt/images/slate-display.png deleted file mode 100644 index 96166143..00000000 Binary files a/resources/library/interactivities/Choisir.wgt/images/slate-display.png and /dev/null differ diff --git a/resources/library/interactivities/Choisir.wgt/images/slate-edit.png b/resources/library/interactivities/Choisir.wgt/images/slate-edit.png deleted file mode 100644 index 17f5fc5c..00000000 Binary files a/resources/library/interactivities/Choisir.wgt/images/slate-edit.png and /dev/null differ diff --git a/resources/library/interactivities/Choisir.wgt/images/slate-help-white.png b/resources/library/interactivities/Choisir.wgt/images/slate-help-white.png deleted file mode 100644 index 7b5ebfd8..00000000 Binary files a/resources/library/interactivities/Choisir.wgt/images/slate-help-white.png and /dev/null differ diff --git a/resources/library/interactivities/Choisir.wgt/images/slate-help.png b/resources/library/interactivities/Choisir.wgt/images/slate-help.png deleted file mode 100644 index 069052d0..00000000 Binary files a/resources/library/interactivities/Choisir.wgt/images/slate-help.png and /dev/null differ diff --git a/resources/library/interactivities/Choisir.wgt/images/slate-toolbar-help.png b/resources/library/interactivities/Choisir.wgt/images/slate-toolbar-help.png new file mode 100644 index 00000000..fb7cdeba Binary files /dev/null and b/resources/library/interactivities/Choisir.wgt/images/slate-toolbar-help.png differ diff --git a/resources/library/interactivities/Choisir.wgt/images/slate-toolbar-reload-white.png b/resources/library/interactivities/Choisir.wgt/images/slate-toolbar-reload-white.png deleted file mode 100644 index 78d146ec..00000000 Binary files a/resources/library/interactivities/Choisir.wgt/images/slate-toolbar-reload-white.png and /dev/null differ diff --git a/resources/library/interactivities/Choisir.wgt/images/slate-toolbar-reload.png b/resources/library/interactivities/Choisir.wgt/images/slate-toolbar-reload.png index 685a5cb2..844169a9 100644 Binary files a/resources/library/interactivities/Choisir.wgt/images/slate-toolbar-reload.png and b/resources/library/interactivities/Choisir.wgt/images/slate-toolbar-reload.png differ diff --git a/resources/library/interactivities/Choisir.wgt/images/toolbar-edit.png b/resources/library/interactivities/Choisir.wgt/images/toolbar-edit.png new file mode 100644 index 00000000..daa338cd Binary files /dev/null and b/resources/library/interactivities/Choisir.wgt/images/toolbar-edit.png differ diff --git a/resources/library/interactivities/Choisir.wgt/images/toolbar-help.png b/resources/library/interactivities/Choisir.wgt/images/toolbar-help.png new file mode 100644 index 00000000..6c4454c0 Binary files /dev/null and b/resources/library/interactivities/Choisir.wgt/images/toolbar-help.png differ diff --git a/resources/library/interactivities/Choisir.wgt/images/toolbar-reload.png b/resources/library/interactivities/Choisir.wgt/images/toolbar-reload.png new file mode 100644 index 00000000..340d7371 Binary files /dev/null and b/resources/library/interactivities/Choisir.wgt/images/toolbar-reload.png differ diff --git a/resources/library/interactivities/Choisir.wgt/index.html b/resources/library/interactivities/Choisir.wgt/index.html index 5d5bc7cd..9c9a371e 100644 --- a/resources/library/interactivities/Choisir.wgt/index.html +++ b/resources/library/interactivities/Choisir.wgt/index.html @@ -54,12 +54,7 @@ and open the template in the editor.
-
- +
  @@ -69,7 +64,17 @@ and open the template in the editor.
- +
+
+ +
+
  diff --git a/resources/library/interactivities/Choisir.wgt/locales/fr/index.html b/resources/library/interactivities/Choisir.wgt/locales/fr/index.html index cafbc283..4336853c 100644 --- a/resources/library/interactivities/Choisir.wgt/locales/fr/index.html +++ b/resources/library/interactivities/Choisir.wgt/locales/fr/index.html @@ -29,12 +29,7 @@ and open the template in the editor.
-
- +
  @@ -44,7 +39,17 @@ and open the template in the editor.
- +
+
+ +
+
  diff --git a/resources/library/interactivities/Choisir.wgt/locales/fr/scripts/selQuestionApp.js b/resources/library/interactivities/Choisir.wgt/locales/fr/scripts/selQuestionApp.js index 4de4b35a..6c976c50 100644 --- a/resources/library/interactivities/Choisir.wgt/locales/fr/scripts/selQuestionApp.js +++ b/resources/library/interactivities/Choisir.wgt/locales/fr/scripts/selQuestionApp.js @@ -15,7 +15,7 @@ var sankoreLang = { edit: "Modifier", - display:"Afficher", + display:"Fermer", question:"La question", example_question:"Ceci est un exemple de question", answer:"Ceci est une réponse possible", @@ -61,7 +61,8 @@ var sankoreLang = { "

Pour supprimer un exercice, cliquez sur la croix à droite du numéro de ”Options”.

"+ -"

Le bouton “Afficher” vous permet d’utiliser l’activité.

" +"

Le bouton “Afficher” vous permet d’utiliser l’activité.

", +theme: "Thème" }; var questionArray; @@ -85,10 +86,11 @@ function init(){ $("#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) //popup message var popupText = $("
").appendTo("#data"); @@ -127,14 +129,14 @@ function init(){ if (window.widget) { window.widget.onleave = function(){ sankore.setPreference("qstArrayData", JSON.stringify(questionArray)); - sankore.setPreference("choisir_style", $(".style_select").find("option:selected").val()); + sankore.setPreference("choisir_style", $("#style_select").find("option:selected").val()); } } if(window.sankore) if(sankore.preference("choisir_style","")){ changeStyle(sankore.preference("choisir_style","")); - $(".style_select").val(sankore.preference("choisir_style","")); + $("#style_select").val(sankore.preference("choisir_style","")); } else changeStyle("3") @@ -143,21 +145,21 @@ function init(){ if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_edit").removeClass("selected"); - $(".style_select").css("display","none"); + $("#parameters").css("display","none"); $(this).css("display", "none"); $("#wgt_edit").css("display", "block"); displayData(true); mode = true; if(window.sankore){ sankore.setPreference("qstArrayData", JSON.stringify(questionArray)); - sankore.setPreference("choisir_style", $(".style_select").find("option:selected").val()); + sankore.setPreference("choisir_style", $("#style_select").find("option:selected").val()); } } } else { if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_display").removeClass("selected"); - $(".style_select").css("display","block"); + $("#parameters").css("display","block"); $(this).css("display", "none"); $("#wgt_display").css("display", "block"); editData(); @@ -165,15 +167,17 @@ function init(){ } } }); - + $("#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 { + } 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"); @@ -192,10 +196,10 @@ function init(){ } }); - $(".style_select option[value='1']").text(sankoreLang.slate); - $(".style_select option[value='2']").text(sankoreLang.pad); + $("#style_select option[value='1']").text(sankoreLang.slate); + $("#style_select option[value='2']").text(sankoreLang.pad); - $(".style_select").change(function (event){ + $("#style_select").change(function (event){ changeStyle($(this).find("option:selected").val()); }) @@ -477,71 +481,71 @@ function init(){ // show questions and answers in display mode function addToPage(array){ - var counter = 1; - for(var i in array){ + var counter = 1; + for(var i in array){ - var qstDiv = $("
"); - var spanOptConn = $("
").appendTo(qstDiv); - var qstNumber = $("" + sankoreLang.question + " " + counter + "").appendTo(spanOptConn); - var qstContent = $("
" + array[i].text + "
").appendTo(qstDiv); - var ansDiv = $("
").appendTo(qstDiv); + var qstDiv = $("
"); + var spanOptConn = $("
").appendTo(qstDiv); + var qstNumber = $("" + sankoreLang.question + " " + counter + "").appendTo(spanOptConn); + var qstContent = $("
" + array[i].text + "
").appendTo(qstDiv); + var ansDiv = $("
").appendTo(qstDiv); - var ansCount = 1; - var type = array[i].type; - var selInput = $("").appendTo(newAnswer); - var ansSpan = $("" + ansCount + ".").appendTo(newAnswer); - var ansContent = $("
" + array[i].answers[j].text + "
").appendTo(newAnswer); - newAnswer.appendTo(ansDiv); - break; - case "2": - local_state = ""; - local_color = ""; - if(begin){ - local_state = (array[i].answers[j].state)?"checked":""; - local_color = (array[i].rightAns.replace(/,/g,"").indexOf(array[i].answers[j].value + " ", 0) != -1)?((array[i].answers[j].was)?"style='background-color: #6c0;'":""):((array[i].answers[j].was)?"style='background-color: red;'":""); - } - newAnswer = $("
"); - ansInput = $("").appendTo(newAnswer); - ansSpan = $("" + ansCount + ".").appendTo(newAnswer); - ansContent = $("
" + array[i].answers[j].text + "
").appendTo(newAnswer); - newAnswer.appendTo(ansDiv); - break; - case "3": - local_state = ""; - local_color = ""; - if(begin){ - local_state = (array[i].answers[j].state)?"selected":""; - local_color = (array[i].answers[j].value == array[i].rightAns)?((array[i].answers[j].was)?"#6c0":""):((array[i].answers[j].was)?"red":""); - } - ansInput = $("").appendTo(selInput); - if(local_state && local_color) - selInput.css("background-color",local_color); - break; - } - ansCount++; + var ansCount = 1; + var type = array[i].type; + var selInput = $("").appendTo(newAnswer); + var ansSpan = $("" + ansCount + ".").appendTo(newAnswer); + var ansContent = $("
" + array[i].answers[j].text + "
").appendTo(newAnswer); + newAnswer.appendTo(ansDiv); + break; + case "2": + local_state = ""; + local_color = ""; + if(begin){ + local_state = (array[i].answers[j].state)?"checked":""; + local_color = (array[i].rightAns.replace(/,/g,"").indexOf(array[i].answers[j].value + " ", 0) != -1)?((array[i].answers[j].was)?"style='background-color: #6c0;'":""):((array[i].answers[j].was)?"style='background-color: red;'":""); + } + newAnswer = $("
"); + ansInput = $("").appendTo(newAnswer); + ansSpan = $("" + ansCount + ".").appendTo(newAnswer); + ansContent = $("
" + array[i].answers[j].text + "
").appendTo(newAnswer); + newAnswer.appendTo(ansDiv); + break; + case "3": + local_state = ""; + local_color = ""; + if(begin){ + local_state = (array[i].answers[j].state)?"selected":""; + local_color = (array[i].answers[j].value == array[i].rightAns)?((array[i].answers[j].was)?"#6c0":""):((array[i].answers[j].was)?"red":""); + } + ansInput = $("").appendTo(selInput); + if(local_state && local_color) + selInput.css("background-color",local_color); + break; + } + ansCount++; + } + qstDiv.appendTo("#data"); + counter++; } - qstDiv.appendTo("#data"); - counter++; - } - begin = false; + begin = false; } } @@ -746,10 +750,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"); @@ -763,10 +767,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"); @@ -780,10 +784,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; } } \ No newline at end of file diff --git a/resources/library/interactivities/Choisir.wgt/locales/ru/index.html b/resources/library/interactivities/Choisir.wgt/locales/ru/index.html index cafbc283..4336853c 100644 --- a/resources/library/interactivities/Choisir.wgt/locales/ru/index.html +++ b/resources/library/interactivities/Choisir.wgt/locales/ru/index.html @@ -29,12 +29,7 @@ and open the template in the editor.
-
- +
  @@ -44,7 +39,17 @@ and open the template in the editor.
- +
+
+ +
+
  diff --git a/resources/library/interactivities/Choisir.wgt/locales/ru/scripts/selQuestionApp.js b/resources/library/interactivities/Choisir.wgt/locales/ru/scripts/selQuestionApp.js index 1bf362ec..5c75cf3a 100644 --- a/resources/library/interactivities/Choisir.wgt/locales/ru/scripts/selQuestionApp.js +++ b/resources/library/interactivities/Choisir.wgt/locales/ru/scripts/selQuestionApp.js @@ -15,7 +15,7 @@ var sankoreLang = { edit: "Изменить", - display:"Показать", + display:"Закрыть", question:"Вопрос", example_question:"Это пример вопроса", answer:"Это пример ответа", @@ -41,7 +41,8 @@ var sankoreLang = { pad: "Планшет", none: "Нет", help: "Помощь", - help_content: "Пример текста помощи ..." + help_content: "Пример текста помощи ...", + theme: "Тема" }; var questionArray; @@ -65,10 +66,11 @@ function init(){ $("#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) //popup message var popupText = $("
").appendTo("#data"); @@ -107,14 +109,14 @@ function init(){ if (window.widget) { window.widget.onleave = function(){ sankore.setPreference("qstArrayData", JSON.stringify(questionArray)); - sankore.setPreference("choisir_style", $(".style_select").find("option:selected").val()); + sankore.setPreference("choisir_style", $("#style_select").find("option:selected").val()); } } if(window.sankore) if(sankore.preference("choisir_style","")){ changeStyle(sankore.preference("choisir_style","")); - $(".style_select").val(sankore.preference("choisir_style","")); + $("#style_select").val(sankore.preference("choisir_style","")); } else changeStyle("3") @@ -123,21 +125,21 @@ function init(){ if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_edit").removeClass("selected"); - $(".style_select").css("display","none"); + $("#parameters").css("display","none"); $(this).css("display", "none"); $("#wgt_edit").css("display", "block"); displayData(true); mode = true; if(window.sankore){ sankore.setPreference("qstArrayData", JSON.stringify(questionArray)); - sankore.setPreference("choisir_style", $(".style_select").find("option:selected").val()); + sankore.setPreference("choisir_style", $("#style_select").find("option:selected").val()); } } } else { if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_display").removeClass("selected"); - $(".style_select").css("display","block"); + $("#parameters").css("display","block"); $(this).css("display", "none"); $("#wgt_display").css("display", "block"); editData(); @@ -149,11 +151,13 @@ function init(){ $("#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 { + } 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"); @@ -172,10 +176,10 @@ function init(){ } }); - $(".style_select option[value='1']").text(sankoreLang.slate); - $(".style_select option[value='2']").text(sankoreLang.pad); + $("#style_select option[value='1']").text(sankoreLang.slate); + $("#style_select option[value='2']").text(sankoreLang.pad); - $(".style_select").change(function (event){ + $("#style_select").change(function (event){ changeStyle($(this).find("option:selected").val()); }) @@ -457,71 +461,71 @@ function init(){ // show questions and answers in display mode function addToPage(array){ - var counter = 1; - for(var i in array){ + var counter = 1; + for(var i in array){ - var qstDiv = $("
"); - var spanOptConn = $("
").appendTo(qstDiv); - var qstNumber = $("" + sankoreLang.question + " " + counter + "").appendTo(spanOptConn); - var qstContent = $("
" + array[i].text + "
").appendTo(qstDiv); - var ansDiv = $("
").appendTo(qstDiv); + var qstDiv = $("
"); + var spanOptConn = $("
").appendTo(qstDiv); + var qstNumber = $("" + sankoreLang.question + " " + counter + "").appendTo(spanOptConn); + var qstContent = $("
" + array[i].text + "
").appendTo(qstDiv); + var ansDiv = $("
").appendTo(qstDiv); - var ansCount = 1; - var type = array[i].type; - var selInput = $("").appendTo(newAnswer); - var ansSpan = $("" + ansCount + ".").appendTo(newAnswer); - var ansContent = $("
" + array[i].answers[j].text + "
").appendTo(newAnswer); - newAnswer.appendTo(ansDiv); - break; - case "2": - local_state = ""; - local_color = ""; - if(begin){ - local_state = (array[i].answers[j].state)?"checked":""; - local_color = (array[i].rightAns.replace(/,/g,"").indexOf(array[i].answers[j].value + " ", 0) != -1)?((array[i].answers[j].was)?"style='background-color: #6c0;'":""):((array[i].answers[j].was)?"style='background-color: red;'":""); - } - newAnswer = $("
"); - ansInput = $("").appendTo(newAnswer); - ansSpan = $("" + ansCount + ".").appendTo(newAnswer); - ansContent = $("
" + array[i].answers[j].text + "
").appendTo(newAnswer); - newAnswer.appendTo(ansDiv); - break; - case "3": - local_state = ""; - local_color = ""; - if(begin){ - local_state = (array[i].answers[j].state)?"selected":""; - local_color = (array[i].answers[j].value == array[i].rightAns)?((array[i].answers[j].was)?"#6c0":""):((array[i].answers[j].was)?"red":""); - } - ansInput = $("").appendTo(selInput); - if(local_state && local_color) - selInput.css("background-color",local_color); - break; - } - ansCount++; + var ansCount = 1; + var type = array[i].type; + var selInput = $("").appendTo(newAnswer); + var ansSpan = $("" + ansCount + ".").appendTo(newAnswer); + var ansContent = $("
" + array[i].answers[j].text + "
").appendTo(newAnswer); + newAnswer.appendTo(ansDiv); + break; + case "2": + local_state = ""; + local_color = ""; + if(begin){ + local_state = (array[i].answers[j].state)?"checked":""; + local_color = (array[i].rightAns.replace(/,/g,"").indexOf(array[i].answers[j].value + " ", 0) != -1)?((array[i].answers[j].was)?"style='background-color: #6c0;'":""):((array[i].answers[j].was)?"style='background-color: red;'":""); + } + newAnswer = $("
"); + ansInput = $("").appendTo(newAnswer); + ansSpan = $("" + ansCount + ".").appendTo(newAnswer); + ansContent = $("
" + array[i].answers[j].text + "
").appendTo(newAnswer); + newAnswer.appendTo(ansDiv); + break; + case "3": + local_state = ""; + local_color = ""; + if(begin){ + local_state = (array[i].answers[j].state)?"selected":""; + local_color = (array[i].answers[j].value == array[i].rightAns)?((array[i].answers[j].was)?"#6c0":""):((array[i].answers[j].was)?"red":""); + } + ansInput = $("").appendTo(selInput); + if(local_state && local_color) + selInput.css("background-color",local_color); + break; + } + ansCount++; + } + qstDiv.appendTo("#data"); + counter++; } - qstDiv.appendTo("#data"); - counter++; - } - begin = false; + begin = false; } } @@ -726,10 +730,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"); @@ -743,10 +747,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"); @@ -760,10 +764,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; } } \ No newline at end of file diff --git a/resources/library/interactivities/Choisir.wgt/scripts/selQuestionApp.js b/resources/library/interactivities/Choisir.wgt/scripts/selQuestionApp.js index a223b8bd..e04f2e83 100644 --- a/resources/library/interactivities/Choisir.wgt/scripts/selQuestionApp.js +++ b/resources/library/interactivities/Choisir.wgt/scripts/selQuestionApp.js @@ -15,7 +15,7 @@ var sankoreLang = { edit: "Edit", - display:"Display", + display:"Close", question:"Question", example_question:"This is an example of the question", answer:"This is one possible answer", @@ -41,7 +41,8 @@ var sankoreLang = { pad: "Pad", none: "None", help: "Help", - help_content: "This is an example of help content ..." + help_content: "This is an example of help content ...", + theme: "Theme" }; var questionArray; @@ -65,10 +66,11 @@ function init(){ $("#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) //popup message var popupText = $("
").appendTo("#data"); @@ -107,14 +109,14 @@ function init(){ if (window.widget) { window.widget.onleave = function(){ sankore.setPreference("qstArrayData", JSON.stringify(questionArray)); - sankore.setPreference("choisir_style", $(".style_select").find("option:selected").val()); + sankore.setPreference("choisir_style", $("#style_select").find("option:selected").val()); } } if(window.sankore) if(sankore.preference("choisir_style","")){ changeStyle(sankore.preference("choisir_style","")); - $(".style_select").val(sankore.preference("choisir_style","")); + $("#style_select").val(sankore.preference("choisir_style","")); } else changeStyle("3") @@ -123,21 +125,21 @@ function init(){ if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_edit").removeClass("selected"); - $(".style_select").css("display","none"); + $("#parameters").css("display","none"); $(this).css("display", "none"); $("#wgt_edit").css("display", "block"); displayData(true); mode = true; if(window.sankore){ sankore.setPreference("qstArrayData", JSON.stringify(questionArray)); - sankore.setPreference("choisir_style", $(".style_select").find("option:selected").val()); + sankore.setPreference("choisir_style", $("#style_select").find("option:selected").val()); } } } else { if(!$(this).hasClass("selected")){ $(this).addClass("selected"); $("#wgt_display").removeClass("selected"); - $(".style_select").css("display","block"); + $("#parameters").css("display","block"); $(this).css("display", "none"); $("#wgt_display").css("display", "block"); editData(); @@ -149,11 +151,13 @@ function init(){ $("#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 { + } 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"); @@ -172,10 +176,10 @@ function init(){ } }); - $(".style_select option[value='1']").text(sankoreLang.slate); - $(".style_select option[value='2']").text(sankoreLang.pad); + $("#style_select option[value='1']").text(sankoreLang.slate); + $("#style_select option[value='2']").text(sankoreLang.pad); - $(".style_select").change(function (event){ + $("#style_select").change(function (event){ changeStyle($(this).find("option:selected").val()); }) @@ -726,10 +730,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"); @@ -743,10 +747,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"); @@ -760,10 +764,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; } } diff --git a/src/adaptors/UBExportFullPDF.cpp b/src/adaptors/UBExportFullPDF.cpp index a65b703a..75dd32c7 100644 --- a/src/adaptors/UBExportFullPDF.cpp +++ b/src/adaptors/UBExportFullPDF.cpp @@ -169,6 +169,7 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QS MergeDescription mergeInfo; int existingPageCount = pDocumentProxy->pageCount(); + for(int pageIndex = 0 ; pageIndex < existingPageCount; pageIndex++) { UBGraphicsScene* scene = UBPersistenceManager::persistenceManager()->loadDocumentScene(pDocumentProxy, pageIndex); @@ -180,18 +181,42 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QS { QString pdfName = UBPersistenceManager::objectDirectory + "/" + pdfItem->fileUuid().toString() + ".pdf"; QString backgroundPath = pDocumentProxy->persistencePath() + "/" + pdfName; + QRectF annotationsRect = scene->itemsBoundingRect(); + + // Original datas + double xAnnotation = qRound(annotationsRect.x()); + double yAnnotation = qRound(annotationsRect.y()); + double xPdf = qRound(pdfItem->sceneBoundingRect().x()); + double yPdf = qRound(pdfItem->sceneBoundingRect().y()); + double hPdf = qRound(pdfItem->sceneBoundingRect().height()); + + // Exportation-transformed datas + double hScaleFactor = pageSize.width()/scene->itemsBoundingRect().width(); + double vScaleFactor = pageSize.height()/scene->itemsBoundingRect().height(); + double scaleFactor = qMin(hScaleFactor, vScaleFactor); + + double xAnnotationsOffset = 0; + double yAnnotationsOffset = 0; + double hPdfTransformed = qRound(hPdf * scaleFactor); + + // Here, we force the PDF page to be on the topleft corner of the page + double xPdfOffset = 0; + double yPdfOffset = (hPdf - hPdfTransformed) * mScaleFactor; + + // Now we align the items + xPdfOffset += (xPdf - xAnnotation) * scaleFactor * mScaleFactor; + yPdfOffset -= (yPdf - yAnnotation) * scaleFactor * mScaleFactor; - qDebug() << "scene->itemsBoundingRect()" << scene->itemsBoundingRect(); - qDebug() << "pdfItem->boundingRect()" << pdfItem->boundingRect(); - qDebug() << "pdfItem->sceneBoundingRect()" << pdfItem->sceneBoundingRect(); + TransformationDescription pdfTransform(xPdfOffset, yPdfOffset, scaleFactor, 0); + TransformationDescription annotationTransform(xAnnotationsOffset, yAnnotationsOffset, 1, 0); MergePageDescription pageDescription(pageSize.width() * mScaleFactor, pageSize.height() * mScaleFactor, pdfItem->pageNumber(), QFile::encodeName(backgroundPath).constData(), - TransformationDescription(), + pdfTransform, pageIndex + 1, - TransformationDescription(), + annotationTransform, false, false); mergeInfo.push_back(pageDescription);