From 40210796b201b42f5c517de1e2f0ac86b7563458 Mon Sep 17 00:00:00 2001 From: maximXbs Date: Thu, 11 Oct 2012 14:44:24 +0200 Subject: [PATCH] fixed Sankre-867 issue (some troubles with sound) --- .../Ordre lettres.wgt/js/script.js | 35 ++++++++-------- .../Ordre lettres.wgt/locales/fr/js/script.js | 42 +++++++++---------- .../Ordre lettres.wgt/locales/ru/js/script.js | 42 +++++++++---------- 3 files changed, 60 insertions(+), 59 deletions(-) diff --git a/resources/library/interactivities/Ordre lettres.wgt/js/script.js b/resources/library/interactivities/Ordre lettres.wgt/js/script.js index 045fca0a..9335dbab 100644 --- a/resources/library/interactivities/Ordre lettres.wgt/js/script.js +++ b/resources/library/interactivities/Ordre lettres.wgt/js/script.js @@ -31,8 +31,8 @@ function start(){ $("div.inline label").html(sankoreLang.theme + tmpl) if(window.sankore){ - if(sankore.preference("associer_sound","")){ - var data = jQuery.parseJSON(sankore.preference("associer_sound","")); + if(sankore.preference("ord_let","")){ + var data = jQuery.parseJSON(sankore.preference("ord_let","")); importData(data); } else @@ -263,15 +263,17 @@ function exportData(){ array_to_export.push(cont_obj); }); } - if(window.sankore) - sankore.setPreference("associer_sound", JSON.stringify(array_to_export)); + if(window.sankore){ + sankore.setPreference("ord_let", JSON.stringify(array_to_export)); + sankore.setPreference("ord_let_locale", "en"); + } if($("#wgt_display").hasClass("selected")){ if(window.sankore) - sankore.setPreference("associer_sound_state", "display"); + sankore.setPreference("ord_let_state", "display"); } else{ if(window.sankore) - sankore.setPreference("associer_sound_state", "edit"); + sankore.setPreference("ord_let_state", "edit"); } } @@ -308,8 +310,8 @@ function importData(data){ tmp_array.push(tmp_letter); } - if(sankore.preference("associer_sound_state","")){ - if(sankore.preference("associer_sound_state","") == "edit") + if(sankore.preference("ord_let_state","")){ + if(sankore.preference("ord_let_state","") == "edit") tmp_array = shuffle(tmp_array); } else tmp_array = shuffle(tmp_array); @@ -365,12 +367,12 @@ function addContainer(){ var sub_container = $("
").appendTo(container); $("
"+ ($(".cont").size() + 1) +"
").appendTo(sub_container); - var text = $("
").appendTo(sub_container); - text.attr("ondragenter", "return false;") - .attr("ondragleave", "$(this).removeClass('gray'); return false;") - .attr("ondragover", "$(this).addClass('gray'); return false;") - .attr("ondrop", "$(this).removeClass('gray'); return onDropAudio(this,event);"); + var text = $("
").appendTo(sub_container); var audio_block = $("
").appendTo(text); + audio_block.attr("ondragenter", "return false;") + .attr("ondragleave", "$(this).removeClass('audio_gray'); return false;") + .attr("ondragover", "$(this).addClass('audio_gray'); return false;") + .attr("ondrop", "$(this).removeClass('audio_gray'); return onDropAudio(this,event);"); $("
").appendTo(audio_block); $("
").appendTo(audio_block); var source = $("").attr("src", ""); @@ -505,12 +507,11 @@ function onDropAudio(obj, event) { var tmp = textData.getElementsByTagName("path")[0].firstChild.textContent; var tmp_type = textData.getElementsByTagName("type")[0].firstChild.textContent; if(tmp_type.substr(0, 5) == "audio"){ - var audio_block = $(obj).find(".audio_block"); $(obj).find("audio").remove(); - audio_block.find(":first-child").removeClass("stop").addClass("play"); + $(obj).find(":first-child").removeClass("stop").addClass("play"); var source = $("").attr("src", tmp); - var audio = $("