Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Full Mozilla support for IPB (Read 6600 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Full Mozilla support for IPB

Hello Dibrom, JohnV or any IPB admin,

At this point, only IE users are able to mark text and apply formatting when creating or editing a post. If you would like to implement Mozilla support, too, replace the "doInsert" function of "/html/ibfcode.js" with this one (make a backup in case you screw it):

Code: [Select]
function doInsert(ibTag, ibClsTag, isSingle)
{
    var isClose = false;
    var obj_ta = document.REPLIER.Post;

    if ( (myVersion >= 4) && is_ie && is_win) // Ensure it works for IE4up / Win only
    {
 if(obj_ta.isTextEdit){ // this doesn't work for NS, but it works for IE 4+ and compatible browsers
     obj_ta.focus();
     var sel = document.selection;
     var rng = sel.createRange();
     rng.colapse;
     if((sel.type == "Text" || sel.type == "None") && rng != null){
   if(ibClsTag != "" && rng.text.length > 0)
       ibTag += rng.text + ibClsTag;
   else if(isSingle)
       isClose = true;
    
   rng.text = ibTag;
     }
 }
 else{
     if(isSingle)
   isClose = true;
    
     obj_ta.value += ibTag;
 }
    }    
    else if ( obj_ta.selectionEnd )
    {
 var ss = obj_ta.selectionStart;
 
 var es = obj_ta.selectionEnd;
 
 if (es <= 2)
 {
     es = obj_ta.textLength;
 }
 
 var start  = (obj_ta.value).substring(0, ss);
 var middle = (obj_ta.value).substring(ss, es);
 var end    = (obj_ta.value).substring(es, obj_ta.textLength);
 
 //-----------------------------------
 // text range?
 //-----------------------------------
 
 if (obj_ta.selectionEnd - obj_ta.selectionStart > 0)
 {
     middle = ibTag + middle + ibClsTag;
 }
 else
 {
     middle = ibTag + middle;
     
     if (isSingle)
     {
   isClose = true;
     }
 }
 
 obj_ta.value = start + middle + end;    
    }
    else
    {
 if(isSingle)
     isClose = true;

 obj_ta.value += ibTag;
    }

    obj_ta.focus();
    

    return isClose;
}


Regards,
Sebastian Mares

PS: Credits for the above function go to Matt Mecham.

Full Mozilla support for IPB

Reply #1
I am using Mozilla Firebird

edit:  but your right the buttons don't work the way they are supposed to, I had to do that manually.
gentoo ~amd64 + layman | ncmpcpp/mpd | wavpack + vorbis + lame

Full Mozilla support for IPB

Reply #2
I hope the moderators won't delete this topic, as it is useful to other people who are running IPB on their website.
Also, it would be cool if JohnV or Dibrom could implement this modification.

Full Mozilla support for IPB

Reply #3
Very cool indeed... Mozilla is becoming more and more widespread (ok, nothing compared to IE, but still something) and I believe it should be full supported. At leat I would be pleased

edit: plus, it's a great browser

Full Mozilla support for IPB

Reply #4
I hope they do implement your code. I'm using FireBird exclusively these days, and composing posts is where IE has it all over FB. Whenever you click outside the compose window (say on a formatting button), it ALWAYS moves the caret to the end of the post and puts the format tags there. Very irritating. Is the code used here (and elsewhere) non-standard...or is javascript (if thats what it is) not implemented completely in FireBird? Inquiring minds want to know.

xen-uno
No one can be told what Ogg Vorbis is...you have to hear it for yourself
- Morpheus

Full Mozilla support for IPB

Reply #5
AFAIK, Mozilla uses a different technique for getting / setting the cursor than Internet Explorer. IPB versions prior to 2.0 do not contain code for handling the different browsers. I asked Matt (the developer of IPB) in a private message to tell me which changes he has done and gave me that code. I have changed some variables (as the code he gave me was from IPB 2.0) and patched the JS file of my forums - everything worked perfectly.

One more thing... I have tested this with IPB 1.3. I don't know if IPB 1.2 will work with the new JS, but I do think so. There aren't much changes from 1.2 to 1.3.

Opera users won't notice any changes, AFAIK, because Opera's JavaScript support is a bit crappy. However, I hope that they will improve the JS engine for the next version. Chances are good.


Full Mozilla support for IPB

Reply #7
I wonder if this works with Opera


Full Mozilla support for IPB

Reply #9
It would sure be nice to get a "Sounds good, we'll look into it" or "Get bent, we'll never implement it" from the HA Staff regarding this issue.

xen-uno
No one can be told what Ogg Vorbis is...you have to hear it for yourself
- Morpheus

Full Mozilla support for IPB

Reply #10
Quote
It would sure be nice to get a "Sounds good, we'll look into it" or "Get bent, we'll never implement it" from the HA Staff regarding this issue.

xen-uno

Well, this is what Peter said (IRC):

Quote
<SebastianMares> By the way... Would be cool if Juha or Darin could modify the JavaScript file so Mozilla users (like me ) could format text easily. 
<DEATH> people who use formatting in every post they write should be shot
<DEATH> people who dont probably dont care
<SebastianMares> Well, it's not only formatting, but quoting and code, too.
<SebastianMares> Anyway...
<DEATH> people who have a problem with typing [ quote ] [ /quote ] probably have bigger problems somewhere else
<SebastianMares>
<DEATH> i get the feeling that our forum would be prettier if that feature didn't exist


So, looking at that conversation, I get a feeling that this "bug fix" will never find its way into HA.

Regards,
Sebastian Mares

Full Mozilla support for IPB

Reply #11
Mozilla here, too.  It is a pain.  Wonder if their host keeps track of % of visits by browser type to see if it would be worth the time and hassle.  I would assume that many who post on these types of techno-babble forums are open source OS users or Microsoft haters.  Or maybe, like me, just think IE and Active Hex and other securty issues make it a disease best avoided while surfing... and posting.

Full Mozilla support for IPB

Reply #12
"<DEATH> people who use formatting in every post they write should be shot"

Sounds like something he would write. I'll give him this...he is consistent.

xen-uno
No one can be told what Ogg Vorbis is...you have to hear it for yourself
- Morpheus


Full Mozilla support for IPB

Reply #14
Ok.  My answer:  I'm busy with finals and other stuff at the moment which is much higher priority than this (and I'll probably continue to be very busy for some time).

Second, I tend to agree with Peter's last point at least in part.  I've been using Mozilla for years now and have never found the lack "support" in the dynamic formatting stuff to be a serious setback.

If JohnV wants to implement this, he's welcome, but I doubt it's a very high priority on his list either unfortunately.