fixed 'ass sons' widget

preferencesAboutTextFull
unknown 13 years ago
parent f7a5176c18
commit 5cb41fcd4d
  1. 11
      resources/nonDistributedWidgets/Ass sons.wgt/css/basic.css
  2. 26
      resources/nonDistributedWidgets/Ass sons.wgt/js/script.js
  3. 23
      resources/nonDistributedWidgets/Ass sons.wgt/locales/fr/js/script.js
  4. 27
      resources/nonDistributedWidgets/Ass sons.wgt/locales/ru/js/script.js

@ -111,7 +111,6 @@ body{
background-color: #999;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
padding-left: 10px;
}
.close_cont{
@ -142,7 +141,6 @@ body{
cursor: pointer;
display: inline-block;
position: relative;
background-color: white;
}
.img_gray{
@ -201,8 +199,15 @@ body{
.audio_block{
width: 120px;
height: 30px;
margin: 5px 0;
padding: 5px 0 5px 10px;
float: left;
border-right: 3px solid white;
}
.audio_gray{
border-top-left-radius: 15px;
border-bottom-left-radius: 15px;
background-color: white;
}
.audio_desc{

@ -45,7 +45,16 @@ function start(){
}
$("#wgt_reload").click(function(){
window.location.reload();
if($("#wgt_display").hasClass("selected")){
$("#wgt_edit").trigger("click");
$("#wgt_display").trigger("click");
} else {
$("#wgt_display").trigger("click");
}
});
$("#wgt_reload, #wgt_display, #wgt_edit").mouseover(function(){
exportData();
});
$(".style_select").change(function (event){
@ -67,7 +76,7 @@ function start(){
var tmp_array = [];
container.find(".text_cont .audio_desc").removeAttr("contenteditable");
container.find(".text_cont").removeAttr("ondragenter")
container.find(".audio_block").removeAttr("ondragenter")
.removeAttr("ondragleave")
.removeAttr("ondragover")
.removeAttr("ondrop")
@ -176,10 +185,10 @@ function start(){
$("<div class='close_cont'>").appendTo(container);
container.find(".imgs_cont").css("background-color", "");
container.find(".text_cont .audio_desc").attr("contenteditable","true");
container.find(".text_cont").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);");
container.find(".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);");
var add_img = $("<div class='add_img'>");
container.find(".img_block").each(function(){
$(this).draggable("destroy");
@ -689,7 +698,7 @@ function addContainer(){
//add new img block
function addImgBlock(dest){
var img_block = $("<div class='img_block img_gray' ondragenter='return false;' ondragleave='$(this).css(\"background-color\",\"white\"); return false;' ondragover='$(this).css(\"background-color\",\"#ccc\"); return false;' ondrop='$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);' style='text-align: center; float: left;'></div>").insertBefore(dest);
var img_block = $("<div class='img_block img_gray' ondragenter='return false;' ondragleave='$(this).css(\"background-color\",\"\"); return false;' ondragover='$(this).css(\"background-color\",\"#ccc\"); return false;' ondrop='$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);' style='text-align: center; float: left;'></div>").insertBefore(dest);
$("<div class='close_img'>").appendTo(img_block);
$("<div class='true_img'>").appendTo(img_block);
$("<input type='hidden' value='0'/>").appendTo(img_block);
@ -774,7 +783,6 @@ function onDropTarget(obj, event) {
}
textData = stringToXML(textData);
var tmp = textData.getElementsByTagName("path")[0].firstChild.textContent;
tmp = tmp.substr(1, tmp.length);
var tmp_img = $("<img/>").attr("src", tmp);
$(obj).append(tmp_img);
setTimeout(function(){
@ -810,7 +818,7 @@ 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");
var audio_block = $(obj);
$(obj).find("audio").remove();
audio_block.find(":first-child").removeClass("stop").addClass("play");
var source = $("<source/>").attr("src", tmp);

@ -44,7 +44,16 @@ function start(){
}
$("#wgt_reload").click(function(){
window.location.reload();
if($("#wgt_display").hasClass("selected")){
$("#wgt_edit").trigger("click");
$("#wgt_display").trigger("click");
} else {
$("#wgt_display").trigger("click");
}
});
$("#wgt_reload, #wgt_display, #wgt_edit").mouseover(function(){
exportData();
});
$(".style_select").change(function (event){
@ -66,7 +75,7 @@ function start(){
var tmp_array = [];
container.find(".text_cont .audio_desc").removeAttr("contenteditable");
container.find(".text_cont").removeAttr("ondragenter")
container.find(".audio_block").removeAttr("ondragenter")
.removeAttr("ondragleave")
.removeAttr("ondragover")
.removeAttr("ondrop")
@ -175,10 +184,10 @@ function start(){
$("<div class='close_cont'>").appendTo(container);
container.find(".imgs_cont").css("background-color", "");
container.find(".text_cont .audio_desc").attr("contenteditable","true");
container.find(".text_cont").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);");
container.find(".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);");
var add_img = $("<div class='add_img'>");
container.find(".img_block").each(function(){
$(this).draggable("destroy");
@ -674,7 +683,7 @@ function addContainer(){
//add new img block
function addImgBlock(dest){
var img_block = $("<div class='img_block img_gray' ondragenter='return false;' ondragleave='$(this).css(\"background-color\",\"white\"); return false;' ondragover='$(this).css(\"background-color\",\"#ccc\"); return false;' ondrop='$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);' style='text-align: center; float: left;'></div>").insertBefore(dest);
var img_block = $("<div class='img_block img_gray' ondragenter='return false;' ondragleave='$(this).css(\"background-color\",\"\"); return false;' ondragover='$(this).css(\"background-color\",\"#ccc\"); return false;' ondrop='$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);' style='text-align: center; float: left;'></div>").insertBefore(dest);
$("<div class='close_img'>").appendTo(img_block);
$("<div class='true_img'>").appendTo(img_block);
$("<input type='hidden' value='0'/>").appendTo(img_block);

@ -9,7 +9,6 @@ var sankoreLang = {
slate: "Узор",
pad: "Планшет"
};
//main function
function start(){
@ -45,7 +44,16 @@ function start(){
}
$("#wgt_reload").click(function(){
window.location.reload();
if($("#wgt_display").hasClass("selected")){
$("#wgt_edit").trigger("click");
$("#wgt_display").trigger("click");
} else {
$("#wgt_display").trigger("click");
}
});
$("#wgt_reload, #wgt_display, #wgt_edit").mouseover(function(){
exportData();
});
$(".style_select").change(function (event){
@ -67,7 +75,7 @@ function start(){
var tmp_array = [];
container.find(".text_cont .audio_desc").removeAttr("contenteditable");
container.find(".text_cont").removeAttr("ondragenter")
container.find(".audio_block").removeAttr("ondragenter")
.removeAttr("ondragleave")
.removeAttr("ondragover")
.removeAttr("ondrop")
@ -176,10 +184,10 @@ function start(){
$("<div class='close_cont'>").appendTo(container);
container.find(".imgs_cont").css("background-color", "");
container.find(".text_cont .audio_desc").attr("contenteditable","true");
container.find(".text_cont").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);");
container.find(".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);");
var add_img = $("<div class='add_img'>");
container.find(".img_block").each(function(){
$(this).draggable("destroy");
@ -675,7 +683,7 @@ function addContainer(){
//add new img block
function addImgBlock(dest){
var img_block = $("<div class='img_block img_gray' ondragenter='return false;' ondragleave='$(this).css(\"background-color\",\"white\"); return false;' ondragover='$(this).css(\"background-color\",\"#ccc\"); return false;' ondrop='$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);' style='text-align: center; float: left;'></div>").insertBefore(dest);
var img_block = $("<div class='img_block img_gray' ondragenter='return false;' ondragleave='$(this).css(\"background-color\",\"\"); return false;' ondragover='$(this).css(\"background-color\",\"#ccc\"); return false;' ondrop='$(this).css(\"background-color\",\"\"); return onDropTarget(this,event);' style='text-align: center; float: left;'></div>").insertBefore(dest);
$("<div class='close_img'>").appendTo(img_block);
$("<div class='true_img'>").appendTo(img_block);
$("<input type='hidden' value='0'/>").appendTo(img_block);
@ -760,7 +768,6 @@ function onDropTarget(obj, event) {
}
textData = stringToXML(textData);
var tmp = textData.getElementsByTagName("path")[0].firstChild.textContent;
tmp = tmp.substr(1, tmp.length);
var tmp_img = $("<img/>").attr("src","../../" + tmp);
$(obj).append(tmp_img);
setTimeout(function(){
@ -824,4 +831,4 @@ if (window.widget) {
$(this).parent().find(":first-child").removeClass("stop").addClass("play");
});
}
}
}

Loading…
Cancel
Save