r38829 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38828‎ | r38829 | r38830 >
Date:01:18, 8 August 2008
Author:dale
Status:old
Tags:
Comment:
lots of cosmetic fixes for new skin
Modified paths:
  • /branches/MetavidWiki-exp/MetavidWiki/includes/MV_MagicWords.php (modified) (history)
  • /branches/MetavidWiki-exp/MetavidWiki/includes/MV_MetavidInterface/MV_MetavidInterface.php (modified) (history)
  • /branches/MetavidWiki-exp/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php (modified) (history)
  • /branches/MetavidWiki-exp/MetavidWiki/includes/MV_MetavidInterface/MV_Tools.php (modified) (history)
  • /branches/MetavidWiki-exp/MetavidWiki/includes/MV_Title.php (modified) (history)
  • /branches/MetavidWiki-exp/MetavidWiki/languages/MV_Messages.php (modified) (history)
  • /branches/MetavidWiki-exp/MetavidWiki/skins/mv_custom.css (modified) (history)
  • /branches/MetavidWiki-exp/MetavidWiki/skins/mv_stream.js (modified) (history)

Diff [purge]

Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_MagicWords.php
@@ -66,7 +66,9 @@
6767 }
6868 //run the search and return the results:
6969 //set up data request:
70 - $ms = new MV_SpecialMediaSearch();
 70+ $ms = new MV_SpecialMediaSearch();
 71+ $_REQUEST['limit']=$this->params['num_results'];
 72+
7173 $ms->filters[] = array ( 'a' => 'and', 't' => 'spoken_by','v' =>$person_name );
7274 $ms->doSearch();
7375 return $ms->getUnifiedResultsHTML($show_sidebar=false);
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_Title.php
@@ -198,9 +198,15 @@
199199 return $this->stream_name . '/'.$start_ntp . $end_ntp;
200200 }
201201
202 - function getTimeDesc(){
 202+ function getTimeDesc($span_separated=false){
203203 if($this->getStartTime() && $this->getEndTime()){
204 - return wfMsg('mv_time_separator', $this->getStartTime(), $this->getEndTime());
 204+ if($span_separated){
 205+ return wfMsg('mv_time_separator',
 206+ '<span class="mv_start_time">'.$this->getStartTime().'</span>',
 207+ '<span class="mv_end_time">'.$this->getEndTime()).'</span>';
 208+ }else{
 209+ return wfMsg('mv_time_separator', $this->getStartTime(), $this->getEndTime());
 210+ }
205211 }else{
206212 return '';
207213 }
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_MetavidInterface/MV_MetavidInterface.php
@@ -89,7 +89,7 @@
9090 $this->page_header ='<h1 class="videoHeader">'.
9191 $this->article->mvTitle->getStreamNameText().' :: '.
9292 $this->components['MV_Tools']->stream_paging_links('prev') .
93 - ' <span id="mv_stream_time">'.$this->article->mvTitle->getTimeDesc() . '</span>'.
 93+ ' <span title="'.wfMsg('mv_click_to_edit').'" id="mv_stream_time">'.$this->article->mvTitle->getTimeDesc($span_separated=true) . '</span>'.
9494 $this->components['MV_Tools']->stream_paging_links('next') .
9595 wfMsg('mv_of') . seconds2ntp($this->article->mvTitle->getDuration()) .
9696 '</h1>';
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_MetavidInterface/MV_Tools.php
@@ -32,6 +32,18 @@
3333 }
3434 $wgOut->addHTML('</div>');
3535 }
 36+ function render_full(){
 37+ global $wgOut;
 38+ //"<div >" .
 39+ /*$wgOut->addHTML("<fieldset ".$this->getStyleOverride()." id=\"".get_class($this)."\" >\n" .
 40+ "<legend id=\"mv_leg_".get_class($this)."\">".$this->render_menu()."</legend>\n");
 41+ */
 42+ //do the implemented html
 43+ $wgOut->addHTML('<div id="MV_Tools">');
 44+ $this->getHTML();
 45+ $wgOut->addHTML('</div>');
 46+ /*$wgOut->addHTML("</fieldset>\n");*/
 47+ }
3648 /*function getStreamPage(){
3749 return ;
3850 }*/
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php
@@ -41,15 +41,25 @@
4242 $out='';
4343 //set up left hand side timeline
4444 $ttl_width = count($this->mvd_tracks)*($this->tl_width);
45 - $wgOut->addHTML('<div id="mv_time_line" style="width:'.$ttl_width.'px">' .
 45+ /*$wgOut->addHTML('<div id="mv_time_line" style="width:'.$ttl_width.'px">' .
4646 $this->get_video_timeline() .
4747 '</div>');
48 - $wgOut->addHTML('<div id="mv_fd_mvd_cont" style="left:'.$ttl_width.'px" >');
 48+ */
 49+ //get nav-interface links
 50+
 51+ //$wgOut->addHTML('<div id="mv_fd_mvd_cont" >');
4952 $wgOut->addHTML("<div id=\"mv_add_new_mvd\" style=\"display:none;\"></div>");
5053 $this->get_transcript_pages();
51 - $wgOut->addHTML("</div>");
 54+ //$wgOut->addHTML("</div>");
5255 }
53 -
 56+ function render_full(){
 57+ global $wgOut;
 58+ //"<div >" .
 59+ $wgOut->addHTML("<div id=\"selectionsBox\">\n");
 60+ //do the implemented html
 61+ $this->getHTML();
 62+ $wgOut->addHTML("</div>\n");
 63+ }
