Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Aleksei Kanash 13 years ago
commit 4d00fc55e0
  1. 32
      resources/library/interactivities/Etudier.wgt/css/basic.css
  2. 2
      resources/library/interactivities/Etudier.wgt/index.html
  3. 67
      resources/library/interactivities/Etudier.wgt/js/script.js
  4. 2
      resources/library/interactivities/Etudier.wgt/locales/fr/index.html
  5. 67
      resources/library/interactivities/Etudier.wgt/locales/fr/js/script.js
  6. 2
      resources/library/interactivities/Etudier.wgt/locales/ru/index.html
  7. 67
      resources/library/interactivities/Etudier.wgt/locales/ru/js/script.js
  8. 4
      src/board/UBDrawingController.h
  9. 14
      src/domain/UBGraphicsScene.cpp
  10. 1
      src/gui/UBActionPalette.cpp
  11. 1
      src/gui/UBActionPalette.h
  12. 41
      src/gui/UBTeacherGuideWidget.cpp
  13. 5
      src/gui/UBTeacherGuideWidget.h

@ -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;
@ -480,3 +478,27 @@ li>div{
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{
}

@ -49,6 +49,7 @@
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
@ -63,6 +64,7 @@
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="slider">
<ul>
</ul>

@ -7,7 +7,9 @@ var sankoreLang = {
wgt_name: "Slider",
slate: "Wood",
pad: "Pad",
none: "None"
none: "None",
help: "Help",
help_content: "This is an example of help content ..."
};
//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,6 +54,7 @@ function start(){
//events
if (window.widget) {
window.widget.onleave = function(){
if(!$("#wgt_help").hasClass("open")){
exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
@ -57,11 +62,30 @@ function start(){
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
}
}
}
$(".style_select").change(function (event){
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(){
$("<div class='add_right'>").appendTo(container);
$("<div class='close_slide'>").appendTo(container);
$("<div class='add_text'>").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).height("");
} 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 = $("<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 = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").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 = $("<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 = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").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 = $("<div class='text_block'><div class='real_text'>" + data[i].text[j].val + "</div></div>");
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)
@ -525,7 +554,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");
@ -541,7 +570,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");
@ -557,7 +586,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");
@ -580,7 +609,7 @@ function onDropTarget(obj, event) {
var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent;
if(tmp_type.substr(0, 5) == "audio"){
var audio_block = $("<div class='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);
$("<div class='close_img' contenteditable='false'>").appendTo(audio_block);
audio_block.addClass("block_border");
$("<div class='play'>").appendTo(audio_block);
@ -590,7 +619,7 @@ function onDropTarget(obj, event) {
audio.append(source);
} else {
var img_block = $("<div class='img_block' style='text-align: center;'></div>").appendTo($(obj));
img_block.css("top",event.clientY).css("left",event.clientX);
img_block.css("top",event.clientY - 54).css("left",event.clientX - 54);
$("<div class='move_block' contenteditable='false'>").appendTo(img_block);
$("<div class='close_img' contenteditable='false'>").appendTo(img_block);
$("<div class='resize_block' contenteditable='false'>").appendTo(img_block);

@ -23,6 +23,7 @@
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
@ -37,6 +38,7 @@
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="slider">
<ul>
</ul>

@ -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,6 +54,7 @@ function start(){
//events
if (window.widget) {
window.widget.onleave = function(){
if(!$("#wgt_help").hasClass("open")){
exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
@ -57,11 +62,30 @@ function start(){
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
}
}
}
$(".style_select").change(function (event){
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(){
$("<div class='add_right'>").appendTo(container);
$("<div class='close_slide'>").appendTo(container);
$("<div class='add_text'>").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 = $("<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 = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").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 = $("<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 = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").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 = $("<div class='text_block'><div class='real_text'>" + data[i].text[j].val + "</div></div>");
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 = $("<div class='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);
$("<div class='close_img' contenteditable='false'>").appendTo(audio_block);
audio_block.addClass("block_border");
$("<div class='play'>").appendTo(audio_block);
@ -591,7 +620,7 @@ function onDropTarget(obj, event) {
audio.append(source);
} else {
var img_block = $("<div class='img_block' style='text-align: center;'></div>").appendTo($(obj));
img_block.css("top",event.clientY).css("left",event.clientX);
img_block.css("top",event.clientY - 54).css("left",event.clientX - 54);
$("<div class='move_block' contenteditable='false'>").appendTo(img_block);
$("<div class='close_img' contenteditable='false'>").appendTo(img_block);
$("<div class='resize_block' contenteditable='false'>").appendTo(img_block);

@ -23,6 +23,7 @@
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
@ -37,6 +38,7 @@
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="slider">
<ul>
</ul>

@ -7,7 +7,9 @@ var sankoreLang = {
wgt_name: "Слайдер",
slate: "Узор",
pad: "Планшет",
none: "Нет"
none: "Нет",
help: "Помощь",
help_content: "Пример текста помощи ..."
};
//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,6 +54,7 @@ function start(){
//events
if (window.widget) {
window.widget.onleave = function(){
if(!$("#wgt_help").hasClass("open")){
exportData();
sankore.setPreference("etudier_style", $(".style_select").find("option:selected").val());
sankore.setPreference("etudier_cur_page", $("#slider").getPage());
@ -57,11 +62,30 @@ function start(){
sankore.setPreference("etudier_right_nav", $("#nextBtn a").css("display"));
}
}
}
$(".style_select").change(function (event){
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")){
@ -123,9 +147,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");
@ -154,6 +178,7 @@ function start(){
$("<div class='add_right'>").appendTo(container);
$("<div class='close_slide'>").appendTo(container);
$("<div class='add_text'>").appendTo(container);
$(window).trigger("resize")
});
$(this).css("display", "none");
$("#wgt_display").css("display", "block");
@ -264,13 +289,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).height("");
} 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;
@ -294,12 +319,15 @@ function start(){
new_li.width(cur_li.width()).height(cur_li.height()).css("float","left");
var new_div = $("<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 = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").appendTo(example);
example.css("top","40%").css("left","40%");
new_div.append(example);
@ -317,12 +345,15 @@ function start(){
new_li.width(cur_li.width()).height(cur_li.height()).css("float","left");
var new_div = $("<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 = $("<div class='text_block' contenteditable='true'>" + sankoreLang.new_slide + "</div>").addClass("block_border");
.attr("ondrop", "$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);");
var example = $("<div class='text_block' style='position: absolute;'>").addClass("block_border");
$("<div class='real_text' contenteditable='true'>" + sankoreLang.new_slide + "</div>").appendTo(example);
$("<div class='move_block' contenteditable='false'>").appendTo(example);
$("<div class='close_img' contenteditable='false'>").appendTo(example);
$("<div class='size_up' contenteditable='false'>").appendTo(example);
$("<div class='size_down' contenteditable='false'>").appendTo(example);
$("<div class='resize_block' contenteditable='false'>").appendTo(example);
example.css("top","40%").css("left","40%");
new_div.append(example);
@ -358,7 +389,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).text();
@ -406,7 +436,6 @@ function importData(data){
var text_div = $("<div class='text_block'>" + data[i].text[j].val + "</div>");
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)
@ -524,7 +553,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");
@ -540,7 +569,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");
@ -556,7 +585,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");
@ -579,7 +608,7 @@ function onDropTarget(obj, event) {
var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent;
if(tmp_type.substr(0, 5) == "audio"){
var audio_block = $("<div class='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);
$("<div class='close_img' contenteditable='false'>").appendTo(audio_block);
audio_block.addClass("block_border");
$("<div class='play'>").appendTo(audio_block);
@ -589,7 +618,7 @@ function onDropTarget(obj, event) {
audio.append(source);
} else {
var img_block = $("<div class='img_block' style='text-align: center;'></div>").appendTo($(obj));
img_block.css("top",event.clientY).css("left",event.clientX);
img_block.css("top",event.clientY - 54).css("left",event.clientX - 54);
$("<div class='move_block' contenteditable='false'>").appendTo(img_block);
$("<div class='close_img' contenteditable='false'>").appendTo(img_block);
$("<div class='resize_block' contenteditable='false'>").appendTo(img_block);

@ -65,6 +65,10 @@ class UBDrawingController : public QObject
mIsDesktopMode = mode;
}
bool isInDesktopMode(){
return mIsDesktopMode;
}
public slots:
void setStylusTool(int tool);

@ -779,7 +779,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
if (mShouldUseOMP)
{
//#pragma omp parallel for
#pragma omp parallel for
for (int i = 0; i < collidItemsSize; i++)
{
UBGraphicsPolygonItem *collidingPolygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*>(collidItems.at(i));
@ -789,7 +789,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
if(eraserInnerRect.contains(collidingPolygonItem->boundingRect()))
{
//#pragma omp critical
#pragma omp critical
// Put the entire polygon into the remove list
toBeRemovedItems << collidingPolygonItem;
}
@ -826,7 +826,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
}
else */if (croppedPathSimplified.isEmpty())
{
//#pragma omp critical
#pragma omp critical
// Put the entire polygon into the remove list if the eraser removes all its visible content
toBeRemovedItems << collidingPolygonItem;
}
@ -837,7 +837,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
foreach(const QPolygonF &pol, croppedPathSimplified.toFillPolygons())
{
UBGraphicsPolygonItem* croppedPolygonItem = collidingPolygonItem->deepCopy(pol);
//#pragma omp critical
#pragma omp critical
if(NULL != pGroup){
croppedPolygonItem->setStrokesGroup(pGroup);
//pGroup->addToGroup(croppedPolygonItem);
@ -845,7 +845,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
// Add this new polygon to the 'added' list
toBeAddedItems << croppedPolygonItem;
}
//#pragma omp critical
#pragma omp critical
// Remove the original polygonitem because it has been replaced by many smaller polygons
toBeRemovedItems << collidingPolygonItem;
}
@ -902,7 +902,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
}
}
if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){
if(eDrawingMode_Vector == DRAWING_MODE && !UBDrawingController::drawingController()->isInDesktopMode()){
foreach(QGraphicsItem* item, toBeRemovedItems){
UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item);
if(NULL != poly){
@ -920,7 +920,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
mRemovedItems += toBeRemovedItems;
}
if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){
if(eDrawingMode_Vector == DRAWING_MODE && !UBDrawingController::drawingController()->isInDesktopMode()){
foreach(QGraphicsItem* item, toBeAddedItems){
UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item);
if(NULL != poly && NULL != poly->strokesGroup()){

@ -231,7 +231,6 @@ void UBActionPalette::mouseReleaseEvent(QMouseEvent * event)
void UBActionPalette::actionChanged()
{
emit itemOnActionPaletteChanged();
for(int i = 0; i < mActions.length() && i < mButtons.length(); i++)
{
mButtons.at(i)->setVisible(mActions.at(i)->isVisible());

@ -61,7 +61,6 @@ class UBActionPalette : public UBFloatingPalette
void closed();
void buttonGroupClicked(int id);
void customMouseReleased();
void itemOnActionPaletteChanged();
protected:
virtual void paintEvent(QPaintEvent *event);

@ -1100,6 +1100,7 @@ UBTeacherGuideWidget::UBTeacherGuideWidget(QWidget* parent, const char* name) :
, mpPageZeroWidget(NULL)
, mpEditionWidget(NULL)
, mpPresentationWidget(NULL)
, mKeyboardActionFired(false)
{
setObjectName(name);
if (UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool()) {
@ -1113,11 +1114,9 @@ UBTeacherGuideWidget::UBTeacherGuideWidget(QWidget* parent, const char* name) :
addWidget(mpPresentationWidget);
}
connect(UBApplication::boardController->controlView(),
SIGNAL(clickOnBoard()), this, SLOT(showPresentationMode()));
connect(UBApplication::boardController->controlView(), SIGNAL(clickOnBoard()), this, SLOT(showPresentationMode()));
connectToStylusPalette();
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this,
SLOT(onActiveSceneChanged()));
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
}
UBTeacherGuideWidget::~UBTeacherGuideWidget()
@ -1138,12 +1137,38 @@ void UBTeacherGuideWidget::onActiveSceneChanged()
}
#include "core/UBApplication.h"
#include "gui/UBMainWindow.h"
void UBTeacherGuideWidget::onTriggeredAction(bool checked)
{
Q_UNUSED(checked);
if(!mKeyboardActionFired)
showPresentationMode();
mKeyboardActionFired=false;
}
void UBTeacherGuideWidget::onTriggeredKeyboardAction(bool checked)
{
Q_UNUSED(checked);
mKeyboardActionFired = true;
}
void UBTeacherGuideWidget::connectToStylusPalette()
{
if (UBApplication::boardController->paletteManager())
connect( UBApplication::boardController->paletteManager()->stylusPalette(), SIGNAL(itemOnActionPaletteChanged()), this, SLOT(showPresentationMode()));
else
QTimer::singleShot(100, this, SLOT(connectToStylusPalette()));
connect(UBApplication::mainWindow->actionPen, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionEraser, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionMarker, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPlay, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomIn, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomOut, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionCapture, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionHand, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionLine, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionText, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(onTriggeredKeyboardAction(bool)));
}
void UBTeacherGuideWidget::showPresentationMode()

@ -214,6 +214,11 @@ private:
UBTeacherGuideEditionWidget* mpEditionWidget;
UBTeacherGuidePresentationWidget* mpPresentationWidget;
QVector<tUBGEElementNode*>mCurrentData;
bool mKeyboardActionFired;
private slots:
void onTriggeredAction(bool checked);
void onTriggeredKeyboardAction(bool checked);
};
#endif // UBTEACHERGUIDEWIDGET_H

Loading…
Cancel
Save