From: Michael Dale Date: Mon, 9 Nov 2009 00:19:06 +0000 (+0000) Subject: * js_log msgs striped from non-debug output (smaller size no console.log calls) X-Git-Tag: 1.31.0-rc.0~38874 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=d0a1e42c3d16fb960e97f51c899b733399e0e3f1;p=lhc%2Fweb%2Fwiklou.git * js_log msgs striped from non-debug output (smaller size no console.log calls) * fixed height for captions for small videos / audio --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 7728a30ec8..277b364771 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1610,7 +1610,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches do not keep obsolete copies of global * styles. */ -$wgStyleVersion = '252'; +$wgStyleVersion = '253'; # Server-side caching: diff --git a/js2/mwEmbed/jsScriptLoader.php b/js2/mwEmbed/jsScriptLoader.php index a8e60cc4b8..e195e20be7 100644 --- a/js2/mwEmbed/jsScriptLoader.php +++ b/js2/mwEmbed/jsScriptLoader.php @@ -44,7 +44,7 @@ class jsScriptLoader { function doScriptLoader() { global $wgJSAutoloadClasses, $wgJSAutoloadLocalClasses, $IP, - $wgEnableScriptMinify, $wgUseFileCache, $wgExtensionMessagesFiles; + $wgEnableScriptMinify, $wgUseFileCache, $wgExtensionMessagesFiles; //load the ExtensionMessagesFiles $wgExtensionMessagesFiles['mwEmbed'] = realpath( dirname( __FILE__ ) ) . '/php/languages/mwEmbed.i18n.php'; @@ -83,7 +83,7 @@ class jsScriptLoader { if ( $wgUseFileCache && !$this->debug ) { $status = $this->sFileCache->saveToFileCache( $this->jsout ); if ( $status !== true ) - $this->error_msg .= $status; + $this->error_msg .= $status; } // Check for an error msg if ( $this->error_msg != '' ) { @@ -120,7 +120,7 @@ class jsScriptLoader { if ( in_array( strtolower( $skin ), $skinNames ) ) { // If in debug mode, add a comment with wiki title and rev: if ( $this->debug ) - $jsout .= "\n/**\n* GenerateUserJs: \n*/\n"; + $jsout .= "\n/**\n* GenerateUserJs: \n*/\n"; return $jsout . $sk->generateUserJs( $skin ) . "\n"; } } else { @@ -136,7 +136,7 @@ class jsScriptLoader { if ( $a->getID() !== 0 ) { // If in debug mode, add a comment with wiki title and rev: if ( $this->debug ) - $jsout .= "\n/**\n* WikiJSPage: " . htmlspecialchars( $title_block ) . " rev: " . $a->getID() . " \n*/\n"; + $jsout .= "\n/**\n* WikiJSPage: " . htmlspecialchars( $title_block ) . " rev: " . $a->getID() . " \n*/\n"; return $jsout . $a->getContent() . "\n"; } @@ -156,7 +156,7 @@ class jsScriptLoader { if ( trim( $file_name ) != '' ) { if ( $this->debug ) - $jsout .= "\n/**\n* File: " . htmlspecialchars( $file_name ) . "\n*/\n"; + $jsout .= "\n/**\n* File: " . htmlspecialchars( $file_name ) . "\n*/\n"; $jsFileStr = $this->doGetJsFile( $file_name ) . "\n"; if( $jsFileStr ){ @@ -167,7 +167,7 @@ class jsScriptLoader { } } } - //if we did not return some js + //if we did not return some js $this->error_msg .= "\nUnknown error\n"; return false; } @@ -200,10 +200,10 @@ class jsScriptLoader { $m = array(); if( preg_match( '/\bgzip(?:;(q)=([0-9]+(?:\.[0-9]+)))?\b/', - $_SERVER['HTTP_ACCEPT_ENCODING'], - $m ) ) { + $_SERVER['HTTP_ACCEPT_ENCODING'], + $m ) ) { if( isset( $m[2] ) && ( $m[1] == 'q' ) && ( $m[2] == 0 ) ) - return false; + return false; //no gzip support found return true; } @@ -259,9 +259,9 @@ class jsScriptLoader { //make sure its a valid wikipage before doing processing $t = Title::newFromDBkey( substr( $reqClass, 3) ); if( $t->exists() - && ( $t->getNamespace() == NS_MEDIAWIKI - || $t->getNamespace() == NS_USER ) ){ - $doAddWT = true; + && ( $t->getNamespace() == NS_MEDIAWIKI + || $t->getNamespace() == NS_USER ) ){ + $doAddWT = true; } } } @@ -384,8 +384,8 @@ class jsScriptLoader { function doProcessJs( $str ){ global $wgEnableScriptLocalization; // Strip out js_log debug lines. Not much luck with this regExp yet: - // if( !$this->debug ) - // $str = preg_replace('/\n\s*js_log\s*\([^\)]([^;]|\n])*;/', "\n", $str); + if( !$this->debug ) + $str = preg_replace('/\n\s*js_log\(([^\)]*\))*\s*[\;\n]/U', "\n", $str); // Do language swap by index: if ( $wgEnableScriptLocalization ){ @@ -422,16 +422,16 @@ class jsScriptLoader { switch( $char ) { case '"': $inquote = !$inquote; - break; + break; case '}': if( ! $inquote){ $returnIndex['e'] =$i; return $returnIndex; } - break; + break; case '\\': if ( $inquote ) $ignorenext = true; - break; + break; } } } @@ -453,14 +453,14 @@ class jsScriptLoader { $inx = self::getLoadGmIndex( $str ); if(!$inx) - return ''; + return ''; return FormatJson::decode( '{' . substr($str, $inx['s'], ($inx['e']-$inx['s'])) . '}', true); } static public function getMsgKeys(& $jmsg, $langCode = false){ global $wgContLanguageCode; if(!$langCode) - $langCode = $wgContLanguageCode; + $langCode = $wgContLanguageCode; //get the msg keys for the a json array foreach ( $jmsg as $msgKey => $default_en_value ) { $jmsg[$msgKey] = wfMsgGetKey( $msgKey, true, $langCode, false ); @@ -514,7 +514,7 @@ class simpleFileCache { // Check for defined files:: if( is_file( $this->filename ) ) - return $this->filename; + return $this->filename; if( is_file( $this->filename .'.gz') ){ $this->filename.='.gz'; @@ -522,7 +522,7 @@ class simpleFileCache { } //check the update the name based on the $wgUseGzip config var if ( isset($wgUseGzip) && $wgUseGzip ) - $this->filename.='.gz'; + $this->filename.='.gz'; } public function isFileCached() { @@ -547,10 +547,10 @@ class simpleFileCache { $m = array(); if ( preg_match( '/\bgzip(?:;(q)=([0-9]+(?:\.[0-9]+)))?\b/', - $_SERVER['HTTP_ACCEPT_ENCODING'], - $m ) ) { + $_SERVER['HTTP_ACCEPT_ENCODING'], + $m ) ) { if ( isset( $m[2] ) && ( $m[1] == 'q' ) && ( $m[2] == 0 ) ) - return false; + return false; return true; } @@ -562,7 +562,7 @@ class simpleFileCache { return 'Error: Called saveToFileCache with $wgUseFileCache off'; } if ( strcmp( $text, '' ) == 0 ) - return 'saveToFileCache: empty output file'; + return 'saveToFileCache: empty output file'; if ( $wgUseGzip ) { $outputText = gzencode( trim( $text ) ); @@ -574,7 +574,7 @@ class simpleFileCache { $status = $this->checkCacheDirs(); if ( $status !== true ) - return $status; + return $status; $f = fopen( $this->filename, 'w' ); if ( $f ) { fwrite( $f, $outputText ); diff --git a/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js b/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js index 7943fbea40..79800b11c7 100644 --- a/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js +++ b/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js @@ -224,8 +224,8 @@ mvBaseUploadInterface.prototype = { //set the action to the api url: $j(_this.editForm).attr('action', _this.api_url ); - js_log('do iframe form submit to: ' + $j(_this.editForm).attr('target') - + ' destName:' + $j(_this.editForm).find("[name='filename']").val() ); + js_log('do iframe form submit to: ' + $j(_this.editForm).attr('target') ); + js_log(' destName:' + $j(_this.editForm).find("[name='filename']").val() ); //do post override diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index 6045ce1c2d..e0e90d5117 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -1726,10 +1726,11 @@ embedVideo.prototype = { //@@todo support position config var loc = $j(this).position(); if($j('#metaBox_'+this.id).length==0){ + var theight = (parseInt( this.height ) < 200) ? 200 : this.height; $j(this).after('
'+ mv_get_loading_img() + diff --git a/js2/mwEmbed/skins/ctrlBuilder.js b/js2/mwEmbed/skins/ctrlBuilder.js index e877452d76..3f7908dd56 100644 --- a/js2/mwEmbed/skins/ctrlBuilder.js +++ b/js2/mwEmbed/skins/ctrlBuilder.js @@ -23,7 +23,7 @@ ctrlBuilder.prototype = { //check for skin overrides for ctrlBuilder if( _global[ embedObj.skin_name + 'Config'] ){ - //clone as to not overide prototype: + //clone as to not override prototype: var _this = $j.extend(true, {}, this, _global[ embedObj.skin_name + 'Config']); return _this; } @@ -119,8 +119,9 @@ ctrlBuilder.prototype = { $j('#dc_'+ embedObj.id).hover( function(){ if($j('#gnp_' + embedObj.id).length==0){ + var toppos = ( embedObj.instanceOf == 'mvPlayList')?25:10; $j(this).append('
' + + 'style="position:absolute;display:none;background:#FFF;top:'+toppos+'px;left:10px;right:10px;">' + gM('mwe-for_best_experience') + '
' + gM('mwe-do_not_warn_again') + @@ -128,7 +129,7 @@ ctrlBuilder.prototype = { $j('#ffwarn_'+embedObj.id).click(function(){ if( $j(this).is(':checked') ){ //set up a cookie for 7 days: - $j.cookie('dismissNativeWarn', true, { expires: 5 }); + $j.cookie('dismissNativeWarn', true, { expires: 7 }); //set the current instance _global['dismissNativeWarn'] = true; $j('#gnp_' + embedObj.id).fadeOut('slow'); @@ -170,7 +171,7 @@ ctrlBuilder.prototype = { $j('#' +embedObj.id).get(0).fullscreen(); }); - js_log(" should add slider binding: " + $tp.find('.play_head').length) ; + js_log(" should add slider binding: " + $tp.find('.play_head').length); $tp.find('.play_head').slider({ range: "min", value: 0, diff --git a/js2/remoteMwEmbed.js b/js2/remoteMwEmbed.js index 78b473c6cf..a1fd0eb863 100644 --- a/js2/remoteMwEmbed.js +++ b/js2/remoteMwEmbed.js @@ -5,7 +5,7 @@ var urlparts = getRemoteEmbedPath(); var mwEmbedHostPath = urlparts[0]; -var mwRemoteVersion = 58776; +var mwRemoteVersion = '1.0'; reqArguments = urlparts[1]; @@ -139,7 +139,7 @@ function rewrite_for_OggHandler( vidIdList ){ if( vidIdList.length != 0 ){ setTimeout( function(){ procVidId( vidIdList.pop() ) - }, 1); + }, 10); } }); };