5464 function render_menu(){
5565 $base_title='';
5666 //set the base title to the stream name:
@@ -128,14 +138,14 @@
129139 }else{
130140 $img_url = MV_StreamImage::getStreamImageURL($mvd_page->stream_id, $mvd_page->start_time, 'medium', true);
131141 }
 142+ //style=\"background:#".$this->getMvdBgColor($mvd_page)."\" "
 143+ $wgOut->addHTML("<fieldset class=\"mv_fd_mvd\" id=\"mv_fd_mvd_{$mvd_page->id}\" name=\"{$mvd_page->wiki_title}\" " .
 144+ "image_url=\"{$img_url}\" >" );
132145
133 - $wgOut->addHTML("<fieldset class=\"mv_fd_mvd\" style=\"background:#".$this->getMvdBgColor($mvd_page)."\" " .
134 - "id=\"mv_fd_mvd_{$mvd_page->id}\" name=\"{$mvd_page->wiki_title}\" " .
135 - "image_url=\"{$img_url}\" >" );
136 -
137 - $wgOut->addHTML("<legend id=\"mv_ld_{$mvd_page->id}\">" .
 146+ /*$wgOut->addHTML("<legend id=\"mv_ld_{$mvd_page->id}\">" .
138147 $this->get_mvd_menu($mvd_page) .
139 - "</legend>");
 148+ "</legend>");*/
 149+ $wgOut->addHTML($this->get_mvd_menu($mvd_page));
140150 $wgOut->addHTML("<div id=\"mv_fcontent_{$mvd_page->id}\">");
141151 if($content==''){
142152 $this->outputMVD($mvd_page);
@@ -261,7 +271,6 @@
262272 return ;
263273 }
264274 }
265 -
266275 $parserOutput = $this->parse_format_text($wikiText, $mvdTitle);
267276
268277 //if absolute_links set preg_replace with the server for every relative link:
@@ -383,17 +392,17 @@
384393
385394 //{s:\''.seconds2ntp($mvd_page->start_time).'\',e:\''.seconds2ntp($mvd_page->end_time).'\'}
386395 $plink='<a title="'.wfMsg('mv_play').' '.seconds2ntp($mvd_page->start_time) . ' to ' . seconds2ntp($mvd_page->end_time).' " ' .
387 - 'style="font-weight:bold;color:#000" ' .
 396+ 'style="text-decoration:none;" ' .
388397 'href="javascript:mv_do_play('.$mvd_page->id.');">' .
389 - '<img src="'.$mvgScriptPath.'/skins/images/control_play_blue.png"> '.
 398+ '<span style="width:44px"><img src="'.$mvgScriptPath.'/skins/images/control_play_blue.png"></span>'.
390399 seconds2ntp($mvd_page->start_time) . ' to ' . seconds2ntp($mvd_page->end_time).'</a>';
391400
392401 //@@TODO set up conditional display: (view source if not logged on, protect, remove if given permission)
393402 $out.=$plink;
394 - $out.="| $elink | $hlink | $dlink ";
 403+ $out.="- $elink - $hlink - $dlink ";
395404 if($wgUser->isAllowed('mv_delete_mvd')){
396405 $rlink = '<a title="'.wfMsg('mv_remove_title').'" href="javascript:mv_disp_remove_mvd(\''.$mvd_page->wiki_title.'\', \''.$mvd_page->id.'\')">'.wfMsg('mv_remove').'</a>';
397 - $out.=' | ' . $rlink;
 406+ $out.=' - ' . $rlink;
398407 }
399408 return $out;
400409 }
Index: branches/MetavidWiki-exp/MetavidWiki/languages/MV_Messages.php
@@ -29,7 +29,7 @@
3030 #add/edit stream text:
3131 'mv_stream_meta' => 'Stream page',
3232 'mv_add_stream' => 'Metavid Add Stream',
33 - 'mv_edit_stream' => 'Metavid Edit Stream',
 33+ 'mv_edit_stream' => 'Metavid Edit Stream',
3434 'mvexportsearch' => 'Metavid Export',
3535 'mvexportsequence' => 'Metavid Export Sequence',
3636 'mvexportstream' => 'Metavid Export Stream',
@@ -79,7 +79,7 @@
8080 'mv_metavid_live' => 'Set up live stream',
8181 'mv_upload_file' => 'Upload file',
8282 'mv_external_file' => 'External file',
83 - 'mv_stream_delete_warning' => 'Deleting this stream will additionally remove $1 pages of metadata',
 83+ 'mv_stream_delete_warning' => 'Deleting this stream will additionally remove $1 pages of metadata',
