r59174 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59173‎ | r59174 | r59175 >
Date:16:33, 17 November 2009
Author:dale
Status:deferred
Tags:
Comment:
* some kplayer updates
* fix to the menu
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/kplayerEmbed.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/vlcEmbed.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/mv_embed.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/skins/mvpcf/playerSkin.css (modified) (history)
  • /trunk/phase3/js2/mwEmbed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/skins/mvpcf/playerSkin.css
@@ -199,3 +199,63 @@
200200 color:#FFE96E;
201201 font-weight:bold;
202202 }
 203+
 204+.videoComplete{
 205+ position: absolute;
 206+ top:0px;
 207+ left:0px;
 208+ z-index: 10;
 209+ font-size:16px;
 210+ overflow: hidden;
 211+ background:transparent url(images/transparent_bg.png) repeat scroll 0 0;
 212+}
 213+.videoComplete .videoOptionsComplete {
 214+ background:transparent url('images/player_video_options_bg.png') no-repeat scroll 0pt;
 215+ color:#7A7A7A;
 216+ font-size:10pt;
 217+ height:158px;
 218+ left:10%;
 219+ overflow:auto;
 220+ padding:19px;
 221+ position:relative;
 222+ top:16%;
 223+ width:283px;
 224+}
 225+.videoComplete .videoOptionsComplete p { text-align: center; margin: 3px 0; padding: 0; }
 226+.videoComplete .videoOptionsComplete a {
 227+ color: white;
 228+/* font-size: 22px;*/
 229+ font-size:12px;
 230+ text-decoration: underline;
 231+}
 232+.videoComplete .videoOptionsComplete a.active{
 233+ color: #bbf;
 234+}
 235+.videoComplete .videoOptionsComplete a.email {
 236+ font-size:16px;
 237+ background: url(images/ico_mail.png) right 0px no-repeat;
 238+ padding: 0 50px 0 0;
 239+}
 240+
 241+.videoComplete div.embed_code textarea {
 242+ margin: 8px 0 8px 0;
 243+ padding: 3px;
 244+ width: 258px;
 245+ height: 54px;
 246+ border: 1px solid #dadada;
 247+ font-family: Arial;
 248+ color: #777;
 249+ font-size: 11px;
 250+}
 251+.videoComplete div.embed_code button.copy_to_clipboard {
 252+ background: #dddddd url(images/button_to_clipboard.png) 0 0 repeat-x;
 253+ border: 1px solid #3b4552;
 254+ text-align: center;
 255+ padding: 2px 4px;
 256+ margin: 0 0 6px 0;
 257+ float: right;
 258+ display: inline;
 259+}
 260+
 261+
 262+
Index: trunk/phase3/js2/mwEmbed/skins/mvpcf/styles.css
@@ -280,64 +280,8 @@
281281 margin: 0 0 6px 0;
282282 }
283283
284 -.videoComplete {
285 -/* width: 100%;
286 - height: 100%;*/
287 - background: url(images/transparent_bg.png) 0 0 repeat;
288 - position: absolute;
289 - top:0px;
290 - left:0px;
291 - z-index: 10;
292 - font-size:16px;
293 - overflow: hidden;
294 -}
295284
296 -/* margin: -305px 0 0 0; */
297 -.videoComplete .videoOptionsComplete {
298 - background:transparent url('images/player_video_options_bg.png') no-repeat scroll 0pt;
299 - color:#7A7A7A;
300 - font-size:10pt;
301 - height:158px;
302 - left:10%;
303 - overflow:auto;
304 - padding:19px;
305 - position:relative;
306 - top:16%;
307 - width:283px;
308 -}
309 -.videoComplete .videoOptionsComplete p { text-align: center; margin: 3px 0; padding: 0; }
310 -.videoComplete .videoOptionsComplete a {
311 - color: white;
312 -/* font-size: 22px;*/
313 - font-size:12px;
314 - text-decoration: underline;
315 -}
316285
317 -.videoComplete .videoOptionsComplete a.email {
318 - font-size:16px;
319 - background: url(images/ico_mail.png) right 0px no-repeat;
320 - padding: 0 50px 0 0;
321 -}
322 -
323 -.videoComplete div.embed_code textarea {
324 - margin: 8px 0 8px 0;
325 - padding: 3px;
326 - width: 258px;
327 - height: 54px;
328 - border: 1px solid #dadada;
329 - font-family: Arial;
330 - color: #777;
331 - font-size: 11px;
332 -}
333 -.videoComplete div.embed_code button.copy_to_clipboard {
334 - background: #dddddd url(images/button_to_clipboard.png) 0 0 repeat-x;
335 - border: 1px solid #3b4552;
336 - text-align: center;
337 - padding: 2px 4px;
338 - margin: 0 0 6px 0;
339 - float: right;
340 - display: inline;
341 -}
342286 .cl_status{
343287 position:absolute;
344288 bottom:0px;
Index: trunk/phase3/js2/mwEmbed/mv_embed.js
@@ -785,11 +785,14 @@
786786
787787 /**
788788 * Utility Functions
789 - *
 789+ */
 790+
 791+
 792+ /**
790793 * parseUri 1.2.2
791794 * (c) Steven Levithan <stevenlevithan.com>
792795 * MIT License
793 - */
 796+ */
794797 $.parseUri = function (str) {
795798 var o = $.parseUri.options,
796799 m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
@@ -817,6 +820,25 @@
818821 loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
819822 }
820823 };
 824+
 825+ /*
 826+ * getAbsoluteUrl takes a src and returns the aboluste location given the document.URL
 827+ * @param {String} src path or url
 828+ */
 829+ $.absoluteUrl = function( src ){
 830+ var pSrc = mw.parseUri( src );
 831+ if( pSrc.protocol != '')
 832+ return src;
 833+
 834+ // Get the document path
 835+ var pDoc = mw.parseUri( document.URL );
 836+ // If a leading slash:
 837+ if( src.indexOf( '/' ) == 1 ){
 838+ return pDoc.protocol + '://' + pDoc.authority + src;
 839+ }else{
 840+ return pDoc.protocol + '://' + pDoc.authority + pDoc.directory + src;
 841+ }
 842+ };
