Skip to content

Instantly share code, notes, and snippets.

@mdogadailo
Last active December 14, 2015 00:09
Show Gist options
  • Save mdogadailo/4996913 to your computer and use it in GitHub Desktop.
Save mdogadailo/4996913 to your computer and use it in GitHub Desktop.
Automatic build elements and variant
javascript:if(console.clear){console.clear();}all={},j=0;$(".edit-delet-links a:contains('edit')").each(function(){var e,t,n;e=this.href.split("/");t=e[e.length-1];n=$(this).parents(".content-element-block").find('.edit-cell-wrap input[type="radio"]');all[t]=[];n.each(function(){all[t].push(this.value)})});config_str='<property name="maxyBox">\n <map>';proper_str="";for(i in all){j++;config_str+='\n <entry key="Box'+j+'" value="'+i+'" />';proper_str+='<property name="ListOfVar'+j+'" value="'+all[i].join(",")+'"/>\n'}config_str+="\n </map>\n</property>";/*console.log(config_str+proper_str);*/ $('body').append('<div id="code_block" style="width: 500px;height: 200px;position: absolute;left: 10px;top: 10px;padding: 10px;background: #FFF;border-radius: 10px;z-index: 10000000000;"><textarea id="code" style="height: 190px;border: 1px solid #000;width: 490px;"></textarea></div>');$('#code').html(config_str+proper_str);void(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment