Index: trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php |
— | — | @@ -132,7 +132,7 @@ |
133 | 133 | $mvDispROEicon=false; |
134 | 134 | |
135 | 135 | //The text Embed a metavid Stream inline in the wiki |
136 | | -$mvEmbedKey = 'EmbedStream'; |
| 136 | +$mvEmbedKey = 'Embed'; |
137 | 137 | |
138 | 138 | //wars people of archive inacuracys (given its a wiki and the source is close caption feed) |
139 | 139 | $mvEnableStreamNotice=true; |
Index: trunk/extensions/MetavidWiki/includes/MV_Hooks.php |
— | — | @@ -78,15 +78,14 @@ |
79 | 79 | */ |
80 | 80 | function mvLinkEnd($skin, $title, $options, &$text, &$attribs, &$ret){ |
81 | 81 | global $mvDefaultAspectRatio, $mvDefaultVideoPlaybackRes, $mvEmbedKey; |
82 | | - //only do link rewrites for STREAM and SEQUENCE name space when on an article page |
83 | | - if( ( substr( $title->getText(), 0, strlen( $mvEmbedKey ) ) != $mvEmbedKey ) && |
84 | | - $title->getNamespace() != MV_NS_SEQUENCE ){ |
| 82 | + //only do link rewrites for $mvEmbedKey |
| 83 | + if( substr( $title->getText(), 0, strlen( $mvEmbedKey ) ) != $mvEmbedKey ){ |
85 | 84 | return true; |
86 | | - } |
| 85 | + } |
87 | 86 | //parse text for extra parameters |
88 | | - //@@todo integrate with image params / maybe file handle ) |
| 87 | + //@@todo integrate with image params / maybe file handle ) |
89 | 88 | $params = explode('|', $text); |
90 | | - //setup defaults: |
| 89 | + //setup defaults: |
91 | 90 | $size = $mvDefaultVideoPlaybackRes; |
92 | 91 | $start_ntp=$end_ntp=null; |
93 | 92 | foreach($params as $param){ |
— | — | @@ -235,7 +234,7 @@ |
236 | 235 | return false; |
237 | 236 | break; |
238 | 237 | default: |
239 | | - // continue proccessing (use default editor) |
| 238 | + // continue processing (use default editor) |
240 | 239 | return true; |
241 | 240 | break; |
242 | 241 | } |
— | — | @@ -328,7 +327,7 @@ |
329 | 328 | $MV_Overlay = new MV_Overlay(); |
330 | 329 | return $MV_Overlay->get_edit_disp( $titleKey, $mvd_id ); |
331 | 330 | } |
332 | | -/* genneral autocomplete */ |
| 331 | +/* general autocomplete */ |
333 | 332 | function mv_helpers_auto_complete( $val = null ) { |
334 | 333 | global $mvMetaDataHelpers, $wgRequest; |
335 | 334 | $property = $wgRequest->getVal( 'prop_name' ); |
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_SequenceTools.php |
— | — | @@ -87,17 +87,23 @@ |
88 | 88 | } |
89 | 89 | //handles copy / paste clip board data actions |
90 | 90 | function do_clipboard( $action ){ |
91 | | - global $wgRequest; |
| 91 | + global $wgRequest, $wgUser; |
92 | 92 | //validate the user-edit token (for both copy and paste) |
93 | | - $token = $wgRequest->getVal( 'clipboardEditToken'); |
| 93 | + $token = $wgRequest->getVal( 'clipboardEditToken'); |
| 94 | + |
94 | 95 | //store the clipboard |
95 | 96 | if( $action == 'copy' ){ |
96 | | - return ''; |
| 97 | + return '1'; |
97 | 98 | } |
98 | 99 | //get the clipboard |
99 | 100 | if( $action == 'paste'){ |
100 | 101 | return ''; |
101 | 102 | } |
| 103 | + //error out: |
| 104 | + return php2jsObj( array( 'status' => 'error', |
| 105 | + 'error_txt' => wfMsg('mv_unknown_clipboard_action') |
| 106 | + ) |
| 107 | + ); |
102 | 108 | } |
103 | 109 | function add_embed_search() { |
104 | 110 | global $wgOut; |
Index: trunk/extensions/MetavidWiki/languages/MV_Messages.php |
— | — | @@ -251,6 +251,7 @@ |
252 | 252 | 'mv_welcome_to_sequencer' => '<h3>Welcome to the sequencer demo</h3> |
253 | 253 | very <b>limited</b> functionality right now. Click on a Clip to edit that resource', |
254 | 254 | 'mv_resource_locator' => 'Resource Locator', |
| 255 | + 'mv_unknown_clipboard_action' => 'Unknown Clipboard Action', |
255 | 256 | |
256 | 257 | 'mv_media_search' => 'Media search', |
257 | 258 | |
Index: trunk/extensions/MetavidWiki/skins/mv_sequence.js |
— | — | @@ -1,292 +0,0 @@ |
2 | | -/*sequencer helper code */ |
3 | | - |
4 | | -mv_addLoadEvent(setup_sequencer); |
5 | | -mvSeq=null; |
6 | | -function setup_sequencer(){ |
7 | | - mv_do_sequence({ |
8 | | - mv_pl_url_id:'mv_pl_url', |
9 | | - video_container_id:'mv_video_container', |
10 | | - sequence_tools_id:'MV_SequenceTools', |
11 | | - timeline_id:'MV_SequenceTimeline' |
12 | | - }); |
13 | | -} |
14 | | - |
15 | | -/* |
16 | | - * similar to mv_d_ajax_form_submit in mv_stream.js |
17 | | - * @@todo could be merged with mv_do_ajax_form_submit from mv_stream (into mv_common.js or something like that) |
18 | | - * */ |
19 | | -function mv_do_ajax_form_submit(mvd_id, edit_action){ |
20 | | - if(mvSeq==null){ |
21 | | - js_error('sequence is not ready...'); |
22 | | - return ''; |
23 | | - } |
24 | | - //set sajax to do a post request |
25 | | - sajax_request_type='POST'; |
26 | | - var args = new Object(); |
27 | | - var post_vars = new Object(); |
28 | | - |
29 | | - var form = document.getElementById('mvd_form_'+mvd_id); |
30 | | - var buttonList = {'wpSave':true, 'wpPreview':true, 'wpLivePreview':true, 'wpDiff':true}; |
31 | | - for(i=0;i<form.elements.length;i++){ |
32 | | - if(buttonList[ form.elements[i].name ]){ |
33 | | - //don't include button unless its the edit action |
34 | | - if(form.elements[i].name.toLowerCase().indexOf( edit_action.toLowerCase() )!=-1){ |
35 | | - post_vars[ form.elements[i].name ]=form.elements[i].value; |
36 | | - } |
37 | | - }else{ |
38 | | - post_vars[ form.elements[i].name ]=form.elements[i].value; |
39 | | - } |
40 | | - //js_log(form.elements[i].name + ' = ' + form.elements[i].value); |
41 | | - } |
42 | | - post_vars['inline_seq'] = mvSeq.getSeqText('inline'); |
43 | | - |
44 | | - js_log("sending: edit action:"+ edit_action + ' url:'+ post_vars.toSource()); |
45 | | - |
46 | | - $j('#mv_seq_edit_preview').html( global_loading_txt); |
47 | | - uri = wgServer + |
48 | | - ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) + |
49 | | - "?action=ajax"; |
50 | | - //add in mediaWiki ajax hook req |
51 | | - uri+='&rs=mv_edit_sequence_submit'; |
52 | | - $j.post(uri, post_vars, function(data){ |
53 | | - switch(edit_action){ |
54 | | - case 'save': |
55 | | - eval(data); |
56 | | - if(mv_result['status']=='ok'){ |
57 | | - //wait 1 seconds to give time for defered updates |
58 | | - setTimeout(function(){ |
59 | | - window.location.href = wgServer+ |
60 | | - ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) + |
61 | | - '/' + wgPageName + '?action=purge'; |
62 | | - }, 1000); |
63 | | - }else if(mv_result['status']=='error'){ |
64 | | - $j('#mv_seq_edit_preview').html( mv_result['error_txt'] ); |
65 | | - } |
66 | | - break; |
67 | | - case 'preview': |
68 | | - $j('#mv_seq_edit_preview').html(data); |
69 | | - break; |
70 | | - } |
71 | | - }) |
72 | | - //do not actually submit |
73 | | - return false; |
74 | | -} |
75 | | -function mv_seqtool_disp(tool_key){ |
76 | | - //hide all not part of the key |
77 | | - $j('.mv_seq_tool').each(function(i){ |
78 | | - if(this.id!='mvseq_'+tool_key)$j(this).fadeOut("fast"); |
79 | | - }); |
80 | | - if($j('#mvseq_'+tool_key).length==0){ |
81 | | - $j('#mv_seqtool_cont').append('<div class="mv_seq_tool" id="mvseq_'+tool_key+'">' + |
82 | | - global_loading_txt + '</div>'); |
83 | | - //do the request load the added tool |
84 | | - uri = wgServer + |
85 | | - ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) + |
86 | | - "?action=ajax"; |
87 | | - uri+='&rs=mv_seqtool_disp&rsargs[]='+tool_key; |
88 | | - $j('#mvseq_'+tool_key).load(uri, function(){ |
89 | | - //add post hooks based on key: |
90 | | - switch(tool_key){ |
91 | | - case 'add_clips_manual': |
92 | | - mv_manual_hooks(); |
93 | | - break; |
94 | | - case 'add_clips_search': |
95 | | - mvJsLoader.doLoad({'mv_setup_search':'../mv_search.js'},function(){ |
96 | | - mv_setup_search('ajax'); |
97 | | - }); |
98 | | - break; |
99 | | - } |
100 | | - }); |
101 | | - }else{ |
102 | | - $j('#mvseq_'+tool_key).fadeIn("fast"); |
103 | | - } |
104 | | - |
105 | | -} |
106 | | -function mv_ajax_search_callback(){ |
107 | | - js_log('mv_ajax_search_callback'); |
108 | | - //rewrite pagging with ajax |
109 | | - $j('#mv_search_pagging a').each(function(){ |
110 | | - $j(this).attr('href', 'javascript:mv_do_ajax_search_request(\''+$j(this).attr('href')+'&seq_inline=true\')'); |
111 | | - }); |
112 | | - //$j('.mv_rtdesc').each(function(){ |
113 | | - // $j(this).prepend('<img onClick=" title="'+getMsg('add_to_end_of_sequence')+'" src="'+mv_embed_path + 'images/application_side_expand.png">'); |
114 | | - //}); |
115 | | -} |
116 | | -//applies mv_seq manual javascript bindings |
117 | | -function mv_manual_hooks(){ |
118 | | - js_log('mv_manual_hooks'); |
119 | | - //load empty mv_embed in #mv_seq_manual_embed |
120 | | - //will be updated based on autocomplete and selected range of selectors |
121 | | - //add autocomplete hook to stream_name #mv_add_stream_name |
122 | | - uri = wgServer + |
123 | | - ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript); |
124 | | - $j('#mv_add_stream_name').autocomplete( |
125 | | - uri, |
126 | | - { |
127 | | - autoFill:true, |
128 | | - onItemSelect:function(v){ |
129 | | - js_log('selected:' + v.innerHTML ); |
130 | | - //unhide adjustment & add hooks (with duration) : |
131 | | - $j('#mv_add_adj_cnt').fadeIn('fast'); |
132 | | - add_adjust_hooks('seq', $j(v).children('.mv_stream_duration').html() ); |
133 | | - //add embed video clip: |
134 | | - var embedCode = $j(v).children('.mv_vid_embed').html(); |
135 | | - $j('#mv_seq_manual_embed').fadeIn('fast'); |
136 | | - $j('#mv_seq_manual_embed').html( embedCode ); |
137 | | - |
138 | | - js_log("embed code:"+ $j('#mv_seq_manual_embed').html() ); |
139 | | - |
140 | | - //base height: |
141 | | - var mv_seq_base_height = $j('#mv_seq_manual_embed').height(); |
142 | | - |
143 | | - //run mv_embed rewrite for the video tag: |
144 | | - rewrite_by_id('vid_seq'); |
145 | | - var vid_seq = $j('#vid_seq').get(0); |
146 | | - //override play action: |
147 | | - vid_seq['old_play']= vid_seq['play']; |
148 | | - vid_seq['old_stop']= vid_seq['stop']; |
149 | | - vid_seq['play'] = function(){ |
150 | | - vid_seq.old_play(); |
151 | | - $j('#mv_seq_manual_embed').css('height', (mv_seq_base_height+70) +'px'); |
152 | | - js_log('height is: ' + $j('#mv_seq_manual_embed').css('height')); } |
153 | | - vid_seq['stop']=function(){ |
154 | | - $j('#mv_seq_manual_embed').css('height',mv_seq_base_height +'px'); |
155 | | - vid_seq.old_stop(); |
156 | | - } |
157 | | - //@@todo add_drag_drop_hook(); |
158 | | - |
159 | | - //add a title output: |
160 | | - $j('#mv_seq_manual_embed').append('<span id="mv_seq_player_time" class="mv_video_time_hr">0:00:00 to 0:00:30</span>'); |
161 | | - //'mv_edit_im_'+mvd_id |
162 | | - //$j('#mv_edit_im_'+mvd_id).attr('src', $j(v).children('img').attr('src')); |
163 | | - }, |
164 | | - formatItem:function(row){ |
165 | | - //hide the duration and embed video in there: |
166 | | - var out = '<div style="display:none;" class="mv_stream_duration">'+row[3]+'</div>' + |
167 | | - '<div style="display:none;" class="mv_vid_embed">'+row[4]+'</div>' + |
168 | | - '<img width="80" height="60" src="'+ row[2] + '">'+row[1]; |
169 | | - js_log('OUT:'+ out); |
170 | | - return out; |
171 | | - }, |
172 | | - matchSubset:0, |
173 | | - extraParams:{action:'ajax',rs:'mv_auto_complete_stream_name'}, |
174 | | - paramName:'rsargs[]', |
175 | | - resultElem:'#mv_add_stream_name_choices' |
176 | | - }); |
177 | | - |
178 | | - //add clip adjustment hooks |
179 | | -} |
180 | | -function mv_add_to_seq(target){ |
181 | | - js_log('mv_add_to_seq'); |
182 | | - //add to the seq: |
183 | | - if(mvSeq){ |
184 | | - if(target){ |
185 | | - mvSeq.addClip({ |
186 | | - track_id:0, |
187 | | - type:'mvClip', |
188 | | - mvclip:target.mvclip, |
189 | | - src: target.src, |
190 | | - img:target.img_url |
191 | | - }); |
192 | | - }else{ |
193 | | - //do a preloaded mvSeq clip (get the src) |
194 | | - var spos = $j('#vid_seq').get(0).thumbnail.indexOf('size='); |
195 | | - var sepos = $j('#vid_seq').get(0).thumbnail.indexOf('&', spos); |
196 | | - var end_img_url = (sepos!=-1)? $j('#vid_seq').get(0).thumbnail.substring(sepos):''; |
197 | | - |
198 | | - var img_url = (spos!=-1)? |
199 | | - $j('#vid_seq').get(0).thumbnail.substring(0, spos) + 'size=320x240'+end_img_url: |
200 | | - $j('#vid_seq').get(0).thumbnail; |
201 | | - mvSeq.addClip({ |
202 | | - track_id:0, |
203 | | - type:'mvClip', |
204 | | - mvclip:$j('#mv_add_stream_name').val() +'?t='+ $j('#mv_start_hr_seq').val() + '/'+ |
205 | | - $j('#mv_end_hr_seq').val(), |
206 | | - src: $j('#vid_seq').get(0).src, |
207 | | - img:img_url |
208 | | - }); |
209 | | - } |
210 | | - }else{ |
211 | | - js_error("error: sequence is not present"); |
212 | | - } |
213 | | -} |
214 | | -//currently disabled: |
215 | | -function add_drag_drop_hook(){ |
216 | | - /* helper: function(){ |
217 | | - $j('body').append($j(this).clone().attr({ |
218 | | - id:'img_thum_vid_seq_drag', |
219 | | - style:'position:absolute', |
220 | | - zindex:99 |
221 | | - }).get(0)); |
222 | | - return $j('#img_thum_vid_seq_drag').get(0); |
223 | | - }, |
224 | | - */ |
225 | | - $j('#img_thumb_vid_seq').draggable({ |
226 | | - opacity:50, |
227 | | - scroll:true, |
228 | | - zindex:99, |
229 | | - drag:function(e, ui){ |
230 | | - js_log('left: '+ui.position.left); |
231 | | - } |
232 | | - }); |
233 | | - //add drop targets on clips if sequence |
234 | | - if(mvSeq){ |
235 | | - for(i in mvSeq.tracks){ |
236 | | - for(j in mvSeq.tracks[i]){ |
237 | | - clip = mvSeq.tracks[i].clips[j]; |
238 | | - $j('#track_'+i+'_clip_'+j).droppable({ |
239 | | - over:function(e, ui){ |
240 | | - $j(this).css('border-left', 'solid thick red'); |
241 | | - }, |
242 | | - out:function(e, ui){ |
243 | | - $j(this).css('border-left', 'solid thin white'); |
244 | | - }, |
245 | | - drop:function(e, ui){ |
246 | | - js_log('drop'); |
247 | | - } |
248 | | - }); |
249 | | - } |
250 | | - } |
251 | | - } |
252 | | -} |
253 | | -function do_video_time_update(start_time, end_time){ |
254 | | - $j('#mv_seq_player_time').html( start_time + ' to ' + end_time ); |
255 | | - if(typeof embed_id=='undefined')embed_id='vid_seq'; |
256 | | - js_log('embed_id:' + embed_id + ' src:'+$j('#'+embed_id).get(0).src ); |
257 | | - if(typeof org_vid_src=='undefined')org_vid_src=$j('#'+embed_id).get(0).src; |
258 | | - if(typeof org_thum_src=='undefined')org_thum_src=$j('#'+embed_id).get(0).thumbnail; |
259 | | - |
260 | | - if(org_vid_src.indexOf('?')!=-1){ |
261 | | - var url = org_vid_src.split('?'); |
262 | | - var new_vid_url = url[0] + '?t=' + start_time+'/'+end_time; |
263 | | - //js_log("new vid url:" +new_vid_url); |
264 | | - if(new_vid_url!=$j('#'+embed_id).attr('src')) |
265 | | - $j('#'+embed_id).get(0).updateVideoSrc(new_vid_url); |
266 | | - } |
267 | | - if(org_thum_src.indexOf('?')!=-1){ |
268 | | - var url = org_thum_src.split('?'); |
269 | | - var sloc = org_thum_src.indexOf('size='); |
270 | | - if( sloc !=-1 ){ |
271 | | - var size = '&'+ org_thum_src.substr(org_thum_src.indexOf('size=')) ; |
272 | | - //strip additional arguments if they past size= |
273 | | - if(size.indexOf('&')!=-1){ |
274 | | - size = size.substr(0, size.indexOf('&')); |
275 | | - } |
276 | | - }else{ |
277 | | - var size =''; |
278 | | - } |
279 | | - var new_thumb = url[0] +'?t='+ start_time +size; |
280 | | - //js_log("new thumb:" + new_thumb); |
281 | | - if(new_thumb!=$j('#'+embed_id).get(0).thumbnail) |
282 | | - $j('#'+embed_id).get(0).updateThumbnail(new_thumb); |
283 | | - } |
284 | | - //make sure the drag hook is applied to the new thumb: |
285 | | - //add_drag_drop_hook(); |
286 | | -} |
287 | | -/* build_sequence_from_playlist_state() |
288 | | - * |
289 | | - * gets sequence tag code from the current playlist object |
290 | | - */ |
291 | | -function build_sequence_from_playlist_state(){ |
292 | | - |
293 | | -} |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | $sample_embed[2]['desc'] = 'simple video with controls and thumbnail'; |
49 | 49 | |
50 | 50 | |
51 | | -$sample_embed[3]['tag'] = '<video roe="http://metavid.org/w/index.php?title=Special:MvExportStream&feed_format=roe&stream_name=Senate_proceeding_08-01-07&t=0:11:40/0:12:20" ></video>'; |
| 51 | +$sample_embed[3]['tag'] = '<video style="width:320px;height:240px" roe="http://metavid.org/w/index.php?title=Special:MvExportStream&feed_format=roe&stream_name=Senate_proceeding_08-01-07&t=0:11:40/0:12:20" ></video>'; |
52 | 52 | $sample_embed[3]['desc'] = 'Demo of ROE only attribute'; |
53 | 53 | |
54 | 54 | |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js |
— | — | @@ -1567,10 +1567,10 @@ |
1568 | 1568 | //give the embed element a unique pid (work around for flowplayer persistence) |
1569 | 1569 | if( this.old_pid!=0 ){ |
1570 | 1570 | this.pid = this.pid +'_'+ this.old_pid; |
1571 | | - } |
| 1571 | + } |
1572 | 1572 | return '<a '+ |
1573 | 1573 | 'href="'+this.media_element.selected_source.getURI( this.seek_time_sec ) + '" '+ |
1574 | | - 'style="display:block;width:400px;height:300px" '+ |
| 1574 | + 'style="display:block;width:' + this.width + ';height:' + this.height + '" '+ |
1575 | 1575 | 'id="'+this.pid+'">'+ |
1576 | 1576 | '</a>'; |
1577 | 1577 | }, |
— | — | @@ -1593,11 +1593,11 @@ |
1594 | 1594 | backgroundGradient: 'none', |
1595 | 1595 | autoHide:'always', |
1596 | 1596 | top:'95%', |
1597 | | - left:'370' |
| 1597 | + right:'0px' |
1598 | 1598 | } |
1599 | 1599 | } |
1600 | 1600 | }; |
1601 | | - //if lightpd |
| 1601 | + //if lightpd |
1602 | 1602 | |
1603 | 1603 | $f(this.pid, mv_embed_path + 'flowplayer/flowplayer-3.0.0-rc4.swf', flowConfig); |
1604 | 1604 | //get the this.fla value: |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_htmlEmbed.js |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | '</div>'+ |
99 | 99 | '</div>' |
100 | 100 | ); |
101 | | - //scale down the font: |
| 101 | + //scale down the fonts: |
102 | 102 | $j('#' + thumb_render_id + ' *').filter('span,div,p,h,h1,h2,h3,h4,h5,h6').css('font-size',font_perc+'%') |
103 | 103 | |
104 | 104 | //replace out links: |
— | — | @@ -122,7 +122,7 @@ |
123 | 123 | return ; |
124 | 124 | }, |
125 | 125 | getEmbedHTML:function(){ |
126 | | - js_log('f:html:getEmbedHTML'); |
| 126 | + js_log('f:html:getEmbedHTML: ' + this.id); |
127 | 127 | //set up the css for our parent div: |
128 | 128 | $j(this).css({'width':this.pc.pp.width, 'height':this.pc.pp.height, 'overflow':"hidden"}); |
129 | 129 | //@@todo support more smil animation layout stuff: |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | }else{ |
140 | 140 | out = this.pc.wholeText; |
141 | 141 | } |
142 | | - js_log('f:getThumbnailHTML: got thumb: '+out); |
| 142 | + //js_log('f:getThumbnailHTML: got thumb: '+out); |
143 | 143 | return out; |
144 | 144 | }, |
145 | 145 | doThumbnailHTML:function(){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js |
— | — | @@ -82,6 +82,7 @@ |
83 | 83 | } |
84 | 84 | } |
85 | 85 | }, |
| 86 | + /* //disable local seeking (while we don't know what we have avaliable) |
86 | 87 | doSeek : function(value){ |
87 | 88 | if( this.vlc ) { |
88 | 89 | if( (this.vlc.input.state == 3) && (this.vlc.input.position != value) ) |
— | — | @@ -90,7 +91,7 @@ |
91 | 92 | this.setStatus( 'seeking...' ); |
92 | 93 | } |
93 | 94 | } |
94 | | - }, |
| 95 | + },*/ |
95 | 96 | playMovieAt : function (order){ |
96 | 97 | //@@todo add clips to playlist after (order) and then play |
97 | 98 | this.play(); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -368,7 +368,7 @@ |
369 | 369 | var quicktimeMozillaPlayer = new mediaPlayer('quicktime-mozilla',['video/ogg'],'quicktime'); |
370 | 370 | var quicktimeActiveXPlayer = new mediaPlayer('quicktime-activex',['video/ogg'],'quicktime'); |
371 | 371 | |
372 | | -var htmlPlayer = new mediaPlayer('html',['text/html', 'image/jpeg'],'html'); |
| 372 | +var htmlPlayer = new mediaPlayer('html',['text/html', 'image/jpeg', 'image/png'],'html'); |
373 | 373 | |
374 | 374 | /** |
375 | 375 | * mediaPlayers is a collection of mediaPlayer objects supported by the client. |
— | — | @@ -1692,7 +1692,7 @@ |
1693 | 1693 | linkback:null, |
1694 | 1694 | |
1695 | 1695 | /** @private */ |
1696 | | - init:function(video_element) |
| 1696 | + init:function( video_element ) |
1697 | 1697 | { |
1698 | 1698 | var _this = this; |
1699 | 1699 | js_log('Initializing mediaElement...' + video_element); |
— | — | @@ -1715,7 +1715,7 @@ |
1716 | 1716 | //js_log(' on inner source: '+i + ' obj: '+ inner_source); |
1717 | 1717 | _this.tryAddSource(inner_source); |
1718 | 1718 | }); |
1719 | | - }, |
| 1719 | + }, |
1720 | 1720 | /** Updates the time request for all sources that have a standard time request argument (ie &t=start_time/end_time) |
1721 | 1721 | */ |
1722 | 1722 | updateSourceTimes:function(start_ntp, end_ntp){ |
— | — | @@ -2093,10 +2093,10 @@ |
2094 | 2094 | var _this = this; |
2095 | 2095 | this.selected_player.load( function() |
2096 | 2096 | { |
2097 | | - js_log('inheriting '+_this.selected_player.library +'Embed to ' + _this.id + ' ' + $j('#'+_this.id).length); |
| 2097 | + //js_log('inheriting '+_this.selected_player.library +'Embed to ' + _this.id + ' ' + $j('#'+_this.id).length); |
2098 | 2098 | //var _this = $j('#'+_this.id).get(0); |
2099 | | - js_log( 'type of ' + _this.selected_player.library +'Embed + ' + |
2100 | | - eval('typeof '+_this.selected_player.library +'Embed')); |
| 2099 | + //js_log( 'type of ' + _this.selected_player.library +'Embed + ' + |
| 2100 | + // eval('typeof '+_this.selected_player.library +'Embed')); |
2101 | 2101 | eval('embedObj = ' +_this.selected_player.library +'Embed;'); |
2102 | 2102 | for(var method in embedObj){ //for in loop oky for object |
2103 | 2103 | //parent method preservation for local overwritten methods |
— | — | @@ -2109,11 +2109,9 @@ |
2110 | 2110 | } |
2111 | 2111 | //update controls if possible |
2112 | 2112 | if(!_this.loading_external_data) |
2113 | | - _this.refreshControlsHTML(); |
2114 | | - |
2115 | | - js_log('plugin load callback complete'); |
| 2113 | + _this.refreshControlsHTML(); |
2116 | 2114 | |
2117 | | - js_log("READY TO PLAY:"+_this.id); |
| 2115 | + //js_log("READY TO PLAY:"+_this.id); |
2118 | 2116 | _this.ready_to_play=true; |
2119 | 2117 | _this.getDuration(); |
2120 | 2118 | _this.getHTML(); |
— | — | @@ -2443,16 +2441,14 @@ |
2444 | 2442 | }, |
2445 | 2443 | getHTML : function (){ |
2446 | 2444 | //@@todo check if we have sources avaliable |
2447 | | - js_log('f:getHTML : '+this.id); |
| 2445 | + js_log('f:getHTML : ' + this.id ); |
2448 | 2446 | var _this = this; |
2449 | 2447 | var html_code = ''; |
2450 | 2448 | html_code = '<div id="videoPlayer_'+this.id+'" style="width:'+this.width+'px;" class="videoPlayer">'; |
2451 | 2449 | html_code += '<div style="width:'+parseInt(this.width)+'px;height:'+parseInt(this.height)+'px;" id="mv_embedded_player_'+this.id+'">' + |
2452 | 2450 | this.getThumbnailHTML() + |
2453 | | - '</div>'; |
2454 | | - |
2455 | | - js_log("mvEmbed:controls "+ typeof this.controls); |
2456 | | - |
| 2451 | + '</div>'; |
| 2452 | + //js_log("mvEmbed:controls "+ typeof this.controls); |
2457 | 2453 | if(this.controls) |
2458 | 2454 | { |
2459 | 2455 | js_log("f:getHTML:AddControls"); |
— | — | @@ -2464,8 +2460,8 @@ |
2465 | 2461 | +(parseInt(this.height)+ctrlBuilder.height)+'px"></div>'); |
2466 | 2462 | } |
2467 | 2463 | html_code += '</div>'; //videoPlayer div close |
2468 | | - js_log('should set: '+this.id); |
2469 | | - $j(this).html(html_code); |
| 2464 | + //js_log('should set: '+this.id); |
| 2465 | + $j(this).html( html_code ); |
2470 | 2466 | //add hooks once Controls are in DOM |
2471 | 2467 | ctrlBuilder.addControlHooks(this); |
2472 | 2468 | |
— | — | @@ -2475,7 +2471,7 @@ |
2476 | 2472 | if(this.autoplay) |
2477 | 2473 | { |
2478 | 2474 | js_log('activating autoplay'); |
2479 | | - this.doEmbedHTML(); |
| 2475 | + this.play(); |
2480 | 2476 | } |
2481 | 2477 | }, |
2482 | 2478 | /* |
— | — | @@ -2552,21 +2548,22 @@ |
2553 | 2549 | //if we are updating don't re-go to the updating url: |
2554 | 2550 | if(this.thumbnail_updating && $j('#new_img_thumb_'+this.id).attr('src')== src ) |
2555 | 2551 | return false; |
2556 | | - |
2557 | | - js_log('set to thumb:'+ src); |
| 2552 | + |
2558 | 2553 | if(quick_switch){ |
2559 | 2554 | $j('#img_thumb_'+this.id).attr('src', src); |
2560 | 2555 | }else{ |
2561 | 2556 | var _this = this; |
2562 | 2557 | //if still animating remove new_img_thumb_ |
2563 | 2558 | if(this.thumbnail_updating==true) |
2564 | | - $j('#new_img_thumb_'+this.id).stop().remove(); |
| 2559 | + $j('#new_img_thumb_'+this.id).stop().remove(); |
| 2560 | + |
2565 | 2561 | if(this.thumbnail_disp){ |
| 2562 | + js_log('set to thumb:'+ src); |
2566 | 2563 | this.thumbnail_updating=true; |
2567 | 2564 | $j('#dc_'+this.id).append('<img src="'+src+'" ' + |
2568 | 2565 | 'style="display:none;position:absolute;zindex:2;top:0px;left:0px;" ' + |
2569 | 2566 | 'width="'+this.width+'" height="'+this.height+'" '+ |
2570 | | - 'id = "new_img_thumb_'+this.id+'" />'); |
| 2567 | + 'id = "new_img_thumb_'+this.id+'" />'); |
2571 | 2568 | //js_log('appended: new_img_thumb_'); |
2572 | 2569 | $j('#new_img_thumb_'+this.id).fadeIn("slow", function(){ |
2573 | 2570 | //once faded in remove org and rename new: |
— | — | @@ -2856,7 +2853,7 @@ |
2857 | 2854 | * base embed controls |
2858 | 2855 | * the play button calls |
2859 | 2856 | */ |
2860 | | - play: function(){ |
| 2857 | + play:function(){ |
2861 | 2858 | var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
2862 | 2859 | js_log("mv_embed play:"+this.id); |
2863 | 2860 | js_log('thum disp:'+this.thumbnail_disp); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_sequencer.js |
— | — | @@ -287,6 +287,9 @@ |
288 | 288 | var menu_item = this.menu_items[item]; |
289 | 289 | //do any menu item post embed js hook processing: |
290 | 290 | switch(item){ |
| 291 | + case 'clipedit': |
| 292 | + //load mv_clip_edit.js |
| 293 | + break; |
291 | 294 | case 'transition': |
292 | 295 | //render out the transitions library |
293 | 296 | this.renderTransitionsSet(target_id); |
— | — | @@ -727,40 +730,21 @@ |
728 | 731 | //add a single or set of clips |
729 | 732 | //to a given position and track_inx |
730 | 733 | addClips:function( clipSet, before_clip_pos, track_inx){ |
731 | | - this_seq = this; |
732 | | - |
733 | | - js_log("seq: add clip: at: "+ before_clip_pos + ' in track: ' + track_inx); |
734 | | - //set defaults if missing |
735 | | - if(typeof trac_inx == 'undefined') |
736 | | - var trackObj = this.plObj.default_track; |
737 | | - else |
738 | | - var trackObj= this_seq.plObj.tracks[track_inx]; |
739 | | - |
| 734 | + this_seq = this; |
| 735 | + js_log("seq: add clip: at: "+ before_clip_pos + ' in track: ' + track_inx); |
740 | 736 | var cur_pos = before_clip_pos; |
741 | 737 | js_log('paste clip before_clip_pos: ' + before_clip_pos); |
| 738 | + //smilXML = |
742 | 739 | $j.each(clipSet, function(inx, clipInitDom){ |
743 | 740 | var mediaElement = document.createElement('ref'); |
744 | 741 | for(var i in clipInitDom){ |
745 | 742 | if(i!='id') |
746 | 743 | $j(mediaElement).attr(i, clipInitDom[i]); |
747 | | - } |
748 | | - var clipObj = new mvSMILClip(mediaElement, |
749 | | - { |
750 | | - id:'p_' + this_seq.plObj.id + '_c_'+cur_pos, |
751 | | - pp:this_seq.plObj, |
752 | | - order:cur_pos |
753 | | - } |
754 | | - ) |
755 | | - js_log('paste clip order: ' + clipObj.order); |
756 | | - //debugger; |
757 | | - if( clipObj ){ |
758 | | - //set up embed: |
759 | | - clipObj.setUpEmbedObj(); |
760 | | - trackObj.addClip(clipObj, cur_pos); |
| 744 | + } |
| 745 | + if( this_seq.plObj.tryAddMedia( mediaElement, cur_pos, track_inx ) ) |
761 | 746 | cur_pos++; |
762 | | - } |
763 | 747 | }); |
764 | | - //debugger; |
| 748 | + debugger; |
765 | 749 | this.do_refresh_timeline(); |
766 | 750 | }, |
767 | 751 | removeClips:function( remove_clip_ary ){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_clip_edit.js |
— | — | @@ -0,0 +1,16 @@ |
| 2 | +/* |
| 3 | +hanndles clip edit controls |
| 4 | + 'inoutpoints':0, //should let you set the in and out points of clip |
| 5 | + 'panzoom':0, //should allow setting keyframes and tweening modes |
| 6 | + 'overlays':0, //should allow setting "locked to clip" overlay tracks |
| 7 | + 'audio':0 //should allow controling the audio volume (with keyframes) |
| 8 | +*/ |
| 9 | + |
| 10 | +var mvClipEdit = function(initObj) { |
| 11 | + return this.init(initObj); |
| 12 | +}; |
| 13 | +mvClipEdit.prototype = { |
| 14 | + init:function( initObj){ |
| 15 | + //setup the clip editor |
| 16 | + } |
| 17 | +} |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js |
— | — | @@ -775,14 +775,16 @@ |
776 | 776 | */ |
777 | 777 | addCliptoTrack: function(clipObj, pos){ |
778 | 778 | if( typeof clipObj['track_id'] =='undefined'){ |
779 | | - clipObj.track_id = 0; |
| 779 | + var track = this.default_track; |
| 780 | + }else{ |
| 781 | + var track = this.tracks[ clipObj.track_id ] |
780 | 782 | } |
781 | | - js_log('add clip' + clipObj.id +' to track: '); |
782 | | - //set the first clip to current (maybe deprecate) |
| 783 | + js_log('add clip' + clipObj.id +' to track: at:' + pos); |
| 784 | + //set the first clip to current (maybe deprecated ) |
783 | 785 | if(clipObj.order==0){ |
784 | 786 | if(!this.cur_clip)this.cur_clip=clipObj; |
785 | 787 | } |
786 | | - this.tracks[ clipObj.track_id ].addClip(clipObj, pos); |
| 788 | + track.addClip(clipObj, pos); |
787 | 789 | }, |
788 | 790 | swapClipDesc: function(req_clipID, callback){ |
789 | 791 | //hide all but the requested |
— | — | @@ -882,6 +884,7 @@ |
883 | 885 | }, |
884 | 886 | //setup the embed object: |
885 | 887 | setUpEmbedObj:function(){ |
| 888 | + js_log('pl:setUpEmbedObj'); |
886 | 889 | //init: |
887 | 890 | //debugger; |
888 | 891 | |
— | — | @@ -1016,7 +1019,7 @@ |
1017 | 1020 | }, |
1018 | 1021 | getClipImg:function(start_offset, size){ |
1019 | 1022 | js_log('f:getClipImg ' + start_offset + ' s:'+size); |
1020 | | - if( !this.img){ |
| 1023 | + if( !this.img){ |
1021 | 1024 | return mv_default_thumb_url; |
1022 | 1025 | }else{ |
1023 | 1026 | if(!size && !start_offset){ |
— | — | @@ -1068,7 +1071,7 @@ |
1069 | 1072 | init:function(vid_init){ |
1070 | 1073 | //send embed_video a created video element: |
1071 | 1074 | ve = document.createElement('div'); |
1072 | | - for(i in vid_init){ |
| 1075 | + for(var i in vid_init){ |
1073 | 1076 | //set the parent clip pointer: |
1074 | 1077 | if(i=='pc'){ |
1075 | 1078 | this['pc']=vid_init['pc']; |
— | — | @@ -1562,7 +1565,7 @@ |
1563 | 1566 | var meta_tags = this.data.getElementsByTagName('meta'); |
1564 | 1567 | var metaNames = new Array('title','interface_url', 'linkback', 'mTitle', 'mTalk'); |
1565 | 1568 | $j.each(meta_tags, function(i,meta_elm){ |
1566 | | - js_log("on META tag: "+ $j(meta_elm).attr('name') ); |
| 1569 | + js_log( "on META tag: "+ $j(meta_elm).attr('name') ); |
1567 | 1570 | for(var i in metaNames){ |
1568 | 1571 | var _name = metaNames[i]; |
1569 | 1572 | if( $j(meta_elm).attr('name') && $j(meta_elm).attr('content') ){ |
— | — | @@ -1582,40 +1585,50 @@ |
1583 | 1586 | js_log('skipping transition: (missing id) ' + trans_elm ); |
1584 | 1587 | } |
1585 | 1588 | }); |
1586 | | - js_log('loaded transitions:' + _this.transitions.length); |
1587 | | - |
| 1589 | + js_log('loaded transitions:' + _this.transitions.length); |
1588 | 1590 | //add seq (latter we will have support more than one seq tag) / more than one "track" |
1589 | 1591 | var seq_tags = this.data.getElementsByTagName('seq'); |
1590 | 1592 | $j.each(seq_tags, function(i,seq_elm){ |
1591 | 1593 | var inx = 0; |
1592 | 1594 | //get all the clips for the given seq: |
1593 | 1595 | $j.each(seq_elm.childNodes, function(i, mediaElement){ |
1594 | | - //~complex~ have to handlde a lot like "switch" "region" etc |
| 1596 | + //~complex~ @@todo to handlde a lot like "switch" "region" etc |
1595 | 1597 | //js_log('process: ' + mediaElemnt.tagName); |
1596 | 1598 | if(typeof mediaElement.tagName!='undefined'){ |
1597 | | - //set up basic mvSMILClip send it the mediaElemnt & mvClip init: |
1598 | | - var clipObj = new mvSMILClip(mediaElement, |
1599 | | - { |
1600 | | - id:'p_' + _this.id + '_c_'+inx, |
1601 | | - pp:_this, |
1602 | | - order:inx |
1603 | | - } |
1604 | | - ); |
1605 | | - if(clipObj){ |
1606 | | - //set up embed: |
1607 | | - clipObj.setUpEmbedObj(); |
1608 | | - //add clip to track: |
1609 | | - _this.addCliptoTrack( clipObj ); |
1610 | | - //valid clip up the order inx: |
| 1599 | + if( _this.tryAddMedia( mediaElement, inx ) ){ |
1611 | 1600 | inx++; |
1612 | | - } |
| 1601 | + } |
1613 | 1602 | } |
1614 | 1603 | }); |
1615 | | - //var cur_clip = new mvClip({type:'srcClip',id:'p_'+this.id+'_c_'+i,pp:this,order:i}); |
1616 | 1604 | }); |
1617 | 1605 | js_log("done proc seq tags"); |
1618 | 1606 | return true; |
1619 | | - } |
| 1607 | + }, |
| 1608 | + tryAddMedia:function(mediaElement, order, track_id){ |
| 1609 | + js_log('SMIL:tryAddMedia:' + mediaElement); |
| 1610 | + //set up basic mvSMILClip send it the mediaElemnt & mvClip init: |
| 1611 | + var clipObj = new mvSMILClip(mediaElement, |
| 1612 | + { |
| 1613 | + "id":'p_' + this.id + '_c_' + order, |
| 1614 | + "pp":this, //set the parent playlist object pointer |
| 1615 | + "order": order |
| 1616 | + } |
| 1617 | + ); |
| 1618 | + //set optional params track |
| 1619 | + if( typeof track_id != 'undefined') |
| 1620 | + clipObj["track_id"] = track_id; |
| 1621 | + |
| 1622 | + //debugger; |
| 1623 | + if (clipObj ){ |
| 1624 | + //set up embed: |
| 1625 | + clipObj.setUpEmbedObj(); |
| 1626 | + //add clip to track: |
| 1627 | + this.addCliptoTrack( clipObj , order); |
| 1628 | + return true; |
| 1629 | + } |
| 1630 | + //@@todo we could throw error details here once we integrate try catches everywhere :P |
| 1631 | + return false; |
| 1632 | + } |
1620 | 1633 | } |
1621 | 1634 | /* extension to mvClip to support smil properties */ |
1622 | 1635 | var mvSMILClip=function(smil_clip_element, mvClipInit){ |
— | — | @@ -1652,13 +1665,15 @@ |
1653 | 1666 | this[method] = myMvClip[method]; |
1654 | 1667 | } |
1655 | 1668 | } |
| 1669 | + |
1656 | 1670 | //get supported media attr init non-set |
1657 | 1671 | $j.each(this.supported_attributes, function(i, attr){ |
1658 | 1672 | if( $j(smil_clip_element).attr(attr)){ |
1659 | 1673 | _this[attr]=$j(smil_clip_element).attr(attr); |
1660 | 1674 | } |
1661 | 1675 | }) |
1662 | | - this['tagName'] =smil_clip_element.tagName; |
| 1676 | + this['tagName'] = smil_clip_element.tagName; |
| 1677 | + |
1663 | 1678 | if( smil_clip_element.firstChild ){ |
1664 | 1679 | this['wholeText'] = smil_clip_element.firstChild.nodeValue; |
1665 | 1680 | js_log("SET wholeText for: "+this['tagName'] + ' '+ this['wholeText']); |
— | — | @@ -1674,14 +1689,12 @@ |
1675 | 1690 | this.transIn = this.pp.transitions[ this.transIn ].clone(); |
1676 | 1691 | this.transIn.pClip = _this; |
1677 | 1692 | this.transIn.transAttrType='transIn'; |
1678 | | - //js_log("SET transIn for " + this.id); |
1679 | 1693 | } |
1680 | 1694 | |
1681 | 1695 | if(this.transOut && this.pp.transitions[ this.transOut ]){ |
1682 | 1696 | this.transOut = this.pp.transitions[ this.transOut ].clone(); |
1683 | 1697 | this.transOut.pClip = _this; |
1684 | | - this.transOut.transAttrType = 'transOut'; |
1685 | | - //js_log("SET transOut for " + this.id); |
| 1698 | + this.transOut.transAttrType = 'transOut'; |
1686 | 1699 | } |
1687 | 1700 | //parse duration / begin times: |
1688 | 1701 | if(this.dur) |
— | — | @@ -1690,9 +1703,8 @@ |
1691 | 1704 | //conform type to video/ogg: |
1692 | 1705 | if(this['type']=='application/ogg'){ |
1693 | 1706 | this['type']='video/ogg'; //conform to 'video/ogg' type |
1694 | | - } |
1695 | | - //@@todo check if valid transition id |
1696 | | - //debugger; |
| 1707 | + } |
| 1708 | + |
1697 | 1709 | return this; |
1698 | 1710 | }, |
1699 | 1711 | //returns the values of supported_attributes: |
— | — | @@ -1856,8 +1868,8 @@ |
1857 | 1869 | } |
1858 | 1870 | var supported_track_attr = |
1859 | 1871 | trackObj.prototype = { |
| 1872 | + //eventualy should be something like "seq" per SMIL spec |
1860 | 1873 | //http://www.w3.org/TR/SMIL3/smil-timing.html#edef-seq |
1861 | | - //(We don't closely mirror the smil spec at this point) |
1862 | 1874 | // but we don't really support anywhere near the full concept of seq containers yet either |
1863 | 1875 | supported_attributes: new Array( |
1864 | 1876 | 'title', |
Index: trunk/extensions/MetavidWiki/skins/mv_sequence.off.js |
— | — | @@ -0,0 +1,292 @@ |
| 2 | +/*sequencer helper code */ |
| 3 | + |
| 4 | +mv_addLoadEvent(setup_sequencer); |
| 5 | +mvSeq=null; |
| 6 | +function setup_sequencer(){ |
| 7 | + mv_do_sequence({ |
| 8 | + mv_pl_url_id:'mv_pl_url', |
| 9 | + video_container_id:'mv_video_container', |
| 10 | + sequence_tools_id:'MV_SequenceTools', |
| 11 | + timeline_id:'MV_SequenceTimeline' |
| 12 | + }); |
| 13 | +} |
| 14 | + |
| 15 | +/* |
| 16 | + * similar to mv_d_ajax_form_submit in mv_stream.js |
| 17 | + * @@todo could be merged with mv_do_ajax_form_submit from mv_stream (into mv_common.js or something like that) |
| 18 | + * */ |
| 19 | +function mv_do_ajax_form_submit(mvd_id, edit_action){ |
| 20 | + if(mvSeq==null){ |
| 21 | + js_error('sequence is not ready...'); |
| 22 | + return ''; |
| 23 | + } |
| 24 | + //set sajax to do a post request |
| 25 | + sajax_request_type='POST'; |
| 26 | + var args = new Object(); |
| 27 | + var post_vars = new Object(); |
| 28 | + |
| 29 | + var form = document.getElementById('mvd_form_'+mvd_id); |
| 30 | + var buttonList = {'wpSave':true, 'wpPreview':true, 'wpLivePreview':true, 'wpDiff':true}; |
| 31 | + for(i=0;i<form.elements.length;i++){ |
| 32 | + if(buttonList[ form.elements[i].name ]){ |
| 33 | + //don't include button unless its the edit action |
| 34 | + if(form.elements[i].name.toLowerCase().indexOf( edit_action.toLowerCase() )!=-1){ |
| 35 | + post_vars[ form.elements[i].name ]=form.elements[i].value; |
| 36 | + } |
| 37 | + }else{ |
| 38 | + post_vars[ form.elements[i].name ]=form.elements[i].value; |
| 39 | + } |
| 40 | + //js_log(form.elements[i].name + ' = ' + form.elements[i].value); |
| 41 | + } |
| 42 | + post_vars['inline_seq'] = mvSeq.getSeqText('inline'); |
| 43 | + |
| 44 | + js_log("sending: edit action:"+ edit_action + ' url:'+ post_vars.toSource()); |
| 45 | + |
| 46 | + $j('#mv_seq_edit_preview').html( global_loading_txt); |
| 47 | + uri = wgServer + |
| 48 | + ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) + |
| 49 | + "?action=ajax"; |
| 50 | + //add in mediaWiki ajax hook req |
| 51 | + uri+='&rs=mv_edit_sequence_submit'; |
| 52 | + $j.post(uri, post_vars, function(data){ |
| 53 | + switch(edit_action){ |
| 54 | + case 'save': |
| 55 | + eval(data); |
| 56 | + if(mv_result['status']=='ok'){ |
| 57 | + //wait 1 seconds to give time for defered updates |
| 58 | + setTimeout(function(){ |
| 59 | + window.location.href = wgServer+ |
| 60 | + ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) + |
| 61 | + '/' + wgPageName + '?action=purge'; |
| 62 | + }, 1000); |
| 63 | + }else if(mv_result['status']=='error'){ |
| 64 | + $j('#mv_seq_edit_preview').html( mv_result['error_txt'] ); |
| 65 | + } |
| 66 | + break; |
| 67 | + case 'preview': |
| 68 | + $j('#mv_seq_edit_preview').html(data); |
| 69 | + break; |
| 70 | + } |
| 71 | + }) |
| 72 | + //do not actually submit |
| 73 | + return false; |
| 74 | +} |
| 75 | +function mv_seqtool_disp(tool_key){ |
| 76 | + //hide all not part of the key |
| 77 | + $j('.mv_seq_tool').each(function(i){ |
| 78 | + if(this.id!='mvseq_'+tool_key)$j(this).fadeOut("fast"); |
| 79 | + }); |
| 80 | + if($j('#mvseq_'+tool_key).length==0){ |
| 81 | + $j('#mv_seqtool_cont').append('<div class="mv_seq_tool" id="mvseq_'+tool_key+'">' + |
| 82 | + global_loading_txt + '</div>'); |
| 83 | + //do the request load the added tool |
| 84 | + uri = wgServer + |
| 85 | + ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) + |
| 86 | + "?action=ajax"; |
| 87 | + uri+='&rs=mv_seqtool_disp&rsargs[]='+tool_key; |
| 88 | + $j('#mvseq_'+tool_key).load(uri, function(){ |
| 89 | + //add post hooks based on key: |
| 90 | + switch(tool_key){ |
| 91 | + case 'add_clips_manual': |
| 92 | + mv_manual_hooks(); |
| 93 | + break; |
| 94 | + case 'add_clips_search': |
| 95 | + mvJsLoader.doLoad({'mv_setup_search':'../mv_search.js'},function(){ |
| 96 | + mv_setup_search('ajax'); |
| 97 | + }); |
| 98 | + break; |
| 99 | + } |
| 100 | + }); |
| 101 | + }else{ |
| 102 | + $j('#mvseq_'+tool_key).fadeIn("fast"); |
| 103 | + } |
| 104 | + |
| 105 | +} |
| 106 | +function mv_ajax_search_callback(){ |
| 107 | + js_log('mv_ajax_search_callback'); |
| 108 | + //rewrite pagging with ajax |
| 109 | + $j('#mv_search_pagging a').each(function(){ |
| 110 | + $j(this).attr('href', 'javascript:mv_do_ajax_search_request(\''+$j(this).attr('href')+'&seq_inline=true\')'); |
| 111 | + }); |
| 112 | + //$j('.mv_rtdesc').each(function(){ |
| 113 | + // $j(this).prepend('<img onClick=" title="'+getMsg('add_to_end_of_sequence')+'" src="'+mv_embed_path + 'images/application_side_expand.png">'); |
| 114 | + //}); |
| 115 | +} |
| 116 | +//applies mv_seq manual javascript bindings |
| 117 | +function mv_manual_hooks(){ |
| 118 | + js_log('mv_manual_hooks'); |
| 119 | + //load empty mv_embed in #mv_seq_manual_embed |
| 120 | + //will be updated based on autocomplete and selected range of selectors |
| 121 | + //add autocomplete hook to stream_name #mv_add_stream_name |
| 122 | + uri = wgServer + |
| 123 | + ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript); |
| 124 | + $j('#mv_add_stream_name').autocomplete( |
| 125 | + uri, |
| 126 | + { |
| 127 | + autoFill:true, |
| 128 | + onItemSelect:function(v){ |
| 129 | + js_log('selected:' + v.innerHTML ); |
| 130 | + //unhide adjustment & add hooks (with duration) : |
| 131 | + $j('#mv_add_adj_cnt').fadeIn('fast'); |
| 132 | + add_adjust_hooks('seq', $j(v).children('.mv_stream_duration').html() ); |
| 133 | + //add embed video clip: |
| 134 | + var embedCode = $j(v).children('.mv_vid_embed').html(); |
| 135 | + $j('#mv_seq_manual_embed').fadeIn('fast'); |
| 136 | + $j('#mv_seq_manual_embed').html( embedCode ); |
| 137 | + |
| 138 | + js_log("embed code:"+ $j('#mv_seq_manual_embed').html() ); |
| 139 | + |
| 140 | + //base height: |
| 141 | + var mv_seq_base_height = $j('#mv_seq_manual_embed').height(); |
| 142 | + |
| 143 | + //run mv_embed rewrite for the video tag: |
| 144 | + rewrite_by_id('vid_seq'); |
| 145 | + var vid_seq = $j('#vid_seq').get(0); |
| 146 | + //override play action: |
| 147 | + vid_seq['old_play']= vid_seq['play']; |
| 148 | + vid_seq['old_stop']= vid_seq['stop']; |
| 149 | + vid_seq['play'] = function(){ |
| 150 | + vid_seq.old_play(); |
| 151 | + $j('#mv_seq_manual_embed').css('height', (mv_seq_base_height+70) +'px'); |
| 152 | + js_log('height is: ' + $j('#mv_seq_manual_embed').css('height')); } |
| 153 | + vid_seq['stop']=function(){ |
| 154 | + $j('#mv_seq_manual_embed').css('height',mv_seq_base_height +'px'); |
| 155 | + vid_seq.old_stop(); |
| 156 | + } |
| 157 | + //@@todo add_drag_drop_hook(); |
| 158 | + |
| 159 | + //add a title output: |
| 160 | + $j('#mv_seq_manual_embed').append('<span id="mv_seq_player_time" class="mv_video_time_hr">0:00:00 to 0:00:30</span>'); |
| 161 | + //'mv_edit_im_'+mvd_id |
| 162 | + //$j('#mv_edit_im_'+mvd_id).attr('src', $j(v).children('img').attr('src')); |
| 163 | + }, |
| 164 | + formatItem:function(row){ |
| 165 | + //hide the duration and embed video in there: |
| 166 | + var out = '<div style="display:none;" class="mv_stream_duration">'+row[3]+'</div>' + |
| 167 | + '<div style="display:none;" class="mv_vid_embed">'+row[4]+'</div>' + |
| 168 | + '<img width="80" height="60" src="'+ row[2] + '">'+row[1]; |
| 169 | + js_log('OUT:'+ out); |
| 170 | + return out; |
| 171 | + }, |
| 172 | + matchSubset:0, |
| 173 | + extraParams:{action:'ajax',rs:'mv_auto_complete_stream_name'}, |
| 174 | + paramName:'rsargs[]', |
| 175 | + resultElem:'#mv_add_stream_name_choices' |
| 176 | + }); |
| 177 | + |
| 178 | + //add clip adjustment hooks |
| 179 | +} |
| 180 | +function mv_add_to_seq(target){ |
| 181 | + js_log('mv_add_to_seq'); |
| 182 | + //add to the seq: |
| 183 | + if(mvSeq){ |
| 184 | + if(target){ |
| 185 | + mvSeq.addClip({ |
| 186 | + track_id:0, |
| 187 | + type:'mvClip', |
| 188 | + mvclip:target.mvclip, |
| 189 | + src: target.src, |
| 190 | + img:target.img_url |
| 191 | + }); |
| 192 | + }else{ |
| 193 | + //do a preloaded mvSeq clip (get the src) |
| 194 | + var spos = $j('#vid_seq').get(0).thumbnail.indexOf('size='); |
| 195 | + var sepos = $j('#vid_seq').get(0).thumbnail.indexOf('&', spos); |
| 196 | + var end_img_url = (sepos!=-1)? $j('#vid_seq').get(0).thumbnail.substring(sepos):''; |
| 197 | + |
| 198 | + var img_url = (spos!=-1)? |
| 199 | + $j('#vid_seq').get(0).thumbnail.substring(0, spos) + 'size=320x240'+end_img_url: |
| 200 | + $j('#vid_seq').get(0).thumbnail; |
| 201 | + mvSeq.addClip({ |
| 202 | + track_id:0, |
| 203 | + type:'mvClip', |
| 204 | + mvclip:$j('#mv_add_stream_name').val() +'?t='+ $j('#mv_start_hr_seq').val() + '/'+ |
| 205 | + $j('#mv_end_hr_seq').val(), |
| 206 | + src: $j('#vid_seq').get(0).src, |
| 207 | + img:img_url |
| 208 | + }); |
| 209 | + } |
| 210 | + }else{ |
| 211 | + js_error("error: sequence is not present"); |
| 212 | + } |
| 213 | +} |
| 214 | +//currently disabled: |
| 215 | +function add_drag_drop_hook(){ |
| 216 | + /* helper: function(){ |
| 217 | + $j('body').append($j(this).clone().attr({ |
| 218 | + id:'img_thum_vid_seq_drag', |
| 219 | + style:'position:absolute', |
| 220 | + zindex:99 |
| 221 | + }).get(0)); |
| 222 | + return $j('#img_thum_vid_seq_drag').get(0); |
| 223 | + }, |
| 224 | + */ |
| 225 | + $j('#img_thumb_vid_seq').draggable({ |
| 226 | + opacity:50, |
| 227 | + scroll:true, |
| 228 | + zindex:99, |
| 229 | + drag:function(e, ui){ |
| 230 | + js_log('left: '+ui.position.left); |
| 231 | + } |
| 232 | + }); |
| 233 | + //add drop targets on clips if sequence |
| 234 | + if(mvSeq){ |
| 235 | + for(i in mvSeq.tracks){ |
| 236 | + for(j in mvSeq.tracks[i]){ |
| 237 | + clip = mvSeq.tracks[i].clips[j]; |
| 238 | + $j('#track_'+i+'_clip_'+j).droppable({ |
| 239 | + over:function(e, ui){ |
| 240 | + $j(this).css('border-left', 'solid thick red'); |
| 241 | + }, |
| 242 | + out:function(e, ui){ |
| 243 | + $j(this).css('border-left', 'solid thin white'); |
| 244 | + }, |
| 245 | + drop:function(e, ui){ |
| 246 | + js_log('drop'); |
| 247 | + } |
| 248 | + }); |
| 249 | + } |
| 250 | + } |
| 251 | + } |
| 252 | +} |
| 253 | +function do_video_time_update(start_time, end_time){ |
| 254 | + $j('#mv_seq_player_time').html( start_time + ' to ' + end_time ); |
| 255 | + if(typeof embed_id=='undefined')embed_id='vid_seq'; |
| 256 | + js_log('embed_id:' + embed_id + ' src:'+$j('#'+embed_id).get(0).src ); |
| 257 | + if(typeof org_vid_src=='undefined')org_vid_src=$j('#'+embed_id).get(0).src; |
| 258 | + if(typeof org_thum_src=='undefined')org_thum_src=$j('#'+embed_id).get(0).thumbnail; |
| 259 | + |
| 260 | + if(org_vid_src.indexOf('?')!=-1){ |
| 261 | + var url = org_vid_src.split('?'); |
| 262 | + var new_vid_url = url[0] + '?t=' + start_time+'/'+end_time; |
| 263 | + //js_log("new vid url:" +new_vid_url); |
| 264 | + if(new_vid_url!=$j('#'+embed_id).attr('src')) |
| 265 | + $j('#'+embed_id).get(0).updateVideoSrc(new_vid_url); |
| 266 | + } |
| 267 | + if(org_thum_src.indexOf('?')!=-1){ |
| 268 | + var url = org_thum_src.split('?'); |
| 269 | + var sloc = org_thum_src.indexOf('size='); |
| 270 | + if( sloc !=-1 ){ |
| 271 | + var size = '&'+ org_thum_src.substr(org_thum_src.indexOf('size=')) ; |
| 272 | + //strip additional arguments if they past size= |
| 273 | + if(size.indexOf('&')!=-1){ |
| 274 | + size = size.substr(0, size.indexOf('&')); |
| 275 | + } |
| 276 | + }else{ |
| 277 | + var size =''; |
| 278 | + } |
| 279 | + var new_thumb = url[0] +'?t='+ start_time +size; |
| 280 | + //js_log("new thumb:" + new_thumb); |
| 281 | + if(new_thumb!=$j('#'+embed_id).get(0).thumbnail) |
| 282 | + $j('#'+embed_id).get(0).updateThumbnail(new_thumb); |
| 283 | + } |
| 284 | + //make sure the drag hook is applied to the new thumb: |
| 285 | + //add_drag_drop_hook(); |
| 286 | +} |
| 287 | +/* build_sequence_from_playlist_state() |
| 288 | + * |
| 289 | + * gets sequence tag code from the current playlist object |
| 290 | + */ |
| 291 | +function build_sequence_from_playlist_state(){ |
| 292 | + |
| 293 | +} |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_sequence.off.js |
___________________________________________________________________ |
Added: svn:mergeinfo |
Added: svn:eol-style |
1 | 294 | + native |