r29559 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29558‎ | r29559 | r29560 >
Date:21:39, 10 January 2008
Author:dale
Status:old
Tags:
Comment:
layout updates
*moved interface styles to css
*added IE conditionals
*Improved IE compatibility
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Component.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_MetavidInterface.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Tools.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_VideoPlayer.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_Title.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/MV_custom.css (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/MV_customIE.css (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_stream.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -164,9 +164,14 @@
165165 $wgOut->addLink(array(
166166 'rel' => 'stylesheet',
167167 'type' => 'text/css',
168 - 'media' => 'screen, projection',
 168+ 'media' => 'all',
169169 'href' => $mvCssUrl
170170 ));
 171+ //add extra IE styles fixes
 172+ $mvCssUrlIE = $mvgScriptPath . '/skins/MV_customIE.css';
 173+ $wgOut->addScript('<!--[if IE]>' .
 174+ '<link href="'.$mvCssUrlIE.'" rel="stylesheet" media="all" type="text/css">'.
 175+ '<![endif]-->');
171176
172177 $mvgHeadersInPlace=true;
173178 }
Index: trunk/extensions/MetavidWiki/includes/MV_Title.php
@@ -169,12 +169,8 @@
170170 }
171171 return $this->stream_name . '/'.$start_ntp . $end_ntp;
172172 }
173 - function getTimeDesc(){
174 - $time_str = $this->getStartTime();
175 - if($this->getEndTime()!=''){
176 - $time_str.=wfMsg('mv_time_separator') . $this->getEndTime();
177 - }
178 - return $time_str;
 173+ function getTimeDesc(){
 174+ return wfMsg('mv_time_separator', $this->getStartTime(), $this->getEndTime());
179175 }
180176 function getStreamImageURL($size=null, $req_time=null, $foce_server=''){
181177 global $mvImageArchive, $mvDefaultVideoPlaybackRes;
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_MetavidInterface.php
@@ -18,18 +18,7 @@
1919 var $components = array();
2020 var $context=null;
2121 var $page_title='';
22 - var $page_header='';
23 - //default layout:
24 - var $cpLayout = array(
25 - 'MV_VideoPlayer'=>'position:absolute;width:322px;top:30px;height:270px;left:10px;margin:4px;',
26 - 'MV_Overlay'=>'position:absolute;left:365px;right:10px;top:30px;bottom:10px;margin:4px;',
27 - 'MV_Tools'=>'position:absolute;width:322px;top:312px;left:10px;bottom:10px;margin:4px;',
28 - 'MV_StreamMeta'=>'position:absolute;width:322px;top:307px;left:10px;bottom:10px;margin:4px;',
29 -
30 - 'MV_SequencePlayer'=>'position:absolute;width:322px;top:25px;bottom:195px;left:10px;margin:4px;',
31 - 'MV_SequenceTools'=>'position:absolute;left:365px;right:10px;top:25px;bottom:195px;margin:4px;',
32 - 'MV_SequenceTimeline'=>'position:absolute;left:10px;right:10px;height:174px;bottom:0px;margin:4px;',
33 - );
 22+ var $page_header='';
3423 function __construct($contextType, & $contextArticle=null ){
3524 global $mv_default_view;
3625 $this->context = $contextType;
@@ -115,12 +104,7 @@
116105
117106
118107 $this->page_title = $this->article->mvTitle->getStreamNameText().' '.$this->article->mvTitle->getTimeDesc();
119 - }
120 - /*renders style position based on default layout */
121 - function getStylePos($cp_name){
122 - if(isset($this->cpLayout[$cp_name]))return $this->cpLayout[$cp_name];
123 - return '';
124 - }
 108+ }
125109 /*
126110 * renders the full page to the wgOut object
127111 */
@@ -130,22 +114,38 @@
131115
132116 //output title and header:
133117 $wgOut->setHTMLTitle($this->page_title);
 118+
134119 if($this->page_header=='')$this->page_header = '<span style="position:relative;top:-12px;font-weight:bold">' .
135120 $this->page_title . '</span>';
136 - $wgOut->addHTML($this->page_header);
137 -
138 -
 121+ $wgOut->addHTML($this->page_header);
139122 //output the time range
140123 //output basic steam info in the
141124 //$out.='<div id="mv_base_container" style="position:absolute;border:solid;border-color:red;width:100%;height:100%">';
 125+
 126+ //start swiching interfaces over to table layout
 127+ //seems easier to get IE & firefox to layout stuff the same way
 128+ //if someone wants to prove me wrong and write cross-browser div/css layout ... by all means :)
 129+ /*if($this->context=='stream'){
 130+ $wgOut->addHTML('<table width="100%" height="600">');
 131+ $wgOut->addHTML('<tr>' .
 132+ '<td width="330" >'
 133+ '</tr>' .
 134+ '<tr>' .
 135+ '</tr>');
 136+ $wgOut->addHTML('</table>');
 137+ }else{*/
 138+ //@@todo dynamic resize page_spacer:
 139+ $wgOut->addHTML('<div id="mv_page_spacer" style="width:100%;height:550px">');
142140 foreach($this->components as $cpKey => &$component){
143 - $component->render_full();
144 - }
 141+ $component->render_full();
 142+ }
 143+ $wgOut->addHTML('</div>');
