forked from p12tic/cppreference-doc
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
122 changed files
with
4,476 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Fixes textarea scrolling bug (bug #19334). The bug only occurs when a | ||
* percentage width is given, so instead of width: 100%, use min-width: 100%; | ||
* max-width: 100%. We also need to give a fixed width for the actual width | ||
* property for the hack to work, although the actual value (500px here) ends | ||
* up being ignored; min/max-width take precedence. | ||
* | ||
* More info: http://grantovich.net/posts/2009/06/that-weird-ie8-textarea-bug/ | ||
*/ | ||
#wpTextbox1 { | ||
height: 390px; | ||
width: 500px; | ||
min-width: 100%; | ||
max-width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
// IE fixes javascript | ||
|
||
window.isMSIE55 = ( window.showModalDialog && window.clipboardData && window.createPopup ); | ||
window.doneIETransform = undefined; | ||
window.doneIEAlphaFix = undefined; | ||
|
||
window.hookit = function() { | ||
if ( !doneIETransform && document.getElementById && document.getElementById( 'bodyContent' ) ) { | ||
doneIETransform = true; | ||
relativeforfloats(); | ||
fixalpha(); | ||
} | ||
}; | ||
|
||
if ( document.attachEvent ) { | ||
document.attachEvent( 'onreadystatechange', window.hookit ); | ||
} | ||
|
||
// png alpha transparency fixes | ||
window.fixalpha = function( logoId ) { | ||
// bg | ||
if ( isMSIE55 && !doneIEAlphaFix ) { | ||
var plogo = document.getElementById( logoId || 'p-logo' ); | ||
if ( !plogo ) { | ||
return; | ||
} | ||
|
||
var logoa = plogo.getElementsByTagName('a')[0]; | ||
if ( !logoa ) { | ||
return; | ||
} | ||
|
||
var bg = logoa.currentStyle.backgroundImage; | ||
var imageUrl = bg.substring( 5, bg.length - 2 ); | ||
|
||
doneIEAlphaFix = true; | ||
|
||
if ( imageUrl.substr( imageUrl.length - 4 ).toLowerCase() == '.png' ) { | ||
var logospan = logoa.appendChild( document.createElement( 'span' ) ); | ||
|
||
logoa.style.backgroundImage = 'none'; | ||
logospan.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + imageUrl + ')'; | ||
logospan.style.height = '100%'; | ||
logospan.style.position = 'absolute'; | ||
logospan.style.width = logoa.currentStyle.width; | ||
logospan.style.cursor = 'hand'; | ||
// Center image with hack for IE5.5 | ||
if ( document.documentElement.dir == 'rtl' ) { | ||
logospan.style.right = '50%'; | ||
logospan.style.setExpression( 'marginRight', '"-" + (this.offsetWidth / 2) + "px"' ); | ||
} else { | ||
logospan.style.left = '50%'; | ||
logospan.style.setExpression( 'marginLeft', '"-" + (this.offsetWidth / 2) + "px"' ); | ||
} | ||
logospan.style.top = '50%'; | ||
logospan.style.setExpression( 'marginTop', '"-" + (this.offsetHeight / 2) + "px"' ); | ||
|
||
var linkFix = logoa.appendChild( logoa.cloneNode() ); | ||
linkFix.style.position = 'absolute'; | ||
linkFix.style.height = '100%'; | ||
linkFix.style.width = '100%'; | ||
} | ||
} | ||
}; | ||
|
||
if ( isMSIE55 ) { | ||
// ondomready | ||
$( fixalpha ); | ||
} | ||
|
||
// fix ie6 disappering float bug | ||
window.relativeforfloats = function() { | ||
var bc = document.getElementById( 'bodyContent' ); | ||
if ( bc ) { | ||
var tables = bc.getElementsByTagName( 'table' ); | ||
var divs = bc.getElementsByTagName( 'div' ); | ||
setrelative( tables ); | ||
setrelative( divs ); | ||
} | ||
}; | ||
|
||
window.setrelative = function( nodes ) { | ||
var i = 0; | ||
while ( i < nodes.length ) { | ||
if( ( ( nodes[i].style.float && nodes[i].style.float != ( 'none' ) || | ||
( nodes[i].align && nodes[i].align != ( 'none' ) ) ) && | ||
( !nodes[i].style.position || nodes[i].style.position != 'relative' ) ) ) | ||
{ | ||
nodes[i].style.position = 'relative'; | ||
} | ||
i++; | ||
} | ||
}; | ||
|
||
// Expand links for printing | ||
String.prototype.hasClass = function( classWanted ) { | ||
var classArr = this.split(/\s/); | ||
for ( var i = 0; i < classArr.length; i++ ) { | ||
if ( classArr[i].toLowerCase() == classWanted.toLowerCase() ) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
|
||
window.expandedURLs = undefined; | ||
|
||
window.onbeforeprint = function() { | ||
expandedURLs = []; | ||
|
||
var contentEl = document.getElementById( 'content' ); | ||
|
||
if ( contentEl ) { | ||
var allLinks = contentEl.getElementsByTagName( 'a' ); | ||
|
||
for ( var i = 0; i < allLinks.length; i++ ) { | ||
if ( allLinks[i].className.hasClass( 'external' ) && !allLinks[i].className.hasClass( 'free' ) ) { | ||
var expandedLink = document.createElement( 'span' ); | ||
var expandedText = document.createTextNode( ' (' + allLinks[i].href + ')' ); | ||
expandedLink.appendChild( expandedText ); | ||
allLinks[i].parentNode.insertBefore( expandedLink, allLinks[i].nextSibling ); | ||
expandedURLs[i] = expandedLink; | ||
} | ||
} | ||
} | ||
}; | ||
|
||
window.onafterprint = function() { | ||
for ( var i = 0; i < expandedURLs.length; i++ ) { | ||
if ( expandedURLs[i] ) { | ||
expandedURLs[i].removeNode( true ); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
// remote scripting library | ||
// (c) copyright 2005 modernmethod, inc | ||
window.sajax_debug_mode = false; | ||
window.sajax_request_type = 'GET'; | ||
|
||
/** | ||
* if sajax_debug_mode is true, this function outputs given the message into | ||
* the element with id = sajax_debug; if no such element exists in the document, | ||
* it is injected. | ||
*/ | ||
window.sajax_debug = function(text) { | ||
if (!sajax_debug_mode) return false; | ||
|
||
var e = document.getElementById( 'sajax_debug' ); | ||
|
||
if ( !e ) { | ||
e = document.createElement( 'p' ); | ||
e.className = 'sajax_debug'; | ||
e.id = 'sajax_debug'; | ||
|
||
var b = document.getElementsByTagName( 'body' )[0]; | ||
|
||
if ( b.firstChild ) { | ||
b.insertBefore( e, b.firstChild ); | ||
} else { | ||
b.appendChild( e ); | ||
} | ||
} | ||
|
||
var m = document.createElement( 'div' ); | ||
m.appendChild( document.createTextNode( text ) ); | ||
|
||
e.appendChild( m ); | ||
|
||
return true; | ||
}; | ||
|
||
/** | ||
* Compatibility wrapper for creating a new XMLHttpRequest object. | ||
*/ | ||
window.sajax_init_object = function() { | ||
sajax_debug( 'sajax_init_object() called..' ); | ||
var A; | ||
try { | ||
// 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( 'Msxml2.XMLHTTP' ); | ||
} catch ( e ) { | ||
try { | ||
A = new ActiveXObject( 'Microsoft.XMLHTTP' ); | ||
} catch ( oc ) { | ||
A = null; | ||
} | ||
} | ||
} | ||
if ( !A ) { | ||
sajax_debug( 'Could not create connection object.' ); | ||
} | ||
|
||
return A; | ||
}; | ||
|
||
/** | ||
* Perform an AJAX call to MediaWiki. Calls are handled by AjaxDispatcher.php | ||
* func_name - the name of the function to call. Must be registered in $wgAjaxExportList | ||
* args - an array of arguments to that function | ||
* target - the target that will handle the result of the call. If this is a function, | ||
* if will be called with the XMLHttpRequest as a parameter; if it's an input | ||
* element, its value will be set to the resultText; if it's another type of | ||
* element, its innerHTML will be set to the resultText. | ||
* | ||
* Example: | ||
* sajax_do_call( 'doFoo', [1, 2, 3], document.getElementById( 'showFoo' ) ); | ||
* | ||
* This will call the doFoo function via MediaWiki's AjaxDispatcher, with | ||
* (1, 2, 3) as the parameter list, and will show the result in the element | ||
* with id = showFoo | ||
*/ | ||
window.sajax_do_call = function(func_name, args, target) { | ||
var i, x, n; | ||
var uri; | ||
var post_data; | ||
uri = mw.util.wikiScript() + '?action=ajax'; | ||
if ( sajax_request_type == 'GET' ) { | ||
if ( uri.indexOf( '?' ) == -1 ) { | ||
uri = uri + '?rs=' + encodeURIComponent( func_name ); | ||
} else { | ||
uri = uri + '&rs=' + encodeURIComponent( func_name ); | ||
} | ||
for ( i = 0; i < args.length; i++ ) { | ||
uri = uri + '&rsargs[]=' + encodeURIComponent( args[i] ); | ||
} | ||
//uri = uri + '&rsrnd=' + new Date().getTime(); | ||
post_data = null; | ||
} else { | ||
post_data = 'rs=' + encodeURIComponent( func_name ); | ||
for ( i = 0; i < args.length; i++ ) { | ||
post_data = post_data + '&rsargs[]=' + encodeURIComponent( args[i] ); | ||
} | ||
} | ||
x = sajax_init_object(); | ||
if ( !x ) { | ||
alert( 'AJAX not supported' ); | ||
return false; | ||
} | ||
|
||
try { | ||
x.open( sajax_request_type, uri, true ); | ||
} catch ( e ) { | ||
if ( window.location.hostname == 'localhost' ) { | ||
alert( "Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing." ); | ||
} | ||
throw e; | ||
} | ||
if ( sajax_request_type == 'POST' ) { | ||
x.setRequestHeader( 'Method', 'POST ' + uri + ' HTTP/1.1' ); | ||
x.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' ); | ||
} | ||
x.setRequestHeader( 'Pragma', 'cache=yes' ); | ||
x.setRequestHeader( 'Cache-Control', 'no-transform' ); | ||
x.onreadystatechange = function() { | ||
if ( x.readyState != 4 ) { | ||
return; | ||
} | ||
|
||
sajax_debug( 'received (' + x.status + ' ' + x.statusText + ') ' + x.responseText ); | ||
|
||
//if ( x.status != 200 ) | ||
// alert( 'Error: ' + x.status + ' ' + x.statusText + ': ' + x.responseText ); | ||
//else | ||
|
||
if ( typeof( target ) == 'function' ) { | ||
target( x ); | ||
} else if ( typeof( target ) == 'object' ) { | ||
if ( target.tagName == 'INPUT' ) { | ||
if ( x.status == 200 ) { | ||
target.value= x.responseText; | ||
} | ||
//else alert( 'Error: ' + x.status + ' ' + x.statusText + ' (' + x.responseText + ')' ); | ||
} else { | ||
if ( x.status == 200 ) { | ||
target.innerHTML = x.responseText; | ||
} else { | ||
target.innerHTML = '<div class="error">Error: ' + x.status + | ||
' ' + x.statusText + ' (' + x.responseText + ')</div>'; | ||
} | ||
} | ||
} else { | ||
alert( 'bad target for sajax_do_call: not a function or object: ' + target ); | ||
} | ||
}; | ||
|
||
sajax_debug( func_name + ' uri = ' + uri + ' / post = ' + post_data ); | ||
x.send( post_data ); | ||
sajax_debug( func_name + ' waiting..' ); | ||
delete x; | ||
|
||
return true; | ||
}; | ||
|
||
/** | ||
* @return boolean whether the browser supports XMLHttpRequest | ||
*/ | ||
window.wfSupportsAjax = function() { | ||
var request = sajax_init_object(); | ||
var supportsAjax = request ? true : false; | ||
delete request; | ||
return supportsAjax; | ||
}; |
Oops, something went wrong.