fixed and well worked widgets

preferencesAboutTextFull
unknown 13 years ago
parent b4cd1d1655
commit 4505f7dbed
  1. 4
      resources/library/interactivities/associer_images.wgt/index.html
  2. 17
      resources/library/interactivities/associer_images.wgt/js/script.js
  3. 4
      resources/library/interactivities/associer_images.wgt/locales/fr/index.html
  4. 22
      resources/library/interactivities/associer_images.wgt/locales/fr/js/script.js
  5. 4
      resources/library/interactivities/associer_images.wgt/locales/ru/index.html
  6. 17
      resources/library/interactivities/associer_images.wgt/locales/ru/js/script.js

@ -14,8 +14,10 @@
lang = sankore.locale().substr(0,2); lang = sankore.locale().substr(0,2);
} else } else
lang = "en"; lang = "en";
if(lang == "en") if(lang == "en"){
sankore.enableDropOnWidget(false);
start(); start();
}
else{ else{
returnStatus(lang); returnStatus(lang);
} }

@ -2,7 +2,8 @@ var sankoreLang = {
display: "Display", display: "Display",
edit: "Edit", edit: "Edit",
short_desc: "Select the number \"three\".", short_desc: "Select the number \"three\".",
add: "Add new block" add: "Add new block",
enter: "Enter your condition here ..."
}; };
//main function //main function
@ -22,15 +23,16 @@ function start(){
else else
showExample(); showExample();
//events //events
$("body").live("mouseout",function(){ if (window.widget) {
if(event.target.tagName == "BODY") window.widget.onleave = function(){
if(window.sankore) exportData();
exportData(); }
}) }
$("#display, #edit").click(function(event){ $("#display, #edit").click(function(event){
if(this.id == "display"){ if(this.id == "display"){
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
sankore.enableDropOnWidget(false);
$(this).addClass("selected"); $(this).addClass("selected");
$("#display_img").removeClass("red_point").addClass("green_point"); $("#display_img").removeClass("red_point").addClass("green_point");
$("#edit_img").removeClass("green_point").addClass("red_point"); $("#edit_img").removeClass("green_point").addClass("red_point");
@ -131,6 +133,7 @@ function start(){
} }
} else { } else {
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
sankore.enableDropOnWidget(true);
$(this).addClass("selected"); $(this).addClass("selected");
$("#edit_img").removeClass("red_point").addClass("green_point"); $("#edit_img").removeClass("red_point").addClass("green_point");
$("#display_img").removeClass("green_point").addClass("red_point"); $("#display_img").removeClass("green_point").addClass("red_point");
@ -567,7 +570,7 @@ function addContainer(){
var close = $("<div class='close_cont'>").appendTo(container); var close = $("<div class='close_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container); var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container);
var text = $("<div class='text_cont' contenteditable>Enter your condition here ... </div>").appendTo(sub_container); var text = $("<div class='text_cont' contenteditable>" + sankoreLang.enter + "</div>").appendTo(sub_container);
$("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container); $("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container);
var add_img = $("<div class='add_img'>").appendTo(imgs_container); var add_img = $("<div class='add_img'>").appendTo(imgs_container);

@ -9,10 +9,8 @@
<script type="text/javascript" src="js/script.js"></script> <script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
sankore.enableDropOnWidget(false);
start(); start();
//here you can put your code
if(window.sankore)
sankore.enableDropOnWidget();
}); });
</script> </script>
</head> </head>

@ -1,4 +1,10 @@
var sankoreLang = {display: "D'affichage", edit: "Modifier", short_desc: "Sélectionner le numéro «trois».", add: "Nouveau bloc"}; var sankoreLang = {
display: "D'affichage",
edit: "Modifier",
short_desc: "Sélectionner le numéro «trois».",
add: "Nouveau bloc",
enter: "Entrez votre état ici ..."
};
//main function //main function
function start(){ function start(){
@ -17,15 +23,16 @@ function start(){
else else
showExample(); showExample();
//events //events
$("body").live("mouseout",function(){ if (window.widget) {
if(event.target.tagName == "BODY") window.widget.onleave = function(){
if(window.sankore) exportData();
exportData(); }
}) }
$("#display, #edit").click(function(event){ $("#display, #edit").click(function(event){
if(this.id == "display"){ if(this.id == "display"){
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
sankore.enableDropOnWidget(false);
$(this).addClass("selected"); $(this).addClass("selected");
$("#display_img").removeClass("red_point").addClass("green_point"); $("#display_img").removeClass("red_point").addClass("green_point");
$("#edit_img").removeClass("green_point").addClass("red_point"); $("#edit_img").removeClass("green_point").addClass("red_point");
@ -126,6 +133,7 @@ function start(){
} }
} else { } else {
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
sankore.enableDropOnWidget(true);
$(this).addClass("selected"); $(this).addClass("selected");
$("#edit_img").removeClass("red_point").addClass("green_point"); $("#edit_img").removeClass("red_point").addClass("green_point");
$("#display_img").removeClass("green_point").addClass("red_point"); $("#display_img").removeClass("green_point").addClass("red_point");
@ -562,7 +570,7 @@ function addContainer(){
var close = $("<div class='close_cont'>").appendTo(container); var close = $("<div class='close_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container); var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container);
var text = $("<div class='text_cont' contenteditable>Enter your condition here ... </div>").appendTo(sub_container); var text = $("<div class='text_cont' contenteditable>" + sankoreLang.enter + "</div>").appendTo(sub_container);
$("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container); $("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container);
var add_img = $("<div class='add_img'>").appendTo(imgs_container); var add_img = $("<div class='add_img'>").appendTo(imgs_container);

@ -9,10 +9,8 @@
<script type="text/javascript" src="js/script.js"></script> <script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
sankore.enableDropOnWidget(false);
start(); start();
//here you can put your code
if(window.sankore)
sankore.enableDropOnWidget();
}); });
</script> </script>
</head> </head>

@ -2,7 +2,8 @@ var sankoreLang = {
display: "Показать", display: "Показать",
edit: "Изменить", edit: "Изменить",
short_desc: "Выберите число \"три\".", short_desc: "Выберите число \"три\".",
add: "Новый блок" add: "Новый блок",
enter: "Введите условие ..."
}; };
//main function //main function
@ -22,15 +23,16 @@ function start(){
else else
showExample(); showExample();
//events //events
$("body").live("mouseout",function(){ if (window.widget) {
if(event.target.tagName == "BODY") window.widget.onleave = function(){
if(window.sankore) exportData();
exportData(); }
}) }
$("#display, #edit").click(function(event){ $("#display, #edit").click(function(event){
if(this.id == "display"){ if(this.id == "display"){
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
sankore.enableDropOnWidget(false);
$(this).addClass("selected"); $(this).addClass("selected");
$("#display_img").removeClass("red_point").addClass("green_point"); $("#display_img").removeClass("red_point").addClass("green_point");
$("#edit_img").removeClass("green_point").addClass("red_point"); $("#edit_img").removeClass("green_point").addClass("red_point");
@ -131,6 +133,7 @@ function start(){
} }
} else { } else {
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
sankore.enableDropOnWidget(true);
$(this).addClass("selected"); $(this).addClass("selected");
$("#edit_img").removeClass("red_point").addClass("green_point"); $("#edit_img").removeClass("red_point").addClass("green_point");
$("#display_img").removeClass("green_point").addClass("red_point"); $("#display_img").removeClass("green_point").addClass("red_point");
@ -567,7 +570,7 @@ function addContainer(){
var close = $("<div class='close_cont'>").appendTo(container); var close = $("<div class='close_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container); var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container);
var text = $("<div class='text_cont' contenteditable>Enter your condition here ... </div>").appendTo(sub_container); var text = $("<div class='text_cont' contenteditable>" + sankoreLang.enter + "</div>").appendTo(sub_container);
$("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container); $("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container);
var add_img = $("<div class='add_img'>").appendTo(imgs_container); var add_img = $("<div class='add_img'>").appendTo(imgs_container);

Loading…
Cancel
Save