insertTags( item.tagOpen, item.tagClose, item.sampleText, item.selectText );
// click tracking
if ( ( typeof $ != 'undefined' ) && ( typeof $.trackAction != 'undefined' ) ) {
- $.trackAction( 'oldedit.' + item.speedTip.replace(/ /g, "-") );
+ $.trackAction( 'oldedit.' + item.speedTip.replace(/ /g, '-') );
}
return false;
};
// we use it to avoid creating the toolbar where javascript is not enabled
window.mwSetupToolbar = function() {
var toolbar = document.getElementById( 'toolbar' );
+ var i = 0;
if ( !toolbar ) {
return false;
}
return false;
}
}
- for ( var i = 0; i < mwEditButtons.length; i++ ) {
+ for ( i = 0; i < mwEditButtons.length; i++ ) {
mwInsertEditButton( toolbar, mwEditButtons[i] );
}
- for ( var i = 0; i < mwCustomEditButtons.length; i++ ) {
+ for ( i = 0; i < mwCustomEditButtons.length; i++ ) {
mwInsertEditButton( toolbar, mwCustomEditButtons[i] );
}
return true;
}
var selText, isSample = false;
+ function checkSelectedText() {
+ if ( !selText ) {
+ selText = sampleText;
+ isSample = true;
+ } else if ( selText.charAt(selText.length - 1) == ' ' ) { // exclude ending space char
+ selText = selText.substring(0, selText.length - 1);
+ tagClose += ' ';
+ }
+ }
+
if ( document.selection && document.selection.createRange ) { // IE/Opera
// save window scroll position
+ var winScroll = null;
if ( document.documentElement && document.documentElement.scrollTop ) {
- var winScroll = document.documentElement.scrollTop
+ winScroll = document.documentElement.scrollTop;
} else if ( document.body ) {
- var winScroll = document.body.scrollTop;
+ winScroll = document.body.scrollTop;
}
// get current selection
txtarea.focus();
txtarea.scrollTop = textScroll;
}
- function checkSelectedText() {
- if ( !selText ) {
- selText = sampleText;
- isSample = true;
- } else if ( selText.charAt(selText.length - 1) == ' ' ) { // exclude ending space char
- selText = selText.substring(0, selText.length - 1);
- tagClose += ' ';
- }
- }
-
};
/**
}
}
- editForm
-} );
-
+} );
\ No newline at end of file