r51731 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51730‎ | r51731 | r51732 >
Date:05:37, 11 June 2009
Author:dale
Status:deferred
Tags:
Comment:
* updated server side sequence parsing.
** Output now includes timestamp and wikiText description
* updated scripts to work better with new-upload branch (with mwEmbed as part of the core)
** (still some work left to be done on that front)
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php (modified) (history)
  • /trunk/extensions/MetavidWiki/maintenance/mv_update.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_allpages.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_search.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_stream.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php
@@ -84,7 +84,8 @@
8585 'interface_url' => str_replace('index.php', 'api.php', $wgServer . $wgScript), //api link (might be a better way to grab that)
8686 'linkback' => $this->mTitle->getFullURL(),
8787 'mTitle' => $this->mTitle->getPrefixedDBKey(),
88 - 'mTalk' => $talkTitle->getPrefixedDBKey()
 88+ 'mTalk' => $talkTitle->getPrefixedDBKey(),
 89+ 'mTouchedTime' => wfTimestamp(TS_ISO_8601, $this->mTitle->getTouched())
8990 );
9091 foreach($metaData as $name=>$val){
9192 $titleNode = $this->smilDoc->createElement('meta');
@@ -92,11 +93,22 @@
9394 $titleNode->setAttribute("content", htmlentities($val) );
9495 $headNode->appendChild($titleNode);
9596 }
 97+ //add special meta wikiDesc:
 98+ $titleNode = $this->smilDoc->createElement('meta');
 99+ $titleNode->setAttribute("name", htmlentities('wikiDesc') );
 100+ $f = $titleNode->ownerDocument->createDocumentFragment();
 101+ $f->appendXML( "<![CDATA[\n".
 102+ trim( $this->getPageContent() ).
 103+ "\n]]>");
 104+ $titleNode->appendChild($f);
 105+ $headNode->appendChild( $titleNode );
96106
 107+
97108 //add resolved transitions to the head:
98109 $tranNodeList = $this->hlrdDoc->getElementsByTagName('transition');
99110 foreach ($tranNodeList as $tranNode){
100 - //for now do a direct copy (future we should do additional validation even though it should be validated on the way in)
 111+ //for now do a direct copy
 112+ //(future we should do additional validation even though it should be validated on the way in)
101113 $node = $this->smilDoc->importNode($tranNode, true);
102114 $headNode->appendChild($node);
103115 }
@@ -251,9 +263,11 @@
252264 foreach($paramVars as $name=>$val){
253265 $phtml.='<param name="' . htmlentities($name) . '">' . htmlentities($val) . '</param>';
254266 }
255 - $f = $node->ownerDocument->createDocumentFragment();
256 - $f->appendXML( $phtml );
257 - $node->appendChild($f);
 267+ if($phtml!=''){
 268+ $f = $node->ownerDocument->createDocumentFragment();
 269+ $f->appendXML( $phtml );
 270+ $node->appendChild($f);
 271+ }
