Diferenças entre edições de "MediaWiki:Ticker.js"

687 bytes adicionados ,  13h24min de 17 de fevereiro de 2014
+ alteração, a pedido de User:Helder.wiki. https://pt.wikinews.org/w/index.php?title=Wikinot%C3%ADcias:P%C3%A1gina_de_testes&action=edit&oldid=173023
(+ alteração, a pedido de User:Helder.wiki. https://pt.wikinews.org/w/index.php?title=Wikinot%C3%ADcias:P%C3%A1gina_de_testes&action=edit&oldid=173023)
 
// Make sure that the /Tickersource page is formatted like [[Wikinews:Tickersource/Tickersource]] using DPLs
ticker_custompages['Portal:Futebol'] = 'Portal:Futebol/Tickersource';
 
 
//Add custommsgs for all custom pages
ticker_toload = ticker_custompages[wgBasePageName];
}
var xmlhttp = sajax_init_object();
$.ajax({
xhr xmlhttp.overrideMimeType( 'text/xml' );
xmlhttp.open( 'GET' url:, mw.util.getUrl( ticker_toload, { 'action': 'render' } ), true);
beforeSend: function( xhr ) {
xmlhttp.onload = function() {
xhr.overrideMimeType( 'text/xml' );
//this.responseXML is the DOM
var entries = this.responseText.split("\n");
//window.alert(this.responseText);
for(var i = 0; i < entries.length; i++){
var val = entries[i];
if(val.indexOf("<li>") === 0 && val.indexOf("<a") != -1){
val = val.substring(val.indexOf("\">")+2, val.indexOf("</a>"));
ticker_tl[ticker_tl.length] = val;
});
}
}).done(function( data, textStatus, jqXHR ) {
$( jqXHR.responseText ).find( 'li a' ).each(function(){
ticker_tl.push( $(this).html() );
});
ticker_prepare();
ticker_tick(false, true);
});
xmlhttp.send( null );
}
 
} else
setTimeout("ticker_tick(false, false)",ticker_speed);
}
 
function sajax_init_object() {
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;
}
}
}
 
return A;
}
 
// Disables for IE, AJAX etc is really bugged in IE, wont work without major rewrite and server-side extension.
if(navigator.userAgent.indexOf("MSIE") == -1){
 
$(ticker_load);
 
}
599

edições