145144 //for now output spacers
146145 //@@todo output a dynamic spacer javascript layout
147 - $out='';
148 - for($i=0;$i<28;$i++)$out.="<br>";
149 - $wgOut->addHTML($out);
 146+ //$out='';
 147+ //for($i=0;$i<28;$i++)$out.="<br>";
 148+ //$wgOut->addHTML($out);
 149+ //}
150150 }
151151 }
152152 ?>
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Tools.php
@@ -14,7 +14,7 @@
1515 function getHTML(){
1616 global $wgOut;
1717 //@@todo look at mv_interface context to get what to display in tool box:
18 - $wgOut->addHTML('<div style="overflow:auto;width:100%;height:90%" id="mv_tool_cont">');
 18+ $wgOut->addHTML('<div id="mv_tool_cont">');
1919 $this->get_tool_html('stream_page');
2020 $wgOut->addHTML('</div>');
2121 }
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php
@@ -33,10 +33,10 @@
3434 $this->load_transcripts();
3535 $out='';
3636 //set up left hand side timeline
37 - $wgOut->addHTML('<div id="mv_time_line" style="float:left;background:#DDDDDD;width:2em;height:95%;overflow:hidden;">' .
 37+ $wgOut->addHTML('<div id="mv_time_line">' .
3838 $this->get_video_timeline() .
3939 '</div>');
40 - $wgOut->addHTML("<div id=\"mv_fd_mvd_cont\" style=\"position:relative;height:95%;width:98%;margin:4px;overflow:auto;\">");
 40+ $wgOut->addHTML("<div id=\"mv_fd_mvd_cont\" >");
4141 $wgOut->addHTML("<div id=\"mv_add_new_mvd\" style=\"display:none;\"></div>");
4242 $this->get_transcript_pages();
4343 $wgOut->addHTML("</div>");
@@ -153,7 +153,7 @@
154154 'onmouseup="mv_do_play()" ' .
155155 */
156156 'style="position:absolute;background:#'.$this->getMvdBgColor($mvd_page).';'.
157 - 'width:2em;';
 157+ 'width:25px;';
158158 //check if duration is set (for php calculation of height position)
159159 if($this->duration){
160160 $page_duration = $mvd_page->end_time - $mvd_page->start_time;
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Component.php
@@ -44,7 +44,7 @@
4545 function render_full(){
4646 global $wgOut;
4747 //"<div >" .
48 - $wgOut->addHTML("<fieldset id=\"".get_class($this)."\" style=\"". $this->mv_interface->getStylePos(get_class($this))."\">\n" .
 48+ $wgOut->addHTML("<fieldset id=\"".get_class($this)."\" >\n" .
4949 "<legend id=\"mv_leg_".get_class($this)."\">".$this->render_menu()."</legend>\n");
5050 //do the implemented html
5151 $this->getHTML();
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_VideoPlayer.php
@@ -30,8 +30,7 @@
3131 //check if media is availible:
3232 $stream_web_url = $cur_stream->getWebStreamURL();
3333 if($stream_web_url){
34 - $out='<span class="mv_video_time_hr"
35 - id="mv_videoPlayerTime">'.$cur_stream->mvTitle->getStartTime().' to '.
 34+ $out='<span id="mv_videoPlayerTime">'.$cur_stream->mvTitle->getStartTime().' to '.
3635 $cur_stream->mvTitle->getEndTime() .
3736 '</span>';
3837 $out.="<video id=\"embed_vid\" thumbnail=\"".$cur_stream->getStreamImageURL() ."\"".
Index: trunk/extensions/MetavidWiki/skins/MV_customIE.css
@@ -0,0 +1,9 @@
 2+#mv_videoPlayerTime{
 3+ top:40px;
 4+}
 5+#mv_fd_mvd_cont{
 6+ top:30px;right:0px;bottom:0px;
 7+}
 8+#mv_tool_cont{
 9+ position:absolute;top:30px;left:5px;right:0px;bottom:0px;overflow:auto;
 10+}
Index: trunk/extensions/MetavidWiki/skins/MV_custom.css
@@ -166,4 +166,40 @@
167167 .set_ogg_player_pref{
168168 text-align:left;
169169 }
170 -
 170+
 171+/*stream interface*/
 172+#MV_VideoPlayer{
 173+ position:absolute;width:322px;top:30px;height:270px;left:10px;margin:4px;
 174+}
 175+#MV_Overlay{
 176+ position:absolute;left:365px;top:30px;right:15px;bottom:10px;margin:4px;
 177+}
 178+#mv_fd_mvd_cont{
 179+ position:absolute;top:0px;left:25px;bottom:30px;right:12px;overflow-x:hidden;overflow-y:auto;
 180+}
 181+#mv_time_line{
 182+ position:absolute;background:#DDDDDD;left:0px;width:25px;height:94%;overflow:hidden;
 183+}
 184+#MV_Tools{
 185+ position:absolute;width:322px;top:312px;left:10px;bottom:10px;margin:4px;
 186+}
 187+#mv_tool_cont{
 188+ position:absolute;top:0px;left:0px;right:13px;bottom:30px;overflow:auto;
 189+}
 190+
 191+
 192+#mv_videoPlayerTime{
 193+ position:absolute;top:10px;right:30px;z-index:5;font-weight: 100;background:black;color:white;
 194+}
 195+/*sequence interface*/
 196+#MV_SequencePlayer{
 197+ position:absolute;width:322px;top:25px;bottom:195px;left:10px;margin:4px;
 198+}
 199+#MV_SequenceTools{
 200+ position:absolute;left:365px;right:10px;top:25px;bottom:195px;margin:4px;
 201+}
 202+#MV_SequenceTimeline{
 203+ position:absolute;left:10px;right:10px;height:174px;bottom:0px;margin:4px;
 204+}
 205+
 206+
