Jump to content

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


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,

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.