258272 break;
259273 case NS_IMAGE:
260274 case NS_FILE:
@@ -713,8 +727,7 @@
714728 $markerList[] = $vidtag;
715729 return $marker;
716730 }
717 - function getPageContent() {
718 - global $wgRequest;
 731+ function getPageContent() {
719732 $base_text = parent::getContent();
720733 // strip the sequence
721734 $seqClose = strpos( $base_text, '</' . SEQUENCE_TAG . '>' );
Index: trunk/extensions/MetavidWiki/skins/mv_search.js
@@ -81,12 +81,8 @@
8282 break;
8383 case 'date_range':
8484 $j('#mvs_'+inx+'_tc').html( gM('loading_txt') );
85 - var load_js_set = { 'Date.fromString':'jquery/plugins/date.js',
86 - '$j.fn.datePicker':'jquery/plugins/jquery.datePicker.js'};
87 - if(embedTypes.msie6){
88 - js_log('using IE v6 need iframe as well');
89 - load_js_set['$j.fn.bgIframe'] = 'jquery/plugins/jquery.bgiframe.js';
90 - }
 85+ //@@todo refactor to new date range method
 86+ var load_js_set = ['$j.fn.datePicker'];
9187 uri = wgServer +
9288 ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript);
9389 mvJsLoader.doLoad(load_js_set,function(){
Index: trunk/extensions/MetavidWiki/skins/mv_allpages.js
@@ -12,18 +12,17 @@
1313 var wgScript = "/w/index.php";
1414
1515 if(typeof wgScriptPath=='undefined')
16 - var wgScriptPath = '/w';
17 -
 16+ var wgScriptPath = '/w';
 17+
1818 var gMvd={};
1919 function mv_setup_allpage(){
2020 js_log("mv embed done loading now setup 'all page'");
2121 //make sure we have jQuery and any base required libs:
2222 mvJsLoader.jQueryCheck(function(){
2323 js_log('allpage_ did jquery check');
24 - mvJsLoader.doLoad( {
25 - '$j.fn.autocomplete':'jquery/plugins/jquery.autocomplete.js',
26 - '$j.fn.hoverIntent':'jquery/plugins/jquery.hoverIntent.js'
27 - }, function(){
 24+ mvJsLoader.doLoad( [
 25+ '$j.fn.autocomplete'
 26+ ], function(){
2827 //js_log('allpage_ auto and hover check'+mv_setup_allpage_flag);
2928 if( ! mv_setup_allpage_flag ){
3029 mv_setup_search_ac();
Index: trunk/extensions/MetavidWiki/skins/mv_stream.js
@@ -59,14 +59,13 @@
6060 //load some additional plugins/components:
6161 //:hoverIntent
6262 //http://cherne.net/brian/resources/jquery.hoverIntent.html
63 - mvJsLoader.doLoad({
64 - '$j.fn.autocomplete': 'jquery/plugins/jquery.autocomplete.js',
65 - '$j.fn.hoverIntent' : 'jquery/plugins/jquery.hoverIntent.js',
66 - '$j.ui' : 'jquery/jquery.ui-1.7.1/ui/ui.core.js',
67 - '$j.ui.resizable' : 'jquery/jquery.ui-1.7.1/ui/ui.resizable.js',
68 - 'mvClipEdit' : 'libClipEdit/mvClipEdit.js',
69 - '$j.ui.draggable' : 'jquery/jquery.ui-1.7.1/ui/ui.draggable.js'
70 - },function(){
 63+ mvJsLoader.doLoad([
 64+ '$j.fn.autocomplete',
 65+ '$j.ui',
 66+ '$j.ui.resizable',
 67+ 'mvClipEdit',
 68+ '$j.ui.draggable'
 69+ ],function(){
7170 //make sure mv_embed has done video re-write:
7271 mv_stream_interface.init();
7372 });
@@ -188,10 +187,8 @@
189188 selector='.mv_timeline_mvd_jumper,.mv_fd_mvd';
190189 }
191190 js_log('selector: '+selector);
192 - $j(selector).hoverIntent({
193 - interval:200, //polling interval
194 - timeout:200, //delay before onMouseOut
195 - over:function(){
 191+ $j(selector).hover(
 192+ function(){
196193 //get the mvd_id (the last part of the this.id)
197194 mvd_id = this.id.split('_').pop();
198195 //if timeline scroll to position:
@@ -204,7 +201,7 @@
205202 }
206203 this_stream.mvdOver( mvd_id );
207204 },
208 - out:function(){
 205+ function(){
209206 //get the mvd_id (the last part of the this.id)
210207 mvd_id = this.id.split('_').pop();
211208 this_stream.mvdOut(mvd_id);
@@ -214,7 +211,7 @@
215212 return ;
216213 });
217214 }
218 - });
 215+ );
219216 },
220217 mvdOver:function(mvd_id){
221218 js_log('f:mvdOver' + mvd_id );
Index: trunk/extensions/MetavidWiki/maintenance/mv_update.php
@@ -137,5 +137,4 @@
138138 $wgDatabase->query( "ALTER TABLE `mv_mvd_index` ADD PRIMARY KEY(`mv_page_id`)" );
139139 print "done\n";
140140 }
141 -
142141 print "done with db tables update check\n";

Status & tagging log