Index: trunk/extensions/MetavidWiki/maintenance/metavid2mvWiki.inc.php |
— | — | @@ -705,11 +705,11 @@ |
706 | 706 | include_once( 'scrape_and_insert.inc.php' ); |
707 | 707 | $mvScrape = new MV_BaseScraper(); |
708 | 708 | |
709 | | - //get all people from the people category |
| 709 | + //get all people from the congress people category |
710 | 710 | $result = $dbr->select( 'categorylinks', 'cl_sortkey', array ( |
711 | 711 | 'cl_to' => 'Person', |
712 | | - '`cl_sortkey` LIKE \'%' . mysql_escape_string( $val |
713 | | - ) . '%\' COLLATE latin1_general_ci' ), __METHOD__, array ( |
| 712 | + /*'`cl_sortkey` LIKE \'%' . mysql_escape_string( $val |
| 713 | + ) . '%\' COLLATE latin1_general_ci' ), __METHOD__, array (*/ |
714 | 714 | 'LIMIT' => $result_limit |
715 | 715 | ) ); |
716 | 716 | $out = ''; |
Index: trunk/extensions/MetavidWiki/includes/MV_Stream.php |
— | — | @@ -234,9 +234,7 @@ |
235 | 235 | $dbw->delete('mv_clipview_digest', array('stream_id'=> $this->id )); |
236 | 236 | //remove any images |
237 | 237 | $dbw->delete('mv_stream_images', array('stream_id' => $this->id)); |
238 | | - //remove pointers to any files: |
239 | | - $dbw->delete('mv_stream_images', array('stream_id' => $this->id)); |
240 | | - //remove mv_streams |
| 238 | + //remove pointers to any files: |
241 | 239 | $dbw->delete( 'mv_stream_files', array( 'stream_id' => $this->id )); |
242 | 240 | } |
243 | 241 | function updateStreamDB() { |
Index: trunk/extensions/MetavidWiki/includes/MV_MagicWords.php |
— | — | @@ -121,11 +121,11 @@ |
122 | 122 | function getRecentSpeeches(){ |
123 | 123 | $dbr = & wfGetDB( DB_READ ); |
124 | 124 | //do a query for speeches: |
125 | | - $vars = array( 'query_key', 'stream_id', 'start_time', 'end_time'); |
126 | | - $conds = array( 'view_date >=' . $dbr->addQuotes( $this->getStartTime() ) ); |
127 | | - $options = array( 'GROUP BY' => 'stream_id', 'ORDER BY' => '`stream_id` DESC ', |
| 125 | + $vars = array( '*' ); |
| 126 | + $conds = array(); |
| 127 | + $options = array( 'ORDER BY' => '`date_start_time` DESC ', |
128 | 128 | 'LIMIT' => intval( $this->params['num_results'] ) ); |
129 | | - $result = $dbr->select( 'mv_clipview_digest', |
| 129 | + $result = $dbr->select( 'mv_streams', |
130 | 130 | $vars, |
131 | 131 | $conds, |
132 | 132 | __METHOD__, |
— | — | @@ -136,7 +136,10 @@ |
137 | 137 | } else { |
138 | 138 | $outItems = Array(); |
139 | 139 | while ( $row = $dbr->fetchObject( $result ) ) { |
140 | | - $o = $this->getItemOutput($row); |
| 140 | + $row->stream_id = $row->id; |
| 141 | + $row->end_time = $row->duration; |
| 142 | + //get the first speech in that day: |
| 143 | + $o = $this->getItemOutput($row, array('use_mvd_time'=>true)); |
141 | 144 | if($o) |
142 | 145 | $outItems[]=$o; |
143 | 146 | } |
— | — | @@ -170,76 +173,50 @@ |
171 | 174 | } |
172 | 175 | |
173 | 176 | } |
174 | | - function getItemOutput( $row ){ |
| 177 | + function getItemOutput( $row, $opt=array() ){ |
175 | 178 | global $wgUser; |
176 | 179 | $sk = $wgUser->getSkin(); |
| 180 | + //set defaults: |
| 181 | + $person_ht = $bill_ht = $category_ht = $o= ''; |
177 | 182 | |
178 | | - $person_ht = $bill_ht = $category_ht = $o= ''; |
179 | | - // first make link and stream title: |
180 | | - $mvStream = MV_Stream::newStreamByID( $row->stream_id ); |
181 | | - if( ! $mvStream->doesStreamExist() ){ |
182 | | - return false; |
| 183 | + if(!isset($row->start_time)){ |
| 184 | + $row->start_time=0; |
183 | 185 | } |
184 | | - $nt = $mvStream->getStreamName() . '/' . seconds2ntp( $row->start_time ) |
185 | | - . '/' . seconds2ntp( $row->end_time ); |
186 | | - $mvTitle = new MV_Title( $nt, MV_NS_STREAM ); |
187 | | - |
188 | | - $mvStreamTitle = Title :: MakeTitle( MV_NS_STREAM, $mvTitle->getNearStreamName( $extra_range = '0' ) ); |
189 | | - |
190 | | - |
191 | | - // output the image: |
192 | | - $o .= $sk->makeKnownLinkObj( $mvStreamTitle, |
193 | | - '<img alt="image for ' . $mvTitle->getStreamNameText() . ' ' . |
194 | | - $mvTitle->getTimeDesc() . '" src="' . $mvTitle->getStreamImageURL( 'small' ) . |
195 | | - '"/>', |
196 | | - 'tl=1' ); |
197 | | - |
198 | | - $title_span = ''; |
199 | | - if ( isset( $mvStream->date_start_time ) ) { |
200 | | - $parts = split( '_', $mvStream->getStreamName() ); |
201 | | - if ( count( $parts ) >= 3 ) { |
202 | | - $title_span = ucfirst( $parts[0] . ' ' ); |
203 | | - } else { |
204 | | - $title_span = $mvStream->getStreamName(); |
205 | | - } |
206 | | - $title_span .= date( 'F jS, Y', $mvStream->date_start_time ); |
207 | | - } else { |
208 | | - $title_span = $mvTitle->getStreamNameText() . $mvTitle->getTimeDesc(); |
| 186 | + if(!isset($row->end_time)){ |
| 187 | + $row->end_time=60*20; |
209 | 188 | } |
210 | | - $o .= '<span class="title">' . |
211 | | - $sk->makeKnownLinkObj( $mvStreamTitle, |
212 | | - $title_span, |
213 | | - 'tl=1' ) . |
214 | | - '</span>'; |
215 | | - // try to get metadata from anno_en first. |
216 | | - // @@todo maybe the following metadata grabbing could be abstracted to a single function in mv_index |
| 189 | + $mvd_out_html =''; |
217 | 190 | $mvd_rows = MV_Index::getMVDInRange( |
218 | | - $row->stream_id, |
219 | | - $row->start_time, |
220 | | - $row->end_time, |
221 | | - $mvd_type = 'anno_en', |
222 | | - $getText = true, |
223 | | - $smw_properties = array( 'Speech_by', 'Bill', 'category' ), |
224 | | - $options = array( 'limit' => 1 ) |
| 191 | + $row->stream_id, |
| 192 | + $row->start_time, |
| 193 | + $row->end_time, |
| 194 | + $mvd_type = 'anno_en', |
| 195 | + $getText = true, |
| 196 | + $smw_properties = array( 'Speech_by', 'Bill', 'category' ), |
| 197 | + $options = array( 'limit' => 1 ) |
225 | 198 | ); |
226 | 199 | if ( count( $mvd_rows ) != 0 ) { |
227 | | - reset( $mvd_rows ); |
| 200 | + reset( $mvd_rows ); |
228 | 201 | $mvd_row = current( $mvd_rows ); |
| 202 | + if( isset($opt['use_mvd_time']) && $opt['use_mvd_time'] ){ |
| 203 | + $row->start_time = $mvd_row->start_time; |
| 204 | + $row->end_time = $mvd_row->end_time; |
| 205 | + } |
229 | 206 | // print_r($mvd_rows); |
230 | 207 | // print "type of: " . gettype($mvd_row); |
231 | 208 | if ( isset( $mvd_row->Speech_by ) ) { |
232 | 209 | if ( trim( $mvd_row->Speech_by ) != '' ) { |
233 | 210 | $ptitle = Title::MakeTitle( NS_MAIN, $mvd_row->Speech_by ); |
234 | | - $o .= '<span class="keywords">' . |
235 | | - $sk->makeKnownLinkObj( $ptitle, $ptitle->getText() ) . |
| 211 | + $mvd_out_html .= '<span class="keywords">' . |
| 212 | + $sk->makeKnownLinkObj( $ptitle, $ptitle->getText() ) . |
236 | 213 | '</span>'; |
237 | 214 | } |
238 | 215 | } |
239 | 216 | if ( isset( $mvd_row->Bill ) ) { |
240 | 217 | if ( trim( $mvd_row->Bill ) != '' ) { |
241 | 218 | $btitle = Title::MakeTitle( NS_MAIN, $mvd_row->Bill ); |
242 | | - $o .= '<br><span class="keywords">Bill:' . |
243 | | - $sk->makeKnownLinkObj( $btitle ) . ' |
| 219 | + $mvd_out_html .= '<br><span class="keywords">Bill:' . |
| 220 | + $sk->makeKnownLinkObj( $btitle ) . ' |
244 | 221 | </span>'; |
245 | 222 | } |
246 | 223 | } |
— | — | @@ -255,12 +232,56 @@ |
256 | 233 | $coma=''; |
257 | 234 | while($cl_row= $dbr->fetchObject($cl_res) ){ |
258 | 235 | $cTitle = Title::MakeTitle(NS_CATEGORY, $cl_row->cl_to); |
259 | | - $o.=$coma.$sk->makeKnownLinkObj($cTitle, $cTitle->getText()); |
| 236 | + $mvd_out_html.=$coma.$sk->makeKnownLinkObj($cTitle, $cTitle->getText()); |
260 | 237 | $coma=', '; |
261 | 238 | } |
262 | | - $o.='</span>'; |
| 239 | + $mvd_out_html.='</span>'; |
263 | 240 | }*/ |
264 | 241 | } |
| 242 | + |
| 243 | + |
| 244 | + // first make link and stream title: |
| 245 | + $mvStream = MV_Stream::newStreamByID( $row->stream_id ); |
| 246 | + if( ! $mvStream->doesStreamExist() ){ |
| 247 | + return false; |
| 248 | + } |
| 249 | + //limit our output range to < 20 min |
| 250 | + if( ($row->end_time - $row->start_time) > 20*60) |
| 251 | + $row->end_time = $row->start_time + 20*60; |
| 252 | + |
| 253 | + $nt = $mvStream->getStreamName() . '/' . seconds2ntp( $row->start_time ) |
| 254 | + . '/' . seconds2ntp( $row->end_time ); |
| 255 | + $mvTitle = new MV_Title( $nt, MV_NS_STREAM ); |
| 256 | + |
| 257 | + $mvStreamTitle = Title :: MakeTitle( MV_NS_STREAM, $mvTitle->getNearStreamName( $extra_range = '0' ) ); |
| 258 | + |
| 259 | + |
| 260 | + // output the image: |
| 261 | + $o .= $sk->makeKnownLinkObj( $mvStreamTitle, |
| 262 | + '<img alt="image for ' . $mvTitle->getStreamNameText() . ' ' . |
| 263 | + $mvTitle->getTimeDesc() . '" src="' . $mvTitle->getStreamImageURL( 'small' ) . |
| 264 | + '"/>', |
| 265 | + 'tl=1' ); |
| 266 | + |
| 267 | + $title_span = ''; |
| 268 | + if ( isset( $mvStream->date_start_time ) ) { |
| 269 | + $parts = split( '_', $mvStream->getStreamName() ); |
| 270 | + if ( count( $parts ) >= 3 ) { |
| 271 | + $title_span = ucfirst( $parts[0] . ' ' ); |
| 272 | + } else { |
| 273 | + $title_span = $mvStream->getStreamName(); |
| 274 | + } |
| 275 | + $title_span .= date( 'F jS, Y', $mvStream->date_start_time ); |
| 276 | + } else { |
| 277 | + $title_span = $mvTitle->getStreamNameText() . $mvTitle->getTimeDesc(); |
| 278 | + } |
| 279 | + $o .= '<span class="title">' . |
| 280 | + $sk->makeKnownLinkObj( $mvStreamTitle, |
| 281 | + $title_span, |
| 282 | + 'tl=1' ) . |
| 283 | + '</span>'; |
| 284 | + //add mvd_annotative output: |
| 285 | + $o.=$mvd_out_html; |
265 | 286 | return $o; |
266 | 287 | } |
267 | 288 | function formatOutputItems($outItems){ |
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 embedable sequencer. |
| 14 | + * is a basic embeddable 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 |
— | — | @@ -922,10 +922,10 @@ |
923 | 923 | 'time':0 |
924 | 924 | }); |
925 | 925 | //render out edit button |
926 | | - track_html+='<div onClick="'+this.instance_name+'.editClip('+track_id+','+j+')" class="clip_edit_button clip_edit_base"/>'; |
| 926 | + track_html+='<div class="clip_edit_button clip_edit_base"/>'; |
927 | 927 | |
928 | 928 | //render out transition edit box |
929 | | - track_html+='<div style="" id="tb_' + base_id + '" class="clip_trans_box"/>'; |
| 929 | + track_html+='<div id="tb_' + base_id + '" style="" class="clip_trans_box"/>'; |
930 | 930 | |
931 | 931 | //render out adjustment text |
932 | 932 | track_html+='<div id="' + base_id + '_adj' + '" class="mv_adj_text" style="top:'+ (this.track_clipThumb_height+10 )+'px;">'+ |
— | — | @@ -936,7 +936,7 @@ |
937 | 937 | track_html+='</span>'; |
938 | 938 | |
939 | 939 | } |
940 | | - //do per display type rendering: |
| 940 | + //do timeline_mode rendering: |
941 | 941 | if(this.timeline_mode == 'time'){ |
942 | 942 | clip.left_px = Math.round( cur_clip_time/this.timeline_scale); |
943 | 943 | clip.width_px = Math.round( Math.round( clip.getDuration() )/this.timeline_scale); |
— | — | @@ -980,6 +980,16 @@ |
981 | 981 | $j(this).removeClass("clip_edit_base").addClass("clip_edit_over"); |
982 | 982 | },function(){ |
983 | 983 | $j(this).removeClass("clip_edit_over").addClass("clip_edit_base"); |
| 984 | + }).click(function(){ |
| 985 | + //get the clip (siblings with mv_clip_thumb class) |
| 986 | + var cur_clip_elm = $j(this).siblings('.mv_clip_thumb'); |
| 987 | + //select the clip (add mv_selected_clip if not already selected) |
| 988 | + if( ! $j( cur_clip_elm ).hasClass("mv_selected_clip") ){ |
| 989 | + $j( cur_clip_elm ).addClass('mv_selected_clip'); |
| 990 | + $j('#' + $j( cur_clip_elm ).parent().attr("id") + '_adj').fadeIn("fast"); |
| 991 | + } |
| 992 | + //invoke the edit resource selected resource tab: |
| 993 | + this_seq.doEditSelectedClip(); |
984 | 994 | }); |
985 | 995 | |
986 | 996 | //apply onClick edit controls: |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -2571,7 +2571,7 @@ |
2572 | 2572 | var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
2573 | 2573 | |
2574 | 2574 | var _this=this; |
2575 | | - var out='<span style="color:white"><blockquote style="background-color:black">'; |
| 2575 | + var out='<span style="color:#FFF;background-color:black;"><blockquote>'; |
2576 | 2576 | var _this=this; |
2577 | 2577 | //js_log('selected src'+ _this.media_element.selected_source.url); |
2578 | 2578 | $j.each(this.media_element.getPlayableSources(), function(index, source) |