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