8484
8585 #tools
8686 'mv_tool_search' => 'Search',
@@ -103,8 +103,8 @@
104104 'mv_category_matches' => 'Category Matches',
105105 'mv_bill_matches' => 'Bill Matches',
106106 'mv_interest_group_matches' => 'Interest Group Matches',
 107+ 'mv_click_to_edit' => 'click to edit',
107108
108 -
109109 #mvd types:
110110 'ht_en' => 'Transcript',
111111 'ht_en_desc' => 'English transcripts. This overlay type is for spoken text',
Index: branches/MetavidWiki-exp/MetavidWiki/skins/mv_custom.css
@@ -16,9 +16,10 @@
1717 }
1818 .mv_fd_mvd{
1919 float:left;
20 - margin:4px;
2120 width:90%;
2221 min-width: 350px;
 22+ border:none;
 23+ border: 1px solid #FFFFFF;
2324 }
2425 .mv_video_time_hr{
2526 position:absolute;
@@ -168,13 +169,13 @@
169170 position:absolute;left:365px;top:30px;right:15px;bottom:10px;margin:4px;min-width:470px;
170171 }
171172 #mv_fd_mvd_cont{
172 - position:absolute;top:0px;bottom:30px;right:12px;overflow-x:hidden;overflow-y:auto;
 173+ position:absolute;top:0px;right:12px;overflow-x:hidden;overflow-y:auto;
173174 }
174175 #mv_time_line{
175176 position:absolute;background:#DDDDDD;left:0px;height:94%;overflow:hidden;
176177 }
177178 #MV_Tools{
178 - position:absolute;width:322px;top:312px;left:10px;bottom:10px;margin:4px;
 179+ position:absolute;width:400px;top:350px;left:10px;bottom:10px;margin:4px;
179180 }
180181 #mv_tool_cont{
181182 position:absolute;top:0px;left:0px;right:13px;bottom:30px;overflow:auto;
Index: branches/MetavidWiki-exp/MetavidWiki/skins/mv_stream.js
@@ -121,6 +121,42 @@
122122 //add all the hover hooks:
123123 this.addHoverHooks();
124124
 125+ //add edit/navigate hook
 126+ var st_input_mode=false;
 127+ $j('#mv_stream_time').click(function(){
 128+ if(!st_input_mode){
 129+ var st = $j('#'+this.id+' .mv_start_time').html();
 130+ var et = $j('#'+this.id+' .mv_end_time').html();
 131+ $j(this).hide();
 132+ $j(this).after('<form style="display:inline" action="javascript:alert(\'wtf\');" id="td_st_mv_stream_time">' +
 133+ '<input class="videoHeader" id="mv_td_start_time" size="7" value="'+st+'">'+
 134+ '<input class="videoHeader" id="mv_td_end_time" size="7" value="'+et+'"> '+
 135+ '<a href="#" id="mv_td_st_go">go</a> :: '+
 136+ '<a href="#" id="mv_td_st_cancel">cancel</a></form>');
 137+ }
 138+ if(!st_input_mode)st_input_mode=true;
 139+ //bind actions for go/cancel
 140+ function getNavUrl(){
 141+ return wgArticlePath.replace('$1',wgPageName+'/'+$j('#mv_td_start_time').val()+'/'+$j('#mv_td_end_time').val());
 142+ }
 143+ $j('#mv_td_st_go').click(function(){
 144+ window.location=getNavUrl();
 145+ return false;
 146+ });
 147+ $j('#td_st_mv_stream_time input').keypress(function (e) {
 148+ if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
 149+ window.location=getNavUrl();
 150+ }
 151+ });
 152+ $j('#mv_td_st_cancel').click(function(){
 153+ $j('#mv_stream_time').show();
 154+ $j('#td_st_mv_stream_time').remove();
 155+ st_input_mode=false;
 156+ return false;
 157+ });
 158+ });
 159+
 160+
125161 //do any tool specific hooks:
126162 this.tool_key = parseUri(document.URL).queryKey.tool_disp;
127163 if(this.tool_key){
@@ -199,7 +235,7 @@
200236 out:function(){
201237
202238 }
203 - });
 239+ });
204240 },
205241 //delay video updates until we are not playing the clip:
206242 delayDoVidMvdUpdate:function(){
@@ -806,7 +842,7 @@
807843 $j('#mv_fd_mvd_'+mvd_id).css('border','1px solid #FF0000');
808844 }
809845 function de_highlight_fd(mvd_id){
810 - $j('#mv_fd_mvd_'+mvd_id).css('border', '1px solid #2F6FAB');
 846+ $j('#mv_fd_mvd_'+mvd_id).css('border', '1px solid #FFFFFF');
811847 }
812848
813849 function highlight_tl_ts(mvd_id){

Status & tagging log