return @mkdir( $dir, $mode, true ); // PHP5 <3
}
-function wfMsgGetKey( $msgKey ) {
+function wfMsgGetKey( $msgKey, $na, $langKey=false ) {
global $messages, $mwLanguageCode;
+ if(!$langKey){
+ $langKey = $mwLanguageCode;
+ }
// Make sure we have the messages file:
require_once( realpath( dirname( __FILE__ ) ) . '/languages/mwEmbed.i18n.php' );
-
- if ( isset( $messages[$mwLanguageCode] ) && isset( $messages[$mwLanguageCode][$msgKey] ) ) {
- return $messages[$mwLanguageCode][$msgKey];
+ if ( isset( $messages[$mwLanguageCode] ) && isset( $messages[$langKey][$msgKey] ) ) {
+ return $messages[$langKey][$msgKey];
} else {
return '<' . $msgKey . '>';
}
* this file exposes some of the functionality of mwEmbed to wikis
* that do not yet have js2 enabled
*/
+
var urlparts = getRemoteEmbedPath();
var mwEmbedHostPath = urlparts[0];
-var reqAguments = urlparts[1];
+var mwRemoteVersion = 58776;
+
+reqArguments = urlparts[1];
+
+//setup up request Params:
+var reqParts = urlparts[1].split('&');
+var reqParam={};
+for(var i=0;i< reqParts.length; i++){
+ var p = reqParts[i].split('=');
+ if( p.length == 2 )
+ reqParam[ p[0] ]= p[1];
+}
addOnloadHook( function(){
//only do rewrites if MV_EMBED / js2 is "off"
// Add media wizard
if( wgAction == 'edit' || wgAction == 'submit' ) {
load_mv_embed( function() {
- loadExternalJs( mwEmbedHostPath + '/editPage.js' + reqAguments );
+ loadExternalJs( mwEmbedHostPath + '/editPage.js' + reqArguments );
} );
}
- //timed text dispaly:
+ //timed text display:
if(wgPageName.indexOf("TimedText") === 0){
load_mv_embed(function(){
- alert('wtf');
- loadExternalJs( mwEmbedHostPath + '/mwEmbed/libTimedText/mvTimeTextEdit.js' + reqAguments );
+ loadExternalJs( mwEmbedHostPath + '/mwEmbed/libTimedText/mvTimeTextEdit.js' + reqArguments );
});
}
// Firefogg integration
if( wgPageName == "Special:Upload" ){
load_mv_embed( function() {
- loadExternalJs( mwEmbedHostPath + '/uploadPage.js' + reqAguments );
+ loadExternalJs( mwEmbedHostPath + '/uploadPage.js' + reqArguments );
} );
}
var wgEnableIframeApiProxy = true;
load_mv_embed( function() {
js_log("Wiki:ApiProxy::");
- loadExternalJs( mwEmbedHostPath + '/apiProxyPage.js' + reqAguments );
+ loadExternalJs( mwEmbedHostPath + '/apiProxyPage.js' + reqArguments );
});
}
var pimg = $j( '#' + vidId + ' img' );
var poster_attr = 'poster = "' + pimg.attr( 'src' ) + '" ';
var pwidth = $j( '#' + vidId).width();
- var pheight = $j( '#' + vidId ).height();
-
+ var pheight = $j( '#' + vidId + ' img').height();
var tag_type = 'video';
// Check for audio
function load_mv_embed( callback ) {
// Inject mv_embed if needed
- if( typeof $mw == 'undefined' ) {
- var mvurl = mwEmbedHostPath + '/mwEmbed/mv_embed.js' + reqAguments ;
- importScriptURI( mvurl );
+ if( typeof $mw == 'undefined' ) {
+ if( reqParam['uselang'] || reqParam['useloader'] ){
+ var rurl = mwEmbedHostPath + '/mwEmbed/jsScriptLoader.php?class=mv_embed';
+ if(typeof window.jQuery == 'undefined'){
+ rurl+= ',window.jQuery';
+ }
+ if(reqParam['urid']){
+ rurl+='&urid=' + reqParam['urid'];
+ }else{
+ rurl+='&urid=' + mwRemoteVersion;
+ }
+ if(reqParam['uselang'] )
+ rurl+='&uselang=' + reqParam['uselang'];
+ //do import url:
+ importScriptURI(rurl);
+ }else{
+ importScriptURI( mwEmbedHostPath + '/mwEmbed/mv_embed.js' + reqArguments );
+ }
}
check_for_mv_embed( callback );
}
} else {
callback();
}
-}
+}
\ No newline at end of file