fixed insert image problem in text for widget

This commit is contained in:
Harry Bomrah 2014-09-16 22:28:48 +08:00
parent 55483420cb
commit b94f3ca2a1
1 changed files with 9 additions and 0 deletions

View File

@ -42,6 +42,14 @@ $(document).ready(function(){
language = t[t.length-1];
language = (language == "tw" ? "zh_tw" : language);
language = decodeURIComponent(language);
if(language.endsWith("]")){
var re = ("\\[(.*)]"),
matches = language.match(re);
if(matches){
language = matches[1];
}
}
})
@ -69,6 +77,7 @@ var initAssets = function(){
deleteBtn.hide();
})
insertBtn.bind(clickEvent,function(){
console.log(language);
var alt_text = $("#"+language+"_desc_"+$("input[type=checkbox]:checked").val()).val();
alt_text = (alt_text ? alt_text : "This is an image");
if(url){