http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72276
Revision: 72276
Author: dale
Date: 2010-09-03 11:17:33 +0000 (Fri, 03 Sep 2010)
Log Message:
-----------
fixes old videoBufferSeek call
added msgs for sequencer
fixed loader calls to include widget and mouse par of juqery ui 1.8.4 upgrade )
expanded flatten dialog box so it does not get cut off
more testing and minor fixes
Modified Paths:
--------------
branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php
branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsSequence.js
branches/MwEmbedStandAlone/modules/Sequencer/loader.js
branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js
branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js
branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
branches/MwEmbedStandAlone/remotes/mediaWiki.js
Modified: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js 2010-09-03
10:54:46 UTC (rev 72275)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js 2010-09-03
11:17:33 UTC (rev 72276)
@@ -156,8 +156,7 @@
// Set up the embed video player class request: (include the
skin js as well)
var dependencyRequest = [
[
- '$j.ui',
- '$j.widget',
+ '$j.ui',
'mw.EmbedPlayer',
'mw.PlayerControlBuilder',
'$j.fn.hoverIntent',
@@ -167,6 +166,7 @@
'JSON'
],
[
+ '$j.widget',
'$j.ui.mouse',
'$j.fn.menu',
'mw.style.jquerymenu',
Modified: branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php
2010-09-03 10:54:46 UTC (rev 72275)
+++ branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php
2010-09-03 11:17:33 UTC (rev 72276)
@@ -45,8 +45,11 @@
'mwe-sequencer-tools-panzoomhelper-desc' => 'Resize and move the
<i>layout helper</i> to update layout',
'mwe-sequencer-tools-panzoomhelper-resetlayout' => 'Reset layout',
+ 'mwe-sequencer-tools-templateedit' => 'Edit template',
+ 'mwe-sequencer-template-name' => 'Template page name',
+ 'mwe-sequencer-tools-templateedit-desc' => 'Edit template parameters',
+ 'mwe-sequencer-edittemplate-params' => 'Template parameters',
-
'mwe-sequencer-tools-transitions' => 'Transitions',
'mwe-sequencer-tools-transitions-desc' => 'Set in and out Transitions',
'mwe-sequencer-clip-transin' => 'Transition in',
Modified:
branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsSequence.js
===================================================================
---
branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsSequence.js
2010-09-03 10:54:46 UTC (rev 72275)
+++
branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsSequence.js
2010-09-03 11:17:33 UTC (rev 72276)
@@ -252,7 +252,7 @@
'title' :
gM('mwe-sequencer-menu-sequence-publish-desc'),
'content' : gM('mwe-sequencer-loading-publish-render'),
'width' : 450,
- 'height' : 400
+ 'height' : 470
});
// Check if we have unsaved changes ( don't publish unsaved
changes )
Modified: branches/MwEmbedStandAlone/modules/Sequencer/loader.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/loader.js 2010-09-03
10:54:46 UTC (rev 72275)
+++ branches/MwEmbedStandAlone/modules/Sequencer/loader.js 2010-09-03
11:17:33 UTC (rev 72276)
@@ -87,7 +87,8 @@
'$j.fn.layout',
// UI components used in the sequencer
interface:
- '$j.ui.mouse',
+ '$j.ui.mouse',
+ '$j.widget',
'$j.ui.accordion',
'$j.ui.dialog',
'$j.ui.droppable',
@@ -95,7 +96,7 @@
'$j.ui.progressbar',
'$j.ui.sortable',
'$j.ui.resizable',
- '$j.ui.slider',
+ '$j.ui.slider',
'$j.ui.tabs'
]
];
Modified: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
2010-09-03 10:54:46 UTC (rev 72275)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
2010-09-03 11:17:33 UTC (rev 72276)
@@ -116,8 +116,8 @@
},
getTemplateText: function( templateTitle, callback ){
var _this = this;
- if(this.templateTextCache[templateTitle]){
- callback(templateTitle);
+ if( this.templateTextCache[templateTitle] ){
+ callback( this.templateTextCache[templateTitle]
);
return ;
}
mw.getTitleText( this.getApiUrl(),templateTitle,
function( templateText ){
Modified: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
2010-09-03 10:54:46 UTC (rev 72275)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
2010-09-03 11:17:33 UTC (rev 72276)
@@ -113,11 +113,9 @@
var trackStack =0;
// Draw all the tracks
$j.each(smilSequenceTracks, function( trackIndex,
smilSequenceTrack ){
- trackStack++;
- mw.log("!!!t++ inx: " + trackIndex + ' stack:' +
trackStack);
+ trackStack++;
_this.drawSequenceTrack( trackIndex, smilSequenceTrack,
function(){
trackStack--;
- mw.log("t-- inx: " + trackIndex + ' stack:' +
trackStack);
if( trackStack == 0 && callback ){
callback();
}
Modified: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js
2010-09-03 10:54:46 UTC (rev 72275)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js
2010-09-03 11:17:33 UTC (rev 72276)
@@ -40,7 +40,7 @@
},
'templateedit':{
'editWidgets' : ['edittemplate'],
- 'editableAttributes' : [ 'apiTitleKey' ],
+ 'editableAttributes' : [ 'apititlekey' ],
'contentTypes' : ['mwtemplate']
},
'transitions' : {
@@ -63,9 +63,9 @@
'title' : gM('mwe-sequencer-clip-panzoom' ),
'defaultValue' : '0%, 0%, 100%, 100%'
},
- 'apiTitleKey' : {
+ 'apititlekey' : {
'type' : 'string',
- 'inputSize' : 15,
+ 'inputSize' : 30,
'title' : gM('mwe-sequencer-template-name' )
},
'transIn' : {
@@ -79,28 +79,34 @@
// Special child node type
'param' : {
'type' : 'childParam',
- 'inputSize' : 20
+ 'inputSize' : 30
}
},
editableTypes: {
'childParam': {
- update: function( _this, smilElement, paramName, value){
+ update: function( _this, smilElement, paramName,
value){
// Check if the param already exists
- $paramNode = $j( smilElement ).find( "[name='"+
paramName + '"]' );
+ $paramNode = $j( smilElement ).find( "[name='"+
paramName + "']" );
if( $paramNode.length == 0){
$j( smilElement ).append(
- $j('<param />').attr('name',
paramName)
+ $j('<param />').attr({
+ 'name': paramName,
+ 'value' : value
+ })
)
+ } else {
+ // Update the param value
+ $paramNode.attr( 'value', value);
}
- // Update the param value
- $paramNode.attr( 'value', value);
+ mw.log("editableTypes::Should have updated
smilElement param: " + paramName
+ + ' to : ' + $j( smilElement
).find( "[name='"+ paramName + '"]' ).attr( 'value') );
},
- getSmilVal: function( _this, smilElement, paramName,
value){
- $paramNode = $j( smilElement ).find(
"[name='"+ paramName + '"]' );
+ getSmilVal: function( _this, smilElement, paramName ){
+ $paramNode = $j( smilElement ).find(
"[name='"+ paramName + "']" );
if( $paramNode.length == 0){
return '';
}
- $paramNode.attr('value');
+ return $paramNode.attr('value');
}
},
'string': {
@@ -185,8 +191,16 @@
},
editWidgets: {
'edittemplate':{
- 'onChange' : function( _this, target, smilElement ){
-
+ 'onChange' : function( _this, smilElement, target ){
+ // Clear the smilElement template cache:
+ $j( smilElement ).data('templateHtmlCache',
null);
+ // Re draw the smilElement in the player
+ var smil = _this.sequencer.getSmil();
+ $playerTarget = $j('#' +
smil.getSmilElementPlayerID( smilElement ) );
+ $playerTarget.loadingSpinner();
+ smil.getLayout().getSmilTemplateHtml(
smilElement, $playerTarget, function(){
+ mw.log("SequencerTools::editWidgets:
smil template updated");
+ });
},
'draw': function( _this, target, smilElement ){
// Parse the set of templates from the template
text cache
@@ -197,19 +211,23 @@
return ;
}
// Get the template wikitext
- _this.sequencer.getServer().getTemplateText($j(
smilElement).attr('apititlekey'), function( templateText ){
- if( ! templateText ){
+ _this.sequencer
+ .getServer()
+ .getTemplateText( $j(
smilElement).attr('apititlekey'), function( templateText ){
+ mw.log("GotTemplateText: " +
templateText );
+ if( ! templateText || typeof
templateText != 'string' ){
mw.log("Error: could not get
wikitext form titlekey: " + $j( smilElement).attr('apititlekey'))
return ;
}
$j( target ).empty().append(
- $j('<h3
/>').text('mwe-sequencer-edittemplate-params')
+ $j('<h3 />').text(
gM('mwe-sequencer-edittemplate-params') )
)
// This is not supposed to be perfect
..
// just get you 'most' of the input
vars 'most' of the time via the greedy regEx:
- var templateVars =
templateText.match(/\{\{\{([^\}]*)\}\}\}/gi);
- var cleanTemplateParams = {};
+ var templateVars =
templateText.match(/\{\{\{([^\}]*)\}\}\}/gi);
+ var cleanTemplateParams = {};
+
for( i =0;i<templateVars.length; i++ ){
var tVar = templateVars[i];
// Remove all {{{ and }}}
@@ -224,15 +242,34 @@
// Output input boxes for each template
var as a param
for( var paramName in
cleanTemplateParams ){
$j( target ).append(
-
_this.getEditableAttribute(smilElement, 'edittemplate', 'param', paramName ),
- $j('<br />')
+
_this.getEditableAttribute(
+
smilElement,
+
'edittemplate',
+
'param',
+
paramName
+ )
+ .find('input')
+ // Bind the change
event:
+ .change(function(){
+
_this.editWidgets.edittemplate.onChange(
+ _this,
+
smilElement,
+ target
+ )
+ })
+ .parent()
+ ,
+ $j('<div />')
+ .css('clear', 'both')
)
- }
+ }
+
+
});
}
},
'panzoom' : {
- 'onChange': function( _this, target, smilElement ){
+ 'onChange': function( _this, smilElement, target ){
var panZoomVal = $j('#'
+_this.getEditToolInputId( 'panzoom', 'panZoom')).val();
mw.log("panzoom change:" + panZoomVal );
@@ -267,7 +304,7 @@
// Add a input box binding:
$j('#' +_this.getEditToolInputId( 'panzoom',
'panZoom'))
.change(function(){
- _this.editWidgets.panzoom.onChange(
_this, target, smilElement);
+ _this.editWidgets.panzoom.onChange(
_this, smilElement, target );
})
$j( target ).append(
@@ -357,7 +394,7 @@
_this.sequencer.getSmil()
.getLayout()
.panZoomLayout(
- smilElement
+ smilElement
);
}
// Add bindings
@@ -378,7 +415,7 @@
// Restore original css for the
layout helper
$j(this).css( orginalHelperCss )
// trigger the 'change'
-
_this.editWidgets.panzoom.onChange( _this, target, smilElement );
+
_this.editWidgets.panzoom.onChange( _this, smilElement, target );
}
})
.css('cursor', 'move')
@@ -400,14 +437,14 @@
// Restore original css
$j(this).css( orginalHelperCss )
// trigger the change
-
_this.editWidgets.panzoom.onChange( _this, target, smilElement );
+
_this.editWidgets.panzoom.onChange( _this, smilElement, target );
}
})
}
},
'trimTimeline' : {
- 'onChange': function( _this, target, smilElement ){
+ 'onChange': function( _this, smilElement, target){
var smil = _this.sequencer.getSmil();
// Update the preview thumbs
@@ -466,7 +503,7 @@
var onInputChange = function( sliderIndex,
timeValue ){
// Register the change
-
_this.editWidgets.trimTimeline.onChange( _this, target, smilElement);
+
_this.editWidgets.trimTimeline.onChange( _this, smilElement, target);
// Update the slider
if( fullClipDuration ){
$j('#'+_this.sequencer.id +
'_trimTimeline' )
@@ -493,7 +530,7 @@
});
// Update the thumbnails:
- _this.editWidgets.trimTimeline.onChange( _this,
target, smilElement );
+ _this.editWidgets.trimTimeline.onChange( _this,
smilElement, target);
// Get the clip full duration to build out the
timeline selector
smil.getBody().getClipAssetDuration(
smilElement, function( clipDuration ) {
@@ -539,7 +576,7 @@
_this.editableTypes['time'].update( _this, smilElement, 'dur', sliderToTime(
ui.values[ 1 ]- ui.values[0] ) );
// update the
widget display
-
_this.editWidgets.trimTimeline.onChange( _this, target, smilElement);
+
_this.editWidgets.trimTimeline.onChange( _this, smilElement, target);
// Register the
edit state for undo / redo
_this.sequencer.getActionsEdit().registerEdit();
@@ -758,7 +795,7 @@
_this.editableAttributes[ attributeName
].inputSize : 6;
// Set paramName based attributes:
- var attributeTitle = ( editAttribute.title ) ?
editAttribute.title : paramName;
+ var attributeTitle = ( editAttribute.title ) ?
editAttribute.title : paramName + ':';
return $j( '<div />' )
.css({
Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js
2010-09-03 10:54:46 UTC (rev 72275)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js
2010-09-03 11:17:33 UTC (rev 72276)
@@ -235,7 +235,7 @@
//mw.log( "SmilAnimate::transformVideoForTime:" + assetId + "
ct:" +vid.currentTime + ' should be: ' + videoSeekTime );
// Register a buffer ready callback
- this.smil.getBuffer().videoBufferSeek( smilElement,
videoSeekTime, function() {
+ this.smil.getBuffer().mediaBufferSeek( smilElement,
videoSeekTime, function() {
//mw.log( "transformVideoForTime:: seek complete ")
if( callback )
callback();
@@ -435,7 +435,7 @@
// xxx need to refactor move to "smilLayout"
updateElementLayout: function( smilElement, percentValues, $target,
htmlElement ){
var _this = this;
- //mw.log("updateElementLayout::" + ' ' + percentValues.left + '
' + percentValues.top + ' ' + percentValues.width + ' ' + percentValues.height
);
+ mw.log("updateElementLayout::" + ' ' + percentValues.left + ' '
+ percentValues.top + ' ' + percentValues.width + ' ' + percentValues.height );
// get a pointer to the html target:
if( !$target ) {
Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
2010-09-03 10:54:46 UTC (rev 72275)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
2010-09-03 11:17:33 UTC (rev 72276)
@@ -89,7 +89,7 @@
this.getElementsForTime( time ,
/* SMIL Element in Range */
function( smilElement) {
- mw.log("SmilBody::renderTime: Element in Range"
+ $j( smilElement ).attr('id'));
+ //mw.log("SmilBody::renderTime: Element in
Range" + $j( smilElement ).attr('id'));
// var relativeTime = time -
smilElement.parentTimeOffset;
var relativeTime = time - $j( smilElement
).data ( 'startOffset' );
@@ -101,7 +101,7 @@
},
/* SMIL Element out of range */
function( smilElement ){
- mw.log("SmilBody::renderTime: Element out of
Range" + $j( smilElement ).attr('id'));
+ //mw.log("SmilBody::renderTime: Element out of
Range" + $j( smilElement ).attr('id'));
// Stop the animation or playback
_this.smil.getAnimate().pauseAnimation(
smilElement )
Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
2010-09-03 10:54:46 UTC (rev 72275)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
2010-09-03 11:17:33 UTC (rev 72276)
@@ -130,7 +130,7 @@
case 'img':
case 'cdata_html':
case 'smiltext':
- // Give the static content a
getSmilElementPlayerID for player layaer control
+ // Give the static content a
getSmilElementPlayerID for player layer control
var $target = $j('<div />')
.attr('id',
_this.smil.getSmilElementPlayerID( smilElement ) )
.css({
@@ -208,7 +208,7 @@
break;
case 'mwtemplate':
$target.loadingSpinner();
- this.addSmilTemplateHtml( smilElement, $target,
callback );
+ this.getSmilTemplateHtml( smilElement, $target,
callback );
return;
break;
case 'cdata_html':
@@ -371,7 +371,7 @@
/**
* Add Smil Template to a $target
*/
- addSmilTemplateHtml: function( smilElement, $target, callback ){
+ getSmilTemplateHtml: function( smilElement, $target, callback ){
var _this = this;
var addTemplateHtmlToTarget = function(){
// Add the html to the target:
@@ -400,7 +400,7 @@
return ;
}
- mw.log("addSmilTemplateHtml:: x-wikitemplate:: " + $j(
smilElement).attr( 'apititlekey' ) + " to target:" + $target.attr('class'));;
+ mw.log("getSmilTemplateHtml:: x-wikitemplate:: " + $j(
smilElement).attr( 'apititlekey' ) + " to target:" + $target.attr('class'));;
// build a wikitext call ( xml keys lose case when put into xml
)
var templateKey = $j( smilElement).attr( 'apititlekey' );
if(!templateKey){
@@ -526,7 +526,9 @@
return $j('<div />')
// Wrap in font-size percentage relative to virtual size
.css( {
- 'font-size': ( scalePercent *100 ) + '%'
+ 'font-size': ( scalePercent *100 ) + '%',
+ 'width': '100%',
+ 'height' : '100%'
})
.append(
$htmlLayout.css( textCss )
@@ -703,11 +705,15 @@
*/
panZoomLayout: function( smilElement, $target, img ){
var _this = this;
+ mw.log( 'panZoomLayout:' + $j( smilElement).attr('id') );
var panZoom = $j( smilElement).attr('panZoom').split(',');
if( !img ){
- var img = $j( '#' + this.smil.getSmilElementPlayerID(
smilElement ) ).get(0);
+ var img = $j( '#' + this.smil.getSmilElementPlayerID(
smilElement ) ).find('img').get(0);
+ if( !img){
+ mw.log('Error getting image for ' + $j(
smilElement).attr('id') );
+ }
}
-
+
_this.getNaturalSize( img, function( natrualSize ){
// Check if the transfrom is needed:
if( parseInt( panZoom.left ) == 0
@@ -719,11 +725,13 @@
( parseInt( panZoom.height ) == 100 &&
panZoom.height.indexOf('%') != -1 )
){
// no transform is needed
+ mw.log("no transofmr needed: " + parseInt(
panZoom.left ) + ' = 0 && ' +
+ ( parseInt( panZoom.width ) ) );
return ;
}
// Get percent values
var percentValues =
_this.smil.getAnimate().getPercentFromPanZoomValues( panZoom, natrualSize );
- //mw.log('panZoomLayout::' + 'l:' + percentValues.left
+ ' t:' + percentValues.top + ' w:' + percentValues.width + ' h:' +
percentValues.height );
+ mw.log('panZoomLayout::' + 'l:' + percentValues.left +
' t:' + percentValues.top + ' w:' + percentValues.width + ' h:' +
percentValues.height );
// Update the layout via the animation engine
updateElementLayout method
_this.smil.getAnimate().updateElementLayout(
smilElement, percentValues, $target, img );
});
Modified: branches/MwEmbedStandAlone/remotes/mediaWiki.js
===================================================================
--- branches/MwEmbedStandAlone/remotes/mediaWiki.js 2010-09-03 10:54:46 UTC
(rev 72275)
+++ branches/MwEmbedStandAlone/remotes/mediaWiki.js 2010-09-03 11:17:33 UTC
(rev 72276)
@@ -271,11 +271,13 @@
var jsPlayerRequest = [
'mw.EmbedPlayer',
'mw.style.EmbedPlayer',
- '$j.ui',
+ '$j.ui',
+ '$j.widget',
+ '$j.ui.mouse',
'mw.PlayerControlBuilder',
'$j.fn.hoverIntent',
'$j.cookie',
- 'JSON',
+ 'JSON',
'$j.ui.slider',
'mw.PlayerSkinKskin',
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs