Index: branches/js2-work/phase3/js/mwEmbed/skins/common/common.css |
— | — | @@ -373,97 +373,10 @@ |
374 | 374 | .ui-dialog .ui-dialog-buttonpane button { float: left !important; } |
375 | 375 | |
376 | 376 | |
377 | | -.vol_container{ |
378 | | - z-index:99; |
379 | | - width:23px; |
380 | | - height:75px; |
381 | | - width:23px; |
382 | | - background: #CCC; |
383 | | -} |
384 | | -.vol_container_below{ |
385 | | - top:30px; |
386 | | -} |
387 | | -.vol_container_top{ |
388 | | - top:-77px; |
389 | | -} |
390 | | -.vol_container .volume_bar{ |
391 | | - margin-top:5px; |
392 | | - height:65px; |
393 | | - width:10px; |
394 | | - margin-left: auto ; |
395 | | - margin-right: auto ; |
396 | | -} |
397 | | -.vol_container .ui-slider-handle{ |
398 | | - cursor : pointer; |
399 | | - width:10px; |
400 | | - height:10px; |
401 | | - position:absolute; |
402 | | - left:-1px; |
403 | | -} |
404 | | - |
405 | | -/* related videos Video */ |
406 | | -.related_vids { |
407 | | - top:10px; |
408 | | - left:5px; |
409 | | - right:5px; |
410 | | - bottom:5px; |
411 | | - position:absolute; |
412 | | - overflow-y:auto; |
413 | | -} |
414 | | -.related_vids h1 { |
415 | | - border:medium none; |
416 | | - font-size:20px; |
417 | | - margin:4px 0px 4px 11px; |
418 | | - padding:0; |
419 | | - color:#FFF; |
420 | | - font-family:arial,sans-serif; |
421 | | -} |
422 | | - |
423 | | -.related_vids ul { |
424 | | - margin:0; |
425 | | - padding:0; |
426 | | - list-style-image:none; |
427 | | - list-style-position:inside; |
428 | | - list-style-type:none; |
429 | | - margin:0; |
430 | | - padding:0; |
431 | | -} |
432 | | - |
433 | | -.related_vids li{ |
434 | | - -x-system-font:none; |
435 | | - color:#FAFAFA; |
436 | | - display:table; |
437 | | - font-family:arial,sans-serif; |
438 | | - font-size:11px; |
439 | | - line-height:normal; |
440 | | - margin:0 0 6px 35px; |
441 | | - padding:0; |
442 | | -} |
443 | | -.related_vids a{ |
444 | | - color:#FAFAFA; |
445 | | -} |
446 | | - |
447 | | -.related_vids li div { |
448 | | - float:right; |
449 | | - margin:5px 0 0 10px; |
450 | | - width:200px; |
451 | | -} |
452 | | - |
453 | | -.related_vids img { |
454 | | - width:80px; |
455 | | - z-index:2; |
456 | | - border-bottom:3px solid #36393D; |
457 | | - border-top:3px solid #36393D; |
458 | | -} |
459 | | - |
460 | 377 | .mw-imported-resource{ |
461 | 378 | border: thin solid black; |
462 | 379 | } |
463 | 380 | |
464 | | -.interface_wrap{ |
465 | | - position:relative; |
466 | | -} |
467 | | - |
468 | 381 | .kaltura-icon { |
469 | 382 | background-image:url('images/kaltura_logo_sm_transparent.png') !important; |
470 | 383 | background-repeat:no-repeat; |
— | — | @@ -473,12 +386,6 @@ |
474 | 387 | margin-top: -6px !important; |
475 | 388 | margin-left: 3px !important; |
476 | 389 | } |
477 | | -.mw-buffer{ |
478 | | - width:0px; |
479 | | - height:100%; |
480 | | - z-index:1; |
481 | | - top:0px; |
482 | | -} |
483 | 390 | |
484 | 391 | .mw-fullscreen-overlay { |
485 | 392 | background: rgb(0, 0, 0) none repeat scroll 0% 0%; |
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js |
— | — | @@ -2387,8 +2387,12 @@ |
2388 | 2388 | * @param {String} cssString Css Payload to be added to head of document |
2389 | 2389 | */ |
2390 | 2390 | mw.addStyleString = function( cssClassName, cssString ) { |
| 2391 | + if( mw.style[ cssClassName ] ){ |
| 2392 | + mw.log(" Style: ( " + cssClassName + ' ) already set' ); |
| 2393 | + return true; |
| 2394 | + } |
2391 | 2395 | // Set the style to true ( to not request it again ) |
2392 | | - mw.style[ cssClassName ] = true; |
| 2396 | + mw.style[ cssClassName ] = true; |
2393 | 2397 | mw.log(" Style: " + cssClassName + ' has been set' ); |
2394 | 2398 | // Wait for the DOM to be ready before adding in the css: |
2395 | 2399 | mw.ready( function() { |
Index: branches/js2-work/phase3/js/mwEmbed/jsScriptLoader.php |
— | — | @@ -107,15 +107,16 @@ |
108 | 108 | |
109 | 109 | // Build the output |
110 | 110 | // Swap in the appropriate language per js_file |
111 | | - foreach ( $this->jsFileList as $classKey => $file_name ) { |
| 111 | + foreach ( $this->jsFileList as $classKey => $filePath ) { |
112 | 112 | |
113 | 113 | // Get the script content |
114 | | - $jstxt = $this->getScriptText( $classKey, $file_name ); |
| 114 | + $jstxt = $this->getScriptText( $classKey, $filePath ); |
115 | 115 | if( $jstxt ){ |
116 | 116 | $this->jsout .= $this->doProcessJs( $jstxt ); |
117 | 117 | } |
118 | 118 | |
119 | | - // If the core mwEmbed class entry point include all the loader js |
| 119 | + // If the core mwEmbed class entry point add some |
| 120 | + // other "core" files: |
120 | 121 | if( $classKey == 'mwEmbed' ){ |
121 | 122 | |
122 | 123 | // Output the loaders: |
— | — | @@ -125,11 +126,11 @@ |
126 | 127 | $this->jsout .= jsClassLoader::getLanguageJs( $this->langCode ); |
127 | 128 | |
128 | 129 | // Output the "common" css file |
129 | | - $filePath = self::getJsPathFromClass( 'mw.style.common' ); |
130 | | - if( $filePath ) { |
131 | | - $this->jsout .= $this->getScriptText( 'mw.style.common', $filePath ); |
132 | | - } |
| 130 | + $this->jsout .= $this->getScriptText( 'mw.style.common' ); |
133 | 131 | |
| 132 | + // Output the jQuery ui theme css |
| 133 | + $this->jsout .= $this->getScriptText( 'mw.style.redmond' ); |
| 134 | + |
134 | 135 | // Output special IE comment tag to support special mwEmbed tags. |
135 | 136 | $NotMinifiedTopJs.='/*@cc_on\'video source itext playlist\'.replace(/\w+/g,function(n){document.createElement(n)})@*/'."\n"; |
136 | 137 | } |
— | — | @@ -256,19 +257,20 @@ |
257 | 258 | * Get the javascript text content from a given classKey |
258 | 259 | * |
259 | 260 | * @param {String} $classKey Class Key to grab text for |
260 | | - * @param {String} [$file_name] Optional file path to get js text |
| 261 | + * @param {String} [$filePath] Optional file path to get js text |
261 | 262 | * @return unknown |
262 | 263 | */ |
263 | | - function getScriptText( $classKey, $file_name = '' ){ |
| 264 | + function getScriptText( $classKey ){ |
264 | 265 | $jsout = ''; |
| 266 | + $filePath = self::getPathFromClass( $classKey ); |
265 | 267 | // Special case: title classes |
266 | 268 | if ( substr( $classKey, 0, 3 ) == 'WT:' ) { |
267 | 269 | global $wgUser; |
268 | 270 | // Get just the title part |
269 | | - $title_block = substr( $classKey, 3 ); |
270 | | - if ( $title_block[0] == '-' && strpos( $title_block, '|' ) !== false ) { |
| 271 | + $titleBlock = substr( $classKey, 3 ); |
| 272 | + if ( $titleBlock[0] == '-' && strpos( $titleBlock, '|' ) !== false ) { |
271 | 273 | // Special case of "-" title with skin |
272 | | - $parts = explode( '|', $title_block ); |
| 274 | + $parts = explode( '|', $titleBlock ); |
273 | 275 | $title = array_shift( $parts ); |
274 | 276 | foreach ( $parts as $tparam ) { |
275 | 277 | list( $key, $val ) = explode( '=', $tparam ); |
— | — | @@ -288,20 +290,20 @@ |
289 | 291 | return $sk->generateUserJs( $skin ) . "\n"; |
290 | 292 | } |
291 | 293 | } else { |
292 | | - $ext = substr($title_block, strrpos($title_block, '.') + 1); |
| 294 | + $ext = substr($titleBlock, strrpos($titleBlock, '.') + 1); |
293 | 295 | // Make sure the wiki title ends with .js or .css |
294 | 296 | if ( self::validFileExtension( $ext ) ) { |
295 | 297 | $this->errorMsg .= 'WikiTitle includes should end with .js or .css'; |
296 | 298 | return false; |
297 | 299 | } |
298 | 300 | // It's a wiki title, append the output of the wikitext: |
299 | | - $t = Title::newFromText( $title_block ); |
| 301 | + $t = Title::newFromText( $titleBlock ); |
300 | 302 | $a = new Article( $t ); |
301 | 303 | // Only get the content if the page is not empty: |
302 | 304 | if ( $a->getID() !== 0 ) { |
303 | 305 | // If in debug mode, add a comment with wiki title and rev: |
304 | 306 | if ( $this->debug ) |
305 | | - $jsout .= "\n/**\n* WikiJSPage: " . htmlspecialchars( $title_block ) . " rev: " . $a->getID() . " \n*/\n"; |
| 307 | + $jsout .= "\n/**\n* WikiJSPage: " . htmlspecialchars( $titleBlock ) . " rev: " . $a->getID() . " \n*/\n"; |
306 | 308 | $fileStr = $a->getContent() . "\n"; |
307 | 309 | $jsout.= ( $ext == 'css' ) ? |
308 | 310 | $this->transformCssOutput( $classKey, $fileStr ) : |
— | — | @@ -310,22 +312,22 @@ |
311 | 313 | } |
312 | 314 | } |
313 | 315 | }else{ |
314 | | - $ext = substr($file_name, strrpos($file_name, '.') + 1); |
| 316 | + $ext = substr($filePath, strrpos($filePath, '.') + 1); |
315 | 317 | // Dealing with files |
316 | | - if ( trim( $file_name ) != '' ) { |
317 | | - $fileStr = $this->getFileContents( $file_name ) . "\n"; |
| 318 | + if ( trim( $filePath ) != '' ) { |
| 319 | + $fileStr = $this->getFileContents( $filePath ) . "\n"; |
318 | 320 | if( $fileStr ){ |
319 | 321 | // Add the file name if debug is enabled |
320 | 322 | if ( $this->debug ){ |
321 | | - $jsout .= "\n/**\n* File: " . htmlspecialchars( $file_name ) . "\n*/\n"; |
| 323 | + $jsout .= "\n/**\n* File: " . htmlspecialchars( $filePath ) . "\n*/\n"; |
322 | 324 | } |
323 | 325 | $jsout.= ( $ext == 'css' ) ? |
324 | | - $this->transformCssOutput( $classKey, $fileStr, $file_name ) : |
| 326 | + $this->transformCssOutput( $classKey, $fileStr, $filePath ) : |
325 | 327 | $fileStr; |
326 | 328 | |
327 | 329 | return $jsout; |
328 | 330 | }else{ |
329 | | - $this->errorMsg .= "\nError could not read file: ". htmlspecialchars( $file_name ) ."\n"; |
| 331 | + $this->errorMsg .= "\nError could not read file: ". htmlspecialchars( $filePath ) ."\n"; |
330 | 332 | return false; |
331 | 333 | } |
332 | 334 | } |
— | — | @@ -347,7 +349,7 @@ |
348 | 350 | $cssOptions[ 'preserveComments' ] = false; |
349 | 351 | } |
350 | 352 | $serverUri = $this->getScriptLoaderUri(); |
351 | | - |
| 353 | + |
352 | 354 | // Check for the two jsScriptLoader entry points: |
353 | 355 | if( strpos( $serverUri, 'mwScriptLoader.php') !== false ){ |
354 | 356 | $cssOptions[ 'prependRelativePath' ] = |
— | — | @@ -515,11 +517,11 @@ |
516 | 518 | |
517 | 519 | $reqClass = preg_replace( "/[^A-Za-z0-9_\-\.]/", '', $reqClass ); |
518 | 520 | |
519 | | - $jsFilePath = self::getJsPathFromClass( $reqClass ); |
| 521 | + $filePath = self::getPathFromClass( $reqClass ); |
520 | 522 | if( !$jsFilePath ){ |
521 | 523 | $this->errorMsg .= 'Requested class: ' . htmlspecialchars( $reqClass ) . ' not found' . "\n"; |
522 | 524 | }else{ |
523 | | - $this->jsFileList[ $reqClass ] = $jsFilePath; |
| 525 | + $this->jsFileList[ $reqClass ] = $filePath; |
524 | 526 | $this->requestKey .= $reqClass; |
525 | 527 | } |
526 | 528 | } |
— | — | @@ -638,7 +640,7 @@ |
639 | 641 | * @param {String} $reqClass Class key to get the path for |
640 | 642 | * @return path of the class or "false" |
641 | 643 | */ |
642 | | - public static function getJsPathFromClass( $reqClass ){ |
| 644 | + public static function getPathFromClass( $reqClass ){ |
643 | 645 | global $wgJSAutoloadClasses; |
644 | 646 | // Make sure the class is loaded: |
645 | 647 | jsClassLoader::loadClassPaths(); |
— | — | @@ -789,7 +791,7 @@ |
790 | 792 | * @return {Array} decoded json array of message key value pairs |
791 | 793 | */ |
792 | 794 | function getMsgKeysFromClass( $class ){ |
793 | | - $filePath = self::getJsPathFromClass( $class ); |
| 795 | + $filePath = self::getPathFromClass( $class ); |
794 | 796 | $str = $this->getScriptText($class, $filePath); |
795 | 797 | |
796 | 798 | $inx = self::getAddMessagesIndex( $str ); |