821843 /**
822844 * Takes in a string returns an xml dom object
823845 */
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/kplayerEmbed.js
@@ -1,5 +1,5 @@
22 var kplayerEmbed = {
3 - instanceOf:'kflashEmbed',
 3+ instanceOf:'kplayerEmbed',
44 supports: {
55 'play_head':true,
66 'pause':true,
@@ -11,6 +11,7 @@
1212 },
1313 getEmbedHTML : function () {
1414 var embed_code = this.getEmbedObj();
 15+ alert
1516 var _this = this;
1617 setTimeout(function(){
1718 _this.postEmbedJS();
@@ -41,9 +42,9 @@
4243 },
4344 postEmbedJS:function() {
4445 var _this = this;
45 - this.getKDP();
 46+ this.getKDP();
 47+ //alert( this.kdp );
4648 if( this.kdp && this.kdp.insertMedia){
47 -
4849 // Add KDP listeners
4950
5051 //this.kdp.addJsListener("doPlay","kdpDoOnPlay");
@@ -52,20 +53,24 @@
5354
5455 _this.bindKdpFunc( 'doPause', 'kdpPause' );
5556 _this.bindKdpFunc( 'doPlay', 'play' );
56 - _this.bindKdpFunc( 'playerPlayEnd', 'onClipDone' );
57 -
58 - // Insert the src:
59 - this.kdp.insertMedia("-1",'http://192.168.192.90/kskin/kplayer-examples/media/bbb.flv','true');
 57+ _this.bindKdpFunc( 'playerPlayEnd', 'onClipDone' );
 58+
 59+ // KDP player likes an absolute url for the src:
 60+ var src = mw.absoluteUrl( _this.getSrc() );
 61+ js_log('play src: ' + src);
 62+ // Insert the src:
 63+ this.kdp.insertMedia("-1", src, 'true' );
6064 this.kdp.dispatchKdpEvent('doPlay');
6165
6266 // Start the monitor
6367 this.monitor();
6468 }else{
 69+ js_log('insert media: not defiend' + typeof this.kdp.insertMedia );
6570 setTimeout( function(){
6671 _this.postEmbedJS();
6772 }, 25);
6873 }
69 - },
 74+ },
7075 /**
7176 * bindKdpFunc
7277 *
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/vlcEmbed.js
@@ -60,9 +60,10 @@
6161 this.vlc.style.width = this.width;
6262 this.vlc.style.height = this.height;
6363 this.vlc.playlist.items.clear();
 64+ var src = mw.absoluteUrl( this.getSrc() ) ;
6465 // @@todo if client supports seeking no need to send seek_offset to URI
65 - js_log( 'vlc play::' + this.getSrc() );
66 - var itemId = this.vlc.playlist.add( this.getSrc() );
 66+ js_log( 'vlc play::' + src );
 67+ var itemId = this.vlc.playlist.add( src );
6768 if ( itemId != -1 ) {
6869 // play
6970 this.vlc.playlist.playItem( itemId );
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -1844,15 +1844,12 @@
18451845 // fade in a black bg div ontop of everything
18461846 var div_code = '<div id="blackbg_' + sel_id + '" class="videoComplete" ' +
18471847 'style="height:' + parseInt( height ) + 'px;width:' + parseInt( width ) + 'px;">' +
1848 - '<div class="videoOptionsComplete">' +
1849 - // @@TODO: this style should go to .css
1850 - '<span style="float:right;margin-right:10px">' +
1851 - '<a href="#" style="color:white;" onClick="$j(\'#' + sel_id + '\').get(0).closeDisplayedHTML();return false;">close</a>' +
 1848+ '<span style="float:right;margin-right:10px">' +
 1849+ '<a href="#" style="color:white;" onClick="$j(\'#' + sel_id + '\').get(0).closeDisplayedHTML();return false;">close</a>' +
18521850 '</span>' +
1853 - '<div id="mv_disp_inner_' + sel_id + '" style="padding-top:10px;">' +
1854 - html_code
1855 - + '</div>' +
1856 - '</div></div>';
 1851+ '<div class="videoOptionsComplete">' +
 1852+ '</div>'+
 1853+ '</div>';
18571854 $j( '#' + sel_id ).prepend( div_code );
18581855 if ( fade_in )
18591856 $j( '#blackbg_' + sel_id ).fadeIn( "slow" );

Status & tagging log