Jump to content

How to know image url when paste it in wysiwyg bb editor?


webster

Recommended Posts

Hello,

 

 

When I select and copy an image from a web-page into the bb rich-text editor, the image doesn't appear,

I checked the source

 

Imge Sorce

<img style="max-width: 600px; cursor: pointer;" onclick="window.open(this.src)"  src="images/smilies/smile.png" border="0" alt="" title="" class="inlineimg" />

 

I found it is saved in the post like.

http://mydomain.com/images/smilies/smile.png[/code]

 

This image is not in my website.

 

Can you please modify this code to make the image bb code be like:

http://somewebsite.com/images/smilies/smile.png[/code]

 


else if (g == "img") {
                        if (isWebKit) {
                            f = f.replace(/<img(.*?)src="(.*?)">/gi, "[img=http://$2]");
                        } else {
                            f.match(/<img(.*?)src="(.*?)"(.*?)>/gi);
                            var s = RegExp.$2;
                            s = s.replace("./", "");
                            if (s.toLowerCase().substr(0, 7) != "http://") {
                                var t = document.URL;
                                t = t.replace("http://", "");
                                var u = t.split("/");
                                var v = "http://";
                                for (var d = 0; d < u.length; d++) {
                                    if (d < u.length - 1) {
                                        v += u[d] + "/";
                                    }
                                }
                                f = f.replace(/\<img(.*?)src="(.*?)"(.*?)>/gi, "[img=http://" + v + s + "]");
                            } else {
                                f = f.replace(/<img(.*?)src="(.*?)"(.*?)>/gi, "[img=http://$2]");
                            }
                        }

 

 

Regards,

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.