Content deleted Content added
m +yyOffset() testing hook for scrolling |
m make scrolling optional |
||
Line 13:
// == Helpers ==
// === DOM manipulation ===
Line 24 ⟶ 21:
// Initialise static variables used within this function
var _static = arguments.callee; // this is the Function we are in. It will be used as a poor man's function-local static scope.
if(ct.noscroll)return;
if (ta.setSelectionRange) {
// Guess the vertical scroll offset by creating a
Line 43:
hta.style.width = ta.clientWidth + 'px';
hta.style.height = ta.clientHeight + 'px';
hta.value = _static.NEWLINES.substring(0, ta.rows) + ta.value.substring(0, start/*+(end-start)/2*/);
var yOffset =
hta.style.display = 'none';
//if(yOffset>ta.scrollTop||yOffset<=ta.scrollTop-ta.clientHeight) {
▲ ta.focus();
▲ ta.setSelectionRange(start, end);
// Opera does not support setting the scrollTop property▼
▲ yOffset -= Math.floor(ta.clientHeight / 2);
if (ta.scrollTop != yOffset
// todo: Warn the user or apply a workaround▼
▲ // Opera does not support setting the scrollTop property
}▼
if (ta.scrollTop != yOffset) {▼
} else {
▲ // todo: Warn the user or apply a workaround
}
//}
▲ }
} else {
// IE incorrectly counts '\r\n' as a signle character
Line 516 ⟶ 515:
return;
}
var suggestion = ct.suggestions[k];▼
s=editform.wpTextbox1.scrollTop,
if (suggestion.replacement == null) { // the issue is not automatically fixable
return;
Line 529 ⟶ 530:
suggestion.start + suggestion.replacement.length
);
if(ct.noscroll)editform.wpTextbox1.scrollTop=s;
// Propose an edit summary unless it's a new section
▲ var editform = document.getElementById('editform');
if (!editform['wpSection'] || (editform['wpSection'].value != 'new')) {
if (ct.appliedSuggestions[suggestion.name] == null) {
|