Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.sub_view').bind('DOMSubtreeModified', function()
- {
- var cl = $('.comment p.ng-binding');
- var pat = /^(?:ht|f)tps?:\/\/.*?\s/mi;
- for (var i = 0; i < cl.length; i++)
- {
- if (pat.exec(cl[i].textContent))
- {
- console.log($(cl[i]));
- $(cl[i]).parent().parent().children('.photo').children('img')[0].src = pat.exec(cl[i].textContent)[0];
- cl[i].textContent = cl[i].textContent.replace(pat, '');
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement