* Use native XMLHttpRequest class in preference to ActiveX on IE 7; this
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 28 Jun 2007 16:06:10 +0000 (16:06 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 28 Jun 2007 16:06:10 +0000 (16:06 +0000)
  avoids the "ActiveX "Do you want to allow ActiveX?" prompt when something
  security settings are cranked this way and AJAX-y gets used.

We still get prompts on IE 6, though, which is kind of annoying.

RELEASE-NOTES
includes/DefaultSettings.php
skins/common/ajax.js

index 316af87..61bc085 100644 (file)
@@ -226,6 +226,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 10397) Fix AJAX watch error fallback when we receive a bogus result
 * (bug 10396) Fix AJAX error when $wgScriptPath/index.php is not valid;
   using $wgScript now included in JS info
+* Use native XMLHttpRequest class in preference to ActiveX on IE 7; this
+  avoids the "ActiveX "Do you want to allow ActiveX?" prompt when something
+  security settings are cranked this way and AJAX-y gets used.
 
 
 == API changes since 1.10 ==
index 4579cac..d05cb5a 100644 (file)
@@ -1198,7 +1198,7 @@ $wgCacheEpoch = '20030516000000';
  * to ensure that client-side caches don't keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '78';
+$wgStyleVersion = '79';
 
 
 # Server-side caching:
index 87fe834..c84f337 100644 (file)
@@ -39,16 +39,21 @@ function sajax_init_object() {
        sajax_debug("sajax_init_object() called..")
        var A;
        try {
-               A=new ActiveXObject("Msxml2.XMLHTTP");
+               // Try the new style before ActiveX so we don't
+               // unnecessarily trigger warnings in IE 7 when
+               // set to prompt about ActiveX usage
+               A = new XMLHttpRequest();
        } catch (e) {
                try {
-                       A=new ActiveXObject("Microsoft.XMLHTTP");
-               } catch (oc) {
-                       A=null;
+                       A=new ActiveXObject("Msxml2.XMLHTTP");
+               } catch (e) {
+                       try {
+                               A=new ActiveXObject("Microsoft.XMLHTTP");
+                       } catch (oc) {
+                               A=null;
+                       }
                }
        }
-       if(!A && typeof XMLHttpRequest != "undefined")
-               A = new XMLHttpRequest();
        if (!A)
                sajax_debug("Could not create connection object.");