views : {list:[], isList: false},
blankstart : {list:[], isList: false},
}
+ function replaceNbsp(str) {
+ var re = new RegExp(String.fromCharCode(160), "g");
+ return str.replace(re, " ");
+ }
function generateShortCodeAttribute(state){
var attribute = $("<div />", {
text : state.attribute,
attribute.attr("data-"+state.type, state.id);
attribute.attr("data-type", state.type);
$("#"+state.type+"-string").empty();
- attribute.prepend( $("<span class='shortcode-space'>").html(" "));
+ attribute.prepend( $("<span class='shortcode-space'>").html(" "));
$("#"+state.type+"-string").html(attribute);
}
function createShortcodeTile(state, elHook){
if( $(this).attr("id") == "copy-to-clipboard" ){
var tempInput = document.createElement("input");
tempInput.style = "position: absolute; left: -1000px; top: -1000px";
- tempInput.value = $("#shortcode-preview").text();
+ tempInput.value = replaceNbsp($("#shortcode-preview").text());
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
+ $("#shortcode-no-space").children("span.shortcode-space").remove();
}else{
setupAttributes();
}