MediaWiki:Wikimediaplayer.js: Difference between revisions

Content deleted Content added
Cyde (talk | contribs)
Fixing a URL
updates
 
(7 intermediate revisions by 4 users not shown)
Line 1:
//Wikimediaplayer, Based on wikiminiatlas by dschwen
//<pre>
var wikimediaplayer =
{
Line 7 ⟶ 6:
width : 400,
height : 450,
playerurl : 'http://tools.wikimedia.de/~gmaxwell/jorbis/JOrbisPlayer.php',
buttonImage: 'http://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Nuvola_apps_kaboodle.png/18px-Nuvola_apps_kaboodle.png',
largebuttonImage: 'http://upload.wikimedia.org/wikipedia/commons/0/0c/Nuvola_apps_kaboodle.png',
imgbase : 'http://tools.wikimedia.de/~dschwen/wikiminiatlas/tiles/'
},
 
Line 35 ⟶ 34:
 
// cross-browser event attachment (John Resig)
// http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html
addEvent : function ( obj, type, fn )
{
Line 91 ⟶ 90:
{
language = window.___location.host.substr(0,2);
var neediframe=0;
 
links = document.getElementsByTagName('a');
for( var key in= 0; key < links.length; key++ )
{
link = links[key];
Line 109 ⟶ 108:
playbutton.playparam = playerlink;
addEvent( playbutton, 'click', toggleIFrame );
neediframe=1;
 
// link.parentNode.insertBefore(playbutton, link.nextSibling);
Line 116:
 
//Big icon for image pages.
if (mw.config.get('wgNamespaceNumber==6')){
divi = document.getElementById('file');
if (!divi)
return;
links = divi.getElementsByTagName('a');
var filere= /\/([^\/]*?.[Oo][Gg][Gg])$/
for( var key in= 0; key < links.length; key++ )
{
link = links[key];
Line 136 ⟶ 138:
playbutton.playparam = playerlink;
addEvent( playbutton, 'click', toggleIFrame );
neediframe=1;
 
// link.parentNode.insertBefore(playbutton, link.nextSibling);
Line 143 ⟶ 146:
}
 
if (neediframe==1) {
// iframe vorbereiten
iframe.div = document.createElement('div');
iframe.div.style.visibility = 'hidden';
iframe.iframediv.style.width = (wmpconfig.width+1012)+'px';
iframe.iframediv.style.height = (wmpconfig.height+1012)+'px';
iframe.iframediv.style.margin = '0px';
iframe.iframediv.style.padding = '0px';
iframe.div.style.zIndexbackgroundColor = 13'white';
iframe.iframediv.style.position = 'absolute';
iframe.iframediv.style.right = '1px2em';
iframe.iframediv.style.top = '1px1em';
iframe.div.style.border = '1px solid gray';
iframe.iframediv.style.zIndex = 1413;
 
iframe.closebutton = document.createElement('img');
// iframe vorbereiten
iframe.divclosebutton.title = documentstrings.createElement('div')close[language];
iframe.closebutton.src = 'http://upload.wikimedia.org/wikipedia/commons/d/d4/Button_hide.png';
iframe.div.style.visibility = 'hidden';
iframe.divclosebutton.style.widthzIndex = (wmpconfig.width+12)+'px'15;
iframe.divclosebutton.style.heightposition = (wmpconfig.height+12)+'pxabsolute';
iframe.divclosebutton.style.marginright = '0px11px';
iframe.divclosebutton.style.paddingtop = '0px11px';
iframe.divclosebutton.style.backgroundColorwidth = 'white18px';
iframe.divclosebutton.style.positioncursor = 'absolutepointer';
iframe.div.styleclosebutton.rightplayparam = '2em';
addEvent( iframe.div.style.top =closebutton, '1emclick', toggleIFrame );
iframe.div.style.border = '1px solid gray';
iframe.div.style.zIndex = 13;
 
iframe.closebuttoniframe = document.createElement('imgiframe');
iframe.closebuttoniframe.titleborder = strings.close[language]'0';
iframe.iframe.style.zIndex = 14;
iframe.closebutton.src = 'http://upload.wikimedia.org/wikipedia/commons/d/d4/Button_hide.png'
iframe.closebuttoniframe.style.zIndexposition = 15'absolute';
iframe.closebuttoniframe.style.positionright = 'absolute1px';
iframe.closebuttoniframe.style.righttop = '11px1px';
iframe.closebuttoniframe.style.topwidth = (wmpconfig.width+10)+'11pxpx';
iframe.closebuttoniframe.style.widthheight = (wmpconfig.height+10)+'18pxpx';
iframe.closebuttoniframe.style.cursormargin = 'pointer0px';
iframe.iframe.closebuttonstyle.playparampadding = '0px';
addEvent( iframe.closebutton, 'click', toggleIFrame );
 
iframe.iframe = documentiframe.createElementdiv.appendChild('iframe'.iframe);
iframe.div.appendChild(iframe.border = '0'closebutton);
iframe.iframe.style.zIndex = 14;
iframe.iframe.style.position = 'absolute';
iframe.iframe.style.right = '1px';
iframe.iframe.style.top = '1px';
iframe.iframe.style.width = (wmpconfig.width+10)+'px';
iframe.iframe.style.height = (wmpconfig.height+10)+'px';
iframe.iframe.style.margin = '0px';
iframe.iframe.style.padding = '0px';
 
var content = document.getElementById('content');
iframe.div.appendChild(iframe.iframe);
content.insertBefore(iframe.div,content.appendChild(iframe.closebuttonchildNodes[0]);
} //with
 
}
var content = document.getElementById('content');
content.insertBefore(iframe.div,content.childNodes[0]);
} //with
}
 
Line 194 ⟶ 198:
// Hook up installation function
//
addOnloadHook$(document).ready(wikimediaplayer.loader);
 
//</pre>