Index: trunk/extensions/MetavidWiki/skins/mv_stream.js
@@ -914,7 +914,7 @@
915915 case 'search':
916916 //load search.js ... @@todo cleanup path
917917 mvJsLoader.doLoad({
918 - 'mv_setup_search':'../mv_search.js',
 918+ 'mv_setup_search':'../mv_search.js'
919919 },function(){
920920 $j('#mv_tool_cont').html( mv_result['innerHTML']);
921921 mv_setup_search();
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -780,7 +780,8 @@
781781 });
782782 }
783783 }
784 - },selectPlaybackMethod:function(){
 784+ },
 785+ selectPlaybackMethod:function(){
785786 //put select list on-top
786787 //make sure the parent is relatively positioned:
787788 $j('#'+this.id).css('position', 'relative');
@@ -1327,7 +1328,6 @@
13281329 }
13291330 }
13301331
1331 -
13321332 /*
13331333 * utility functions:
13341334 */
@@ -1339,9 +1339,9 @@
13401340 /*
13411341 * IE and non-firebug debug:
13421342 */
1343 - /* var log_elm = document.getElementById('mv_js_log');
 1343+ /*var log_elm = document.getElementById('mv_js_log');
13441344 if(!log_elm){
1345 - document.write('<textarea id="mv_js_log" cols="80" rows="6"></textarea>');
 1345+ document.write('<div style="position:absolute;z-index:50;top:0px;left:0px;right:0px;height:150px;"><textarea id="mv_js_log" cols="80" rows="6"></textarea></div>');
13461346 var log_elm = document.getElementById('mv_js_log');
13471347 }
13481348 if(log_elm){

Status & tagging log