+ \r
+ \r
+ var observer = new MutationObserver(function(mutations) {\r
+ mutations.forEach(function(mutation) {\r
+ if(mutation.addedNodes.length > 0) {\r
+ console.log(mutation.addedNodes);\r
+ }\r
+ _.each(mutation.addedNodes, function(node) {\r
+ node = $(node);\r
+ node.parent().find('[wlxml-tag]').each(function() {\r
+ tag = $(this);\r
+ if(!tag.attr('id'))\r
+ tag.attr('id', 'xxxxxxxx-xxxx-xxxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {var r = Math.random()*16|0,v=c=='x'?r:r&0x3|0x8;return v.toString(16);}));\r
+ });\r
+ });\r
+ }); \r
+ });\r
+ var config = { attributes: true, childList: true, characterData: true, subtree: true };\r
+ observer.observe(this.node.find('#rng-visualEditor-contentWrapper')[0], config);