Index: branches/new-upload/phase3/js2/mwEmbed/jquery/plugins/jquery.pngFix.js |
— | — | @@ -0,0 +1,113 @@ |
| 2 | +/**
|
| 3 | + * --------------------------------------------------------------------
|
| 4 | + * jQuery-Plugin "pngFix"
|
| 5 | + * Version: 1.2, 09.03.2009
|
| 6 | + * by Andreas Eberhard, andreas.eberhard@gmail.com
|
| 7 | + * http://jquery.andreaseberhard.de/
|
| 8 | + *
|
| 9 | + * Copyright (c) 2007 Andreas Eberhard
|
| 10 | + * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
|
| 11 | + *
|
| 12 | + * Changelog:
|
| 13 | + * 09.03.2009 Version 1.2
|
| 14 | + * - Update for jQuery 1.3.x, removed @ from selectors
|
| 15 | + * 11.09.2007 Version 1.1
|
| 16 | + * - removed noConflict
|
| 17 | + * - added png-support for input type=image
|
| 18 | + * - 01.08.2007 CSS background-image support extension added by Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
|
| 19 | + * 31.05.2007 initial Version 1.0
|
| 20 | + * --------------------------------------------------------------------
|
| 21 | + * @example $(function(){$(document).pngFix();});
|
| 22 | + * @desc Fixes all PNG's in the document on document.ready
|
| 23 | + *
|
| 24 | + * jQuery(function(){jQuery(document).pngFix();});
|
| 25 | + * @desc Fixes all PNG's in the document on document.ready when using noConflict
|
| 26 | + *
|
| 27 | + * @example $(function(){$('div.examples').pngFix();});
|
| 28 | + * @desc Fixes all PNG's within div with class examples
|
| 29 | + *
|
| 30 | + * @example $(function(){$('div.examples').pngFix( { blankgif:'ext.gif' } );});
|
| 31 | + * @desc Fixes all PNG's within div with class examples, provides blank gif for input with png
|
| 32 | + * --------------------------------------------------------------------
|
| 33 | + */
|
| 34 | +
|
| 35 | +(function($) {
|
| 36 | +
|
| 37 | +jQuery.fn.pngFix = function(settings) {
|
| 38 | +
|
| 39 | + // Settings
|
| 40 | + settings = jQuery.extend({
|
| 41 | + blankgif: 'blank.gif'
|
| 42 | + }, settings);
|
| 43 | +
|
| 44 | + var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
|
| 45 | + var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);
|
| 46 | +
|
| 47 | + if (jQuery.browser.msie && (ie55 || ie6)) {
|
| 48 | +
|
| 49 | + //fix images with png-source
|
| 50 | + jQuery(this).find("img[src$=.png]").each(function() {
|
| 51 | +
|
| 52 | + jQuery(this).attr('width',jQuery(this).width());
|
| 53 | + jQuery(this).attr('height',jQuery(this).height());
|
| 54 | +
|
| 55 | + var prevStyle = '';
|
| 56 | + var strNewHTML = '';
|
| 57 | + var imgId = (jQuery(this).attr('id')) ? 'id="' + jQuery(this).attr('id') + '" ' : '';
|
| 58 | + var imgClass = (jQuery(this).attr('class')) ? 'class="' + jQuery(this).attr('class') + '" ' : '';
|
| 59 | + var imgTitle = (jQuery(this).attr('title')) ? 'title="' + jQuery(this).attr('title') + '" ' : '';
|
| 60 | + var imgAlt = (jQuery(this).attr('alt')) ? 'alt="' + jQuery(this).attr('alt') + '" ' : '';
|
| 61 | + var imgAlign = (jQuery(this).attr('align')) ? 'float:' + jQuery(this).attr('align') + ';' : '';
|
| 62 | + var imgHand = (jQuery(this).parent().attr('href')) ? 'cursor:hand;' : '';
|
| 63 | + if (this.style.border) {
|
| 64 | + prevStyle += 'border:'+this.style.border+';';
|
| 65 | + this.style.border = '';
|
| 66 | + }
|
| 67 | + if (this.style.padding) {
|
| 68 | + prevStyle += 'padding:'+this.style.padding+';';
|
| 69 | + this.style.padding = '';
|
| 70 | + }
|
| 71 | + if (this.style.margin) {
|
| 72 | + prevStyle += 'margin:'+this.style.margin+';';
|
| 73 | + this.style.margin = '';
|
| 74 | + }
|
| 75 | + var imgStyle = (this.style.cssText);
|
| 76 | +
|
| 77 | + strNewHTML += '<span '+imgId+imgClass+imgTitle+imgAlt;
|
| 78 | + strNewHTML += 'style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+imgAlign+imgHand;
|
| 79 | + strNewHTML += 'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;';
|
| 80 | + strNewHTML += 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + jQuery(this).attr('src') + '\', sizingMethod=\'scale\');';
|
| 81 | + strNewHTML += imgStyle+'"></span>';
|
| 82 | + if (prevStyle != ''){
|
| 83 | + strNewHTML = '<span style="position:relative;display:inline-block;'+prevStyle+imgHand+'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;'+'">' + strNewHTML + '</span>';
|
| 84 | + }
|
| 85 | +
|
| 86 | + jQuery(this).hide();
|
| 87 | + jQuery(this).after(strNewHTML);
|
| 88 | +
|
| 89 | + });
|
| 90 | +
|
| 91 | + // fix css background pngs
|
| 92 | + jQuery(this).find("*").each(function(){
|
| 93 | + var bgIMG = jQuery(this).css('background-image');
|
| 94 | + if(bgIMG.indexOf(".png")!=-1){
|
| 95 | + var iebg = bgIMG.split('url("')[1].split('")')[0];
|
| 96 | + jQuery(this).css('background-image', 'none');
|
| 97 | + jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')";
|
| 98 | + }
|
| 99 | + });
|
| 100 | +
|
| 101 | + //fix input with png-source
|
| 102 | + jQuery(this).find("input[src$=.png]").each(function() {
|
| 103 | + var bgIMG = jQuery(this).attr('src');
|
| 104 | + jQuery(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + bgIMG + '\', sizingMethod=\'scale\');';
|
| 105 | + jQuery(this).attr('src', settings.blankgif)
|
| 106 | + });
|
| 107 | +
|
| 108 | + }
|
| 109 | +
|
| 110 | + return jQuery;
|
| 111 | +
|
| 112 | +};
|
| 113 | +
|
| 114 | +})(jQuery);
|
Index: branches/new-upload/phase3/js2/mwEmbed/php/jsAutoloadLocalClasses.php |
— | — | @@ -14,12 +14,14 @@ |
15 | 15 | $wgJSAutoloadLocalClasses['j.cookie'] = $wgMwEmbedDirectory . 'jquery/jquery.ui-1.7.1/external/cookie/jquery.cookie.js'; |
16 | 16 | |
17 | 17 | $wgJSAutoloadLocalClasses['j.contextMenu'] = $wgMwEmbedDirectory . 'jquery/plugins/jquery.contextMenu.js'; |
| 18 | + $wgJSAutoloadLocalClasses['j.fn.pngFix'] = $wgMwEmbedDirectory . 'jquery/plugins/jquery.pngFix.js'; |
| 19 | + |
18 | 20 | $wgJSAutoloadLocalClasses['j.fn.autocomplete'] = $wgMwEmbedDirectory . 'jquery/plugins/jquery.autocomplete.js'; |
19 | 21 | $wgJSAutoloadLocalClasses['j.fn.hoverIntent'] = $wgMwEmbedDirectory . 'jquery/plugins/jquery.hoverIntent.js'; |
20 | 22 | $wgJSAutoloadLocalClasses['j.Jcrop'] = $wgMwEmbedDirectory . 'jquery/plugins/Jcrop/js/jquery.Jcrop.js'; |
21 | 23 | $wgJSAutoloadLocalClasses['Date.fromString'] = $wgMwEmbedDirectory . 'jquery/plugins/date.js'; |
22 | 24 | $wgJSAutoloadLocalClasses['j.fn.datePicker'] = $wgMwEmbedDirectory . 'jquery/plugins/jquery.datePicker.js'; |
23 | | - |
| 25 | + |
24 | 26 | //jquery.ui |
25 | 27 | $wgJSAutoloadLocalClasses['j.ui'] = $wgMwEmbedDirectory . 'jquery/jquery.ui-1.7.1/ui/ui.core.js'; |
26 | 28 | |
Index: branches/new-upload/phase3/js2/mwEmbed/skins/mvpcf/styles.css |
— | — | @@ -297,8 +297,7 @@ |
298 | 298 | .mvttseek{ |
299 | 299 | cursor:pointer; |
300 | 300 | } |
301 | | -.large_play_button { |
302 | | - background: url(images/player_big_play_button.png) 0 0 no-repeat; |
| 301 | +.large_play_button { |
303 | 302 | display:block; |
304 | 303 | width: 130px; |
305 | 304 | height: 96px; |
Index: branches/new-upload/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | /*parseUri class parses URIs:*/ |
61 | 61 | var parseUri=function(d){var o=parseUri.options,value=o.parser[o.strictMode?"strict":"loose"].exec(d);for(var i=0,uri={};i<14;i++){uri[o.key[i]]=value[i]||""}uri[o.q.name]={};uri[o.key[12]].replace(o.q.parser,function(a,b,c){if(b)uri[o.q.name][b]=c});return uri};parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}}; |
62 | 62 | |
| 63 | + |
63 | 64 | //get mv_embed location if it has not been set |
64 | 65 | if( !mv_embed_path ){ |
65 | 66 | var mv_embed_path = getMvEmbedPath(); |
— | — | @@ -112,7 +113,7 @@ |
113 | 114 | "mv_ogg-player-flowplayer" : "Flowplayer", |
114 | 115 | "mv_ogg-player-selected" : " (selected)", |
115 | 116 | "mv_ogg-player-omtkplayer" : "OMTK Flash Vorbis", |
116 | | - "mv_generic_missing_plugin" : "You browser does not appear to support playback type: <b>$1</b><br> visit the <a href=\"http://metavid.org/wiki/Client_Playback\">Playback Methods</a> page to download a player<br>", |
| 117 | + "mv_generic_missing_plugin" : "You browser does not appear to support playback type: <b>$1</b><br> visit the <a href=\"http://commons.wikimedia.org/wiki/Commons:Media_help\">Playback Methods</a> page to download a player<br>", |
117 | 118 | |
118 | 119 | "add_to_end_of_sequence" : "Add to End of Sequence", |
119 | 120 | |
— | — | @@ -404,9 +405,13 @@ |
405 | 406 | var secReq = {}; |
406 | 407 | //IE loads things out of order running j.slider before j.ui is ready |
407 | 408 | //load ui depenent scripts in a second request: |
408 | | - if($j.browser.msie){ |
| 409 | + if($j.browser.msie){ |
409 | 410 | secReq = { |
410 | 411 | '$j.ui.slider' : 'jquery/' + jQueryUiVN + '/ui/ui.slider.js' |
| 412 | + } |
| 413 | + //ie6 yay! |
| 414 | + if($j.browser.version <= 6){ |
| 415 | + secReq[ '$j.fn.pngFix' ] = 'jquery/plugins/jquery.pngFix.js'; |
411 | 416 | } |
412 | 417 | }else{ |
413 | 418 | baseReq['$j.ui.slider'] = 'jquery/' + jQueryUiVN + '/ui/ui.slider.js'; |
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/mv_baseEmbed.js |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | } |
109 | 109 | //process selected elements: |
110 | 110 | //ie8 does not play well with the jQuery video,audio,playlist selector use native: |
111 | | - if($j.browser.msie = true && $j.browser.version >= 8){ |
| 111 | + if($j.browser.msie && $j.browser.version >= 8){ |
112 | 112 | jtags = j_selector.split(','); |
113 | 113 | for(var i=0;i<jtags.length;i++){ |
114 | 114 | $j( document.getElementsByTagName( jtags[i] )).each(function(){ |
— | — | @@ -288,8 +288,13 @@ |
289 | 289 | //big_play_link_ play binding: |
290 | 290 | $j('#big_play_link_' + embedObj.id).unbind().click(function(){ |
291 | 291 | $j('#' + embedObj.id).get(0).play(); |
292 | | - }); |
| 292 | + }); |
293 | 293 | |
| 294 | + if( $j.browser.msie && $j.browser.version <= 6){ |
| 295 | + $j('#big_play_link_' + embedObj.id).pngFix(); |
| 296 | + } |
| 297 | + |
| 298 | + |
294 | 299 | //captions binding: |
295 | 300 | $j('#timed_text_' + embedObj.id).unbind().btnBind().click(function(){ |
296 | 301 | $j('#' + embedObj.id).get(0).showTextInterface(); |
— | — | @@ -1073,7 +1078,7 @@ |
1074 | 1079 | if( this.pc ) |
1075 | 1080 | var missing_type = this.pc.type; |
1076 | 1081 | js_log('no player found for given source type ' + missing_type); |
1077 | | - this.load_error= gM('mv_generic_missing_plugin', missing_type ); |
| 1082 | + this.load_error= this.getPluginMissingHTML(missing_type); |
1078 | 1083 | } |
1079 | 1084 | }, |
1080 | 1085 | inheritEmbedObj:function(){ |
— | — | @@ -1505,13 +1510,15 @@ |
1506 | 1511 | /* |
1507 | 1512 | * get missing plugin html (check for user included code) |
1508 | 1513 | */ |
1509 | | - getPluginMissingHTML : function(){ |
| 1514 | + getPluginMissingHTML : function(missing_type){ |
1510 | 1515 | //keep the box width hight: |
1511 | 1516 | var out = '<div style="width:'+this.width+'px;height:'+this.height+'px">'; |
1512 | 1517 | if(this.user_missing_plugin_html){ |
1513 | 1518 | out+= this.user_missing_plugin_html; |
1514 | 1519 | }else{ |
1515 | | - out+= gM('generic_missing_plugin') + ' or <a title="'+gM('download_clip')+'" href="'+this.src +'">'+gM('download_clip')+'</a>'; |
| 1520 | + if(!missing_type) |
| 1521 | + missing_type=''; |
| 1522 | + out+= gM('mv_generic_missing_plugin', missing_type) + ' or <a title="'+gM('download_clip')+'" href="'+this.src +'">'+gM('download_clip')+'</a>'; |
1516 | 1523 | } |
1517 | 1524 | return out + '</div>'; |
1518 | 1525 | }, |
— | — | @@ -1685,7 +1692,9 @@ |
1686 | 1693 | if(!id)id=this.id; |
1687 | 1694 | return '<div id="big_play_link_'+id+'" class="large_play_button" '+ |
1688 | 1695 | 'style="left:'+((this.playerPixelWidth()-130)/2)+'px;'+ |
1689 | | - 'top:'+((this.playerPixelHeight()-96)/2)+'px;"></div>'; |
| 1696 | + 'top:' + ((this.playerPixelHeight()-96)/2) + 'px;">'+ |
| 1697 | + '<img src="' + mv_skin_img_path + 'player_big_play_button.png">'+ |
| 1698 | + '</div>'; |
1690 | 1699 | }, |
1691 | 1700 | doLinkBack:function(){ |
1692 | 1701 | if(this.roe && this.media_element.addedROEData==false){ |
— | — | @@ -2557,27 +2566,21 @@ |
2558 | 2567 | js_log("running detect"); |
2559 | 2568 | this.players = new mediaPlayers(); |
2560 | 2569 | //every browser supports html rendering: |
2561 | | - this.players.addPlayer( htmlPlayer ); |
2562 | | - // First some browser detection |
2563 | | - this.msie = ( navigator.appName == "Microsoft Internet Explorer" ); |
2564 | | - this.msie6 = ( navigator.userAgent.indexOf("MSIE 6")===false); |
2565 | | - this.opera = ( navigator.appName == 'Opera' ); |
2566 | | - this.safari = ( navigator.vendor && navigator.vendor.substr( 0, 5 ) == 'Apple' ); |
2567 | | - |
| 2570 | + this.players.addPlayer( htmlPlayer ); |
2568 | 2571 | // In Mozilla, navigator.javaEnabled() only tells us about preferences, we need to |
2569 | 2572 | // search navigator.mimeTypes to see if it's installed |
2570 | 2573 | var javaEnabled = navigator.javaEnabled(); |
2571 | 2574 | // In Opera, navigator.javaEnabled() is all there is |
2572 | | - var invisibleJava = this.opera; |
| 2575 | + var invisibleJava = $j.browser.opera; |
2573 | 2576 | // Some browsers filter out duplicate mime types, hiding some plugins |
2574 | | - var uniqueMimesOnly = this.opera || this.safari; |
| 2577 | + var uniqueMimesOnly = $j.browser.opera || $j.browser.safari; |
2575 | 2578 | // Opera will switch off javaEnabled in preferences if java can't be found. |
2576 | 2579 | // And it doesn't register an application/x-java-applet mime type like Mozilla does. |
2577 | 2580 | if ( invisibleJava && javaEnabled ) |
2578 | 2581 | this.players.addPlayer( cortadoPlayer ); |
2579 | 2582 | |
2580 | 2583 | // ActiveX plugins |
2581 | | - if(this.msie){ |
| 2584 | + if($j.browser.msie){ |
2582 | 2585 | // check for flash |
2583 | 2586 | if ( this.testActiveX( 'ShockwaveFlash.ShockwaveFlash')){ |
2584 | 2587 | //try to get the flash version for omtk include: |