r45866 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45865‎ | r45866 | r45867 >
Date:08:45, 18 January 2009
Author:dale
Status:deferred
Tags:
Comment:
* big update to sequencer
* basic support for reading and editing template parameters
* improved clipedit submenu system
* style updates
* fixes for add_media_wizard
* improved support for firefogg upload response parse
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/add_media_wizard.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/firefogg.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mv_remote_media_search.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mv_upload.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_nativeEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_playlist.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_sequencer.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/archive_org_logo_80.png (deleted) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/archive_org_tab.png (deleted) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/archive_org_tab.png (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/mv_sequence.css (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php
@@ -206,34 +206,47 @@
207207 //if template look for template parameters:
208208 $templateText = '{{'. $uriTitle->getText();
209209 $addedParamFlag=false;
 210+ $paramVars = Array();
210211 while ($node->childNodes->length){
211212 if($node->firstChild->nodeName=='param'){
212213 $param = & $node->firstChild;
213214 //make sure we have a name:
214 - if($param->hasAttribute('name')){
 215+ if($param->hasAttribute('name')){
215216 //we have parameters:
216217 $templateText.= "|\n";
217218 $templateText .= $param->getAttribute('name') . '=';
218219 //try and get the value from the value attribute or innerHTML
219220 if($param->hasAttribute('value')){
220221 $templateText .= $param->getAttribute('value');
 222+ $paramVars[ $param->getAttribute('name') ] = $param->getAttribute('value');
221223 }else{
222224 //grab from inner html:
 225+ $inerHTML ='';
223226 while ($param->childNodes->length){
224 - $templateText .= $param->ownerDocument->saveXML( $param->firstChild );
225 - $param->removeChild( $param->firstChild );
226 - }
 227+ $inerHTML .= $param->ownerDocument->saveXML( $param->firstChild );
 228+ $param->removeChild( $param->firstChild );
 229+ }
 230+ $templateText .= $inerHTML;
 231+ $paramVars[ $param->getAttribute('name') ] = $inerHTML;
227232 }
228233 }
229234 $addedParamFlag=true;
230235 }
231 - $node->removeChild($node->firstChild);
 236+ $node->removeChild($node->firstChild);
232237 }
233238 //close up the template wikiText call:
234239 $templateText.=($addedParamFlag)?"\n}}":'}}';
235240 //$parserOutput = $wgParser->parse($templateText ,$this->mTitle, ParserOptions::newFromUser( $wgUser ));
236241 //print "should parse: \n $templateText";
237242 $this->parseInnerWikiText($node, $templateText);
 243+ //re-add the param nodes
 244+ $phtml='';
 245+ foreach($paramVars as $name=>$val){
 246+ $phtml.='<param name="' . htmlentities($name) . '">' . htmlentities($val) . '</param>';
 247+ }
 248+ $f = $node->ownerDocument->createDocumentFragment();
 249+ $f->appendXML( $phtml );
 250+ $node->appendChild($f);
238251 break;
239252 case NS_IMAGE:
240253 case NS_FILE:
Index: trunk/extensions/MetavidWiki/skins/add_media_wizard.js
@@ -9,15 +9,16 @@
1010 //if mv_embed is hosted somewhere other than near by the add_media_wizard you can define it here:
1111 var mv_add_media_wizard_path = 'http://mvbox2.cse.ucsc.edu/w/extensions/MetavidWiki/skins/';
1212
 13+
1314 //*code should not have to modify anything below*/
1415 //check if we are on a edit page:
1516 if(wgAction=='edit'){
1617 //add onPage ready request:
17 - addOnloadHook( function(){
 18+ addOnloadHook( function(){
1819 var imE = document.createElement('img');
1920 imE.style.cursor = 'pointer';
2021 imE.id = 'mv-add_media';
21 - imE.src = wgScriptPath + '/extensions/MetavidWiki/skins/mv_embed/images/Button_add_media.png';
 22+ imE.src = getAddMediaPath( 'mv_embed/images/Button_add_media.png' );
2223
2324 var toolbar = document.getElementById("toolbar");
2425 toolbar.appendChild(imE);
@@ -30,14 +31,11 @@
3132 //add firefog support to Special Upload page:
3233 if(wgPageName== "Special:Upload"){
3334 addOnloadHook( function(){
34 - js_log("!!upload hook");
35 - load_mv_embed( function(){
36 - js_log('!!loaded mv_embed');
 35+ //alert("!!upload hook");
 36+ load_mv_embed( function(){
3737 //load jQuery and what not (we need to refactor the loading system for mv_embed)
3838 mvEmbed.load_libs(function(){
39 - js_log('!!loaded load libs');
40 - mvJsLoader.doLoad({'mvUploader' : 'libAddMedia/mv_upload.js'},function(){
41 - js_log("!!make uploaer");
 39+ mvJsLoader.doLoad({'mvUploader' : 'libAddMedia/mv_upload.js'},function(){
4240 mvUp = new mvUploader();
4341 });
4442 });
@@ -119,29 +117,21 @@
120118 if( typeof mvEmbed == 'undefined'){
121119 //get mv_embed path from _this_ file location:
122120 var mv_embed_url = getAddMediaPath( 'mv_embed/mv_embed.js' );
123 - //make sure its not already there:
124 - for(var i=0; i < document.getElementsByTagName('script').length; i++){
125 - var s = document.getElementsByTagName('script')[i];
126 - if(s.src == mv_embed_url){
127 - check_for_mv_embed( callback );
128 - return ;
129 - }
130 - }
131121 var e = document.createElement("script");
132122 e.setAttribute('src', mv_embed_url);
133123 e.setAttribute('type',"text/javascript");
134124 document.getElementsByTagName("head")[0].appendChild(e);
135 - setTimeout('check_for_mv_embed(callback);', 25);
 125+ check_for_mv_embed( callback );
136126 }else{
137127 check_for_mv_embed( callback );
138128 }
139129 }
140130
141131 function check_for_mv_embed( callback ){
142 - js_log('check_for_mv_embed');
143132 if( typeof mvEmbed == 'undefined'){
144 - setTimeout('check_for_mv_embed( callback );', 25);
 133+ setTimeout('check_for_mv_embed( ' + callback +');', 25);
145134 }else{
 135+ js_log('callback is now: ' + callback);
146136 callback();
147137 }
148138 }
@@ -155,7 +145,6 @@
156146 return s.src.replace('add_media_wizard.js', replace_str);
157147 }
158148 }
159 - js_log('Error: could not find add media path force config:');
160149 return mv_add_media_wizard_path + replace_str;
161150 }
162151
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php
@@ -87,7 +87,7 @@
8888 <table border="1" cellpadding="6" width="600">
8989 <? foreach ( $sample_embed as $key => $aval ) {
9090 // $key!=8 && $key!=3 $key != 0 && $key != 1 && && $key!=3
91 - if ( $key!=3 )continue;
 91+ if ( $key!=2 )continue;
9292 ?>
9393 <tr>
9494 <td valign="top"><?=$aval['tag']?></td>
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mv_remote_media_search.js
@@ -138,7 +138,7 @@
139139 'lib' : 'archive',
140140 'local' : false,
141141 'resource_prefix': 'AO_',
142 - 'tab_img':false
 142+ 'tab_img':true
143143 }
144144 },
145145 //some default layout values:
@@ -273,23 +273,23 @@
274274 mv_set_loading('#rsd_results');
275275
276276 //load the (firefog enhanced) upload manager:
277 - if(!_this.cUpLoader){
278 - mvJsLoader.doLoad( {'mvUploader': 'libAddMedia/mv_upload.js'},function(){
279 - _this.cUpLoader = new mvUploader({
280 - 'target_div': 'rsd_results',
281 - 'upload_cb:': function( rTitle){
282 - //set to loading:
283 - mv_set_loading('#rsd_results');
284 - //do a direct api query for resource info (to build rObj
285 - _this.getResourceFromTitle( rTitle, function(rObj){
286 - //call resource Edit:
287 - _this.resourceEdit( rObj );
288 - });
289 - }
290 - }
291 - );
292 - });
293 - }
 277+
 278+ //load the upload.js from mediaWiki:
 279+ mvJsLoader.doLoad( {'mvUploader': 'libAddMedia/mv_upload.js'},function(){
 280+ _this.cUpLoader = new mvUploader({
 281+ 'target_div': 'rsd_results',
 282+ 'upload_done_action:': function( rTitle){
 283+ //set to loading:
 284+ mv_set_loading('#rsd_results');
 285+ //do a direct api query for resource info (to build rObj
 286+ _this.getResourceFromTitle( rTitle, function(rObj){
 287+ //call resource Edit:
 288+ _this.resourceEdit( rObj );
 289+ });
 290+ }
 291+ }
 292+ );
 293+ });
294294 },
295295 runSearch: function(){
296296 var _this = this;
@@ -582,10 +582,10 @@
583583 };
584584 var loadLibs = {'mvClipEdit':'libSequencer/mv_clipedit.js'};
585585 if( mediaType == 'image'){
586 - //load the croping library:
587 - loadLibs['$j.Jcrop']='jquery/plugins/Jcrop/js/jquery.Jcrop.js';
 586+ //load the crop library:
 587+ //loadLibs['$j.Jcrop']='jquery/plugins/Jcrop/js/jquery.Jcrop.js';
588588 //@@todo integrate css calls into mvJsLoader or move jcrop css
589 - loadExternalCss( mv_embed_path + 'jquery/plugins/Jcrop/css/jquery.Jcrop.css');
 589+ //loadExternalCss( mv_embed_path + 'jquery/plugins/Jcrop/css/jquery.Jcrop.css');
590590 //display the mvClipEdit obj once we are done loading:
591591 mvJsLoader.doLoad( loadLibs,function(){
592592 //run the image clip tools
@@ -982,8 +982,7 @@
983983 }
984984 }
985985 //redraw tabs
986 - this.drawTabs();
987 -
 986+ this.drawTabs();
988987 if( this.disp_item == 'upload' ){
989988 this.doUploadInteface();
990989 }else{
@@ -1293,12 +1292,15 @@
12941293 if(data.query && data.query.pages){
12951294 for(var page_id in data.query.pages){
12961295 var page = data.query.pages[ page_id ];
 1296+ //make sure the reop is shared
 1297+ if( page.imagerepository == 'shared'){
 1298+ continue;
 1299+ }
12971300 //make sure the page is not a redirect
12981301 if(page.revisions[0]['*'].indexOf('#REDIRECT')===0){
12991302 //skip page is redirect
13001303 continue;
1301 - }
1302 -
 1304+ }
13031305 this.resultsObj[page_id]={
13041306 'titleKey' : page.title,
13051307 'link' :page.imageinfo[0].descriptionurl,
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mv_upload.js
@@ -5,7 +5,8 @@
66 ONCE THAT IS READY
77 */
88
9 -gMsg['upload-enable-converter'] = 'Enable video converter (to upload source video footage not yet converted to theora format) <i>more info</i>';
 9+gMsg['upload-enable-converter'] = 'Enable video converter (to upload source video not yet converted to theora format)'+
 10+ '<a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">more info</a>';
1011 gMsg['upload-fogg_not_installed'] = 'If you want to upload video consider installing <a href="http://firefogg.org">firefogg.org</a>, <i>more info</i>';
1112 gMsg['upload-in-progress'] = 'Doing Transcode & Upload (do not close this window)';
1213 gMsg['upload-transcoded-status'] = 'Transcoded';
@@ -13,7 +14,8 @@
1415 gMsg['upload-select-file'] = 'Select File...';
1516
1617 var default_upload_options = {
17 - 'target_div':''
 18+ 'target_div':'',
 19+ 'upload_done_action':'redirect'
1820 }
1921
2022 var mvUploader = function(initObj){
@@ -39,13 +41,20 @@
4042 mvJsLoader.doLoad({'upFirefogg' : 'libAddMedia/firefogg.js'},function(){
4143 //if we are not on the upload page grab the upload html via ajax:
4244 if( !_this.on_upload_page){
43 - $j.get(wgArticlePath.replace(/\$1/, 'Special:Upload'), {}, function(data){
44 - sp = data.indexOf('<div id="content">');
45 - se = data.indexOf('<!-- end content -->');
46 - if(sp!=-1 && se !=-1){
47 - $j('#'+_this.target_div).html( data.substr(sp, (se-sp) ) );
48 - }
49 - _this.setupFirefogg();
 45+ $j.get(wgArticlePath.replace(/\$1/, 'Special:Upload'), {}, function(data){
 46+ //add upload.js:
 47+ $j.getScript( stylepath + '/common/upload.js', function(){
 48+ //really need "upload api"
 49+ wgAjaxUploadDestCheck = true;
 50+ wgAjaxLicensePreview = false;
 51+ wgUploadAutoFill = true;
 52+ sp = data.indexOf('<div id="content">');
 53+ se = data.indexOf('<!-- end content -->');
 54+ if(sp!=-1 && se !=-1){
 55+ $j('#'+_this.target_div).html( data.substr(sp, (se-sp) ) );
 56+ }
 57+ _this.setupFirefogg();
 58+ });
5059 });
5160 }else{
5261 _this.setupFirefogg();
@@ -68,15 +77,16 @@
6978 {'upload_done_action':'redirect'}:
7079 {'upload_done_action':function( rTitle ){
7180 js_log('add_done_action callback for uploader');
72 - //call the parent insert resource preview
 81+ //call the parent insert resource preview
 82+ _this.upload_done_action( rTitle );
7383 }
7484 };
75 - init_firefogg( intFirefoggObj );
76 - //firefogg handles the form submit (even on image uploads when called by gui)
77 - if( !this.on_upload_page ){
78 - $j('#mw-upload-form').submit(function(){
79 - return false;
80 - });
 85+ //if firefog is not taking over the submit we can here:
 86+ if( ! init_firefogg( intFirefoggObj ) ){
 87+ //firefogg handles the form submit (even on image uploads when called by gui)
 88+ if( !this.on_upload_page ){
 89+
 90+ }
8191 }
8292 },
8393 //same add code as specialUpload if($wgEnableFirefogg){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/firefogg.js
@@ -12,11 +12,12 @@
1313 if(!iObj)
1414 iObj = {};
1515 //init based on if Firefogg is available
16 - if(typeof(Firefogg) == 'undefined') {
17 -
 16+ if(typeof(Firefogg) == 'undefined') {
1817 e = document.getElementById('wgfogg_not_installed');
1918 if(e)
2019 e.style.display='inline';
 20+ //no support for firefogg
 21+ return false;
2122 }else{
2223 e = document.getElementById('wgfogg_not_installed');
2324 if(e)
@@ -27,7 +28,7 @@
2829 e.style.display='inline';
2930
3031 fe = document.getElementById('wgEnableFirefogg');
31 - if(fe){
 32+ if(fe){
3233 js_log('wgEnableFirefogg found:');
3334 //get a new fogg object with default options
3435 var fogg = new upFirefogg( iObj );
@@ -43,10 +44,12 @@
4445 fogg.disable_fogg();
4546 }
4647 });
47 - }else{
 48+ }else{
4849 js_log('could not find wgEnableFirefogg');
4950 }
5051 }
 52+ //we did init with support
 53+ return true;
5154 }
5255
5356 var default_firefogg_options = {
@@ -93,14 +96,13 @@
9497 select_fogg:function(){
9598 var _this = this;
9699 if(_this.ogg.selectVideo()) {
97 - var editForm = document.getElementById( 'mw-upload-form' );
 100+ var editForm = document.getElementById( 'mw-upload-form' );
 101+ _this.org_onsubmit = editForm.onsubmit;
98102 editForm.onsubmit = function return_false(){
99103 return false;
100 - };
101 - //update the submit button:
102 -
 104+ };
103105 //set binding for "upload" button to call our transcode process
104 - addHandler( editForm, 'submit', function() {
 106+ addHandler( editForm, 'submit', function() {
105107 //check if the title and or description are empty don't let the person submit
106108 e = document.getElementById('wpDestFile')
107109 if(typeof e.value == 'undefined' || e.value=='' || e.value.substr(-4) != '.ogg')
@@ -135,7 +137,7 @@
136138 if( _this.ogg.state == 'encoding' ) {
137139 setTimeout(encodingStatus, 500);
138140 }
139 - //encoding sucessfull, state can also be 'encoding failed'
 141+ //encoding done, state can also be 'encoding failed'
140142 else if ( _this.ogg.state == 'encoding done' ) {
141143 //hide the fogg-status-transcode
142144 e = document.getElementById('fogg-status-transcode');
@@ -143,31 +145,12 @@
144146 //show the fogg-status-upload
145147 e = document.getElementById('fogg-status-upload');
146148 e.style.display='inline';
147 -
148 - var data = {};
149 -
150 - //get all the form fields:
151 - var inputs = editForm.getElementsByTagName('input');
152 - for(var i=0;i < inputs.length; i++){
153 - if( inputs[i].getAttribute('name') != 'wpUploadFile'){
154 - if( inputs[i].getAttribute('type')=='checkbox'){
155 - if(inputs[i].checked){
156 - data[ inputs[i].getAttribute('name') ] = 'true';
157 - }else{
158 - data[ inputs[i].getAttribute('name') ] = 'false';
159 - }
160 - }else{
161 - data[ inputs[i].getAttribute('name') ] = inputs[i].value;
162 - }
163 - }
164 - }
 149+
 150+ //get the input
 151+ var data = _this.getEditFormData( editForm );
 152+
165153 //hard code some values
166 - data['wpSourceType']='file';
167 - //get text area input:
168 - var inputs = editForm.getElementsByTagName('textarea');
169 - for(var i=0;i < inputs.length; i++){
170 - data[ inputs[i].getAttribute('name') ] = inputs[i].value;
171 - }
 154+ data['wpSourceType']='file';
172155
173156 var data_str = JSON.stringify(data);
174157 //alert('send data:'+ data_str);
@@ -233,13 +216,36 @@
234217 }
235218 }
236219 encodingStatus();
237 - //don't submit the form (let firefogg hanndle it)
 220+ //don't submit the form (let firefogg handle it)
238221 return false;
239222 }); //addHandler mapping
240223 }else{
241 - //remove upload bidning if no file was selected
 224+ //remove upload binding if no file was selected
242225 }
243226 },
 227+ getEditFormData:function( editForm ){
 228+ var data = {};
 229+ //get all the form fields:
 230+ var inputs = editForm.getElementsByTagName('input');
 231+ for(var i=0;i < inputs.length; i++){
 232+ if( inputs[i].getAttribute('name') != 'wpUploadFile'){
 233+ if( inputs[i].getAttribute('type')=='checkbox'){
 234+ if(inputs[i].checked){
 235+ data[ inputs[i].getAttribute('name') ] = 'true';
 236+ }else{
 237+ data[ inputs[i].getAttribute('name') ] = 'false';
 238+ }
 239+ }else{
 240+ data[ inputs[i].getAttribute('name') ] = inputs[i].value;
 241+ }
 242+ }
 243+ }
 244+ var inputs = editForm.getElementsByTagName('textarea');
 245+ for(var i=0;i < inputs.length; i++){
 246+ data[ inputs[i].getAttribute('name') ] = inputs[i].value;
 247+ }
 248+ return data;
 249+ },
244250 disable_fogg:function(){
245251 //show normal file upload
246252 e = document.getElementById('wg-base-upload');
@@ -248,8 +254,12 @@
249255 //hide fogg stuff
250256 e = document.getElementById('fogg-video-file');
251257 if(e) e.style.display='none';
252 -
253 - //disable the fogg
 258+
 259+ if( this.upload_done_action == 'redirect' ){
 260+ //restore the original form action
 261+ editForm.onsubmit = this.org_onsubmit;
 262+ }
 263+ //disable the fogg:
254264 this.enabled=false;
255265 },
256266 fogg_update_progress:function(progress){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_sequencer.js
@@ -10,7 +10,7 @@
1111 *
1212 *
1313 * mv_sequencer.js
14 - * is a basic embeddable sequencer.
 14+ * is a basic embedable sequencer.
1515 * extends the playlist with drag/drop/sortable/add/remove functionality
1616 * editing of annotative content (mostly for wiki)
1717 * enables more dynamic layouts
@@ -18,12 +18,8 @@
1919 */
2020
2121 gMsg['menu_clipedit'] = 'Edit Selected Resource';
22 - gMsg['sc_fileopts'] ='Clip Detail';
23 - gMsg['sc_inoutpoints'] ='Set In-Out points';
24 - gMsg['sc_panzoom'] ='Pan zoom Controls';
25 - gMsg['sc_overlays'] ='Overlays';
26 - gMsg['sc_audio'] ='Audio Control';
2722
 23+
2824 gMsg['menu_cliplib'] = 'Add Resource';
2925 gMsg['menu_transition'] = 'Transitions Effects';
3026 gMsg['menu_resource_overview'] = 'Resource Overview';
@@ -53,8 +49,11 @@
5450
5551 //menu items display helper:
5652 gMsg['mv_welcome_to_sequencer'] = '<h3>Welcome to the sequencer demo</h3>'+
57 -'very <b>limited</b> functionality right now. Click on a Clip to edit that resource';
 53+'very <b>limited</b> functionality right now. Not much documentation yet either';
5854
 55+gMsg['no_selected_resource'] = '<h3>No Resource selected</h3> Select a Clip to enable resource editing';
 56+gMsg['error_edit_multiple'] = '<h3>Multiple Resources Selected</h3> Select a single clip to edit it';
 57+
5958 gMsg['mv_editor_options'] = 'Editor options';
6059 gMsg['mv_editor_mode'] = 'Editor mode';
6160 gMsg['mv_simple_editor_desc'] = 'simple editor (iMovie style)';
@@ -117,15 +116,11 @@
118117 //the menu_items Object contains: default html, js setup/loader functions
119118 menu_items : {
120119 'clipedit':{
121 - 'd':1,
122 - 'submenu':{
123 - 'fileopts':{},
124 - 'inoutpoints':{},
125 - 'panzoom':{},
126 - 'overlays':{},
127 - 'audio':{}
128 - },
129 - 'html': getMsg('mv_welcome_to_sequencer')
 120+ 'd':0,
 121+ 'html':' ',
 122+ 'click_js':function( this_seq ){
 123+ this_seq.doEditSelectedClip();
 124+ }
130125 },
131126 'cliplib':{
132127 'd':0,
@@ -137,8 +132,7 @@
138133 'profile':'sequence',
139134 'p_seq':this_seq,
140135 'target_id':'cliplib_ic',
141 - 'instance_name': this_seq.instance_name + '.mySearch'
142 -
 136+ 'instance_name': this_seq.instance_name + '.mySearch'
143137 });
144138 });
145139 }
@@ -277,14 +271,21 @@
278272 //display a menu item (hide the rest)
279273 disp:function( item ){
280274 js_log('menu_item disp: ' + item);
281 -
282 - for(var i in this.menu_items){
 275+ //hide the welcome msg if visible
 276+ $j('#welcome_ic').fadeOut("fast");
 277+ //update the display and item state:
 278+ for(var i in this.menu_items){
283279 if(i==item){
284 - $j('#'+i+'_ic').fadeIn("fast");
 280+ $j('#'+i+'_ic').fadeIn("fast");
 281+ this.menu_items[i].d = 1;
 282+ //do any click_js actions:getInsertControl
 283+ if( this.menu_items[i].click_js )
 284+ this.menu_items[i].click_js( this );
285285 }else{
286286 $j('#'+i+'_ic').filter(':visible').fadeOut("fast");
 287+ this.menu_items[i].d = 0;
287288 }
288 - }
 289+ }
289290 },
290291 //setup the menu items:
291292 setupMenuItems:function(){
@@ -500,36 +501,19 @@
501502 //render the menu:
502503 var menu_html = '<ul id="seq_menu">';
503504 var item_containers ='';
504 -
505 - //@@todo ~maybe~ load menu via ajax request
506 - //(avoid so much hmtl in js? or keep in js to keep high protabillity of sequencer? )
507505
508506 $j.each(this.menu_items, function(inx, menu_item){
509507 var disp_style = (menu_item.d)?'inline':'none';
510508 var sel_class = (menu_item.d)?'class="mv_selected_item"':'';
511509 menu_html+='<li '+sel_class+' id="mv_menu_item_'+inx+'">' + getMsg('menu_' + inx ) +'</li>';
512510 item_containers += '<div class="seq_control_container" id="' + inx +
513 - '_ic" style="display:' + disp_style +';">'
514 - //add in subMenus if set
515 - //check for submenu and add to item container
516 - var sub_menu_html='';
517 - if( typeof menu_item.submenu != 'undefined'){
518 - sub_menu_html+= '<ul id="mv_submenu_' + inx +'" class="mv_submenu">';
519 - $j.each(menu_item.submenu, function(subInx, sub_menu_item){
520 - var disp_style = (menu_item.d)?'block':'none';
521 - var sub_sel_class = (sub_menu_item==1)?'class="mv_sub_selected"':'';
522 - sub_menu_html+= '<li ' + sub_sel_class + ' id="mv_sub_menu_item_' + subInx + '">' +
523 - getMsg('sc_' + subInx ) + '</li>';
524 - item_containers+= '<div class="submenu_container" id="sc_' + subInx+'" '+
525 - ' style="display:' + disp_style +';"></div>';
526 - });
527 - sub_menu_html+= '</ul>';
528 - }
529 - item_containers += sub_menu_html;
 511+ '_ic" style="display:' + disp_style +';">'
530512 item_containers += (menu_item.html) ? menu_item.html : '<h3>' + getMsg('menu_'+inx) + '</h3>';
531513 item_containers +='</div>';
532514 });
533 - menu_html+='</ul>';
 515+ menu_html+='</ul>';
 516+
 517+ item_containers+='<div class="seq_control_container" id="welcome_ic">' + getMsg('mv_welcome_to_sequencer') + '</div>';
534518
535519 $j('#'+this.sequence_tools_id).html( menu_html + item_containers );
536520 //add binding for menu
@@ -592,7 +576,7 @@
593577 },
594578 /*returns a xml or json representation of the current sequence */
595579 getSeqOutputJSON:function(){
596 - js_log('json output');
 580+ js_log('json output:');
597581 },
598582 getSeqOutputHLRDXML:function(){
599583 var o='<sequence_hlrd>' +"\n";
@@ -638,50 +622,49 @@
639623 alert('f:getSeqOutputHLRDXML'+ o);
640624
641625 return false;
642 - },
643 - //@@todo integrate into clip view ...
 626+ },
644627 editClip:function(track_inx, clip_inx){
645 - $j('#modalbox').hide();
646 - if($j('#modal_window').length==0){
647 - $j('body').append('<div id="modal_window" class="modal_editor" />');
 628+ var cObj = this.plObj.tracks[ track_inx ].clips[ clip_inx ];
 629+ this.doEditClip( cObj );
 630+ },
 631+ doEditSelectedClip:function(){
 632+ var this_seq = this;
 633+ //and only one clip selected
 634+ if(this_seq.menu_items['clipedit'].d ){
 635+ var num_sel = $j('.mv_selected_clip').length
 636+ if( num_sel == 1){
 637+ $j('.mv_selected_clip').each(function(){
 638+ this_seq.doEditClip( this_seq.getClipFromSeqID( $j(this).parent().attr('id') ) );
 639+ });
 640+ }else if( num_sel === 0){
 641+ //no clip selected warning:
 642+ $j('#clipedit_ic').html( getMsg('no_selected_resource') );
 643+ }else if( num_sel > 1){
 644+ //multiple clip selected warning:
 645+ $j('#clipedit_ic').html( getMsg('error_edit_multiple') );
 646+ }
648647 }
649 - //empty out the modal_window and show it
650 - $j('#modal_window').empty().show();
651 - //set to the current clip in "clip mode"
652 - var clip = this.plObj.tracks[track_inx].clips[ clip_inx ];
653 - //@@todo do per clip type edit modes:
654 - $j('#modal_window').append('<div style="position:absolute;top:10px;left:25%;width:'+this.plObj.width+'px;">'+
655 - '<h3>' + clip.getTitle() + '</h3>'+
656 - '<video id="chop_clip_' + track_inx + '_' + clip_inx + '" ' +
657 - 'style="width:'+this.plObj.width+'px;height:'+this.plObj.height+'px;" '+
658 - 'poster="'+clip.embed.media_element.getThumbnailURL()+'" ' +
659 - 'src="' + clip.src + '"></video>'+
660 - '<div style="padding-top:10px;">'+
661 - '<span style="position:absolute;left:0px;">'+
662 - 'start time:<input id="chop_start" type="text" size="10" value="0:0:0">'+
663 - '</span>'+
664 - '<span style="position:absolute;right:0px;">'+
665 - 'end time:<input id="chop_end" type="text" size="10" '+
666 - 'value="' + seconds2ntp(clip.getDuration()) + '" >' +
667 - '</span>'+
668 - '</div>'+
669 - '</div>'
670 - //start time end time field display
671 - );
672 - $j('#modal_window').append('<div style="position:absolute;bottom:10px;left:50%;">'+
673 - '<a style="border:solid gray;font-size:1.2em;" onClick="window.confirm(\''+getMsg('edit_cancel_confirm')+'\')" '+
674 - 'href="javascript:'+this.instance_name+'.closeModWindow()">'+
675 - getMsg('edit_cancel') + '</a> '+
676 - '<a style="border:solid gray;font-size:1.2em;" href="javascript:'+this.instance_name+'.saveClipEdit()">'+
677 - getMsg('edit_save')+
678 - '</a>'+
679 - '</div>'
680 - );
681 - rewrite_by_id('chop_clip_' + track_inx + '_' + clip_inx );
682 - //@@todo add in-out setters
 648+ },
 649+ //updates the clip details div if edit resource is set
 650+ doEditClip:function( cObj){
 651+ var this_seq = this;
 652+
 653+ //set default edit action (maybe edit_action can be sent via by context click)
 654+ var edit_action = 'fileopts';
683655
684 - //@@todo add start / end hooks
685 -
 656+ mv_get_loading_img( '#clipedit_ic' );
 657+ //load the clipEdit library if not already loaded:
 658+ mvJsLoader.doLoad( {'mvClipEdit' : 'libSequencer/mv_clipedit.js' }, function(){
 659+ //setup the cliploader
 660+ this_seq.myClipEditor = new mvClipEdit({
 661+ 'rObj' : cObj,
 662+ 'control_ct':'clipedit_ic',
 663+ 'clip_disp_ct': cObj.id,
 664+ 'edit_action':edit_action,
 665+ 'p_seqObj': this_seq,
 666+ 'profile':'sequence'
 667+ });
 668+ });
686669 },
687670 //save new clip segment
688671 saveClipEdit:function(){
@@ -714,20 +697,24 @@
715698 //upload clipboard to the server (if possible)
716699 if( parseUri( document.URL ).host != parseUri( this_seq.plObj.interface_url ).host ){
717700 js_log('error: presently we can\'t copy clips across domains');
718 - }else{
719 - var req_url = this_seq.plObj.interface_url + '?action=ajax&rs=mv_seqtool_clipboard&rsargs[]=copy';
720 - $j.ajax({
721 - type: "POST",
722 - url:req_url,
723 - data: $j.param( {
724 - "clipboard_data": $j.toJSON( this_seq.clipboard ),
725 - "clipboardEditToken": this_seq.clipboardEditToken
726 - }),
727 - success:function(data){
728 - //callback( data );
729 - js_log('did clipboard push ' + $j.toJSON( this_seq.clipboard ) );
730 - }
731 - });
 701+ }else{
 702+ if( this_seq.clipboardEditToken ){
 703+ var req_url = this_seq.plObj.interface_url + '?action=ajax&rs=mv_seqtool_clipboard&rsargs[]=copy';
 704+ $j.ajax({
 705+ type: "POST",
 706+ url:req_url,
 707+ data: $j.param( {
 708+ "clipboard_data": $j.toJSON( this_seq.clipboard ),
 709+ "clipboardEditToken": this_seq.clipboardEditToken
 710+ }),
 711+ success:function(data){
 712+ //callback( data );
 713+ js_log('did clipboard push ' + $j.toJSON( this_seq.clipboard ) );
 714+ }
 715+ });
 716+ }else{
 717+ js_log('error: no clipboardEditToken to uplaod clipboard to server');
 718+ }
732719 }
733720 },
734721 cutSelectedClips:function(){
@@ -996,13 +983,14 @@
997984
998985 //jump to clip time
999986 var sClipObj = this_seq.getClipFromSeqID( $j(this).parent().attr('id') );
1000 - this_seq.plObj.updateCurrentClip( sClipObj );
 987+ this_seq.plObj.updateCurrentClip( sClipObj );
 988+
1001989 if( $j(this).hasClass("mv_selected_clip") ){
1002990 $j(this).removeClass("mv_selected_clip");
1003991 $j('#' + $j(this).parent().attr("id") + '_adj').fadeOut("fast");
1004992 }else{
1005993 $j(this).addClass('mv_selected_clip');
1006 - $j('#' + $j(this).parent().attr("id") + '_adj').fadeIn("fast");
 994+ $j('#' + $j(this).parent().attr("id") + '_adj').fadeIn("fast");
1007995 }
1008996 //if shift select is down select the in-between clips
1009997 if( this_seq.key_shift_down ){
@@ -1031,6 +1019,8 @@
10321020 }
10331021 }
10341022
 1023+ this_seq.doEditSelectedClip();
 1024+
10351025 });
10361026 //add in control for time based display
10371027 //debugger;
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js
@@ -13,13 +13,32 @@
1414 gMsg['mv_preview_insert']= 'Preview Insert';
1515 gMsg['mv_cancel_image_insert']='Cancel Image Insert';
1616
 17+ gMsg['sc_fileopts'] ='Clip Detail Edit';
 18+ gMsg['sc_inoutpoints'] ='Set In-Out points';
 19+ gMsg['sc_panzoom'] ='Pan Zoom Crop';
 20+ gMsg['sc_overlays'] ='Overlays';
 21+ gMsg['sc_audio'] ='Audio Control';
 22+ gMsg['sc_duration'] ='Duration';
 23+
 24+gMsg['mv_template_properties'] = 'Template Properties';
 25+gMsg['mv_custom_title'] = 'Custom Title';
 26+gMsg['mv_edit_properties'] = 'Edit Properties';
 27+gMsg['mv_other_properties'] = 'Other Properties';
 28+gMsg['mv_resource_page'] = 'Resource Page';
 29+
1730 var default_clipedit_values = {
1831 'rObj': null, // the resource object
1932 'clip_disp_ct':null,//target clip disp
2033 'control_ct':null, //control container
2134 'media_type': null, //media type
 35+ 'parent_ct': null, //parent container
 36+
2237 'p_rsdObj': null, //parent remote search object
23 - 'parent_ct': null //parent container
 38+ 'p_seqObj': null, //parent sequence Object
 39+
 40+ 'edit_action': null, //the requested edit action
 41+ 'profile': 'inpage' //the given profile either "inpage" or "sequence"
 42+ //timeline invokes the timeline editor (letting you set keyframes)
2443 }
2544 var mvClipEdit = function(initObj) {
2645 return this.init(initObj);
@@ -37,16 +56,218 @@
3857 this[i] = initObj[i];
3958 }
4059 }
41 - //check the media_type:
42 - js_log('mvClipEdit:: media type:' + this.media_type + 'base width: ' + this.rObj.width + ' bh: ' + this.rObj.height);
 60+
 61+ //if media type was not supplied detect for resoure if possible:
 62+ //@@todo more advanced detection.
 63+ if(!this.media_type){
 64+ if( this.rObj.type.indexOf("image/") === 0){
 65+ this.media_type = 'image';
 66+ }else if( this.rObj.type.indexOf("video/") === 0){
 67+ this.media_type = 'video';
 68+ }else if( this.rObj.type.indexOf("text/") === 0){
 69+ this.media_type = 'template';
 70+ }
 71+ }
4372
44 - //could seperate out into media Types objects for now just call method
45 - if(this.media_type == 'image'){
46 - this.setUpImageCtrl();
47 - }else if(this.media_type=='video'){
48 - this.setUpVideoCtrl();
 73+ //display control:
 74+ if(this.profile == 'sequence'){
 75+ this.doEditTypesMenu();
 76+ this.doDisplayEdit();
 77+ }else{
 78+ //check the media_type:
 79+ js_log('mvClipEdit:: media type:' + this.media_type + ' base width: ' + this.rObj.width + ' bh: ' + this.rObj.height);
 80+ //could seperate out into media Types objects for now just call method
 81+ if(this.media_type == 'image'){
 82+ this.setUpImageCtrl();
 83+ }else if(this.media_type=='video'){
 84+ this.setUpVideoCtrl();
 85+ }
 86+ }
 87+ },
 88+
 89+ //master edit types object:
 90+ //maybe we should refactor these into their own classes
 91+ //more refactor each media type should be its own class inheriting the shared baseEditType object
 92+ edit_types:{
 93+ 'fileopts':{
 94+ 'd':1,
 95+ 'media':['image','video','template'],
 96+ 'doEdit':function( _this ){
 97+ var doEditHtml = function(){
 98+ //add html for rObj resource:
 99+ var o= '<table>' +
 100+ '<tr>' +
 101+ '<td colspan="2"><b>'+getMsg('mv_edit_properties')+'</b></td>'+
 102+ '</tr>'+
 103+ '<tr>'+
 104+ '<td>' +
 105+ getMsg('mv_custom_title') +
 106+ '</td>'+
 107+ '<td><input type="text" size="15" maxwidth="255" value="';
 108+ if(_this.rObj.title != null)
 109+ o+=_this.rObj.title;
 110+ o+='">'+
 111+ '</td>'+
 112+ '</tr>';
 113+ if( _this.rObj.tVars){
 114+ var existing_p = _this.rObj.params;
 115+ var testing_a = _this.rObj.tVars;
 116+ //debugger;
 117+ o+= '<tr>'+
 118+ '<td colspan="2"><b>'+getMsg('mv_template_properties')+'</b></td>'+
 119+ '</tr>';
 120+ for(var i =0; i < _this.rObj.tVars.length ; i++){
 121+ o+='<tr>'+
 122+ '<td>' +
 123+ _this.rObj.tVars[i] +
 124+ '</td>' +
 125+ '<td><input type="text" size="15" maxwidth="255" value="';
 126+ if(_this.rObj.params[ _this.rObj.tVars[i] ]){
 127+ o+= _this.rObj.params[ _this.rObj.tVars[i] ];
 128+ }
 129+ o+='">'+
 130+ '</td>'+
 131+ '</tr>';
 132+ }
 133+ }
 134+ o+= '<tr>'+
 135+ '<td colspan="2"><b>'+getMsg('mv_other_properties')+'</b></td>'+
 136+ '</tr>'+
 137+ '<tr>'+
 138+ '<td>' +
 139+ getMsg('mv_resource_page') +
 140+ '</td>' +
 141+ '<td><a href="' + wgArticlePath.replace(/\$1/, _this.rObj.uri ) +'">'+
 142+ _this.rObj.uri + '</a>'+
 143+ '</td>'+
 144+ '</tr>';
 145+ o+='</table>';
 146+
 147+ $j('#sub_cliplib_ic').html ( o );
 148+ //add update bindings
 149+ }
 150+ //if media type is template we have to query to get its URI to get its paramaters
 151+ if(_this.media_type == 'template' && !_this.rObj.tVars){
 152+ mv_set_loading('#sub_cliplib_ic');
 153+ var reqObj ={ 'action':'query',
 154+ 'prop':'revisions',
 155+ 'titles': _this.rObj.uri,
 156+ 'rvprop':'content'
 157+ };
 158+ //get the interface uri from the plObject
 159+ var api_url = _this.p_seqObj.plObj.interface_url.replace(/index\.php/, 'api.php');
 160+ //first check
 161+ do_api_req( reqObj, api_url,function(data){
 162+ if(typeof data.query.pages == 'undefined')
 163+ return doEditHtml();
 164+ for(var i in data.query.pages){
 165+ var page = data.query.pages[i];
 166+ var template_rev = page['revisions'][0]['*'];
 167+ }
 168+
 169+ //do a regular ex to get the ~likely~ template values
 170+ //(ofcourse this sucks)
 171+ //but maybe this will make its way into the api sometime soon to support wysiwyg type editors
 172+ //idealy it would expose a good deal of info about the template params
 173+ js_log('matching against: ' + template_rev);
 174+ var tempVars = template_rev.match(/\{\{\{([^\}]*)\}\}\}/gi);
 175+ //clean up results:
 176+ _this.rObj.tVars = new Array();
 177+ for(var i=0; i < tempVars.length; i++){
 178+ var tvar = tempVars[i].replace('{{{','').replace('}}}','');
 179+ //strip anything after a |
 180+ if(tvar.indexOf('|') != -1){
 181+ tvar = tvar.substr(0, tvar.indexOf('|'));
 182+ }
 183+ //check for duplicates:
 184+ var do_add=true;
 185+ for(var j=0; j < _this.rObj.tVars.length; j++){
 186+ js_log('checking: ' + _this.rObj.tVars[j] + ' against:' + tvar);
 187+ if( _this.rObj.tVars[j] == tvar)
 188+ do_add=false;
 189+ }
 190+ //add the template vars to the output obj
 191+ if(do_add)
 192+ _this.rObj.tVars.push( tvar );
 193+ }
 194+ doEditHtml();
 195+ });
 196+ }else{
 197+ doEditHtml();
 198+ }
 199+
 200+
 201+ }
 202+ },
 203+ 'duration':{
 204+ d:0,
 205+ 'media':['image','template']
 206+ 'doEdit':function(){
 207+
 208+ }
 209+ },
 210+ 'inoutpoints':{
 211+ 'd':0,
 212+ 'media':['video']
 213+ },
 214+ 'panzoom':{
 215+ 'd':0,
 216+ 'media':['image','video']
 217+ },
 218+ 'overlays':{
 219+ 'd':0,
 220+ 'media':['image','video']
 221+ },
 222+ 'audio':{
 223+ 'd':0,
 224+ 'media':['image','video', 'template']
49225 }
 226+ },
 227+ doEditTypesMenu:function(){
 228+ var _this = this;
 229+ //add in subMenus if set
 230+ //check for submenu and add to item container
 231+ var o='';
 232+ o+= '<ul id="mv_submenu_clipedit" class="mv_submenu">';
 233+ $j.each(this.edit_types, function(sInx, editType){
 234+ //check if the given editType is valid for our given media type
 235+ var include = false;
 236+ for(var i =0; i < editType.media.length;i++){
 237+ if( editType.media[i] == _this.media_type)
 238+ include = true;
 239+ }
 240+ if(include){
 241+ var sub_sel_class = (editType.d == 1)?'class="mv_sub_selected"':'';
 242+ o+= '<li ' + sub_sel_class + ' id="mv_smi_' + sInx + '">' +
 243+ getMsg('sc_' + sInx ) + '</li>';
 244+ }
 245+ });
 246+ o+= '</ul>';
 247+ //add sub menu container with menu html:
 248+ o+= '<div id="sub_cliplib_ic" class="submenu_container"></div>';
 249+ $j('#'+this.control_ct).html( o ) ;
 250+ //set up bindings:
 251+ for( var i in this.edit_types){
 252+ $j('#mv_smi_'+ i).click( function(){
 253+ _this.doDisplayEdit( $j(this).attr("id").replace('mv_smi_','') );
 254+ });
 255+ }
50256 },
 257+ doDisplayEdit:function( edit_type ){
 258+ if(!edit_type)
 259+ for(var i in this.edit_types){
 260+ if(this.edit_types[i].d == 1)
 261+ edit_type = i;
 262+ }
 263+ js_log('doDisplayEdit: ' + edit_type );
 264+ //remove from all
 265+ $j('#mv_submenu_clipedit li').removeClass('mv_sub_selected');
 266+ //add selected class:
 267+ $j('#mv_smi_' + edit_type).addClass('mv_sub_selected');
 268+
 269+ //do edit interface for that edit type:
 270+ this.edit_types[ edit_type ].doEdit( this );
 271+ },
51272 setUpVideoCtrl:function(){
52273 js_log('setUpVideoCtrl:f');
53274 var eb = $j('#embed_vid').get(0);
@@ -143,6 +364,7 @@
144365 '<h3>Edit tools</h3>' +
145366 '<div class="mv_edit_button mv_crop_button_base" id="mv_crop_button" alt="crop" title="'+getMsg('mv_crop')+'"/>'+
146367 '<a href="#" class="mv_crop_msg">' + getMsg('mv_crop') + '</a> '+
 368+ '<span style="display:none" class="mv_crop_msg_load">' + getMsg('loading_txt') + '<span> '+
147369 '<a href="#" style="display:none" class="mv_apply_crop">' + getMsg('mv_apply_crop') + '</a> '+
148370 '<a href="#" style="display:none" class="mv_rest_crop">' + getMsg('mv_reset_crop') + '</a> '+
149371 '<br style="clear:both"><br>'+
@@ -208,22 +430,41 @@
209431 );
210432 }
211433 },
 434+ //right now enableCrop loads "just in time"
 435+ //@@todo we really need an "auto loader" type system.
212436 enableCrop:function(){
213437 var _this = this;
214438 $j('.mv_crop_msg').hide();
215 - $j('.mv_rest_crop,.mv_apply_crop').show();
216 - $j('#mv_crop_button').removeClass('mv_crop_button_base').addClass('mv_crop_button_selected').attr('title',getMsg('mv_crop_done'));
217 - $j('#' + _this.clip_disp_ct + ' img').Jcrop({
218 - onSelect: function(c){
219 - js_log('on select:' + c.x +','+ c.y+','+ c.x2+','+ c.y2+','+ c.w+','+ c.h);
220 - _this.rObj.crop = c;
221 - },
222 - onChange: function(c){
223 - }
224 - });
 439+ $j('.mv_crop_msg_load').show();
 440+ var doEnableCrop = function(){
 441+ $j('.mv_crop_msg_load').hide();
 442+ $j('.mv_rest_crop,.mv_apply_crop').show();
 443+ $j('#mv_crop_button').removeClass('mv_crop_button_base').addClass('mv_crop_button_selected').attr('title',getMsg('mv_crop_done'));
 444+ $j('#' + _this.clip_disp_ct + ' img').Jcrop({
 445+ onSelect: function(c){
 446+ js_log('on select:' + c.x +','+ c.y+','+ c.x2+','+ c.y2+','+ c.w+','+ c.h);
 447+ _this.rObj.crop = c;
 448+ },
 449+ onChange: function(c){
 450+ }
 451+ });
 452+ }
 453+ if(typeof $j.Jcrop == 'undefined'){
 454+ loadExternalCss( mv_embed_path + 'jquery/plugins/Jcrop/css/jquery.Jcrop.css');
 455+ //load the jcrop library if needed:
 456+ mvJsLoader.doLoad({'$j.Jcrop':'jquery/plugins/Jcrop/js/jquery.Jcrop.js'},function(){
 457+ doEnableCrop();
 458+ });
 459+ }else{
 460+ doEnableCrop();
 461+ }
 462+
225463 }
226464 }
227 -// mv_lock_vid_updates defined in mv_stream.js (we need further refactoring )
 465+
 466+
 467+
 468+// mv_lock_vid_updates defined in mv_stream.js (we need to do some more refactoring )
228469 if(typeof mv_lock_vid_updates == 'undefined')
229470 mv_lock_vid_updates= false;
230471
@@ -301,7 +542,7 @@
302543
303544 //if re-size width less than width of image bump it up:
304545 var resize_width = Math.round((slider_end*track_width)-(slider_start*track_width));
305 - if(resize_width<17)resize_width=17;
 546+ if( resize_width < 17 ) resize_width=17;
306547
307548 $j('#resize_'+mvd_id).css({
308549 left:Math.round(slider_start*track_width)+'px',
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_playlist.js
@@ -31,7 +31,7 @@
3232 if(typeof wgServer=='undefined'){
3333 var defaultMetaDataProvider = 'http://metavid.org/overlay/archive_browser/export_cmml?stream_name=';
3434 }else{
35 - var defaultMetaDataProvider = wgServer+wgScript+'?title=Special:MvExportStream&feed_format=roe&stream_name=';
 35+ var defaultMetaDataProvider = wgServer + wgScript + '?title=Special:MvExportStream&feed_format=roe&stream_name=';
3636 }
3737
3838 var mvPlayList = function(element) {
@@ -297,8 +297,7 @@
298298 this.srcType = 'smil';
299299 }
300300 }
301 - }
302 -
 301+ }
303302 if(this.srcType){
304303 js_log('is of type:'+ this.srcType);
305304 this.getPlaylist();
@@ -1567,28 +1566,29 @@
15681567 return false;
15691568 }
15701569 }
 1570+//http://www.w3.org/TR/2007/WD-SMIL3-20070713/smil-extended-media-object.html#smilMediaNS-BasicMedia
 1571+//and added resource description elements
 1572+var mv_smil_ref_supported_attributes = new Array(
 1573+ 'id',
 1574+ 'src',
 1575+ 'type',
 1576+ 'region',
 1577+ 'transIn',
 1578+ 'transOut',
 1579+ 'fill',
 1580+ 'dur',
 1581+
 1582+ 'uri',
 1583+ 'poster'
 1584+);
15711585 /* extension to mvClip to support smil properties */
1572 -var mvSMILClip=function(smil_clip_element, mvClipInit){
1573 - return this.init(smil_clip_element, mvClipInit);
 1586+var mvSMILClip=function(sClipElm, mvClipInit){
 1587+ return this.init(sClipElm, mvClipInit);
15741588 }
15751589 //all the overwritten and new methods for SMIL extension of mv_embed
1576 -mvSMILClip.prototype = {
1577 - //http://www.w3.org/TR/2007/WD-SMIL3-20070713/smil-extended-media-object.html#smilMediaNS-BasicMedia
1578 - //and added resource description elements
1579 - supported_attributes : new Array(
1580 - 'id',
1581 - 'src',
1582 - 'type',
1583 - 'region',
1584 - 'transIn',
1585 - 'transOut',
1586 - 'fill',
1587 - 'dur',
1588 -
1589 - 'uri',
1590 - 'poster'
1591 - ),
1592 - init:function(smil_clip_element, mvClipInit){
 1590+mvSMILClip.prototype = {
 1591+ params : {}, //support param as child of ref clips per SMIL spec
 1592+ init:function(sClipElm, mvClipInit){
15931593 _this = this;
15941594
15951595 //make new mvCLip with ClipInit vals
@@ -1604,21 +1604,21 @@
16051605 }
16061606
16071607 //get supported media attr init non-set
1608 - $j.each(this.supported_attributes, function(i, attr){
1609 - if( $j(smil_clip_element).attr(attr)){
1610 - _this[attr]=$j(smil_clip_element).attr(attr);
 1608+ $j.each(mv_smil_ref_supported_attributes, function(i, attr){
 1609+ if( $j(sClipElm).attr(attr)){
 1610+ _this[attr]=$j(sClipElm).attr(attr);
16111611 }
16121612 })
1613 - this['tagName'] = smil_clip_element.tagName;
 1613+ this['tagName'] = sClipElm.tagName;
16141614
1615 - if( smil_clip_element.firstChild ){
1616 - this['wholeText'] = smil_clip_element.firstChild.nodeValue;
 1615+ if( sClipElm.firstChild ){
 1616+ this['wholeText'] = sClipElm.firstChild.nodeValue;
16171617 js_log("SET wholeText for: "+this['tagName'] + ' '+ this['wholeText']);
16181618 }
16191619 //debugger;
16201620 //mv_embed specific property:
1621 - if( $j(smil_clip_element).attr('poster') )
1622 - this['img'] = $j(smil_clip_element).attr('poster');
 1621+ if( $j(sClipElm).attr('poster') )
 1622+ this['img'] = $j(sClipElm).attr('poster');
16231623
16241624 //lookup and assign copies of transitions
16251625 // (since transition needs to hold some per-instance state info)
@@ -1641,14 +1641,22 @@
16421642 if(this['type']=='application/ogg'){
16431643 this['type']='video/ogg'; //conform to 'video/ogg' type
16441644 }
 1645+
 1646+ //also grab andy child param elements if present:
 1647+ if( sClipElm.getElementsByTagName('param')[0] ){
 1648+ for(var i=0; i< sClipElm.getElementsByTagName('param').length; i++){
 1649+ this.params[ sClipElm.getElementsByTagName('param')[i].getAttribute("name") ] =
 1650+ sClipElm.getElementsByTagName('param')[i].firstChild.nodeValue;
 1651+ }
 1652+ }
16451653
16461654 return this;
16471655 },
16481656 //returns the values of supported_attributes:
16491657 getAttributeObj:function(){
16501658 var elmObj = {};
1651 - for(var i in this.supported_attributes){
1652 - var attr = this.supported_attributes[i];
 1659+ for(var i=0; i < mv_smil_ref_supported_attributes.length; i++){
 1660+ var attr = mv_smil_ref_supported_attributes[i];
16531661 if(this[attr])
16541662 elmObj[ attr ] = this[attr];
16551663 }
@@ -1805,7 +1813,7 @@
18061814 }
18071815 var supported_track_attr =
18081816 trackObj.prototype = {
1809 - //eventualy should be something like "seq" per SMIL spec
 1817+ //should be something like "seq" per SMIL spec
18101818 //http://www.w3.org/TR/SMIL3/smil-timing.html#edef-seq
18111819 // but we don't really support anywhere near the full concept of seq containers yet either
18121820 supported_attributes: new Array(
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/mv_sequence.css
@@ -170,18 +170,18 @@
171171 right:0px;
172172 }
173173 .submenu_container{
174 - left:110px;
 174+ top:25px;
 175+ left:10px;
 176+ right:0px;
175177 overflow:auto;
176178 position:absolute;
177179 broder: solid thin gray;
178180 }
179181 .mv_submenu{
180182 /*position:absolute;*/
181 - float:left;
182183 left:0px;
183184 top:0px;
184185 margin:2px;
185 - width:100px;
186186 list-style-type:none;
187187 bottom:0px;
188188 border:none;
@@ -190,9 +190,11 @@
191191 .mv_submenu li{
192192 border:solid thin gray;
193193 cursor:pointer;
 194+ display:inline;
 195+ padding:5px;
194196 }
195197 .mv_submenu .mv_sub_selected{
196 - border-right: none;
 198+ border-bottom: none;
197199 }
198200 #seq_menu .mv_selected_item{
199201 border-bottom:none;
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/archive_org_logo_80.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/archive_org_tab.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/archive_org_tab.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/archive_org_tab.png
___________________________________________________________________
Added: svn:mime-type
200202 + application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css
@@ -12,11 +12,12 @@
1313 .modal_editor {
1414 background:#AAA none repeat scroll 0 0;
1515 border:3px solid #666666;
16 - left:10%;
17 - top:5%;
 16+ left:2px;
 17+ top:2px;
 18+ right:2px;
1819 position:fixed;
19 - width:80%;
20 - height:90%;
 20+ width:99%;
 21+ height:99%;
2122 z-index:100;
2223 }
2324 .mv_track {
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -21,7 +21,7 @@
2222 MV_DO_INIT=false;
2323 }
2424
25 -//used to grab fresh copies of scripts. (should be changed on every deployable commit)
 25+//used to grab fresh copies of scripts. (should be changed on commit)
2626 var MV_EMBED_VERSION = '1.0rc3';
2727
2828 //the name of the player skin (default is mvpcf)
@@ -37,32 +37,20 @@
3838 //the default height/width of the video (if no style or width attribute provided)
3939 var mv_default_video_size = '400x300';
4040
41 -//this restricts playable sources to ROE xml media without start end time attribute
42 -var mv_restrict_roe_time_source = true;
43 -
4441 var global_player_list = new Array();
4542 var global_req_cb = new Array();//the global request callback array
4643 var _global = this;
4744 var mv_init_done=false;
4845 var global_cb_count =0;
4946
50 -/*
51 - * its best if you just require all your external data sources to serve up json data.
52 - * or
53 - * have a limited set of domains that you accept data from
54 - * enabling mv_proxy is not such a good idea from security standpoint but if you know what your doing
55 - * you can enable it here (also you have to un comment mv_data_proxy die(); line)
56 -*/
57 -var MV_ENABLE_DATA_PROXY=false;
58 -
59 -/*parseUri class:*/
 47+/*parseUri class parses URIs:*/
6048 var parseUri=function(d){var o=parseUri.options,value=o.parser[o.strictMode?"strict":"loose"].exec(d);for(var i=0,uri={};i<14;i++){uri[o.key[i]]=value[i]||""}uri[o.q.name]={};uri[o.key[12]].replace(o.q.parser,function(a,b,c){if(b)uri[o.q.name][b]=c});return uri};parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};
6149
6250 //get mv_embed location if it has not been set
6351 if( !mv_embed_path ){
6452 var mv_embed_path =getMvEmbedPath();
6553 }
66 -//set the unique request id (for ensuring fresh copies of scripts on udpates)
 54+//set the unique request id (for ensuring fresh copies of scripts on updates)
6755 if( !mv_embed_urid ){
6856 var mv_embed_urid = getMvUniqueReqId();
6957 }
@@ -117,7 +105,7 @@
118106 gMsg['seek_to'] = 'Seek to';
119107
120108 //grabs from the globalMsg obj
121 -//@@todo integrate msg serving into CMS
 109+//@@todo integrate msg serving into script loader
122110 function getMsg( key , args ) {
123111 if ( key in gMsg ) {
124112 if(typeof args == 'object'){
@@ -3100,7 +3088,7 @@
31013089 return false;
31023090 }
31033091 function loadExternalCss(url){
3104 - if( url.indexOf('?')==-1 ){
 3092+ if( url.indexOf('?') == -1 ){
31053093 url+='?'+mv_embed_urid;
31063094 }
31073095 js_log('load css: ' + url);
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_nativeEmbed.js
@@ -97,7 +97,7 @@
9898 }
9999 }
100100 }
101 - //update load progress if nessisary f
 101+ //update load progress if needed
102102 if( ! this.monitorTimerId ){
103103 if(document.getElementById(this.id)){
104104 this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 250);

Status & tagging log