Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php |
— | — | @@ -206,34 +206,47 @@ |
207 | 207 | //if template look for template parameters: |
208 | 208 | $templateText = '{{'. $uriTitle->getText(); |
209 | 209 | $addedParamFlag=false; |
| 210 | + $paramVars = Array(); |
210 | 211 | while ($node->childNodes->length){ |
211 | 212 | if($node->firstChild->nodeName=='param'){ |
212 | 213 | $param = & $node->firstChild; |
213 | 214 | //make sure we have a name: |
214 | | - if($param->hasAttribute('name')){ |
| 215 | + if($param->hasAttribute('name')){ |
215 | 216 | //we have parameters: |
216 | 217 | $templateText.= "|\n"; |
217 | 218 | $templateText .= $param->getAttribute('name') . '='; |
218 | 219 | //try and get the value from the value attribute or innerHTML |
219 | 220 | if($param->hasAttribute('value')){ |
220 | 221 | $templateText .= $param->getAttribute('value'); |
| 222 | + $paramVars[ $param->getAttribute('name') ] = $param->getAttribute('value'); |
221 | 223 | }else{ |
222 | 224 | //grab from inner html: |
| 225 | + $inerHTML =''; |
223 | 226 | 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; |
227 | 232 | } |
228 | 233 | } |
229 | 234 | $addedParamFlag=true; |
230 | 235 | } |
231 | | - $node->removeChild($node->firstChild); |
| 236 | + $node->removeChild($node->firstChild); |
232 | 237 | } |
233 | 238 | //close up the template wikiText call: |
234 | 239 | $templateText.=($addedParamFlag)?"\n}}":'}}'; |
235 | 240 | //$parserOutput = $wgParser->parse($templateText ,$this->mTitle, ParserOptions::newFromUser( $wgUser )); |
236 | 241 | //print "should parse: \n $templateText"; |
237 | 242 | $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); |
238 | 251 | break; |
239 | 252 | case NS_IMAGE: |
240 | 253 | case NS_FILE: |
Index: trunk/extensions/MetavidWiki/skins/add_media_wizard.js |
— | — | @@ -9,15 +9,16 @@ |
10 | 10 | //if mv_embed is hosted somewhere other than near by the add_media_wizard you can define it here: |
11 | 11 | var mv_add_media_wizard_path = 'http://mvbox2.cse.ucsc.edu/w/extensions/MetavidWiki/skins/'; |
12 | 12 | |
| 13 | + |
13 | 14 | //*code should not have to modify anything below*/ |
14 | 15 | //check if we are on a edit page: |
15 | 16 | if(wgAction=='edit'){ |
16 | 17 | //add onPage ready request: |
17 | | - addOnloadHook( function(){ |
| 18 | + addOnloadHook( function(){ |
18 | 19 | var imE = document.createElement('img'); |
19 | 20 | imE.style.cursor = 'pointer'; |
20 | 21 | 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' ); |
22 | 23 | |
23 | 24 | var toolbar = document.getElementById("toolbar"); |
24 | 25 | toolbar.appendChild(imE); |
— | — | @@ -30,14 +31,11 @@ |
31 | 32 | //add firefog support to Special Upload page: |
32 | 33 | if(wgPageName== "Special:Upload"){ |
33 | 34 | 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(){ |
37 | 37 | //load jQuery and what not (we need to refactor the loading system for mv_embed) |
38 | 38 | 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(){ |
42 | 40 | mvUp = new mvUploader(); |
43 | 41 | }); |
44 | 42 | }); |
— | — | @@ -119,29 +117,21 @@ |
120 | 118 | if( typeof mvEmbed == 'undefined'){ |
121 | 119 | //get mv_embed path from _this_ file location: |
122 | 120 | 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 | | - } |
131 | 121 | var e = document.createElement("script"); |
132 | 122 | e.setAttribute('src', mv_embed_url); |
133 | 123 | e.setAttribute('type',"text/javascript"); |
134 | 124 | document.getElementsByTagName("head")[0].appendChild(e); |
135 | | - setTimeout('check_for_mv_embed(callback);', 25); |
| 125 | + check_for_mv_embed( callback ); |
136 | 126 | }else{ |
137 | 127 | check_for_mv_embed( callback ); |
138 | 128 | } |
139 | 129 | } |
140 | 130 | |
141 | 131 | function check_for_mv_embed( callback ){ |
142 | | - js_log('check_for_mv_embed'); |
143 | 132 | if( typeof mvEmbed == 'undefined'){ |
144 | | - setTimeout('check_for_mv_embed( callback );', 25); |
| 133 | + setTimeout('check_for_mv_embed( ' + callback +');', 25); |
145 | 134 | }else{ |
| 135 | + js_log('callback is now: ' + callback); |
146 | 136 | callback(); |
147 | 137 | } |
148 | 138 | } |
— | — | @@ -155,7 +145,6 @@ |
156 | 146 | return s.src.replace('add_media_wizard.js', replace_str); |
157 | 147 | } |
158 | 148 | } |
159 | | - js_log('Error: could not find add media path force config:'); |
160 | 149 | return mv_add_media_wizard_path + replace_str; |
161 | 150 | } |
162 | 151 | |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | <table border="1" cellpadding="6" width="600"> |
89 | 89 | <? foreach ( $sample_embed as $key => $aval ) { |
90 | 90 | // $key!=8 && $key!=3 $key != 0 && $key != 1 && && $key!=3 |
91 | | - if ( $key!=3 )continue; |
| 91 | + if ( $key!=2 )continue; |
92 | 92 | ?> |
93 | 93 | <tr> |
94 | 94 | <td valign="top"><?=$aval['tag']?></td> |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mv_remote_media_search.js |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | 'lib' : 'archive', |
140 | 140 | 'local' : false, |
141 | 141 | 'resource_prefix': 'AO_', |
142 | | - 'tab_img':false |
| 142 | + 'tab_img':true |
143 | 143 | } |
144 | 144 | }, |
145 | 145 | //some default layout values: |
— | — | @@ -273,23 +273,23 @@ |
274 | 274 | mv_set_loading('#rsd_results'); |
275 | 275 | |
276 | 276 | //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 | + }); |
294 | 294 | }, |
295 | 295 | runSearch: function(){ |
296 | 296 | var _this = this; |
— | — | @@ -582,10 +582,10 @@ |
583 | 583 | }; |
584 | 584 | var loadLibs = {'mvClipEdit':'libSequencer/mv_clipedit.js'}; |
585 | 585 | 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'; |
588 | 588 | //@@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'); |
590 | 590 | //display the mvClipEdit obj once we are done loading: |
591 | 591 | mvJsLoader.doLoad( loadLibs,function(){ |
592 | 592 | //run the image clip tools |
— | — | @@ -982,8 +982,7 @@ |
983 | 983 | } |
984 | 984 | } |
985 | 985 | //redraw tabs |
986 | | - this.drawTabs(); |
987 | | - |
| 986 | + this.drawTabs(); |
988 | 987 | if( this.disp_item == 'upload' ){ |
989 | 988 | this.doUploadInteface(); |
990 | 989 | }else{ |
— | — | @@ -1293,12 +1292,15 @@ |
1294 | 1293 | if(data.query && data.query.pages){ |
1295 | 1294 | for(var page_id in data.query.pages){ |
1296 | 1295 | var page = data.query.pages[ page_id ]; |
| 1296 | + //make sure the reop is shared |
| 1297 | + if( page.imagerepository == 'shared'){ |
| 1298 | + continue; |
| 1299 | + } |
1297 | 1300 | //make sure the page is not a redirect |
1298 | 1301 | if(page.revisions[0]['*'].indexOf('#REDIRECT')===0){ |
1299 | 1302 | //skip page is redirect |
1300 | 1303 | continue; |
1301 | | - } |
1302 | | - |
| 1304 | + } |
1303 | 1305 | this.resultsObj[page_id]={ |
1304 | 1306 | 'titleKey' : page.title, |
1305 | 1307 | 'link' :page.imageinfo[0].descriptionurl, |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mv_upload.js |
— | — | @@ -5,7 +5,8 @@ |
6 | 6 | ONCE THAT IS READY |
7 | 7 | */ |
8 | 8 | |
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>'; |
10 | 11 | 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>'; |
11 | 12 | gMsg['upload-in-progress'] = 'Doing Transcode & Upload (do not close this window)'; |
12 | 13 | gMsg['upload-transcoded-status'] = 'Transcoded'; |
— | — | @@ -13,7 +14,8 @@ |
14 | 15 | gMsg['upload-select-file'] = 'Select File...'; |
15 | 16 | |
16 | 17 | var default_upload_options = { |
17 | | - 'target_div':'' |
| 18 | + 'target_div':'', |
| 19 | + 'upload_done_action':'redirect' |
18 | 20 | } |
19 | 21 | |
20 | 22 | var mvUploader = function(initObj){ |
— | — | @@ -39,13 +41,20 @@ |
40 | 42 | mvJsLoader.doLoad({'upFirefogg' : 'libAddMedia/firefogg.js'},function(){ |
41 | 43 | //if we are not on the upload page grab the upload html via ajax: |
42 | 44 | 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 | + }); |
50 | 59 | }); |
51 | 60 | }else{ |
52 | 61 | _this.setupFirefogg(); |
— | — | @@ -68,15 +77,16 @@ |
69 | 78 | {'upload_done_action':'redirect'}: |
70 | 79 | {'upload_done_action':function( rTitle ){ |
71 | 80 | 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 ); |
73 | 83 | } |
74 | 84 | }; |
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 | + } |
81 | 91 | } |
82 | 92 | }, |
83 | 93 | //same add code as specialUpload if($wgEnableFirefogg){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/firefogg.js |
— | — | @@ -12,11 +12,12 @@ |
13 | 13 | if(!iObj) |
14 | 14 | iObj = {}; |
15 | 15 | //init based on if Firefogg is available |
16 | | - if(typeof(Firefogg) == 'undefined') { |
17 | | - |
| 16 | + if(typeof(Firefogg) == 'undefined') { |
18 | 17 | e = document.getElementById('wgfogg_not_installed'); |
19 | 18 | if(e) |
20 | 19 | e.style.display='inline'; |
| 20 | + //no support for firefogg |
| 21 | + return false; |
21 | 22 | }else{ |
22 | 23 | e = document.getElementById('wgfogg_not_installed'); |
23 | 24 | if(e) |
— | — | @@ -27,7 +28,7 @@ |
28 | 29 | e.style.display='inline'; |
29 | 30 | |
30 | 31 | fe = document.getElementById('wgEnableFirefogg'); |
31 | | - if(fe){ |
| 32 | + if(fe){ |
32 | 33 | js_log('wgEnableFirefogg found:'); |
33 | 34 | //get a new fogg object with default options |
34 | 35 | var fogg = new upFirefogg( iObj ); |
— | — | @@ -43,10 +44,12 @@ |
44 | 45 | fogg.disable_fogg(); |
45 | 46 | } |
46 | 47 | }); |
47 | | - }else{ |
| 48 | + }else{ |
48 | 49 | js_log('could not find wgEnableFirefogg'); |
49 | 50 | } |
50 | 51 | } |
| 52 | + //we did init with support |
| 53 | + return true; |
51 | 54 | } |
52 | 55 | |
53 | 56 | var default_firefogg_options = { |
— | — | @@ -93,14 +96,13 @@ |
94 | 97 | select_fogg:function(){ |
95 | 98 | var _this = this; |
96 | 99 | 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; |
98 | 102 | editForm.onsubmit = function return_false(){ |
99 | 103 | return false; |
100 | | - }; |
101 | | - //update the submit button: |
102 | | - |
| 104 | + }; |
103 | 105 | //set binding for "upload" button to call our transcode process |
104 | | - addHandler( editForm, 'submit', function() { |
| 106 | + addHandler( editForm, 'submit', function() { |
105 | 107 | //check if the title and or description are empty don't let the person submit |
106 | 108 | e = document.getElementById('wpDestFile') |
107 | 109 | if(typeof e.value == 'undefined' || e.value=='' || e.value.substr(-4) != '.ogg') |
— | — | @@ -135,7 +137,7 @@ |
136 | 138 | if( _this.ogg.state == 'encoding' ) { |
137 | 139 | setTimeout(encodingStatus, 500); |
138 | 140 | } |
139 | | - //encoding sucessfull, state can also be 'encoding failed' |
| 141 | + //encoding done, state can also be 'encoding failed' |
140 | 142 | else if ( _this.ogg.state == 'encoding done' ) { |
141 | 143 | //hide the fogg-status-transcode |
142 | 144 | e = document.getElementById('fogg-status-transcode'); |
— | — | @@ -143,31 +145,12 @@ |
144 | 146 | //show the fogg-status-upload |
145 | 147 | e = document.getElementById('fogg-status-upload'); |
146 | 148 | 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 | + |
165 | 153 | //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'; |
172 | 155 | |
173 | 156 | var data_str = JSON.stringify(data); |
174 | 157 | //alert('send data:'+ data_str); |
— | — | @@ -233,13 +216,36 @@ |
234 | 217 | } |
235 | 218 | } |
236 | 219 | encodingStatus(); |
237 | | - //don't submit the form (let firefogg hanndle it) |
| 220 | + //don't submit the form (let firefogg handle it) |
238 | 221 | return false; |
239 | 222 | }); //addHandler mapping |
240 | 223 | }else{ |
241 | | - //remove upload bidning if no file was selected |
| 224 | + //remove upload binding if no file was selected |
242 | 225 | } |
243 | 226 | }, |
| 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 | + }, |
244 | 250 | disable_fogg:function(){ |
245 | 251 | //show normal file upload |
246 | 252 | e = document.getElementById('wg-base-upload'); |
— | — | @@ -248,8 +254,12 @@ |
249 | 255 | //hide fogg stuff |
250 | 256 | e = document.getElementById('fogg-video-file'); |
251 | 257 | 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: |
254 | 264 | this.enabled=false; |
255 | 265 | }, |
256 | 266 | fogg_update_progress:function(progress){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_sequencer.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | * |
12 | 12 | * |
13 | 13 | * mv_sequencer.js |
14 | | - * is a basic embeddable sequencer. |
| 14 | + * is a basic embedable sequencer. |
15 | 15 | * extends the playlist with drag/drop/sortable/add/remove functionality |
16 | 16 | * editing of annotative content (mostly for wiki) |
17 | 17 | * enables more dynamic layouts |
— | — | @@ -18,12 +18,8 @@ |
19 | 19 | */ |
20 | 20 | |
21 | 21 | 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'; |
27 | 22 | |
| 23 | + |
28 | 24 | gMsg['menu_cliplib'] = 'Add Resource'; |
29 | 25 | gMsg['menu_transition'] = 'Transitions Effects'; |
30 | 26 | gMsg['menu_resource_overview'] = 'Resource Overview'; |
— | — | @@ -53,8 +49,11 @@ |
54 | 50 | |
55 | 51 | //menu items display helper: |
56 | 52 | 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'; |
58 | 54 | |
| 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 | + |
59 | 58 | gMsg['mv_editor_options'] = 'Editor options'; |
60 | 59 | gMsg['mv_editor_mode'] = 'Editor mode'; |
61 | 60 | gMsg['mv_simple_editor_desc'] = 'simple editor (iMovie style)'; |
— | — | @@ -117,15 +116,11 @@ |
118 | 117 | //the menu_items Object contains: default html, js setup/loader functions |
119 | 118 | menu_items : { |
120 | 119 | '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 | + } |
130 | 125 | }, |
131 | 126 | 'cliplib':{ |
132 | 127 | 'd':0, |
— | — | @@ -137,8 +132,7 @@ |
138 | 133 | 'profile':'sequence', |
139 | 134 | 'p_seq':this_seq, |
140 | 135 | 'target_id':'cliplib_ic', |
141 | | - 'instance_name': this_seq.instance_name + '.mySearch' |
142 | | - |
| 136 | + 'instance_name': this_seq.instance_name + '.mySearch' |
143 | 137 | }); |
144 | 138 | }); |
145 | 139 | } |
— | — | @@ -277,14 +271,21 @@ |
278 | 272 | //display a menu item (hide the rest) |
279 | 273 | disp:function( item ){ |
280 | 274 | 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){ |
283 | 279 | 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 ); |
285 | 285 | }else{ |
286 | 286 | $j('#'+i+'_ic').filter(':visible').fadeOut("fast"); |
| 287 | + this.menu_items[i].d = 0; |
287 | 288 | } |
288 | | - } |
| 289 | + } |
289 | 290 | }, |
290 | 291 | //setup the menu items: |
291 | 292 | setupMenuItems:function(){ |
— | — | @@ -500,36 +501,19 @@ |
501 | 502 | //render the menu: |
502 | 503 | var menu_html = '<ul id="seq_menu">'; |
503 | 504 | 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? ) |
507 | 505 | |
508 | 506 | $j.each(this.menu_items, function(inx, menu_item){ |
509 | 507 | var disp_style = (menu_item.d)?'inline':'none'; |
510 | 508 | var sel_class = (menu_item.d)?'class="mv_selected_item"':''; |
511 | 509 | menu_html+='<li '+sel_class+' id="mv_menu_item_'+inx+'">' + getMsg('menu_' + inx ) +'</li>'; |
512 | 510 | 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 +';">' |
530 | 512 | item_containers += (menu_item.html) ? menu_item.html : '<h3>' + getMsg('menu_'+inx) + '</h3>'; |
531 | 513 | item_containers +='</div>'; |
532 | 514 | }); |
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>'; |
534 | 518 | |
535 | 519 | $j('#'+this.sequence_tools_id).html( menu_html + item_containers ); |
536 | 520 | //add binding for menu |
— | — | @@ -592,7 +576,7 @@ |
593 | 577 | }, |
594 | 578 | /*returns a xml or json representation of the current sequence */ |
595 | 579 | getSeqOutputJSON:function(){ |
596 | | - js_log('json output'); |
| 580 | + js_log('json output:'); |
597 | 581 | }, |
598 | 582 | getSeqOutputHLRDXML:function(){ |
599 | 583 | var o='<sequence_hlrd>' +"\n"; |
— | — | @@ -638,50 +622,49 @@ |
639 | 623 | alert('f:getSeqOutputHLRDXML'+ o); |
640 | 624 | |
641 | 625 | return false; |
642 | | - }, |
643 | | - //@@todo integrate into clip view ... |
| 626 | + }, |
644 | 627 | 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 | + } |
648 | 647 | } |
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'; |
683 | 655 | |
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 | + }); |
686 | 669 | }, |
687 | 670 | //save new clip segment |
688 | 671 | saveClipEdit:function(){ |
— | — | @@ -714,20 +697,24 @@ |
715 | 698 | //upload clipboard to the server (if possible) |
716 | 699 | if( parseUri( document.URL ).host != parseUri( this_seq.plObj.interface_url ).host ){ |
717 | 700 | 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 | + } |
732 | 719 | } |
733 | 720 | }, |
734 | 721 | cutSelectedClips:function(){ |
— | — | @@ -996,13 +983,14 @@ |
997 | 984 | |
998 | 985 | //jump to clip time |
999 | 986 | var sClipObj = this_seq.getClipFromSeqID( $j(this).parent().attr('id') ); |
1000 | | - this_seq.plObj.updateCurrentClip( sClipObj ); |
| 987 | + this_seq.plObj.updateCurrentClip( sClipObj ); |
| 988 | + |
1001 | 989 | if( $j(this).hasClass("mv_selected_clip") ){ |
1002 | 990 | $j(this).removeClass("mv_selected_clip"); |
1003 | 991 | $j('#' + $j(this).parent().attr("id") + '_adj').fadeOut("fast"); |
1004 | 992 | }else{ |
1005 | 993 | $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"); |
1007 | 995 | } |
1008 | 996 | //if shift select is down select the in-between clips |
1009 | 997 | if( this_seq.key_shift_down ){ |
— | — | @@ -1031,6 +1019,8 @@ |
1032 | 1020 | } |
1033 | 1021 | } |
1034 | 1022 | |
| 1023 | + this_seq.doEditSelectedClip(); |
| 1024 | + |
1035 | 1025 | }); |
1036 | 1026 | //add in control for time based display |
1037 | 1027 | //debugger; |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js |
— | — | @@ -13,13 +13,32 @@ |
14 | 14 | gMsg['mv_preview_insert']= 'Preview Insert'; |
15 | 15 | gMsg['mv_cancel_image_insert']='Cancel Image Insert'; |
16 | 16 | |
| 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 | + |
17 | 30 | var default_clipedit_values = { |
18 | 31 | 'rObj': null, // the resource object |
19 | 32 | 'clip_disp_ct':null,//target clip disp |
20 | 33 | 'control_ct':null, //control container |
21 | 34 | 'media_type': null, //media type |
| 35 | + 'parent_ct': null, //parent container |
| 36 | + |
22 | 37 | '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) |
24 | 43 | } |
25 | 44 | var mvClipEdit = function(initObj) { |
26 | 45 | return this.init(initObj); |
— | — | @@ -37,16 +56,218 @@ |
38 | 57 | this[i] = initObj[i]; |
39 | 58 | } |
40 | 59 | } |
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 | + } |
43 | 72 | |
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'] |
49 | 225 | } |
| 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 | + } |
50 | 256 | }, |
| 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 | + }, |
51 | 272 | setUpVideoCtrl:function(){ |
52 | 273 | js_log('setUpVideoCtrl:f'); |
53 | 274 | var eb = $j('#embed_vid').get(0); |
— | — | @@ -143,6 +364,7 @@ |
144 | 365 | '<h3>Edit tools</h3>' + |
145 | 366 | '<div class="mv_edit_button mv_crop_button_base" id="mv_crop_button" alt="crop" title="'+getMsg('mv_crop')+'"/>'+ |
146 | 367 | '<a href="#" class="mv_crop_msg">' + getMsg('mv_crop') + '</a> '+ |
| 368 | + '<span style="display:none" class="mv_crop_msg_load">' + getMsg('loading_txt') + '<span> '+ |
147 | 369 | '<a href="#" style="display:none" class="mv_apply_crop">' + getMsg('mv_apply_crop') + '</a> '+ |
148 | 370 | '<a href="#" style="display:none" class="mv_rest_crop">' + getMsg('mv_reset_crop') + '</a> '+ |
149 | 371 | '<br style="clear:both"><br>'+ |
— | — | @@ -208,22 +430,41 @@ |
209 | 431 | ); |
210 | 432 | } |
211 | 433 | }, |
| 434 | + //right now enableCrop loads "just in time" |
| 435 | + //@@todo we really need an "auto loader" type system. |
212 | 436 | enableCrop:function(){ |
213 | 437 | var _this = this; |
214 | 438 | $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 | + |
225 | 463 | } |
226 | 464 | } |
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 ) |
228 | 469 | if(typeof mv_lock_vid_updates == 'undefined') |
229 | 470 | mv_lock_vid_updates= false; |
230 | 471 | |
— | — | @@ -301,7 +542,7 @@ |
302 | 543 | |
303 | 544 | //if re-size width less than width of image bump it up: |
304 | 545 | 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; |
306 | 547 | |
307 | 548 | $j('#resize_'+mvd_id).css({ |
308 | 549 | left:Math.round(slider_start*track_width)+'px', |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_playlist.js |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | if(typeof wgServer=='undefined'){ |
33 | 33 | var defaultMetaDataProvider = 'http://metavid.org/overlay/archive_browser/export_cmml?stream_name='; |
34 | 34 | }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='; |
36 | 36 | } |
37 | 37 | |
38 | 38 | var mvPlayList = function(element) { |
— | — | @@ -297,8 +297,7 @@ |
298 | 298 | this.srcType = 'smil'; |
299 | 299 | } |
300 | 300 | } |
301 | | - } |
302 | | - |
| 301 | + } |
303 | 302 | if(this.srcType){ |
304 | 303 | js_log('is of type:'+ this.srcType); |
305 | 304 | this.getPlaylist(); |
— | — | @@ -1567,28 +1566,29 @@ |
1568 | 1567 | return false; |
1569 | 1568 | } |
1570 | 1569 | } |
| 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 | +); |
1571 | 1585 | /* 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); |
1574 | 1588 | } |
1575 | 1589 | //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){ |
1593 | 1593 | _this = this; |
1594 | 1594 | |
1595 | 1595 | //make new mvCLip with ClipInit vals |
— | — | @@ -1604,21 +1604,21 @@ |
1605 | 1605 | } |
1606 | 1606 | |
1607 | 1607 | //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); |
1611 | 1611 | } |
1612 | 1612 | }) |
1613 | | - this['tagName'] = smil_clip_element.tagName; |
| 1613 | + this['tagName'] = sClipElm.tagName; |
1614 | 1614 | |
1615 | | - if( smil_clip_element.firstChild ){ |
1616 | | - this['wholeText'] = smil_clip_element.firstChild.nodeValue; |
| 1615 | + if( sClipElm.firstChild ){ |
| 1616 | + this['wholeText'] = sClipElm.firstChild.nodeValue; |
1617 | 1617 | js_log("SET wholeText for: "+this['tagName'] + ' '+ this['wholeText']); |
1618 | 1618 | } |
1619 | 1619 | //debugger; |
1620 | 1620 | //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'); |
1623 | 1623 | |
1624 | 1624 | //lookup and assign copies of transitions |
1625 | 1625 | // (since transition needs to hold some per-instance state info) |
— | — | @@ -1641,14 +1641,22 @@ |
1642 | 1642 | if(this['type']=='application/ogg'){ |
1643 | 1643 | this['type']='video/ogg'; //conform to 'video/ogg' type |
1644 | 1644 | } |
| 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 | + } |
1645 | 1653 | |
1646 | 1654 | return this; |
1647 | 1655 | }, |
1648 | 1656 | //returns the values of supported_attributes: |
1649 | 1657 | getAttributeObj:function(){ |
1650 | 1658 | 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]; |
1653 | 1661 | if(this[attr]) |
1654 | 1662 | elmObj[ attr ] = this[attr]; |
1655 | 1663 | } |
— | — | @@ -1805,7 +1813,7 @@ |
1806 | 1814 | } |
1807 | 1815 | var supported_track_attr = |
1808 | 1816 | trackObj.prototype = { |
1809 | | - //eventualy should be something like "seq" per SMIL spec |
| 1817 | + //should be something like "seq" per SMIL spec |
1810 | 1818 | //http://www.w3.org/TR/SMIL3/smil-timing.html#edef-seq |
1811 | 1819 | // but we don't really support anywhere near the full concept of seq containers yet either |
1812 | 1820 | supported_attributes: new Array( |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/mv_sequence.css |
— | — | @@ -170,18 +170,18 @@ |
171 | 171 | right:0px; |
172 | 172 | } |
173 | 173 | .submenu_container{ |
174 | | - left:110px; |
| 174 | + top:25px; |
| 175 | + left:10px; |
| 176 | + right:0px; |
175 | 177 | overflow:auto; |
176 | 178 | position:absolute; |
177 | 179 | broder: solid thin gray; |
178 | 180 | } |
179 | 181 | .mv_submenu{ |
180 | 182 | /*position:absolute;*/ |
181 | | - float:left; |
182 | 183 | left:0px; |
183 | 184 | top:0px; |
184 | 185 | margin:2px; |
185 | | - width:100px; |
186 | 186 | list-style-type:none; |
187 | 187 | bottom:0px; |
188 | 188 | border:none; |
— | — | @@ -190,9 +190,11 @@ |
191 | 191 | .mv_submenu li{ |
192 | 192 | border:solid thin gray; |
193 | 193 | cursor:pointer; |
| 194 | + display:inline; |
| 195 | + padding:5px; |
194 | 196 | } |
195 | 197 | .mv_submenu .mv_sub_selected{ |
196 | | - border-right: none; |
| 198 | + border-bottom: none; |
197 | 199 | } |
198 | 200 | #seq_menu .mv_selected_item{ |
199 | 201 | 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 |
200 | 202 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css |
— | — | @@ -12,11 +12,12 @@ |
13 | 13 | .modal_editor { |
14 | 14 | background:#AAA none repeat scroll 0 0; |
15 | 15 | border:3px solid #666666; |
16 | | - left:10%; |
17 | | - top:5%; |
| 16 | + left:2px; |
| 17 | + top:2px; |
| 18 | + right:2px; |
18 | 19 | position:fixed; |
19 | | - width:80%; |
20 | | - height:90%; |
| 20 | + width:99%; |
| 21 | + height:99%; |
21 | 22 | z-index:100; |
22 | 23 | } |
23 | 24 | .mv_track { |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | MV_DO_INIT=false; |
23 | 23 | } |
24 | 24 | |
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) |
26 | 26 | var MV_EMBED_VERSION = '1.0rc3'; |
27 | 27 | |
28 | 28 | //the name of the player skin (default is mvpcf) |
— | — | @@ -37,32 +37,20 @@ |
38 | 38 | //the default height/width of the video (if no style or width attribute provided) |
39 | 39 | var mv_default_video_size = '400x300'; |
40 | 40 | |
41 | | -//this restricts playable sources to ROE xml media without start end time attribute |
42 | | -var mv_restrict_roe_time_source = true; |
43 | | - |
44 | 41 | var global_player_list = new Array(); |
45 | 42 | var global_req_cb = new Array();//the global request callback array |
46 | 43 | var _global = this; |
47 | 44 | var mv_init_done=false; |
48 | 45 | var global_cb_count =0; |
49 | 46 | |
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:*/ |
60 | 48 | 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*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}}; |
61 | 49 | |
62 | 50 | //get mv_embed location if it has not been set |
63 | 51 | if( !mv_embed_path ){ |
64 | 52 | var mv_embed_path =getMvEmbedPath(); |
65 | 53 | } |
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) |
67 | 55 | if( !mv_embed_urid ){ |
68 | 56 | var mv_embed_urid = getMvUniqueReqId(); |
69 | 57 | } |
— | — | @@ -117,7 +105,7 @@ |
118 | 106 | gMsg['seek_to'] = 'Seek to'; |
119 | 107 | |
120 | 108 | //grabs from the globalMsg obj |
121 | | -//@@todo integrate msg serving into CMS |
| 109 | +//@@todo integrate msg serving into script loader |
122 | 110 | function getMsg( key , args ) { |
123 | 111 | if ( key in gMsg ) { |
124 | 112 | if(typeof args == 'object'){ |
— | — | @@ -3100,7 +3088,7 @@ |
3101 | 3089 | return false; |
3102 | 3090 | } |
3103 | 3091 | function loadExternalCss(url){ |
3104 | | - if( url.indexOf('?')==-1 ){ |
| 3092 | + if( url.indexOf('?') == -1 ){ |
3105 | 3093 | url+='?'+mv_embed_urid; |
3106 | 3094 | } |
3107 | 3095 | js_log('load css: ' + url); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_nativeEmbed.js |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | } |
99 | 99 | } |
100 | 100 | } |
101 | | - //update load progress if nessisary f |
| 101 | + //update load progress if needed |
102 | 102 | if( ! this.monitorTimerId ){ |
103 | 103 | if(document.getElementById(this.id)){ |
104 | 104 | this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 250); |