Jump to content

MediaWiki:Common.js/edit.js: Difference between revisions

why is "is_gecko" failing? does this extra check fix the issue?
(remove debugging msg)
(why is "is_gecko" failing? does this extra check fix the issue?)
Line 374: Line 374:
var x, y, ph, s, pl, pt, pw;
var x, y, ph, s, pl, pt, pw;
var m = document.getElementById('XEBmnu');
var m = document.getElementById('XEBmnu');
if (is_gecko) {
if (typeof is_gecko !== 'undefined' && is_gecko) {
ph = m.offsetHeight;
ph = m.offsetHeight;
x = e.clientX + window.scrollX;
x = e.clientX + window.scrollX;
Line 446: Line 446:
this.IESelectedRange = XEBgetIESelectedRange();
this.IESelectedRange = XEBgetIESelectedRange();


var winW = (is_gecko) ? window.innerWidth : document.body.offsetWidth;
var winW = (typeof is_gecko !== 'undefined' && is_gecko) ? window.innerWidth : document.body.offsetWidth;
if ((winW - this.width) < x) {
if ((winW - this.width) < x) {
x = (winW - this.width - 60);
x = (winW - this.width - 60);
Line 466: Line 466:
function setInnerHTML(html, title) {
function setInnerHTML(html, title) {
var i;
var i;
var winW = (is_gecko) ? window.innerWidth : document.body.offsetWidth;
var winW = (typeof is_gecko !== 'undefined' && is_gecko) ? window.innerWidth : document.body.offsetWidth;
if ((winW - this.width) < this.x) {
if ((winW - this.width) < this.x) {
this.x = (winW - this.width);
this.x = (winW - this.width);
Line 880: Line 880:
}
}
// IE & Opera
// IE & Opera
if (document.selection && !is_gecko) {
if (document.selection && (typeof is_gecko === 'undefined' || !is_gecko)) {
theSelection = document.selection.createRange().text;
theSelection = document.selection.createRange().text;
if (!theSelection) {
if (!theSelection) {
Line 914: Line 914:
}
}
// IE & Opera
// IE & Opera
if (document.selection && !is_gecko) {
if (document.selection && (typeof is_gecko === 'undefined' || !is_gecko)) {
txtarea.focus();
txtarea.focus();
IESel.Rng = document.selection.createRange();
IESel.Rng = document.selection.createRange();
Line 933: Line 933:


// IE
// IE
if (document.selection && !is_gecko) {
if (document.selection && (typeof is_gecko === 'undefined' || !is_gecko)) {


tr = IESelectedRange.Rng;
tr = IESelectedRange.Rng;