r60312 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60311‎ | r60312 | r60313 >
Date:12:18, 23 December 2009
Author:dale
Status:deferred
Tags:
Comment:
* some sequencer fixes
* some text edit enhancements
* language file updates
* fixed some loading issues
* started stubs for "remote sequencer" support
Modified paths:
  • /branches/js2-work/phase3/js/editPage.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/includes/languages/mwEmbed.i18n.php (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/includes/maintenance/mergeJavascriptMsg.php (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/jquery.dragDropFile.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/loader.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.Firefogg.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.proxy.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/ClipEdit/mw.ClipEdit.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/loader.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.RemoteSequencer.js (added) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/jquery.menu.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mvTextInterface.js (deleted) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.css (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/old_mvTimeTextEdit.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/mwEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/styles.css (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Add_Media_Wizard.html (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js
@@ -6,7 +6,7 @@
77 var urlparts = getRemoteEmbedPath();
88 var mwEmbedHostPath = urlparts[0];
99 var mwRemoteVersion = '1.1d';
10 -var mwUseScriptLoader = false;
 10+var mwUseScriptLoader = true;
1111
1212 // Setup up request Params:
1313 var reqParts = urlparts[1].substring( 1 ).split( '&' );
@@ -40,7 +40,7 @@
4141 // Add media wizard
4242 if ( wgAction == 'edit' || wgAction == 'submit' ) {
4343 loadMwEmbed( [
44 - 'remoteSearchDriver',
 44+ 'mw.RemoteSearchDriver',
4545 '$j.fn.textSelection',
4646 '$j.ui',
4747 '$j.ui.sortable'
@@ -59,11 +59,24 @@
6060 } );
6161 }
6262
 63+ // Remote Sequencer
 64+ if( wgPageName.indexOf( "Sequence" ) === 0 ){
 65+ // If on a view page set content to "loading"
 66+ var body = document.getElementById('bodyContent');
 67+ body.innerHTML = 'loading sequence <blink>...</blink>';
 68+ loadMwEmbed( function(){
 69+ mw.load( 'Sequencer', function(){
 70+ mw.load( mwEmbedHostPath + '/mwEmbed/Sequencer/mw.Sequencer.js?' + mwGetReqArgs() );
 71+ } );
 72+ } );
 73+ }
 74+
 75+
6376 // Firefogg integration
6477 if ( wgPageName == "Special:Upload" ) {
6578 loadMwEmbed([
66 - 'mvBaseUploadInterface',
67 - 'mvFirefogg',
 79+ 'mw.BaseUploadInterface',
 80+ 'mw.Firefogg',
6881 '$j.ui',
6982 '$j.ui.progressbar',
7083 '$j.ui.dialog',
@@ -90,8 +103,21 @@
91104 vidIdList.push( divs[i].getAttribute( "id" ) );
92105 }
93106 }
94 - if ( vidIdList.length > 0 ) {
95 - var jsSetVideo = [ 'embedPlayer', '$j.ui', 'ctrlBuilder', '$j.cookie', '$j.ui.slider', 'kskinConfig' ];
 107+ if ( vidIdList.length > 0 ) {
 108+ //Load the video style sheets:
 109+ importStylesheetURI( mwEmbedHostPath + '/mwEmbed/skins/mvpcf/styles.css?' + mwGetReqArgs() );
 110+ importStylesheetURI( mwEmbedHostPath + '/mwEmbed/skins/kskin/playerSkin.css?' + mwGetReqArgs() );
 111+
 112+ var jsSetVideo = [
 113+ 'mw.EmbedPlayer',
 114+ '$j.ui',
 115+ 'ctrlBuilder',
 116+ '$j.cookie',
 117+ '$j.ui.slider',
 118+ 'kskinConfig',
 119+ '$j.fn.menu',
 120+ 'mw.TimedText'
 121+ ];
96122 // Quick sniff use java if IE and native if firefox
97123 // ( other browsers will run detect and get on-demand )
98124 if (navigator.userAgent.indexOf("MSIE") != -1)
@@ -197,7 +223,7 @@
198224 if ( vidIdList.length != 0 ) {
199225 setTimeout( function() {
200226 procVidId( vidIdList.pop() )
201 - }, 1 );
 227+ }, 1 );
202228 }
203229
204230 }
@@ -223,7 +249,7 @@
224250 scriptPath = s.src.replace( '/mediaWiki.js', '' )
225251 }
226252 // Use the external_media_wizard path:
227 - return [scriptPath + '/../../', reqStr];
 253+ return [scriptPath + '/../..', reqStr];
228254 }
229255 }
230256 }
Index: branches/js2-work/phase3/js/mwEmbed/tests/Add_Media_Wizard.html
@@ -28,7 +28,7 @@
2929 //we only enabled commons
3030 //(since javascript includes from other servers would be problamatic ) in a default install
3131 //** but you can set this to 'all' to pull from multiple repositories
32 - 'enabled_providers' : ['all'],
 32+ 'enabled_providers' : ['wiki_commons'],
3333
3434 //the local wiki api url:
3535 'local_wiki_api_url': 'none'
Index: branches/js2-work/phase3/js/mwEmbed/includes/maintenance/mergeJavascriptMsg.php
@@ -131,7 +131,7 @@
132132 if ( $messages['en'][$k] != $v ) {
133133 $doReplaceFlag = true;
134134 if( $showInfo )
135 - print "'$k'does not match:\n" . $messages['en'][$k] . "\n!=\n" . $v . "\n";
 135+ print "'$k' does not match:\n" . $messages['en'][$k] . "\n!=\n" . $v . "\n In: {$curFileName} \n";
136136 }
137137 // add the actual value: (replace new lines (not compatible json)
138138 // $jsMsgAry[$k] = str_replace("\n", '\\n', $messages['en'][$k]);
Index: branches/js2-work/phase3/js/mwEmbed/includes/languages/mwEmbed.i18n.php
@@ -12,69 +12,66 @@
1313
1414 $messages['en'] = array(
1515 /*
16 - * js file: /libClipEdit/mvClipEdit.js
 16+ * js file: /modules/EmbedPlayer/mw.EmbedPlayer.js
1717 */
18 - 'mwe-crop' => 'Crop image',
19 - 'mwe-apply_crop' => 'Apply crop to image',
20 - 'mwe-reset_crop' => 'Reset crop',
21 - 'mwe-insert_image_page' => 'Insert into page',
22 - 'mwe-insert_into_sequence' => 'Insert into sequence',
23 - 'mwe-preview_insert' => 'Preview insert',
24 - 'mwe-cancel_image_insert' => 'Cancel insert',
25 - 'mwe-sc_attributes' => 'Clip detail edit',
26 - 'mwe-sc_inoutpoints' => 'Set in-out points',
27 - 'mwe-sc_overlays' => 'Overlays',
28 - 'mwe-sc_audio' => 'Audio control',
29 - 'mwe-sc_duration' => 'Duration',
30 - 'mwe-template_properties' => 'Template properties',
31 - 'mwe-custom_title' => 'Custom title',
32 - 'mwe-edit_properties' => 'Edit properties',
33 - 'mwe-other_properties' => 'Other properties',
34 - 'mwe-resource_page' => 'Resource page:',
35 - 'mwe-set_in_out_points' => 'Set in-out points',
36 - 'mwe-start_time' => 'Start time',
37 - 'mwe-end_time' => 'End time',
38 - 'mwe-preview_inout' => 'Preview in-out points',
39 - 'mwe-edit-tools' => 'Edit tools',
40 - 'mwe-inline-description' => 'Caption',
41 - 'mwe-edit-video-tools' => 'Edit video tools:',
42 - 'mwe-duration' => 'Duration:',
43 - 'mwe-layout' => 'Layout:',
 18+ 'mwe-loading_plugin' => 'loading plugin ...',
 19+ 'mwe-select_playback' => 'Set playback preference',
 20+ 'mwe-link_back' => 'Link back',
 21+ 'mwe-error_swap_vid' => 'Error: mwEmbed was unable to swap the video tag for the mwEmbed interface',
 22+ 'mwe-add_to_end_of_sequence' => 'Add to end of sequence',
 23+ 'mwe-missing_video_stream' => 'The video file for this stream is missing',
 24+ 'mwe-play_clip' => 'Play clip',
 25+ 'mwe-pause_clip' => 'Pause clip',
 26+ 'mwe-volume_control' => 'Volume control',
 27+ 'mwe-player_options' => 'Player options',
 28+ 'mwe-timed_text' => 'Timed text',
 29+ 'mwe-player_fullscreen' => 'Fullscreen',
 30+ 'mwe-next_clip_msg' => 'Play next clip',
 31+ 'mwe-prev_clip_msg' => 'Play previous clip',
 32+ 'mwe-current_clip_msg' => 'Continue playing this clip',
 33+ 'mwe-seek_to' => 'Seek $1',
 34+ 'mwe-paused' => 'paused',
 35+ 'mwe-download_segment' => 'Download selection:',
 36+ 'mwe-download_full' => 'Download full video file:',
 37+ 'mwe-download_right_click' => 'To download, right click and select <i>Save link as...</i>',
 38+ 'mwe-download_clip' => 'Download video',
 39+ 'mwe-download_text' => 'Download text (<a style="color:white" title="cmml" href="http://wiki.xiph.org/index.php/CMML">CMML</a> xml):',
 40+ 'mwe-download' => 'Download',
 41+ 'mwe-share' => 'Share',
 42+ 'mwe-credits' => 'Credits',
 43+ 'mwe-clip_linkback' => 'Clip source page',
 44+ 'mwe-chose_player' => 'Choose video player',
 45+ 'mwe-share_this_video' => 'Share this video',
 46+ 'mwe-video_credits' => 'Video credits',
 47+ 'mwe-menu_btn' => 'Menu',
 48+ 'mwe-close_btn' => 'Close',
 49+ 'mwe-ogg-player-vlc-player' => 'VLC player',
 50+ 'mwe-ogg-player-videoElement' => 'Native Ogg video',
 51+ 'mwe-ogg-player-oggPlugin' => 'Generic Ogg plugin',
 52+ 'mwe-ogg-player-quicktime-mozilla' => 'QuickTime plugin',
 53+ 'mwe-ogg-player-quicktime-activex' => 'QuickTime ActiveX',
 54+ 'mwe-ogg-player-cortado' => 'Java Cortado',
 55+ 'mwe-ogg-player-flowplayer' => 'Flowplayer',
 56+ 'mwe-ogg-player-kplayer' => 'Kaltura player',
 57+ 'mwe-ogg-player-selected' => '(selected)',
 58+ 'mwe-ogg-player-omtkplayer' => 'OMTK Flash Vorbis',
 59+ 'mwe-generic_missing_plugin' => 'You browser does not appear to support the following playback type: <b>$1</b><br />Visit the <a href="http://commons.wikimedia.org/wiki/Commons:Media_help">Playback Methods</a> page to download a player.<br />',
 60+ 'mwe-for_best_experience' => 'For a better video playback experience we recommend:<br /><b><a href="http://www.mozilla.com/en-US/firefox/upgrade.html?from=mwEmbed">Firefox 3.5</a>.</b>',
 61+ 'mwe-do_not_warn_again' => 'Dismiss for now.',
 62+ 'mwe-playerSelect' => 'Players',
 63+ 'mwe-read_before_embed' => '<a href="http://mediawiki.org/wiki/Security_Notes_on_Remote_Embedding" target="_new">Read this</a> before embedding.',
 64+ 'mwe-embed_site_or_blog' => 'Embed on a page',
 65+ 'mwe-related_videos' => 'Related videos',
 66+ 'mwe-seeking' => 'seeking',
 67+ 'mwe-copy-code' => 'Copy code',
 68+ 'mwe-video-h264' => 'H.264 video',
 69+ 'mwe-video-flv' => 'Flash video',
 70+ 'mwe-video-ogg' => 'Ogg video',
 71+ 'mwe-video-audio' => 'Ogg audio',
4472
4573 /*
46 - * js file: /libTimedText/mvTimeTextEdit.js
 74+ * js file: /modules/Sequencer/mw.Sequencer.js
4775 */
48 - 'mwe-upload-subs-file' => 'Upload subtitle',
49 - 'mwe-add-subs-file-title' => 'Select subtitle to upload',
50 - 'mwe-error-only-srt' => 'You can only upload srt files.',
51 - 'mwe-watch-video' => 'Watch video',
52 - 'mwe-select-other-language' => 'Select another language',
53 - 'mwe-saving' => 'saving...',
54 -
55 - /*
56 - * js file: /libTimedText/mvTextInterface.js
57 - */
58 - 'mwe-select_transcript_set' => 'Select subtitles',
59 - 'mwe-auto_scroll' => 'auto scroll',
60 - 'mwe-close' => 'close',
61 - 'mwe-improve_transcript' => 'Improve',
62 - 'mwe-no_text_tracks_found' => 'No text subtitles found',
63 - 'mwe-add-edit-subs' => 'Add/edit subtitles',
64 -
65 - /*
66 - * js file: /libSequencer/mvTimedEffectsEdit.js
67 - */
68 - 'mwe-transition_in' => 'Transition in',
69 - 'mwe-transition_out' => 'Transition out',
70 - 'mwe-effects' => 'Effects stack',
71 - 'mwe-remove_transition' => 'Remove transition',
72 - 'mwe-edit_transin' => 'Edit transition into clip',
73 - 'mwe-edit_transout' => 'Edit transition out of clip',
74 - 'mwe-add-transition' => 'Add a transition',
75 -
76 - /*
77 - * js file: /libSequencer/mvSequencer.js
78 - */
7976 'mwe-menu_clipedit' => 'Edit media',
8077 'mwe-menu_transition' => 'Transitions and effects',
8178 'mwe-menu_cliplib' => 'Add media',
@@ -111,23 +108,49 @@
112109 'mwe-sequencer_credit_line' => 'Developed by <a href="http://kaltura.com">Kaltura, Inc.</a> in partnership with the <a href="http://wikimediafoundation.org/wiki/Home">Wikimedia Foundation</a> (<a href="#">more information</a>).',
113110
114111 /*
115 - * js file: /mwEmbed.js
 112+ * js file: /modules/Sequencer/mw.TimedEffectsEdit.js
116113 */
117 - 'mwe-loading_txt' => 'Loading ...',
118 - 'mwe-size-gigabytes' => '$1 GB',
119 - 'mwe-size-megabytes' => '$1 MB',
120 - 'mwe-size-kilobytes' => '$1 K',
121 - 'mwe-size-bytes' => '$1 B',
122 - 'mwe-error_load_lib' => 'Error: JavaScript $1 was not retrievable or does not define $2',
123 - 'mwe-loading-add-media-wiz' => 'Loading add media wizard',
124 - 'mwe-apiproxy-setup' => 'Setting up API proxy',
125 - 'mwe-load-drag-item' => 'Loading dragged item',
126 - 'mwe-ok' => 'OK',
127 - 'mwe-cancel' => 'Cancel',
 114+ 'mwe-transition_in' => 'Transition in',
 115+ 'mwe-transition_out' => 'Transition out',
 116+ 'mwe-effects' => 'Effects stack',
 117+ 'mwe-remove_transition' => 'Remove transition',
 118+ 'mwe-edit_transin' => 'Edit transition into clip',
 119+ 'mwe-edit_transout' => 'Edit transition out of clip',
 120+ 'mwe-add-transition' => 'Add a transition',
128121
129122 /*
130 - * js file: /libMwApi/mw.proxy.js
 123+ * js file: /modules/ClipEdit/mw.ClipEdit.js
131124 */
 125+ 'mwe-crop' => 'Crop image',
 126+ 'mwe-apply_crop' => 'Apply crop to image',
 127+ 'mwe-reset_crop' => 'Reset crop',
 128+ 'mwe-insert_image_page' => 'Insert into page',
 129+ 'mwe-insert_into_sequence' => 'Insert into sequence',
 130+ 'mwe-preview_insert' => 'Preview insert',
 131+ 'mwe-cancel_image_insert' => 'Cancel insert',
 132+ 'mwe-sc_attributes' => 'Clip detail edit',
 133+ 'mwe-sc_inoutpoints' => 'Set in-out points',
 134+ 'mwe-sc_overlays' => 'Overlays',
 135+ 'mwe-sc_audio' => 'Audio control',
 136+ 'mwe-sc_duration' => 'Duration',
 137+ 'mwe-template_properties' => 'Template properties',
 138+ 'mwe-custom_title' => 'Custom title',
 139+ 'mwe-edit_properties' => 'Edit properties',
 140+ 'mwe-other_properties' => 'Other properties',
 141+ 'mwe-resource_page' => 'Resource page:',
 142+ 'mwe-set_in_out_points' => 'Set in-out points',
 143+ 'mwe-start_time' => 'Start time',
 144+ 'mwe-end_time' => 'End time',
 145+ 'mwe-preview_inout' => 'Preview in-out points',
 146+ 'mwe-edit-tools' => 'Edit tools',
 147+ 'mwe-inline-description' => 'Caption',
 148+ 'mwe-edit-video-tools' => 'Edit video tools:',
 149+ 'mwe-duration' => 'Duration:',
 150+ 'mwe-layout' => 'Layout',
 151+
 152+ /*
 153+ * js file: /modules/ApiProxy/mw.proxy.js
 154+ */
132155 'mwe-setting-up-proxy' => 'Setting up proxy...',
133156 'mwe-re-try' => 'Retry API request',
134157 'mwe-re-trying' => 'Retrying API request...',
@@ -136,103 +159,58 @@
137160 'mwe-remember-loging' => 'General security reminder: Only login to web sites when your address bar displays that site\'s address.',
138161
139162 /*
140 - * js file: /libAddMedia/mvFirefogg.js
 163+ * js file: /modules/TimedText/mw.TimedTextEdit.js
141164 */
142 - 'fogg-select_file' => 'Select file',
143 - 'fogg-select_new_file' => 'Select new file',
144 - 'fogg-select_url' => 'Select URL',
145 - 'fogg-save_local_file' => 'Save Ogg',
146 - 'fogg-check_for_firefogg' => 'Checking for Firefogg...',
147 - 'fogg-installed' => 'Firefogg is installed',
148 - 'fogg-for_improved_uploads' => 'For improved uploads:',
149 - 'fogg-please_install' => '<a href="$1">Install Firefogg</a>. More <a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">about Firefogg</a>.',
150 - 'fogg-use_latest_firefox' => 'Please first install <a href="http://www.mozilla.com/en-US/firefox/upgrade.html?from=firefogg">Firefox 3.5</a> (or later). <i>Then revisit this page to install the <b>Firefogg</b> extension.</i>',
151 - 'fogg-passthrough_mode' => 'Your selected file is already Ogg or not a video file',
152 - 'fogg-transcoding' => 'Encoding video to Ogg...',
153 - 'fogg-encoding-done' => 'Encoding complete',
154 - 'fogg-badtoken' => 'Token is not valid',
155 - 'fogg-preview' => 'Preview video',
156 - 'fogg-hidepreview' => 'Hide preview',
 165+ 'mew-timedtext-editor' => 'Timed text editor',
 166+ 'mwe-stage-transcribe' => 'Transcribe',
 167+ 'mwe-stage-sync' => 'Sync',
 168+ 'mwe-stage-translate' => 'Translate',
 169+ 'mwe-stage-upload' => 'Upload from local file',
 170+ 'mwe-select-language' => 'Select language',
 171+ 'mwe-file-language' => 'Subtitle file language',
 172+ 'mwe-upload-file' => 'Upload text file',
 173+ 'mwe-uploading-text' => 'Uploading text file',
157174
158175 /*
159 - * js file: /libAddMedia/searchLibs/baseRemoteSearch.js
 176+ * js file: /modules/TimedText/mw.TimedText.js
160177 */
161 - 'mwe-imported_from' => '$1 imported from [$2 $3]. See the original [$4 resource page] for more information.',
 178+ 'mwe-back-btn' => 'Back',
 179+ 'mwe-chose-text' => 'Chose text',
 180+ 'mwe-add-timed-text' => 'Add timed text',
 181+ 'mwe-loading-text-edit' => 'Loading timed text editor',
 182+ 'mwe-search' => 'Search clip',
 183+ 'mwe-layout' => 'Layout',
 184+ 'mwe-layout-ontop' => 'Ontop of video',
 185+ 'mwe-layout-below' => 'Below video',
 186+ 'mwe-layout-off' => 'Hide subtitles',
 187+ 'mwe-loading-text' => 'Loading text ...',
 188+ 'mwe-key-language' => '$1, $2',
 189+ 'mwe-textcat-cc' => 'Captions',
 190+ 'mwe-textcat-sub' => 'Subtitles',
 191+ 'mwe-textcat-tad' => 'Audio description',
 192+ 'mwe-textcat-ktv' => 'Karaoke',
 193+ 'mwe-textcat-tik' => 'Ticker text',
 194+ 'mwe-textcat-ar' => 'Active regions',
 195+ 'mwe-textcat-nb' => 'Annotation',
 196+ 'mwe-textcat-meta' => 'Timed metadata',
 197+ 'mwe-textcat-trx' => 'Transcript',
 198+ 'mwe-textcat-lrc' => 'Lyrics',
 199+ 'mwe-textcat-lin' => 'Linguistic markup',
 200+ 'mwe-textcat-cue' => 'Cue points',
162201
163202 /*
164 - * js file: /libAddMedia/searchLibs/metavidSearch.js
 203+ * js file: /modules/TimedText/old_mvTimeTextEdit.js
165204 */
166 - 'mwe-stream_title' => '$1 $2 to $3',
 205+ 'mwe-upload-subs-file' => 'Upload subtitle',
 206+ 'mwe-add-subs-file-title' => 'Select subtitle to upload',
 207+ 'mwe-error-only-srt' => 'You can only upload srt files.',
 208+ 'mwe-watch-video' => 'Watch video',
 209+ 'mwe-select-other-language' => 'Select another language',
 210+ 'mwe-saving' => 'saving...',
167211
168212 /*
169 - * js file: /libAddMedia/mvAdvFirefogg.js
 213+ * js file: /modules/AddMedia/mw.RemoteSearchDriver.js
170214 */
171 - 'fogg-help-sticky' => 'Help (click to stick)',
172 - 'fogg-cg-preset' => 'Preset: <strong>$1</strong>',
173 - 'fogg-cg-quality' => 'Basic quality and resolution control',
174 - 'fogg-cg-meta' => 'Metadata for the clip',
175 - 'fogg-cg-range' => 'Encoding range',
176 - 'fogg-cg-advVideo' => 'Advanced video encoding controls',
177 - 'fogg-cg-advAudio' => 'Advanced audio encoding controls',
178 - 'fogg-preset-custom' => 'Custom settings',
179 - 'fogg-webvideo-desc' => 'Web video Theora, Vorbis 400 kbit/s and 400px maximum width',
180 - 'fogg-savebandwidth-desc' => 'Low bandwidth Theora, Vorbis 164 kbit/s and 200px maximum width',
181 - 'fogg-highquality-desc' => 'High quality Theora, Vorbis 1080px maximum width',
182 - 'fogg-videoQuality-title' => 'Video quality',
183 - 'fogg-videoQuality-help' => 'Used to set the <i>visual quality</i> of the encoded video (not used if you set bitrate in advanced controls below).',
184 - 'fogg-starttime-title' => 'Start second',
185 - 'fogg-starttime-help' => 'Only encode from time in seconds',
186 - 'fogg-endtime-title' => 'End second',
187 - 'fogg-endtime-help' => 'Only encode to time in seconds',
188 - 'fogg-audioQuality-title' => 'Audio quality',
189 - 'fogg-audioQuality-help' => 'Used to set the <i>acoustic quality</i> of the encoded audio (not used if you set bitrate in advanced controls below).',
190 - 'fogg-videoCodec-title' => 'Video codec',
191 - 'fogg-videoCodec-help' => 'Used to select the clip video codec. Presently only Theora is supported. More about the <a target="_new" href="http://en.wikipedia.org/wiki/Theora">Theora codec</a>.',
192 - 'fogg-audioCodec-title' => 'Audio codec',
193 - 'fogg-audioCodec-help' => 'Used to set the clip audio codec. Presently only Vorbis is supported. More about the <a target="_new" href="http://en.wikipedia.org/wiki/Vorbis">Vorbis codec</a>',
194 - 'fogg-width-title' => 'Video width',
195 - 'fogg-width-help' => 'Resize to given width.',
196 - 'fogg-height-title' => 'Video height',
197 - 'fogg-height-help' => 'Resize to given height.',
198 - 'fogg-videoBitrate-title' => 'Video bitrate',
199 - 'fogg-videoBitrate-help' => 'Video bitrate sets the encoding bitrate for video in (kb/s)',
200 - 'fogg-twopass-title' => 'Two pass encoding',
201 - 'fogg-twopass-help' => 'Two pass encoding enables more constant quality by making two passes over the video file',
202 - 'fogg-framerate-title' => 'Frame rate',
203 - 'fogg-framerate-help' => 'The video frame rate. More about <a target="_new" href="http://en.wikipedia.org/wiki/Frame_rate">frame rate</a>.',
204 - 'fogg-aspect-title' => 'Aspect ratio',
205 - 'fogg-aspect-help' => 'The video aspect ratio can be 4:3 or 16:9. More about <a target="_new" href="http://en.wikipedia.org/wiki/Aspect_ratio_%28image%29">aspect ratios</a>.',
206 - 'fogg-keyframeInterval-title' => 'Key frame interval',
207 - 'fogg-keyframeInterval-help' => 'The keyframe interval in frames. Note: Most codecs force keyframes if the difference between frames is greater than keyframe encode size. More about <a href="http://en.wikipedia.org/wiki/I-frame">keyframes</a>.',
208 - 'fogg-denoise-title' => 'Denoise filter',
209 - 'fogg-denoise-help' => 'Denoise input video. More about <a href="http://en.wikipedia.org/wiki/Video_denoising">denoise</a>.',
210 - 'fogg-novideo-title' => 'No video',
211 - 'fogg-novideo-help' => 'disable video in the output',
212 - 'fogg-audioBitrate-title' => 'Audio bitrate',
213 - 'fogg-samplerate-title' => 'Audio sampling rate',
214 - 'fogg-samplerate-help' => 'set output sample rate (in Hz).',
215 - 'fogg-noaudio-title' => 'No audio',
216 - 'fogg-noaudio-help' => 'disable audio in the output',
217 - 'fogg-title-title' => 'Title',
218 - 'fogg-title-help' => 'A title for your clip',
219 - 'fogg-artist-title' => 'Creator name',
220 - 'fogg-artist-help' => 'The creator of this clip',
221 - 'fogg-date-title' => 'Date',
222 - 'fogg-date-help' => 'The date the footage was created or released',
223 - 'fogg-location-title' => 'Location',
224 - 'fogg-location-help' => 'The location of the footage',
225 - 'fogg-organization-title' => 'Organization',
226 - 'fogg-organization-help' => 'Name of organization (studio)',
227 - 'fogg-copyright-title' => 'Copyright',
228 - 'fogg-copyright-help' => 'The copyright of the clip',
229 - 'fogg-license-title' => 'License',
230 - 'fogg-license-help' => 'The license of the clip (preferably a Creative Commons URL).',
231 - 'fogg-contact-title' => 'Contact',
232 - 'fogg-contact-help' => 'Contact link',
233 -
234 - /*
235 - * js file: /libAddMedia/remoteSearchDriver.js
236 - */
237215 'mwe-add_media_wizard' => 'Add media wizard',
238216 'mwe-media_search' => 'Media search',
239217 'rsd_box_layout' => 'Box layout',
@@ -281,6 +259,8 @@
282260 'mwe-ftype-unk' => 'Unknown file format',
283261 'rsd-wiki_commons-title' => 'Wikimedia Commons',
284262 'rsd-wiki_commons' => 'Wikimedia Commons, an archive of freely-licensed educational media content (images, sound and video clips)',
 263+ 'rsd-kaltura-title' => 'Kaltura search',
 264+ 'rsd-kaltura' => 'Kaltura agragated search for free-licenced media across multiple search providers',
285265 'rsd-this_wiki-title' => 'This wiki',
286266 'rsd-this_wiki-desc' => 'The local wiki install',
287267 'rsd-archive_org-title' => 'Archive.org',
@@ -289,24 +269,11 @@
290270 'rsd-flickr-desc' => 'Flickr.com, a online photo sharing site',
291271 'rsd-metavid-title' => 'Metavid.org',
292272 'rsd-metavid-desc' => 'Metavid.org, a community archive of US House and Senate floor proceedings',
 273+ 'rsd-search-timeout' => 'The search request did not complete. The server may be down experiencing heavy load. You can try again later',
293274
294275 /*
295 - * js file: /libAddMedia/simpleUploadForm.js
 276+ * js file: /modules/AddMedia/mw.BaseUploadInterface.js
296277 */
297 - 'mwe-select_file' => 'Select file',
298 - 'mwe-more_licence_options' => 'For more licence options, view the <a href="$1">normal upload page</a>',
299 - 'mwe-select_ownwork' => 'I am uploading entirely my own work, and licencing it under:',
300 - 'mwe-licence_cc-by-sa' => 'Creative Commons Share Alike (3.0)',
301 - 'mwe-upload' => 'Upload file',
302 - 'mwe-destfilename' => 'Destination filename:',
303 - 'mwe-summary' => 'Summary',
304 - 'mwe-error_not_loggedin' => 'You do not appear to be logged in or do not have upload privileges.',
305 - 'mwe-watch-this-file' => 'Watch this file',
306 - 'mwe-ignore-any-warnings' => 'Ignore any warnings',
307 -
308 - /*
309 - * js file: /libAddMedia/mvBaseUploadInterface.js
310 - */
311278 'mwe-upload-transcode-in-progress' => 'Transcode and upload in progress (do not close this window)',
312279 'mwe-upload-in-progress' => 'Upload in progress (do not close this window)',
313280 'mwe-upload-transcoded-status' => 'Transcoded',
@@ -331,74 +298,152 @@
332299 'mwe-wgfogg_warning_bad_extension' => 'You have selected a file with an unsuported extension (<a href="http://commons.wikimedia.org/wiki/Commons:Firefogg#Supported_File_Types">more information</a>).',
333300
334301 /*
335 - * js file: /libAddMedia/dragDropFile.js
 302+ * js file: /modules/AddMedia/jquery.simpleUploadForm.js
336303 */
 304+ 'mwe-select_file' => 'Select file',
 305+ 'mwe-more_license_options' => 'For more license options, view the <a href="$1">normal upload page</a>',
 306+ 'mwe-select_ownwork' => 'I am uploading entirely my own work, and licencing it under:',
 307+ 'mwe-license_cc-by-sa' => 'Creative Commons Share Alike (3.0)',
 308+ 'mwe-upload' => 'Upload file',
 309+ 'mwe-destfilename' => 'Destination filename:',
 310+ 'mwe-summary' => 'Summary',
 311+ 'mwe-error_not_loggedin' => 'You do not appear to be logged in or do not have upload privileges.',
 312+ 'mwe-watch-this-file' => 'Watch this file',
 313+ 'mwe-ignore-any-warnings' => 'Ignore any warnings',
 314+
 315+ /*
 316+ * js file: /modules/AddMedia/mw.Firefogg.js
 317+ */
 318+ 'fogg-select_file' => 'Select file',
 319+ 'fogg-select_new_file' => 'Select new file',
 320+ 'fogg-select_url' => 'Select URL',
 321+ 'fogg-save_local_file' => 'Save Ogg',
 322+ 'fogg-check_for_firefogg' => 'Checking for Firefogg...',
 323+ 'fogg-installed' => 'Firefogg is installed',
 324+ 'fogg-for_improved_uploads' => 'For improved uploads:',
 325+ 'fogg-please_install' => '<a href="$1">Install Firefogg</a>. More <a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">about Firefogg</a>.',
 326+ 'fogg-use_latest_firefox' => 'Please first install <a href="http://www.mozilla.com/en-US/firefox/upgrade.html?from=firefogg">Firefox 3.5</a> (or later). <i>Then revisit this page to install the <b>Firefogg</b> extension.</i>',
 327+ 'fogg-passthrough_mode' => 'Your selected file is already Ogg or not a video file',
 328+ 'fogg-transcoding' => 'Encoding video to Ogg...',
 329+ 'fogg-encoding-done' => 'Encoding complete',
 330+ 'fogg-badtoken' => 'Token is not valid',
 331+ 'fogg-preview' => 'Preview video',
 332+ 'fogg-hidepreview' => 'Hide preview',
 333+
 334+ /*
 335+ * js file: /modules/AddMedia/searchLibs/metavidSearch.js
 336+ */
 337+ 'mwe-stream_title' => '$1 $2 to $3',
 338+
 339+ /*
 340+ * js file: /modules/AddMedia/searchLibs/baseRemoteSearch.js
 341+ */
 342+ 'mwe-imported_from' => '$1 imported from [$2 $3]. See the original [$4 resource page] for more information.',
 343+ 'mwe-import-description' => '$1, imported from $2',
 344+
 345+ /*
 346+ * js file: /modules/AddMedia/jquery.dragDropFile.js
 347+ */
337348 'mwe-upload-multi' => 'Upload {{PLURAL:$1|file|files}}',
338349 'mwe-review-upload' => 'Review file {{PLURAL:$1|upload|uploads}}',
339350
340351 /*
341 - * js file: /skins/kskin/kskin.js
 352+ * js file: /modules/AddMedia/mw.FirefoggGUI.js
342353 */
 354+ 'fogg-help-sticky' => 'Help (click to stick)',
 355+ 'fogg-cg-preset' => 'Preset: <strong>$1</strong>',
 356+ 'fogg-cg-quality' => 'Basic quality and resolution control',
 357+ 'fogg-cg-meta' => 'Metadata for the clip',
 358+ 'fogg-cg-range' => 'Encoding range',
 359+ 'fogg-cg-advVideo' => 'Advanced video encoding controls',
 360+ 'fogg-cg-advAudio' => 'Advanced audio encoding controls',
 361+ 'fogg-preset-custom' => 'Custom settings',
 362+ 'fogg-webvideo-desc' => 'Web video Theora, Vorbis 400 kbit/s and 400px maximum width',
 363+ 'fogg-savebandwidth-desc' => 'Low bandwidth Theora, Vorbis 164 kbit/s and 200px maximum width',
 364+ 'fogg-highquality-desc' => 'High quality Theora, Vorbis 1080px maximum width',
 365+ 'fogg-videoQuality-title' => 'Video quality',
 366+ 'fogg-videoQuality-help' => 'Used to set the <i>visual quality</i> of the encoded video (not used if you set bitrate in advanced controls below).',
 367+ 'fogg-starttime-title' => 'Start second',
 368+ 'fogg-starttime-help' => 'Only encode from time in seconds',
 369+ 'fogg-endtime-title' => 'End second',
 370+ 'fogg-endtime-help' => 'Only encode to time in seconds',
 371+ 'fogg-audioQuality-title' => 'Audio quality',
 372+ 'fogg-audioQuality-help' => 'Used to set the <i>acoustic quality</i> of the encoded audio (not used if you set bitrate in advanced controls below).',
 373+ 'fogg-videoCodec-title' => 'Video codec',
 374+ 'fogg-videoCodec-help' => 'Used to select the clip video codec. Presently only Theora is supported. More about the <a target="_new" href="http://en.wikipedia.org/wiki/Theora">Theora codec</a>.',
 375+ 'fogg-audioCodec-title' => 'Audio codec',
 376+ 'fogg-audioCodec-help' => 'Used to set the clip audio codec. Presently only Vorbis is supported. More about the <a target="_new" href="http://en.wikipedia.org/wiki/Vorbis">Vorbis codec</a>',
 377+ 'fogg-width-title' => 'Video width',
 378+ 'fogg-width-help' => 'Resize to given width.',
 379+ 'fogg-height-title' => 'Video height',
 380+ 'fogg-height-help' => 'Resize to given height.',
 381+ 'fogg-videoBitrate-title' => 'Video bitrate',
 382+ 'fogg-videoBitrate-help' => 'Video bitrate sets the encoding bitrate for video in (kb/s)',
 383+ 'fogg-twopass-title' => 'Two pass encoding',
 384+ 'fogg-twopass-help' => 'Two pass encoding enables more constant quality by making two passes over the video file',
 385+ 'fogg-framerate-title' => 'Frame rate',
 386+ 'fogg-framerate-help' => 'The video frame rate. More about <a target="_new" href="http://en.wikipedia.org/wiki/Frame_rate">frame rate</a>.',
 387+ 'fogg-aspect-title' => 'Aspect ratio',
 388+ 'fogg-aspect-help' => 'The video aspect ratio can be 4:3 or 16:9. More about <a target="_new" href="http://en.wikipedia.org/wiki/Aspect_ratio_%28image%29">aspect ratios</a>.',
 389+ 'fogg-keyframeInterval-title' => 'Key frame interval',
 390+ 'fogg-keyframeInterval-help' => 'The keyframe interval in frames. Note: Most codecs force keyframes if the difference between frames is greater than keyframe encode size. More about <a href="http://en.wikipedia.org/wiki/I-frame">keyframes</a>.',
 391+ 'fogg-denoise-title' => 'Denoise filter',
 392+ 'fogg-denoise-help' => 'Denoise input video. More about <a href="http://en.wikipedia.org/wiki/Video_denoising">denoise</a>.',
 393+ 'fogg-novideo-title' => 'No video',
 394+ 'fogg-novideo-help' => 'disable video in the output',
 395+ 'fogg-audioBitrate-title' => 'Audio bitrate',
 396+ 'fogg-samplerate-title' => 'Audio sampling rate',
 397+ 'fogg-samplerate-help' => 'set output sample rate (in Hz).',
 398+ 'fogg-noaudio-title' => 'No audio',
 399+ 'fogg-noaudio-help' => 'disable audio in the output',
 400+ 'fogg-title-title' => 'Title',
 401+ 'fogg-title-help' => 'A title for your clip',
 402+ 'fogg-artist-title' => 'Creator name',
 403+ 'fogg-artist-help' => 'The creator of this clip',
 404+ 'fogg-date-title' => 'Date',
 405+ 'fogg-date-help' => 'The date the footage was created or released',
 406+ 'fogg-location-title' => 'Location',
 407+ 'fogg-location-help' => 'The location of the footage',
 408+ 'fogg-organization-title' => 'Organization',
 409+ 'fogg-organization-help' => 'Name of organization (studio)',
 410+ 'fogg-copyright-title' => 'Copyright',
 411+ 'fogg-copyright-help' => 'The copyright of the clip',
 412+ 'fogg-license-title' => 'License',
 413+ 'fogg-license-help' => 'The license of the clip (preferably a Creative Commons URL).',
 414+ 'fogg-contact-title' => 'Contact',
 415+ 'fogg-contact-help' => 'Contact link',
 416+
 417+ /*
 418+ * js file: /modules/AddMedia/loader.js
 419+ */
 420+ 'mwe-loading-add-media-wiz' => 'Loading add media wizard',
 421+
 422+ /*
 423+ * js file: /mwEmbed.js
 424+ */
 425+ 'mwe-loading_txt' => 'Loading ...',
 426+ 'mwe-size-gigabytes' => '$1 GB',
 427+ 'mwe-size-megabytes' => '$1 MB',
 428+ 'mwe-size-kilobytes' => '$1 K',
 429+ 'mwe-size-bytes' => '$1 B',
 430+ 'mwe-error_load_lib' => 'Error: JavaScript $1 was not retrievable or does not define $2',
 431+ 'mwe-apiproxy-setup' => 'Setting up API proxy',
 432+ 'mwe-load-drag-item' => 'Loading dragged item',
 433+ 'mwe-ok' => 'OK',
 434+ 'mwe-cancel' => 'Cancel',
 435+
 436+ /*
 437+ * js file: /skins/kskin/kskinConfig.js
 438+ */
343439 'mwe-credit-title' => 'Title: $1',
344440 'mwe-kaltura-platform-title' => 'Kaltura open source video platform',
345441
346442 /*
347 - * js file: /libEmbedPlayer/embedPlayer.js
 443+ * js file: /tests/testLang.js
348444 */
349 - 'mwe-loading_plugin' => 'loading plugin ...',
350 - 'mwe-select_playback' => 'Set playback preference',
351 - 'mwe-link_back' => 'Link back',
352 - 'mwe-error_swap_vid' => 'Error: mwEmbed was unable to swap the video tag for the mwEmbed interface',
353 - 'mwe-add_to_end_of_sequence' => 'Add to end of sequence',
354 - 'mwe-missing_video_stream' => 'The video file for this stream is missing',
355 - 'mwe-play_clip' => 'Play clip',
356 - 'mwe-pause_clip' => 'Pause clip',
357 - 'mwe-volume_control' => 'Volume control',
358 - 'mwe-player_options' => 'Player options',
359 - 'mwe-closed_captions' => 'Closed captions',
360 - 'mwe-player_fullscreen' => 'Fullscreen',
361 - 'mwe-next_clip_msg' => 'Play next clip',
362 - 'mwe-prev_clip_msg' => 'Play previous clip',
363 - 'mwe-current_clip_msg' => 'Continue playing this clip',
364 - 'mwe-seek_to' => 'Seek $1',
365 - 'mwe-paused' => 'paused',
366 - 'mwe-download_segment' => 'Download selection:',
367 - 'mwe-download_full' => 'Download full video file:',
368 - 'mwe-download_right_click' => 'To download, right click and select <i>Save link as...</i>',
369 - 'mwe-download_clip' => 'Download video',
370 - 'mwe-download_text' => 'Download text (<a style="color:white" title="cmml" href="http://wiki.xiph.org/index.php/CMML">CMML</a> xml):',
371 - 'mwe-download' => 'Download',
372 - 'mwe-share' => 'Share',
373 - 'mwe-credits' => 'Credits',
374 - 'mwe-clip_linkback' => 'Clip source page',
375 - 'mwe-chose_player' => 'Choose video player',
376 - 'mwe-share_this_video' => 'Share this video',
377 - 'mwe-video_credits' => 'Video credits',
378 - 'mwe-menu_btn' => 'Menu',
379 - 'mwe-close_btn' => 'Close',
380 - 'mwe-ogg-player-vlc-player' => 'VLC player',
381 - 'mwe-ogg-player-videoElement' => 'Native Ogg video',
382 - 'mwe-ogg-player-oggPlugin' => 'Generic Ogg plugin',
383 - 'mwe-ogg-player-quicktime-mozilla' => 'QuickTime plugin',
384 - 'mwe-ogg-player-quicktime-activex' => 'QuickTime ActiveX',
385 - 'mwe-ogg-player-cortado' => 'Java Cortado',
386 - 'mwe-ogg-player-flowplayer' => 'Flowplayer',
387 - 'mwe-ogg-player-kplayer' => 'Kaltura player',
388 - 'mwe-ogg-player-selected' => '(selected)',
389 - 'mwe-ogg-player-omtkplayer' => 'OMTK Flash Vorbis',
390 - 'mwe-generic_missing_plugin' => 'You browser does not appear to support the following playback type: <b>$1</b><br />Visit the <a href="http://commons.wikimedia.org/wiki/Commons:Media_help">Playback Methods</a> page to download a player.<br />',
391 - 'mwe-for_best_experience' => 'For a better video playback experience we recommend:<br /><b><a href="http://www.mozilla.com/en-US/firefox/upgrade.html?from=mwEmbed">Firefox 3.5</a>.</b>',
392 - 'mwe-do_not_warn_again' => 'Dismiss for now.',
393 - 'mwe-playerSelect' => 'Players',
394 - 'mwe-read_before_embed' => '<a href="http://mediawiki.org/wiki/Security_Notes_on_Remote_Embedding" target="_new">Read this</a> before embedding.',
395 - 'mwe-embed_site_or_blog' => 'Embed on a page',
396 - 'mwe-related_videos' => 'Related videos',
397 - 'mwe-seeking' => 'seeking',
398 - 'mwe-copy-code' => 'Copy code',
399 - 'mwe-video-h264' => 'H.264 video',
400 - 'mwe-video-flv' => 'Flash video',
401 - 'mwe-video-ogg' => 'Ogg video',
402 - 'mwe-video-audio' => 'Ogg audio',
 445+ 'undelete_short' => 'Undelete {{PLURAL:$1|one edit|$1 edits}}',
 446+ 'category-subcat-count' => '{{PLURAL:$2|This category has only the following subcategory.|This category has the following {{PLURAL:$1|subcategory|$1 subcategories}}, out of $2 total.}}',
 447+ 'mwe-upload-multi' => 'Upload {{PLURAL:$1|file|files}}',
403448 );
404449
405450 /** Message documentation (Message documentation)
Index: branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/styles.css
@@ -528,6 +528,9 @@
529529 margin:0 0 6px 35px;
530530 padding:0;
531531 }
 532+.related_vids a{
 533+ color:#FAFAFA;
 534+}
532535
533536 .related_vids li div {
534537 float:right;
Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js
@@ -140,7 +140,7 @@
141141 $target = $j( '#' + embedObj.id );
142142
143143 // Add play hook:
144 - $target.find( '.play-btn,.play-btn-large' ).unbind().btnBind().click( function() {
 144+ $target.find( '.play-btn,.play-btn-large' ).unbind().buttonHover().click( function() {
145145 embedObj.play();
146146 } );
147147
@@ -186,17 +186,17 @@
187187
188188
189189 // Captions binding:
190 - $target.find( '.timed-text' ).unbind().btnBind().click( function() {
 190+ $target.find( '.timed-text' ).unbind().buttonHover().click( function() {
191191 embedObj.showTextInterface();
192192 } );
193193
194194 // Options binding:
195 - $target.find( '.options-btn' ).unbind().btnBind().click( function() {
 195+ $target.find( '.options-btn' ).unbind().buttonHover().click( function() {
196196 embedObj.doOptionsHTML();
197197 } );
198198
199199 // Fullscreen binding:
200 - $target.find( '.fullscreen-btn' ).unbind().btnBind().click( function() {
 200+ $target.find( '.fullscreen-btn' ).unbind().buttonHover().click( function() {
201201 embedObj.fullscreen();
202202 } );
203203
@@ -334,7 +334,7 @@
335335 var embedObj = this.embedObj;
336336 var _this = this;
337337 var $target = $j( '#' + embedObj.id );
338 - $target.find( '.volume_control' ).unbind().btnBind().click( function() {
 338+ $target.find( '.volume_control' ).unbind().buttonHover().click( function() {
339339 mw.log( 'clicked volume control' );
340340 $j( '#' + embedObj.id ).get( 0 ).toggleMute();
341341 } );
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mvTextInterface.js
@@ -1,683 +0,0 @@
2 -mw.addMessages( {
3 - "mwe-select_transcript_set" : "Select subtitles",
4 - "mwe-auto_scroll" : "auto scroll",
5 - "mwe-close" : "close",
6 - "mwe-improve_transcript" : "Improve",
7 - "mwe-no_text_tracks_found" : "No text subtitles found",
8 - "mwe-add-edit-subs" : "Add/edit subtitles"
9 -} )
10 -// text interface object (for inline display captions)
11 -var mvTextInterface = function( parentEmbed ) {
12 - return this.init( parentEmbed );
13 -}
14 -mvTextInterface.prototype = {
15 - text_lookahead_time:0,
16 - body_ready:false,
17 - default_time_range: "source", // by default just use the source don't get a time-range
18 - transcript_set:null,
19 - autoscroll:true,
20 - add_to_end_on_this_pass:false,
21 - scrollTimerId:0,
22 - editlink: '',
23 - suportedMime: {
24 - 'srt': 'text/x-srt',
25 - 'cmml': 'text/cmml'
26 - },
27 - init:function( parentEmbed ) {
28 - // init a new availableTracks obj:
29 - this.availableTracks = new Array();
30 - // set the parent embed object:
31 - this.pe = parentEmbed;
32 - // parse roe if not already done:
33 - this.getTextTracks();
34 - },
35 - // @@todo separate out data loader & data display
36 - getTextTracks:function() {
37 - // mw.log("load timed text from roe: "+ this.pe.roe);
38 - var _this = this;
39 - // if roe not yet loaded do load it:
40 - if ( this.pe.roe || _this.pe.wikiTitleKey ) {
41 - if ( !this.pe.media_element.addedROEData ) {
42 - $j( '#mv_txt_load_' + _this.pe.id ).show(); // show the loading icon
43 - if ( _this.pe.roe ) {
44 - mw.getMvJsonUrl( _this.pe.roe, function( data ){
45 - _this.pe.media_element.addROE( data );
46 - _this.getParseTimedText_rowReady();
47 - } );
48 - } else if ( _this.pe.wikiTitleKey ) {
49 - // check for a clear namespace key:
50 - _this.getTextTracksWikiTitle()
51 - }
52 - } else {
53 - mw.log( 'row data ready (no roe request)' );
54 - _this.getParseTimedText_rowReady();
55 - }
56 - } else {
57 - if ( this.pe.media_element.textSourceExists() ) {
58 - _this.getParseTimedText_rowReady();
59 - } else {
60 - mw.log( 'no roe data or timed text sources' );
61 - }
62 - }
63 - },
64 - getTextTracksWikiTitle:function() {
65 - var apiUrl = mw.getLocalApiUrl();
66 - var _this = this;
67 -
68 - var timedtext_ns = 102;
69 - if ( typeof wgNamespaceIds != 'undefined' && wgNamespaceIds['timedtext'] ) {
70 - timedtext_ns = wgNamespaceIds['timedtext'];
71 - }
72 - var request = {
73 - 'list' : 'allpages',
74 - 'apprefix' : _this.pe.wikiTitleKey,
75 - 'apnamespace' : timedtext_ns,
76 - 'prop':'revisions'
77 - };
78 - mw.getJSON( apiUrl, request, function( subData ) {
79 - if ( subData.error && subData.error.code == 'apunknown_apnamespace' ) {
80 - var request = {
81 - 'list' : 'allpages',
82 - 'apprefix' : 'TimedText:' + _this.pe.wikiTitleKey
83 - };
84 - mw.getJSON( apiUrl, request, function( subData ) {
85 - _this.doProcSubPages( subData, wgServer + wgScriptPath );
86 - } );
87 - } else {
88 - _this.doProcSubPages( subData, wgServer + wgScriptPath );
89 - }
90 - } );
91 - },
92 - doProcSubPages: function( subData, hostPath ) {
93 - var _this = this;
94 - // look for text tracks:
95 - var foundTextTracks = false;
96 -
97 - var request ={
98 - 'meta' : 'siteinfo',
99 - 'siprop' : 'languages'
100 - }
101 - var url = hostPath + '/api.php';
102 - // get all the known languages:
103 - mw.getJSON(url , request, function( langDataRaw ) {
104 - var langData = { };
105 - var lagRaw = langDataRaw.query.languages;
106 - for ( var j in lagRaw ) {
107 - langData[ lagRaw[j].code ] = lagRaw[j]['*'];
108 - }
109 - for ( var i in subData.query.allpages ) {
110 - var subPage = subData.query.allpages[i];
111 - var langKey = subPage.title.split( '.' );
112 - var extension = langKey.pop();
113 - langKey = langKey.pop();
114 - if ( ! _this.suportedMime[ extension ] ) {
115 - mw.log( 'Error: unknown extension:' + extension );
116 - continue;
117 - }
118 -
119 - if ( !langData[ langKey] ) {
120 - mw.log( 'Error: langkey:' + langKey + ' not found' );
121 - } else {
122 - var textElm = document.createElement( 'text' );
123 - $j( textElm ).attr( {
124 - 'category' : 'SUB',
125 - 'lang' : langKey,
126 - 'type' : _this.suportedMime[ extension ],
127 - 'title' : langData[ langKey]
128 - } );
129 - // We use the api since ?action raw on the real title has cache issues
130 - $j( textElm ).attr( {
131 - 'apisrc' : hostPath + '/api.php',
132 - 'titleKey' : subPage.title
133 - } );
134 - _this.pe.media_element.tryAddSource( textElm );
135 - foundTextTracks = true;
136 - }
137 - }
138 - // after all text loaded (or we have allready checked commons
139 - if ( foundTextTracks || hostPath.indexOf( 'commons.wikimedia' ) !== -1 ) {
140 - // alert('calling getParseTimedText_rowReady ');
141 - _this.getParseTimedText_rowReady();
142 - } else {
143 - _this.checkSharedRepo();
144 - }
145 - } );
146 - },
147 - checkSharedRepo:function() {
148 - var _this = this;
149 - mw.log( 'checking for shared value of image' );
150 - // check if its a shared repo
151 - var request = {
152 - 'titles': 'File:' + _this.pe.wikiTitleKey,
153 - 'prop' : 'imageinfo'
154 - };
155 - mw.getJSON( request, function( data ) {
156 - if ( data.query.pages && data.query.pages['-1'] && data.query.pages['-1'].imagerepository == 'shared' ) {
157 - mw.log( 'image is shared checking commons for subtitles' );
158 - // found shared repo assume commons:
159 - var request = {
160 - 'list' : 'allpages',
161 - 'apprefix' : _this.pe.wikiTitleKey,
162 - 'apnamespace' : 102
163 - };
164 - mw.getJSON( mw.commons_api_url, request, function( data ) {
165 - _this.editlink = 'http://commons.wikimedia.org/wiki/TimedText:' + _this.pe.wikiTitleKey + '.' + wgUserLanguage + '.srt';
166 - _this.doProcSubPages( data, 'http://commons.wikimedia.org/w/' );
167 - } );
168 - } else {
169 - // no shared repo do normal proc
170 - _this.getParseTimedText_rowReady();
171 - }
172 - } );
173 - },
174 - getParseTimedText_rowReady: function () {
175 - var _this = this;
176 - var found_tracks = false;
177 - // create timedTextObj
178 - mw.log( "mv_txt_load_:SHOW mv_txt_load_" );
179 - $j( '#mv_txt_load_' + _this.pe.id ).show(); // show the loading icon
180 -
181 - // setup edit link:
182 - if ( _this.editlink == '' ) {
183 - if ( this.pe.media_element.linkback ) {
184 - _this.editlink = this.pe.media_element.linkback;
185 - } else if ( this.pe.wikiTitleKey && wgServer && wgScript ) { // check for wikiTitleKey (for edit linkback)
186 - // only local:
187 - _this.editlink = wgServer + wgScript + '?title=TimedText:' + this.pe.wikiTitleKey + '.' + wgUserLanguage + '.srt&action=edit';
188 - }
189 - }
190 - $j.each( this.pe.media_element.sources, function( inx, source ) {
191 - if ( typeof source.id == 'undefined' || source.id == null ) {
192 - source.id = 'text_' + inx;
193 - }
194 - var tObj = new timedTextObj( source );
195 - // make sure its a valid timed text format (we have not loaded or parsed yet) : (
196 - if ( tObj.lib != null ) {
197 - _this.availableTracks.push( tObj );
198 - // display requested language if we can know that:
199 - if ( ( typeof wgUserLanguage != 'undefined' && source['lang'] == wgUserLanguage ) || source['default'] == "true" ) {
200 - // we did set at least one track by default tag
201 - found_tracks = true;
202 - _this.loadAndDisplay( _this.availableTracks.length - 1 );
203 - } else {
204 - // don't load the track and don't display
205 - }
206 - }
207 - } );
208 -
209 - // no default clip found take the userLanguage key if set:
210 - if ( !found_tracks ) {
211 - $j.each( _this.availableTracks, function( inx, source ) {
212 - _this.loadAndDisplay( inx );
213 - found_tracks = true;
214 - // return after loading first available
215 - return false;
216 - } );
217 - }
218 -
219 - // if nothing found anywhere give the not found msg:
220 - if ( !found_tracks ) {
221 - $j( '#metaBox_' + _this.pe.id ).html( '' +
222 - '<h3>' + gM( 'mwe-no_text_tracks_found' ) + '</h3>' +
223 - '<a href="' + _this.editlink + '">' + gM( 'mwe-add-edit-subs' ) + '</a>'
224 - );
225 - }
226 - },
227 - loadAndDisplay: function ( track_id ) {
228 - var _this = this;
229 - $j( '#mv_txt_load_' + _this.pe.id ).show();// show the loading icon
230 - _this.availableTracks[ track_id ].load( _this.default_time_range, function() {
231 - $j( '#mv_txt_load_' + _this.pe.id ).hide();
232 - _this.addTrack( track_id );
233 - } );
234 - },
235 - addTrack: function( track_id ) {
236 - mw.log( 'f:displayTrack:' + track_id );
237 - var _this = this;
238 - // set the display flag to true:
239 - _this.availableTracks[ track_id ].display = true;
240 - // setup the layout:
241 - this.setup_layout();
242 - mw.log( "SHOULD ADD: track:" + track_id + ' count:' + _this.availableTracks[ track_id ].textNodes.length );
243 -
244 - // a flag to avoid checking all clips if we know we are adding to the end:
245 - _this.add_to_end_on_this_pass = false;
246 -
247 - // run clip adding on a timed interval to not lock the browser on large srt file merges (should use worker threads)
248 - var i = 0;
249 - var track_id = track_id;
250 - var addNextClip = function() {
251 - var text_clip = _this.availableTracks[ track_id ].textNodes[i];
252 - if ( text_clip ) {
253 - _this.add_merge_text_clip( text_clip, track_id );
254 - i++;
255 - if ( i < _this.availableTracks[ track_id ].textNodes.length ) {
256 - setTimeout( addNextClip, 1 );
257 - }
258 - }
259 - }
260 - addNextClip();
261 - },
262 - add_merge_text_clip: function( text_clip, track_id ) {
263 - var _this = this;
264 - // make sure the clip does not already exist:
265 - if ( $j( '#tc_' + text_clip.id ).length == 0 ) {
266 - var inserted = false;
267 - var text_clip_start_time = mw.npt2seconds( text_clip.start );
268 -
269 - var insertHTML = '<div id="tc_' + text_clip.id + '" ' +
270 - 'start_sec="' + text_clip_start_time + '" ' +
271 - 'start="' + text_clip.start + '" end="' + text_clip.end + '" ' +
272 - 'class="mvtt track_' + track_id + '">' +
273 - '<div class="mvttseek" style="top:0px;left:0px;right:0px;height:20px;font-size:small">' +
274 - text_clip.start + ' to ' + text_clip.end +
275 - '</div>' +
276 - text_clip.body +
277 - '</div>';
278 - if ( !_this.add_to_end_on_this_pass ) {
279 - $j( '#mmbody_' + this.pe.id + ' .mvtt' ).each( function() {
280 - if ( !inserted ) {
281 - if ( $j( this ).attr( 'start_sec' ) > text_clip_start_time ) {
282 - inserted = true;
283 - $j( this ).before( insertHTML );
284 - }
285 - } else {
286 - _this.add_to_end = true;
287 - }
288 - } );
289 - }
290 - // mw.log('should just add to end: '+insertHTML);
291 - if ( !inserted ) {
292 - $j( '#mmbody_' + this.pe.id ).append( insertHTML );
293 - }
294 -
295 - // apply the mouse over transcript seek/click functions:
296 - $j( ".mvttseek" ).click( function() {
297 - _this.pe.doSeek( $j( this ).parent().attr( "start_sec" ) / _this.pe.getDuration() );
298 - } );
299 - $j( ".mvttseek" ).hoverIntent( {
300 - interval:200, // polling interval
301 - timeout:200, // delay before onMouseOut
302 - over:function () {
303 - mw.log( 'mvttseek: over' );
304 - $j( this ).parent().addClass( 'tt_highlight' );
305 - // do section highlight
306 - _this.pe.highlightPlaySection( {
307 - 'start' : $j( this ).parent().attr( "start" ),
308 - 'end' : $j( this ).parent().attr( "end" )
309 - } );
310 - },
311 - out:function () {
312 - mw.log( 'mvttseek: out' );
313 - $j( this ).parent().removeClass( 'tt_highlight' );
314 - // de highlight section
315 - _this.pe.hideHighlight();
316 - }
317 - }
318 - );
319 - }
320 - },
321 - setup_layout:function() {
322 - var _this = this;
323 - // check if we have already loaded the menu/body:
324 - if ( $j( '#tt_mmenu_' + this.pe.id ).length == 0 ) {
325 - // alert( this.availableTracks.length );
326 - if ( this.availableTracks.length != 0 ) {
327 - $j( '#metaBox_' + this.pe.id ).html(
328 - this.getMenu() +
329 - this.getBody()
330 - );
331 - this.doMenuBindings();
332 - }
333 - }
334 - },
335 - show:function() {
336 - // setup layout if not already done:
337 - this.setup_layout();
338 - // display the interface if not already displayed:
339 - $j( '#metaBox_' + this.pe.id ).fadeIn( "fast" );
340 - // start the autoscroll timer:
341 - if ( this.autoscroll )
342 - this.setAutoScroll();
343 - },
344 - close:function() {
345 - // the meta box:
346 - $j( '#metaBox_' + this.pe.id ).fadeOut( 'fast' );
347 - // the icon link:
348 - $j( '#metaButton_' + this.pe.id ).fadeIn( 'fast' );
349 - },
350 - getBody:function() {
351 - return '<div id="mmbody_' + this.pe.id + '" ' +
352 - 'style="position:absolute;top:30px;left:0px;' +
353 - 'right:0px;bottom:0px;' +
354 - 'height:' + ( this.pe.height) +
355 - 'px;overflow:auto;"><span style="display:none;" id="mv_txt_load_' + this.pe.id + '">' +
356 - mw.loading_spinner() + '</span>' +
357 - '</div>';
358 - },
359 - getTsSelect:function() {
360 - var _this = this;
361 - mw.log( 'getTsSelect' );
362 - var selHTML = '<div id="mvtsel_' + this.pe.id + '" style="position:absolute;background:#FFF;top:30px;left:0px;right:0px;bottom:0px;overflow:auto;">';
363 - selHTML += '<b>' + gM( 'mwe-select_transcript_set' ) + '</b><ul>';
364 - // debugger;
365 - for ( var i in _this.availableTracks ) { // for in loop ok on object
366 - var checked = ( _this.availableTracks[i].display ) ? 'checked' : '';
367 - selHTML += '<li><input name="language" value="' + i + '" class="mvTsSelect" type="radio" ' + checked + '>' +
368 - _this.availableTracks[i].getTitle() + '</li>';
369 - }
370 - selHTML += '</ul>' +
371 - '</div>';
372 - $j( '#metaBox_' + _this.pe.id ).append( selHTML );
373 - $j( '.mvTsSelect' ).click( function() {
374 - _this.applyTsSelect();
375 - } );
376 - },
377 - applyTsSelect:function() {
378 - var _this = this;
379 - // update availableTracks
380 - $j( '#mvtsel_' + this.pe.id + ' .mvTsSelect' ).each( function() {
381 - var track_id = $j( this ).val();
382 - if ( this.checked ) {
383 - // if not yet loaded now would be a good time
384 - if ( ! _this.availableTracks[ track_id ].loaded ) {
385 - _this.loadAndDisplay( track_id );
386 - } else {
387 - _this.availableTracks[track_id].display = true;
388 - // display the named class:
389 - $j( '#mmbody_' + _this.pe.id + ' .track_' + track_id ).show();
390 - }
391 - } else {
392 - if ( _this.availableTracks[track_id].display ) {
393 - _this.availableTracks[track_id].display = false;
394 - // hide unchecked
395 - $j( '#mmbody_' + _this.pe.id + ' .track_' + track_id ).hide();
396 - }
397 - }
398 - } );
399 - $j( '#mvtsel_' + _this.pe.id ).fadeOut( "fast" ).remove();
400 - },
401 - monitor:function() {
402 - _this = this;
403 - // grab the time from the video object
404 - var cur_time = this.pe.currentTime ;
405 - if ( cur_time != 0 ) {
406 - var search_for_range = true;
407 - // check if the current transcript is already where we want:
408 - if ( $j( '#mmbody_' + this.pe.id + ' .tt_scroll_highlight' ).length != 0 ) {
409 - var curhl = $j( '#mmbody_' + this.pe.id + ' .tt_scroll_highlight' ).get( 0 );
410 - if ( mw.npt2seconds( $j( curhl ).attr( 'start' ) ) < cur_time &&
411 - mw.npt2seconds( $j( curhl ).attr( 'end' ) ) > cur_time ) {
412 - /*mw.log('in range of current hl: ' +
413 - mw.npt2seconds($j(curhl).attr('start')) + ' to ' + mw.npt2seconds($j(curhl).attr('end')));
414 - */
415 - search_for_range = false;
416 - } else {
417 - search_for_range = true;
418 - // remove the highlight from all:
419 - $j( '#mmbody_' + this.pe.id + ' .tt_scroll_highlight' ).removeClass( 'tt_scroll_highlight' );
420 - }
421 - };
422 - /*mw.log('search_for_range:'+search_for_range + ' for: '+ cur_time);*/
423 - if ( search_for_range ) {
424 - // search for current time: add tt_scroll_highlight to clip
425 - // optimize:
426 - // should do binnary search not iterative
427 - // avoid jquery function calls do native loops
428 - $j( '#mmbody_' + this.pe.id + ' .mvtt' ).each( function() {
429 - if ( mw.npt2seconds( $j( this ).attr( 'start' ) ) < cur_time &&
430 - mw.npt2seconds( $j( this ).attr( 'end' ) ) > cur_time ) {
431 - _this.prevTimeScroll = cur_time;
432 - $j( '#mmbody_' + _this.pe.id ).animate( {
433 - scrollTop: $j( this ).get( 0 ).offsetTop
434 - }, 'slow' );
435 - $j( this ).addClass( 'tt_scroll_highlight' );
436 - // mw.log('should add class to: ' + $j(this).attr('id'));
437 - // done with loop
438 - return false;
439 - }
440 - } );
441 - }
442 - }
443 - },
444 - setAutoScroll:function( timer ) {
445 - var _this = this;
446 - this.autoscroll = ( typeof timer == 'undefined' ) ? this.autoscroll:timer;
447 - if ( this.autoscroll ) {
448 - // start the timer if its not already running
449 - if ( !this.scrollTimerId ) {
450 - var mvElm = $j('#' + _this.id ).get(0);
451 - if( mvElm )
452 - this.scrollTimerId = setInterval( mvElm.textInterface.monitor(), 500 );
453 - }
454 - // jump to the current position:
455 - var cur_time = parseInt ( this.pe.currentTime );
456 - mw.log( 'cur time: ' + cur_time );
457 -
458 - _this = this;
459 - var scroll_to_id = '';
460 - $j( '#mmbody_' + this.pe.id + ' .mvtt' ).each( function() {
461 - if ( cur_time > mw.npt2seconds( $j( this ).attr( 'start' ) ) ) {
462 - _this.prevTimeScroll = cur_time;
463 - if ( $j( this ).attr( 'id' ) )
464 - scroll_to_id = $j( this ).attr( 'id' );
465 - }
466 - } );
467 - if ( scroll_to_id != '' )
468 - $j( '#mmbody_' + _this.pe.id ).animate( { scrollTop: $j( '#' + scroll_to_id ).position().top } , 'slow' );
469 - } else {
470 - // stop the timer
471 - clearInterval( this.scrollTimerId );
472 - this.scrollTimerId = 0;
473 - }
474 - },
475 - getMenu:function() {
476 - var out = '';
477 - var _this = this;
478 - // add in loading icon:
479 - var as_checked = ( this.autoscroll ) ? 'checked':'';
480 - out += '<div id="tt_mmenu_' + this.pe.id + '" class="ui-widget-header" style="font-size:.6em;position:absolute;top:0;height:30px;left:0px;right:0px;">';
481 - out += $j.btnHtml( gM( 'mwe-select_transcript_set' ), 'tt-select', 'shuffle' );
482 -
483 - if ( _this.editlink != '' )
484 - out += ' ' + $j.btnHtml( gM( 'mwe-improve_transcript' ), 'tt-improve' );
485 -
486 - out += '<input class="tt-scroll" type="checkbox" ' + as_checked + '>' + gM( 'mwe-auto_scroll' );
487 -
488 - out += ' ' + $j.btnHtml( gM( 'mwe-close' ), 'tt-close', 'circle-close' );
489 -
490 - out += '</div>';
491 - return out;
492 - },
493 - doMenuBindings:function() {
494 - var _this = this;
495 - var mt = '#tt_mmenu_' + _this.pe.id;
496 - $j( mt + ' .tt-close' ).unbind().btnBind().click( function() {
497 - $j( '#' + _this.pe.id ).get( 0 ).closeTextInterface();
498 - return false;
499 - } );
500 - $j( mt + ' .tt-select' ).unbind().btnBind().click( function() {
501 - $j( '#' + _this.pe.id ).get( 0 ).textInterface.getTsSelect();
502 - return false;
503 - } );
504 - $j( mt + ' .tt-scroll' ).click( function() {
505 - _this.setAutoScroll( this.checked );
506 - } );
507 - $j( mt + ' .tt-improve' ).unbind().btnBind().click( function() {
508 - document.location.href = _this.editlink;
509 - } );
510 - }
511 -}
512 -
513 -/* text format objects
514 -* @@todo allow loading from external lib set
515 -*/
516 -var timedTextObj = function( source ) {
517 - // @@todo in the future we could support timed text in oggs if they can be accessed via javascript
518 - // we should be able to do a HEAD request to see if we can read transcripts from the file.
519 - switch( source.mime_type ) {
520 - case 'text/cmml':
521 - this.lib = 'CMML';
522 - break;
523 - case 'text/srt':
524 - case 'text/x-srt':
525 - this.lib = 'SRT';
526 - break;
527 - default:
528 - mw.log( source.mime_type + ' is not suported timed text fromat' );
529 - return ;
530 - break;
531 - }
532 - // extend with the per-mime type lib:
533 - eval( 'var tObj = timedText' + this.lib + ';' );
534 - for ( var i in tObj ) {
535 - this[ i ] = tObj[i];
536 - }
537 - return this.init( source );
538 -}
539 -
540 -// base timedText object
541 -timedTextObj.prototype = {
542 - loaded: false,
543 - lib:null,
544 - display: false,
545 - textNodes:new Array(),
546 - init: function( source ) {
547 - // copy source properties
548 - this.source = source;
549 - this.id = source.id;
550 - },
551 - getTitle:function() {
552 - return this.source.title;
553 - },
554 - getSRC:function() {
555 - return this.source.src;
556 - }
557 -}
558 -
559 -// Specific Timed Text formats:
560 -
561 -timedTextCMML = {
562 - load: function( range, callback ) {
563 - var _this = this;
564 - mw.log( 'textCMML: loading track: ' + this.src );
565 -
566 - // :: Load transcript range ::
567 - var pcurl = mw.parseUri( _this.getSRC() );
568 - // check for urls without time keys:
569 - if ( typeof pcurl.queryKey['t'] == 'undefined' ) {
570 - // in which case just get the full time req:
571 - mw.getMvJsonUrl( this.getSRC(), function( data ) {
572 - _this.doParse( data );
573 - _this.loaded = true;
574 - callback();
575 - } );
576 - return ;
577 - }
578 - // temporal urls:
579 - var req_time = pcurl.queryKey['t'].split( '/' );
580 - req_time[0] = mw.npt2seconds( req_time[0] );
581 - req_time[1] = mw.npt2seconds( req_time[1] );
582 - if ( req_time[1] - req_time[0] > _this.request_length ) {
583 - // longer than 5 min will only issue a (request 5 min)
584 - req_time[1] = req_time[0] + _this.request_length;
585 - }
586 - // set up request url:
587 - url = pcurl.protocol + '://' + pcurl.authority + pcurl.path + '?';
588 - $j.each( pcurl.queryKey, function( key, val ) {
589 - if ( key != 't' ) {
590 - url += key + '=' + val + '&';
591 - } else {
592 - url += 't=' + mw.seconds2npt( req_time[0] ) + '/' + mw.seconds2npt( req_time[1] ) + '&';
593 - }
594 - } );
595 - mw.getMvJsonUrl( url, function( data ) {
596 - mw.log( "load track clip count:" + data.getElementsByTagName( 'clip' ).length );
597 - _this.doParse( data );
598 - _this.loaded = true;
599 - callback();
600 - } );
601 - },
602 - doParse: function( data ) {
603 - var _this = this;
604 - $j.each( data.getElementsByTagName( 'clip' ), function( inx, clip ) {
605 - // mw.log(' on clip ' + clip.id);
606 - var text_clip = {
607 - start: $j( clip ).attr( 'start' ).replace( 'npt:', '' ),
608 - end: $j( clip ).attr( 'end' ).replace( 'npt:', '' ),
609 - type_id: _this.id,
610 - id: $j( clip ).attr( 'id' )
611 - }
612 - $j.each( clip.getElementsByTagName( 'body' ), function( binx, bn ) {
613 - if ( bn.textContent ) {
614 - text_clip.body = bn.textContent;
615 - } else if ( bn.text ) {
616 - text_clip.body = bn.text;
617 - }
618 - } );
619 - _this.textNodes.push( text_clip );
620 - } );
621 - }
622 -}
623 -timedTextSRT = {
624 - load: function( range, callback ) {
625 - var _this = this;
626 - mw.log( 'textSRT: loading : ' + _this.getSRC() );
627 - if ( _this.getSRC() ) {
628 - mw.getMvJsonUrl( _this.getSRC() , function( data ) {
629 - _this.doParse( data );
630 - _this.loaded = true;
631 - callback();
632 - } );
633 - } else if ( _this.source.apisrc ) {
634 - var request = {
635 - 'titles': _this.source.titleKey,
636 - 'prop':'revisions',
637 - 'rvprop':'content'
638 - };
639 - mw.getJSON( _this.source.apisrc,request, function( data ) {
640 - if ( data && data.query && data.query.pages ) {
641 - for ( var i in data.query.pages ) {
642 - var page = data.query.pages[i];
643 - if ( page.revisions ) {
644 - for ( var j in page.revisions ) {
645 - if ( page.revisions[j]['*'] ) {
646 - _this.doParse( page.revisions[j]['*'] );
647 - _this.loaded = true;
648 - callback();
649 - }
650 - }
651 - }
652 - }
653 - }
654 - } );
655 - }
656 - },
657 - doParse:function( data ) {
658 - // split up the transcript chunks:
659 - // strip any \r's
660 - var tc = data.split( /[\r]?\n[\r]?\n/ );
661 - // pushing can take time
662 - for ( var s = 0; s < tc.length ; s++ ) {
663 - var st = tc[s].split( '\n' );
664 - if ( st.length >= 2 ) {
665 - var n = st[0];
666 - var i = st[1].split( ' --> ' )[0].replace( /^\s+|\s+$/g, "" );
667 - var o = st[1].split( ' --> ' )[1].replace( /^\s+|\s+$/g, "" );
668 - var t = st[2];
669 - if ( st.length > 2 ) {
670 - for ( j = 3; j < st.length; j++ )
671 - t += '\n' + st[j];
672 - }
673 - var text_clip = {
674 - "start": i,
675 - "end": o,
676 - "type_id": this.id,
677 - "id": this.id + '_' + n,
678 - "body": t
679 - }
680 - this.textNodes.push( text_clip );
681 - }
682 - }
683 - }
684 -};
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/jquery.menu.js
@@ -20,8 +20,7 @@
2121
2222 $.fn.menu = function( options ){
2323 var caller = this;
24 - var options = options;
25 -
 24+ var options = options;
2625 if( ! caller.m ){
2726 caller.m = new Menu(caller, options);
2827 allUIMenus.push( caller.m );
@@ -54,7 +53,9 @@
5554
5655 //Else process the request:
5756 if( options == 'show' )
58 - caller.m.showMenu();
 57+ caller.m.showMenu();
 58+
 59+ return this;
5960 };
6061
6162 function Menu(caller, options){
@@ -310,7 +311,7 @@
311312 clearTimeout(hideTimer);
312313 var subList = $(this).next();
313314 if (!fitVertical(subList, $(this).offset().top)) { subList.css({ top: 'auto', bottom: 0 }); };
314 - if (!fitHorizontal(subList, $(this).offset().left + 100)) { subList.css({ left: 'auto', right: linkWidth, 'z-index': 999 }); };
 315+ if (!fitHorizontal(subList, $(this).offset().left + 100)) { subList.css({ left: 'auto', right: linkWidth, 'z-index': 1005 }); };
315316 showTimer = setTimeout(function(){
316317 subList.addClass('ui-widget-content').show(options.showSpeed).attr('aria-expanded', 'true');
317318 }, 300);
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js
@@ -31,7 +31,7 @@
3232
3333 "mwe-loading-text" : "Loading text ...",
3434
35 - "mwe-key-language": "($1) $2",
 35+ "mwe-key-language": "$1, $2",
3636
3737 "mwe-textcat-cc" : "Captions",
3838 "mwe-textcat-sub" : "Subtitles",
@@ -175,7 +175,9 @@
176176 setupTextSources: function( callback ){
177177 var _this = this;
178178 if( this.textSourceSetupFlag ){
179 - callback();
 179+ if( callback ){
 180+ callback();
 181+ }
180182 return ;
181183 }
182184 // Load textSources
@@ -196,10 +198,10 @@
197199
198200 /**
199201 * Binds the timed text menu
200 - * and updates its content from "getMenu"
 202+ * and updates its content from "getMainMenu"
201203 *
202204 * @param {Object} target to display the menu
203 - * @param {Bollean} autoShow If the menu should be displayed
 205+ * @param {Boolean} autoShow If the menu should be displayed
204206 */
205207 bindMenu: function( target , autoShow){
206208 var _this = this;
@@ -213,24 +215,16 @@
214216 _this.setupTextSources( function(){
215217 // NOTE: Button target should be an option or config
216218 $menuButton.unbind().menu( {
217 - 'content' : _this.getMenu(),
 219+ 'content' : _this.getMainMenu(),
218220 'crumbDefaultText' : ' ',
219221 'targetMenuContainer' : _this.menuTarget,
220222 'autoShow' : autoShow,
221223 'backLinkText' : gM( 'mwe-back-btn' )
222224 } );
223225 });
224 - },
 226+ },
225227
226228 /**
227 - * Refresh the menu
228 - */
229 - refreshMenu: function( ){
230 - // update the menu
231 - this.bindMenu( this.menuTarget, false );
232 - },
233 -
234 - /**
235229 * Monitor video time and update timed text filed[s]
236230 */
237231 monitor: function( ){
@@ -404,7 +398,7 @@
405399 * [ All videos ]
406400 * [ Chapters ] seek to chapter
407401 */
408 - getMenu: function(){
 402+ getMainMenu: function(){
409403 var _this = this;
410404
411405
@@ -422,10 +416,7 @@
423417 ),
424418
425419 // Search Menu option
426 - _this.getLi( gM('mwe-search'), 'search'),
427 -
428 - //Include the "make transcript" link:
429 - _this.getLiAddText()
 420+ _this.getLi( gM('mwe-search'), 'search')
430421 );
431422 }
432423 // Put in the "Make Transcript" link
@@ -443,12 +434,12 @@
444435 showTimedTextEditUI: function( mode ){
445436 var _this = this;
446437 // Show a loader:
447 - $j.addLoaderDialog( gM( 'mwe-loading-text-edit' ));
 438+ mw.addLoaderDialog( gM( 'mwe-loading-text-edit' ));
448439 // Load the timedText edit interface
449440 mw.load( 'TimedText.Edit', function(){
450 - $j.closeLoaderDialog();
 441+ mw.closeLoaderDialog();
451442 if( ! _this.editText ){
452 - _this.editText = new mw.TimedTextEdit();
 443+ _this.editText = new mw.TimedTextEdit( _this );
453444 }
454445 _this.editText.showUI();
455446 })
@@ -477,10 +468,10 @@
478469 getLiSource: function( source ){
479470 var _this = this;
480471 //See if the source is currently "on"
481 - var sourceIcon = ( this.isSourceEnabled( source ) )? 'bullet' : 'radio-on';
 472+ var source_icon = ( this.isSourceEnabled( source ) )? 'bullet' : 'radio-on';
482473
483474 if( source.title ){
484 - return this.getLi( source.title, sourceIcon, function(){
 475+ return this.getLi( source.title, source_icon, function(){
485476 mw.log(" call selectTextSource");
486477 _this.selectTextSource( source );
487478 });
@@ -491,7 +482,7 @@
492483 _this.getLanguageName ( langKey );
493484 return this.getLi(
494485 gM('mwe-key-language', [langKey, unescape( mw.languages[ source.lang ] ) ] ),
495 - sourceIcon,
 486+ source_icon,
496487 function(){
497488 mw.log(" call selectTextSource");
498489 _this.selectTextSource( source );
@@ -536,7 +527,7 @@
537528 var layoutOptions = [ ];
538529
539530 //Only display the "ontop" option if the player supports it:
540 - if( this.embedPlayer.supports['overlays'] )
 531+ if( this.embedPlayer.supports[ 'overlays' ] )
541532 layoutOptions.push( 'ontop' );
542533
543534 //Add below and "off" options:
@@ -626,7 +617,7 @@
627618 // Empyt out previus text to force an interface update:
628619 this.prevText = [];
629620 // Refresh the Menu:
630 - this.refreshMenu();
 621+ this.bindMenu( this.menuTarget, false );
631622 // Issues a "monitor" command to update the timed text for the new layout
632623 this.monitor();
633624 },
@@ -711,7 +702,7 @@
712703 if( text === this.prevText[ source.category ] )
713704 return ;
714705
715 - mw.log( 'updateTextDisplay: ' + text );
 706+ //mw.log( 'updateTextDisplay: ' + text );
716707
717708 var $player = $j( '#' + this.embedPlayer.id);
718709 var $textTarget = $player.find( '.itext_' + source.category + ' span' );
@@ -734,7 +725,7 @@
735726 // Update text ( use "html" instead of "text" so that parsers can swap in html for formating
736727 $textTarget.html( text );
737728 }
738 - mw.log( ' len: ' + $textTarget.length + ' ' + $textTarget.html() );
 729+ //mw.log( ' len: ' + $textTarget.length + ' ' + $textTarget.html() );
739730 // Update the prev text:
740731 this.prevText[ source.category ] = text;
741732 },
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/old_mvTimeTextEdit.js
@@ -113,7 +113,7 @@
114114 'title' : title,
115115 'text' : srt,
116116 'token': editToken
117 - };
 117+ };
118118 mw.getJSON( request, function( dialog ) {
119119 return function( result ) {
120120 document.location.href = wgArticlePath.replace( '/$1', '?title=' + title + '&action=edit' );
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.css
@@ -170,13 +170,13 @@
171171 background: #ffd;
172172 border:none;
173173 }
174 -
 174+/*
175175 .TimedTextEdit input[type=text]
176176 {
177177 background: #ffd;
178 - border:none;
179 - width:70%;
 178+ border:none;
180179 }
 180+*/
181181
182182 .TimedTextEdit .hotkeybox {
183183 background: #333;
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js
@@ -6,11 +6,17 @@
77 "mwe-stage-transcribe" : "Transcribe",
88 "mwe-stage-sync" : "Sync",
99 "mwe-stage-translate" : "Translate",
10 - "mwe-stage-upload" : "Upload from local file"
 10+ "mwe-stage-upload" : "Upload from local file",
 11+
 12+ "mwe-select-language": "Select language",
 13+ "mwe-file-language": "Subtitle file language",
 14+
 15+ "mwe-upload-file": "Upload text file",
 16+ "mwe-uploading-text": "Uploading text file"
1117 } );
1218
13 -mw.TimedTextEdit = function(){
14 - return this.init();
 19+mw.TimedTextEdit = function( parentTimedText ){
 20+ return this.init( parentTimedText );
1521 }
1622 mw.TimedTextEdit.prototype = {
1723 // The target container for the interface:
@@ -35,8 +41,8 @@
3642 /**
3743 * @constructor
3844 */
39 - init: function( options ){
40 -
 45+ init: function( parentTimedText ){
 46+ this.parentTimedText = parentTimedText;
4147 },
4248
4349 /**
@@ -55,9 +61,7 @@
5662 */
5763 initDialog: function(){
5864 var _this =this;
59 -
6065 _this.createTabs();
61 -
6266 },
6367
6468 /**
@@ -72,7 +76,7 @@
7377 $tabContainer.find('ul').append(
7478 $j('<li>').append(
7579 $j('<a>')
76 - .attr( 'href', '#' + edit_stage_id )
 80+ .attr( 'href', '#tab-' + edit_stage_id )
7781 .append(
7882 $j('<span style="float:left;">')
7983 .addClass( 'ui-icon ui-icon-' + editStage.icon )
@@ -85,16 +89,21 @@
8690 // Append the menu item content container
8791 $tabContainer.append(
8892 $j('<div>')
89 - .attr( 'id', edit_stage_id )
90 - .append(
91 - _this.createInterface( edit_stage_id )
92 - )
 93+ .attr( 'id', 'tab-' + edit_stage_id )
 94+ .css({
 95+ 'height': $j( window ).height() - 270
 96+ })
9397 );
9498 }
9599 //debugger
96100 // Add the tags to the target:
97101 $j( _this.target_container ).append( $tabContainer );
98102
 103+ //Create all the "interfaces"
 104+ for(var edit_stage_id in this.textEditStages){
 105+ _this.createInterface( edit_stage_id )
 106+ }
 107+
99108 //Add tabs interface
100109 $j('#TimedTextEdit-tabs').tabs( {
101110 select: function( event, ui ) {
@@ -104,8 +113,7 @@
105114
106115 },
107116 selectTab: function( tab_id ){
108 - mw.log('sel: ' + tab_id);
109 -
 117+ mw.log('sel: ' + tab_id);
110118 },
111119
112120 /**
@@ -114,8 +122,185 @@
115123 * @type {Object}
116124 */
117125 createInterface: function( edit_stage_id){
 126+ $target = $j('#tab-' + edit_stage_id);
 127+ if( this[edit_stage_id + 'Interface']){
 128+ this[ edit_stage_id + 'Interface']( $target );
 129+ }else{
 130+ $target.append( ' interface under development' );
 131+ }
 132+ },
 133+ uploadInterface: function( $target ){
 134+ var _this = this;
 135+ // Check if user has XHR file upload support & we are on the target wiki
118136
 137+ // Add Select file:
 138+ $target.append(
 139+ $j('<div>').css({
 140+ 'width':'300px',
 141+ 'float': 'left'
 142+ }).append(
 143+ '<input type="file" id="timed_text_file_upload"></input><br />'
 144+ )
 145+ )
 146+
 147+
 148+ $target.append(
 149+ //Get a little helper input filed to update the language
 150+ $j('<input id="langKey-input" type="text" maxlength="10" size="3">')
 151+ .change(function(){
 152+ var langKey = $j(this).val();
 153+ if( mw.languages[ langKey ] ){
 154+ $buttonTarget.find('.btnText').text(
 155+ unescape( mw.languages[ langKey ] )
 156+ );
 157+ }
 158+ }),
 159+ // Get a jQuery button object with language menu:
 160+ $j.button( {
 161+ 'style': { 'float' : 'left' },
 162+ 'class': 'language-select-btn',
 163+ 'text': gM('mwe-select-language'),
 164+ 'icon_id': 'triangle-1-e'
 165+ } ).attr('id', 'language-select')
 166+ .unbind()
 167+ .buttonHover()
 168+ )
 169+
 170+
 171+ var $buttonTarget = $target.find('.language-select-btn');
 172+ // Add menu container:
 173+ var loc = $buttonTarget.position();
 174+ $target.append(
 175+ $j('<div>')
 176+ .addClass('ui-widget ui-widget-content ui-corner-all')
 177+ .attr( 'id', 'upload-language-select' )
 178+ .loadingSpinner()
 179+ .css( {
 180+ 'position' : 'absolute',
 181+ 'z-index' : 10,
 182+ 'top' : ( loc.top + 40 ) + 'px',
 183+ 'left' : parseInt( loc.left ) + 'px',
 184+ 'height' : '180px',
 185+ 'width' : '180px',
 186+ 'overflow' : 'auto',
 187+ 'font-size' : '12px',
 188+ 'z-index' : 1005
 189+ } )
 190+ .hide()
 191+ );
 192+ // Add menu binding to button target
 193+ $buttonTarget.menu( {
 194+ 'content' : _this.getLanguageList(),
 195+ 'backLinkText' : gM( 'mwe-back-btn' ),
 196+ 'targetMenuContainer': '#upload-language-select'
 197+ } );
 198+
 199+
 200+ //Add upload input bindings:
 201+ $j( '#timed_text_file_upload' ).change( function( ev ) {
 202+ if ( $j(this).val() ) {
 203+ var langKey = $j(this).val().split( '.' );
 204+ var extension = langKey.pop();
 205+ langKey = langKey.pop();
 206+ if( mw.languages[ langKey ] ){
 207+ $buttonTarget.find('.btnText').text(
 208+ unescape( mw.languages[ langKey ] )
 209+ );
 210+ }
 211+ }
 212+ });
 213+
 214+ //Add an upload button:
 215+ $target.append(
 216+ $j('<div style="clear: both"></div><br /><br />'),
 217+ $j.button( {
 218+ 'style': { 'float' : 'left' },
 219+ 'text': gM('mwe-upload-file'),
 220+ 'icon_id': 'disk'
 221+ } )
 222+ .unbind()
 223+ .buttonHover()
 224+ .click( function(){
 225+ _this.uploadTextFile();
 226+ })
 227+ );
 228+
119229 },
 230+ /**
 231+ * Uploads a text file
 232+ */
 233+ uploadTextFile: function(){
 234+ //put a dialog ontop
 235+ mw.addLoaderDialog( gM( 'mwe-uploading-text') );
 236+
 237+ //Get timed text target title
 238+ // NOTE: this should be cleand up with accessors
 239+ var targetTitleKey = this.parentTimedText.embedPlayer.wikiTitleKey;
 240+
 241+ //Add TimedText NS and language key and ".srt"
 242+ targetTitleKey = 'TimedText:' + targetTitleKey + $j('#langKey-input').val() + '.srt';
 243+
 244+ //get a token
 245+ mw.getToken(targetTitleKey, function( token ){
 246+ // Get the file text
 247+
 248+ mw.log("got token: " + token);
 249+ var request = {
 250+ 'action' : 'edit',
 251+ 'title' : title,
 252+ 'text' : srt,
 253+ 'token': token
 254+ };
 255+ })
 256+ },
 257+ /**
 258+ * Gets the lanugage set.
 259+ *
 260+ * Checks off languages that area already "loaded" according to parentTimedText
 261+ *
 262+ * This is cpu intensive function
 263+ * Optimize: switch to html string building, insert and bind
 264+ * (instead of building html with jquery calls )
 265+ * Optimize: pre-sort both language lists and continue checks where we left off
 266+ *
 267+ * ~ what really a lot of time is putting this ~into~ the dom ~
 268+ */
 269+ getLanguageList: function(){
 270+ var _this = this;
 271+ var $langMenu = $j( '<ul>' );
 272+ // Loop through all supported languages:
 273+ for ( var langKey in mw.languages ) {
 274+ var language = mw.languages [ langKey ];
 275+ var source_icon = 'radio-on';
 276+ //check if the key is in the _this.parentTimedText source array
 277+ for( var i in _this.parentTimedText.textSources ){
 278+ var pSource = _this.parentTimedText.textSources[i];
 279+ if( pSource.lang == langKey){
 280+ source_icon = 'bullet';
 281+ }
 282+ }
 283+ // call out to "anonymous" function to variable scope the langKey
 284+ $langMenu.append(
 285+ _this.getLangMenuItem( langKey , source_icon)
 286+ )
 287+ }
 288+ return $langMenu;
 289+ },
 290+ getLangMenuItem: function( langKey , source_icon){
 291+ return this.parentTimedText.getLi(
 292+ unescape( mw.languages[ langKey ] ),
 293+ source_icon,
 294+ function(){
 295+ mw.log( "Selected: " + langKey );
 296+ // Update the input box text
 297+ $j('#langKey-input').val( langKey );
 298+ // Update the menu item:
 299+ $j( '#language-select' ).val( unescape( mw.languages[ langKey ] ) )
 300+ } );
 301+ },
 302+ /**
 303+ * Creates the interface dialog container
 304+ */
120305 createDialogContainer: function(){
121306 var _this = this;
122307 //Setup the target container:
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.Firefogg.js
@@ -455,7 +455,7 @@
456456 }
457457
458458 // Bind the preview button
459 - $j( '#upProgressDialog .fogg_preview' ).btnBind().click( function() {
 459+ $j( '#upProgressDialog .fogg_preview' ).buttonHover().click( function() {
460460 return _this.onPreviewClick( this );
461461 });
462462 },
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js
@@ -164,7 +164,7 @@
165165 } )( jQuery );
166166
167167
168 -/*
 168+/**
169169 * Set the mediaWiki globals if unset
170170 */
171171 if ( typeof wgServer == 'undefined' )
@@ -174,9 +174,9 @@
175175 if ( typeof stylepath == 'undefined' )
176176 stylepath = '';
177177
178 -/*
179 - * Base remoteSearch Driver interface
180 - */
 178+/**
 179+* Base remoteSearch Driver interface
 180+*/
181181 mw.RemoteSearchDriver = function( options ) {
182182 return this.init( options );
183183 }
@@ -826,7 +826,7 @@
827827 '</div>';
828828 $j( this.target_container ).html( o );
829829 // add simple styles:
830 - $j( this.target_container + ' .rms_search_button' ).btnBind().click( function() {
 830+ $j( this.target_container + ' .rms_search_button' ).buttonHover().click( function() {
831831 _this.showCurrentTab();
832832 } );
833833
@@ -1737,7 +1737,7 @@
17381738 $j( b_target )
17391739 .html( $j.btnHtml( gM( 'mwe-cancel' ) , 'mv_cancel_rsd', 'close' ) )
17401740 .children( '.mv_cancel_rsd' )
1741 - .btnBind()
 1741+ .buttonHover()
17421742 .click( function() {
17431743 $j( _this.target_container ).dialog( 'close' );
17441744 } );
@@ -1852,9 +1852,11 @@
18531853 } );
18541854 } );
18551855 },
1856 -
 1856+
18571857 /**
1858 - * Checks if a given content provider is local.
 1858+ * Check if a given content provider is local.
 1859+ * @param {Object} provider Provider object to be checked
 1860+ * @return
18591861 */
18601862 isProviderLocal: function( provider ) {
18611863 if ( provider.local ) {
@@ -1877,10 +1879,13 @@
18781880 * Check if the file is either a local upload, or if it has already been
18791881 * imported under the standard filename scheme.
18801882 *
 1883+ * @param {Object} resource Resouce to check for local file
 1884+ * @param {Function} callback Function to call once check is done
 1885+ *
18811886 * Calls the callback with two parameters:
18821887 * callback( resource, status )
18831888 *
1884 - * resource: a resource object pointing to the local file if there is one,
 1889+ * resource: A resource object pointing to the local file if there is one,
18851890 * or false if not
18861891 *
18871892 * status: may be 'local', 'shared', 'imported' or 'missing'
@@ -1888,11 +1893,11 @@
18891894 isFileLocallyAvailable: function( resource, callback ) {
18901895 var _this = this;
18911896 // Add a loader on top
1892 - $j.addLoaderDialog( gM( 'mwe-checking-resource' ) );
 1897+ mw.addLoaderDialog( gM( 'mwe-checking-resource' ) );
18931898
18941899 // Extend the callback, closing the loader dialog before chaining
18951900 var myCallback = function( status ) {
1896 - $j.closeLoaderDialog();
 1901+ mw.closeLoaderDialog();
18971902 if ( typeof callback == 'function' ) {
18981903 callback( status );
18991904 }
@@ -2094,7 +2099,7 @@
20952100
20962101 // Add bindings:
20972102 $j( _this.target_container + ' .rsd_import_apreview' )
2098 - .btnBind()
 2103+ .buttonHover()
20992104 .click( function() {
21002105 mw.log( " Do preview asset update" );
21012106 $j( '#rsd_import_desc' ).html( mw.loading_spinner() );
@@ -2110,7 +2115,7 @@
21112116 } );
21122117
21132118 $j( buttonPaneSelector + ' .rsd_import_doimport' )
2114 - .btnBind()
 2119+ .buttonHover()
21152120 .click( function() {
21162121 mw.log( "do import asset:" + _this.import_url_mode );
21172122 // check import mode:
@@ -2127,7 +2132,7 @@
21282133 }
21292134 } );
21302135 $j( buttonPaneSelector + ' .rsd_import_acancel' )
2131 - .btnBind()
 2136+ .buttonHover()
21322137 .click( function() {
21332138 $j( '#rsd_resource_import' ).fadeOut( "fast", function() {
21342139 $j( this ).remove();
@@ -2217,7 +2222,7 @@
22182223 doApiImport: function( resource, callback ) {
22192224 var _this = this;
22202225 mw.log( ":doApiImport:" );
2221 - $j.addLoaderDialog( gM( 'mwe-importing_asset' ) );
 2226+ mw.addLoaderDialog( gM( 'mwe-importing_asset' ) );
22222227
22232228 // Load the BaseUploadInterface:
22242229 mw.load(
@@ -2246,7 +2251,7 @@
22472252 uploader.editToken = token;
22482253
22492254 // Close the loader now that we are ready to present the progress dialog::
2250 - $j.closeLoaderDialog();
 2255+ mw.closeLoaderDialog();
22512256 uploader.doHttpUpload( {
22522257 'url': resource.src,
22532258 'filename': resource.target_resource_title,
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/jquery.dragDropFile.js
@@ -86,7 +86,7 @@
8787 '</td>' +
8888 '</tr>'
8989 );
90 - /*$j.addDialog( "upload this image", '<img width="300" src="' + files[i].getAsDataURL() + '">' +
 90+ /*mw.addDialog( "upload this image", '<img width="300" src="' + files[i].getAsDataURL() + '">' +
9191 '<br>name: ' + files[i].name + '</br>' +
9292 '<br>size: ' + files[i].fileSize + '</br>' +
9393 '<br>mime: ' + files[i].mediaType + '</br>');
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/loader.js
@@ -29,15 +29,9 @@
3030 * Note: We should move relevant parts of these style sheets to the addMedia/css folder
3131 * phase 2: We should separate out sheet sets per sub-module:
3232 */
33 -var addMediaSheets = [
34 - mw.getConfig( 'jquery_skin_path' ) + 'jquery-ui-1.7.1.custom.css',
35 - mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/styles.css'
36 -]
3733
3834 //Setup the addMediaWizard module
3935 mw.addModuleLoader( 'AddMedia.addMediaWizard', function( callback ){
40 - // Get addMedia style sheets
41 - mw.getStyleSheet( addMediaSheets );
4236 // Load all the required libs:
4337 mw.load( [
4438 [ 'mw.RemoteSearchDriver',
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -452,7 +452,7 @@
453453 if ( method != 'readyState' ) { // readyState crashes IE ( don't include )
454454 swapPlayerElement[method] = playerInterface[method];
455455 }
456 - }
 456+ }
457457
458458 // Now Swap out the video element for the embed_video obj:
459459 $j( targetElement )
@@ -2579,7 +2579,7 @@
25802580 }
25812581
25822582 $j( '#' + eid + ' .play-btn span' ).removeClass( 'ui-icon-play' ).addClass( 'ui-icon-pause' );
2583 - $j( '#' + eid + ' .play-btn' ).unbind().btnBind().click( function() {
 2583+ $j( '#' + eid + ' .play-btn' ).unbind().buttonHover().click( function() {
25842584 $j( '#' + eid ).get( 0 ).pause();
25852585 } ).attr( 'title', gM( 'mwe-pause_clip' ) );
25862586
@@ -2611,7 +2611,7 @@
26122612 var $pt = $j( '#' + eid);
26132613 // update the ctrl "paused state"
26142614 $pt.find('.play-btn span' ).removeClass( 'ui-icon-pause' ).addClass( 'ui-icon-play' );
2615 - $pt.find('.play-btn' ).unbind().btnBind().click( function() {
 2615+ $pt.find('.play-btn' ).unbind().buttonHover().click( function() {
26162616 _this.play();
26172617 } ).attr( 'title', gM( 'mwe-play_clip' ) );
26182618 },
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js
@@ -540,7 +540,7 @@
541541 _this.doEditor();
542542 return false;
543543 } ).appendTo( '#ptitle_' + this.id );
544 - $j( '.editBtn_' + this.id ).btnBind();
 544+ $j( '.editBtn_' + this.id ).buttonHover();
545545 }
546546 // render out the dividers on the timeline:
547547 this.colorPlayHead();
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/loader.js
@@ -9,7 +9,7 @@
1010 } );
1111
1212 mw.addModuleLoader( 'Sequencer', function( callback ){
13 - mw.getStyleSheet( mw.getConfig( 'jquery_skin_path' ) + 'jquery-ui-1.7.1.custom.css' );
 13+ //Get sequencer style sheet
1414 mw.getStyleSheet( mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/mv_sequence.css' );
1515 // Make sure we have the required mwEmbed libs:
1616 mw.load( [
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.RemoteSequencer.js
@@ -0,0 +1,22 @@
 2+/**
 3+* Stop-gap for php sequencer support
 4+*
 5+* Supports basic "sequencer" functionality as a javascript rewrite system.
 6+*/
 7+mw.ready( function(){
 8+ // Check page type
 9+
 10+ //"edit" page
 11+ // grab textbox text,
 12+ // set page to loading
 13+ // display sequence editor in "body" with -> full-screen link
 14+
 15+
 16+ // "view" page
 17+ // set page content to "loading"
 18+ // get wikitext of page via api
 19+ // grab xml
 20+ // update page with sequence and
 21+});
 22+
 23+alert('seq rw');
\ No newline at end of file
Index: branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.proxy.js
@@ -149,11 +149,11 @@
150150 $.proxy.proxyNotReadyDialog = function() {
151151 var buttons = { };
152152 buttons[ gM( 'mwe-re-try' ) ] = function() {
153 - $j.addLoaderDialog( gM( 'mwe-re-trying' ) );
 153+ mw.addLoaderDialog( gM( 'mwe-re-trying' ) );
154154 $.proxy.doFrameProxy( lastApiReq );
155155 }
156156 buttons[ gM( 'mwe-cancel' ) ] = function() {
157 - $j.closeLoaderDialog();
 157+ mw.closeLoaderDialog();
158158 }
159159 var pUri = mw.parseUri( $.proxy.server_frame );
160160
@@ -163,7 +163,7 @@
164164 var login_url = pUri.protocol + '://' + pUri.host;
165165 login_url += pUri.path.replace( 'MediaWiki:ApiProxy', 'Special:UserLogin' );
166166
167 - $j.addDialog(
 167+ mw.addDialog(
168168 gM( 'mwe-proxy-not-ready' ),
169169 gM( 'mwe-please-login', [ login_url, pUri.host] ) +
170170 '<p style="font-size:small">' +
Index: branches/js2-work/phase3/js/mwEmbed/modules/ClipEdit/mw.ClipEdit.js
@@ -29,7 +29,7 @@
3030 "mwe-inline-description" : "Caption",
3131 "mwe-edit-video-tools" : "Edit video tools:",
3232 "mwe-duration" : "Duration:",
33 - "mwe-layout" : "Layout:"
 33+ "mwe-layout" : "Layout"
3434 } );
3535
3636 /**
@@ -556,7 +556,7 @@
557557 } );
558558
559559 // Preview button:
560 - $j( '#' + this.target_control_display + ' .inOutPreviewClip' ).btnBind().click( function() {
 560+ $j( '#' + this.target_control_display + ' .inOutPreviewClip' ).buttonHover().click( function() {
561561 $j( '#embed_vid' ).get( 0 ).stop();
562562 $j( '#embed_vid' ).get( 0 ).play();
563563 } );
@@ -637,7 +637,7 @@
638638 case 'insert_seq':
639639 $j( b_target ).append( $j.btnHtml( gM( 'mwe-insert_into_sequence' ), 'mv_insert_sequence', 'check' ) + ' ' )
640640 .children( '.mv_insert_sequence' )
641 - .btnBind()
 641+ .buttonHover()
642642 .click( function() {
643643 _this.applyEdit();
644644 _this.controlActionsCallback['insert_seq']( _this.resource );
@@ -646,7 +646,7 @@
647647 case 'insert':
648648 $j( b_target ).append( $j.btnHtml( gM( 'mwe-insert_image_page' ), 'mv_insert_image_page', 'check' ) + ' ' )
649649 .children( '.mv_insert_image_page' )
650 - .btnBind()
 650+ .buttonHover()
651651 .click( function() {
652652 _this.applyEdit();
653653 _this.controlActionsCallback['insert']( _this.resource );
@@ -655,7 +655,7 @@
656656 case 'preview':
657657 $j( b_target ).append( $j.btnHtml( gM( 'mwe-preview_insert' ), 'mv_preview_insert', 'refresh' ) + ' ' )
658658 .children( '.mv_preview_insert' )
659 - .btnBind()
 659+ .buttonHover()
660660 .click( function() {
661661 _this.applyEdit();
662662 _this.controlActionsCallback['preview']( _this.resource );
@@ -664,7 +664,7 @@
665665 case 'cancel':
666666 $j( b_target ).append( $j.btnHtml( gM( 'mwe-cancel_image_insert' ), 'mv_cancel_img_edit', 'close' ) + ' ' )
667667 .children( '.mv_cancel_img_edit' )
668 - .btnBind()
 668+ .buttonHover()
669669 .click( function() {
670670 // no cancel action;
671671 _this.controlActionsCallback['cancel']( _this.resource );
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js
@@ -57,8 +57,10 @@
5858 */
5959 var mwDefaultConf = {
6060
 61+
6162 'enabledModules' : mwEnabledModuleList,
6263
 64+
6365 // Default skin name
6466 'skinName' : 'mvpcf',
6567
@@ -197,8 +199,8 @@
198200 //debugger;
199201
200202 setupUserConfigFlag = true;
201 - if( callback )
202 - callback();
 203+ if( callback )
 204+ callback();
203205 });
204206 }
205207
@@ -954,8 +956,7 @@
955957 }
956958
957959 // Try loading as a "file"?
958 - if( loadRequest ) {
959 - mw.log("Loading as \"file\" : " + loadRequest );
 960+ if( loadRequest ) {
960961 if( loadRequest.indexOf( '.js' ) == -1 && !mw.getScriptLoaderPath() ){
961962 mw.log( 'Error: are you sure ' + loadRequest + ' is a file ( is it missing a class path? ) ' );
962963 }
@@ -982,12 +983,11 @@
983984
984985 // Check if we can load via the "script-loader" ( mwEmbed was included via scriptLoader )
985986 if( mw.getScriptLoaderPath() ){
986 - loadStates = this.getGroupLoadState( loadSet );
987 - //if loadStates is empty issue the callback direclty:
 987+ loadStates = this.getGroupLoadState( loadSet );
988988 if( mw.isEmpty( loadStates ) ){
 989+ mw.log( 'loadMany:all classes already loaded');
989990 callback();
990 - return ;
991 - }
 991+ }
992992 }else{
993993 // Check if its a dependency set ( nested objects )
994994 if( typeof loadSet [ 0 ] == 'object' ){
@@ -1019,7 +1019,7 @@
10201020 }
10211021 // Run the parent scope callback for "loadMany"
10221022 if( loadDone ){
1023 - callback( );
 1023+ callback( loadName );
10241024 }
10251025 } );
10261026 }
@@ -1030,7 +1030,7 @@
10311031 * Groups the loadSet into a single sequential array
10321032 *
10331033 * Groups the scriptRequest where possible:
1034 - * Modules include "loader code" so they are separated
 1034+ * Modules include "loader code" so they are seperated
10351035 * into pre-condition code to be run for subsequent requests
10361036 *
10371037 * @param {Object} loadSet Loadset to return grouped
@@ -1040,7 +1040,6 @@
10411041 getGroupLoadState: function( loadSet ){
10421042 var groupedLoadSet = [];
10431043 var loadStates = { };
1044 -
10451044 // Merge load set into new groupedLoadSet
10461045 if( typeof loadSet[0] == 'object' ){
10471046 for( var i in loadSet ){
@@ -1053,15 +1052,22 @@
10541053 groupedLoadSet = loadSet;
10551054 }
10561055
1057 - // Build the loadStates Set as a single string:
 1056+ // Setup grouped loadStates Set:
10581057 var groupClassKey = '';
10591058 var coma = '';
10601059 for( var i=0; i < groupedLoadSet.length; i++ ) {
10611060 var loadName = groupedLoadSet[ i ];
1062 - //Check if its a classPath key, if so make sure it does not exist (before adding it to the grouped request)
1063 - if( this.classPaths[ loadName ] && ! mw.isset( loadName ) ) {
1064 - groupClassKey += coma + loadName
1065 - coma = ',';
 1061+ if( this.classPaths[ loadName ] ) {
 1062+ // Only add to group request if not already set:
 1063+ if ( !mw.isset( loadName ) ){
 1064+ groupClassKey += coma + loadName
 1065+ coma = ',';
 1066+ }
 1067+ // Issue a request for any dependent style sheets ( won't load if already present )
 1068+ if( typeof this.stylePaths[ loadName ] != 'undefined' ){
 1069+ mw.getStyleSheet( mw.getMwEmbedPath() + this.stylePaths[ loadName ] );
 1070+ }
 1071+
10661072 }else if( this.moduleLoaders[ loadName ] ) {
10671073 // Module loaders break up grouped script requests ( add the current groupClassKey )
10681074 if( groupClassKey != '' ){
@@ -1073,13 +1079,12 @@
10741080 }
10751081 }
10761082
1077 - // Add groupClassKey is empty return false
 1083+ // Add groupClassKey if set:
10781084 if( groupClassKey != '' ){
1079 - //return the loadStates
1080 - loadStates [ groupClassKey ] = 0;
1081 - }
 1085+ loadStates [ groupClassKey ] = 0;
 1086+ }
10821087
1083 - return loadStates;
 1088+ return loadStates;
10841089 },
10851090
10861091
@@ -1303,7 +1308,7 @@
13041309 if( !data['format'] )
13051310 data['format'] = 'json';
13061311
1307 - mw.log("run getJSON: " + url + ' data: ' + data['action'] );
 1312+ mw.log("run getJSON: " + url + ' data: ' + data['action'] + ' apiPost: ' +mw.getConfig( 'apiPostActions' ) );
13081313
13091314 if( $j.inArray( data['action'], mw.getConfig( 'apiPostActions' ) ) != -1 ){
13101315 if( ! mw.isLocalDomain( url ) ){
@@ -1359,7 +1364,7 @@
13601365 /**
13611366 * Simple api helper to grab an edit token
13621367 *
1363 - * @param title The wiki page title you want to edit
 1368+ * @param {String} [title] The wiki page title you want to edit
13641369 * @param {String} [api_url] The target API URL
13651370 * @param {callback} callback Function to pass the token to
13661371 */
@@ -1372,9 +1377,15 @@
13731378 mw.log( 'mw:getToken' );
13741379
13751380 // If no title is provided get a token for the user page:
1376 - if ( typeof title != 'string' && wgUserName ) {
1377 - title = 'User:' + wgUserName;
1378 - }
 1381+ if ( typeof title != 'string' ) {
 1382+ if( wgUserName ){
 1383+ title = 'User:' + wgUserName;
 1384+ }else{
 1385+ //Try maintalk page:
 1386+ title = 'Talk:Main_Page';
 1387+ }
 1388+ }
 1389+
13791390
13801391 var request = {
13811392 'prop': 'info',
@@ -1399,6 +1410,65 @@
14001411 */
14011412
14021413 /**
 1414+ * addLoaderDialog
 1415+ * small helper for putting a loading dialog box on top of everything
 1416+ * (helps block for request that
 1417+ *
 1418+ * @param msg text text of the loader msg
 1419+ */
 1420+ mw.addLoaderDialog = function( msg_txt ) {
 1421+ mw.addDialog( msg_txt, msg_txt + '<br>' + mw.loading_spinner() );
 1422+ }
 1423+
 1424+ /**
 1425+ * add a dialog window:
 1426+ */
 1427+ mw.addDialog = function ( title, msg_txt, btn ) {
 1428+ $j( '#mwe_tmp_loader' ).remove();
 1429+ // append the style free loader ontop:
 1430+ $j( 'body' ).append( '<div id="mwe_tmp_loader" style="display:none" title="' + title + '" >' +
 1431+ msg_txt +
 1432+ '</div>' );
 1433+ // special btn == ok gives empty give a single "oky" -> "close"
 1434+ if ( btn == 'ok' ) {
 1435+ btn[ gM( 'mwe-ok' ) ] = function() {
 1436+ $j( '#mwe_tmp_loader' ).close();
 1437+ }
 1438+ }
 1439+ // turn the loader into a real dialog loader:
 1440+ mw.load( [
 1441+ [
 1442+ '$j.ui'
 1443+ ],
 1444+ [
 1445+ '$j.ui.dialog'
 1446+ ]
 1447+ ], function() {
 1448+ $j( '#mwe_tmp_loader' ).dialog( {
 1449+ bgiframe: true,
 1450+ draggable: false,
 1451+ resizable: false,
 1452+ modal: true,
 1453+ width:400,
 1454+ buttons: btn
 1455+ } );
 1456+ } );
 1457+ }
 1458+ mw.closeLoaderDialog = function() {
 1459+ mw.load( [
 1460+ [
 1461+ '$j.ui'
 1462+ ],
 1463+ [
 1464+ '$j.ui.dialog'
 1465+ ]
 1466+ ], function() {
 1467+ $j( '#mwe_tmp_loader' ).dialog( 'destroy' ).remove();
 1468+ } );
 1469+ }
 1470+
 1471+
 1472+ /**
14031473 * Similar to php isset function checks if the variable exists.
14041474 * Does a safe check of a descendent method or variable
14051475 *
@@ -1544,7 +1614,7 @@
15451615 * @param {Function} callback Function to run once DOM and jQuery are ready
15461616 */
15471617 mw.ready = function( callback ){
1548 - mw.log('addOnloadHook:: ' );
 1618+ mw.log('addOnloadHook:: ' );
15491619 if( mwReadyFlag === false ){
15501620
15511621 // Add the callbcak to the onLoad function stack
@@ -1649,7 +1719,7 @@
16501720 * {String} url Url of the style sheet to be loaded
16511721 */
16521722 mw.getStyleSheet = function( url ) {
1653 -
 1723+ // Load a set of style sheets:
16541724 if ( typeof url == 'object' ) {
16551725 for ( var i in url ) {
16561726 mw.getStyleSheet( url[i] );
@@ -1664,9 +1734,19 @@
16651735
16661736 // Check if style sheet is already included:
16671737 var foundSheet = false;
1668 - $j( 'link' ).each( function(){
1669 - if( $j( this) .attr( 'href' ) == url )
1670 - foundSheet = true;
 1738+ $j( 'link' ).each( function(){
 1739+ var currentSheet = $j( this) .attr( 'href' );
 1740+ var sheetParts = currentSheet.split('?');
 1741+ var urlParts = url.split('?');
 1742+ //if the base url's match check the pamaters:
 1743+ if( sheetParts[0] == urlParts[0] && sheetParts[1]){
 1744+ mw.log(" sheet compare: " + sheetParts[1].split( '&' ).sort().join('') + ' != ' + urlParts[1].split('&').sort().join(''));
 1745+ //Check if url params match ( sort to do string compare )
 1746+ if( sheetParts[1].split( '&' ).sort().join('') ==
 1747+ urlParts[1].split('&').sort().join('') ){
 1748+ foundSheet = true;
 1749+ }
 1750+ }
16711751 } );
16721752 if( foundSheet ){
16731753 mw.log( 'sheet: ' + url + ' already included ' );
@@ -1874,12 +1954,13 @@
18751955
18761956 // If we're in debug mode, get a fresh unique request key and pass on "debug" param
18771957 if ( mw.parseUri( mwEmbedSrc ).queryKey['debug'] == 'true' ) {
1878 - mw.setConfig( 'debug', true );
 1958+
 1959+ mw.setConfig( 'debug', true );
18791960 var d = new Date();
18801961 req_param += 'urid=' + d.getTime() + '&debug=true';
1881 -
1882 - } else if ( urid ) { // Just pass on the existing urid:
1883 -
 1962+
 1963+ } else if ( urid ) {
 1964+ // Just pass on the existing urid:
18841965 req_param += 'urid=' + urid;
18851966 } else {
18861967 // Otherwise, Use the mwEmbed version
@@ -2066,7 +2147,7 @@
20672148 return ;
20682149 mwSetupFlag = true;
20692150
2070 - mw.log( 'mw:setupMwEmbed' );
 2151+ mw.log( 'mw:setupMwEmbed :: ' + mw.getMwEmbedSrc() );
20712152
20722153 // Make sure jQuery is loaded
20732154 mw.load( 'window.jQuery', function(){
@@ -2076,17 +2157,18 @@
20772158 }
20782159
20792160 mw.log(" loadded all ~loaders~ " );
2080 -
 2161+
 2162+ mw.setConfig( 'jquery_skin_path', mw.getMwEmbedPath() + 'jquery/jquery.ui/themes/' + mw.getConfig( 'jui_skin' ) + '/' );
 2163+
20812164 // Only load jquery ui theme sheet if ui-widget does not exist.
2082 - if( ! mw.styleRuleExists( 'ui-widget' ) ){
2083 - mw.setConfig( 'jquery_skin_path', mw.getMwEmbedPath() + 'jquery/jquery.ui/themes/' + mw.getConfig( 'jui_skin' ) + '/' );
 2165+ if( ! mw.styleRuleExists( 'ui-widget' ) ){
 2166+ mw.getStyleSheet( mw.getConfig( 'jquery_skin_path' ) + 'jquery-ui-1.7.1.custom.css' );
20842167 }
20852168
20862169 mw.setConfig( 'skin_img_path', mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/images/' );
20872170 mw.setConfig( 'default_video_thumb', mw.getConfig( 'skin_img_path' ) + 'vid_default_thumb.jpg' );
20882171
2089 - // Make Core skin/style sheets are always available:
2090 - mw.getStyleSheet( mw.getConfig( 'jquery_skin_path' ) + 'jquery-ui-1.7.1.custom.css' );
 2172+ // Make Core skin/style sheets are always available:
20912173 mw.getStyleSheet( mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/styles.css' );
20922174
20932175 // Set up AJAX to not send dynamic URLs for loading scripts
@@ -2398,8 +2480,37 @@
23992481 className + '"><span class="ui-icon ui-icon-' + iconId + '" ></span>' +
24002482 '<span class="btnText">' + msg + '</span></a>';
24012483 }
 2484+ // Shortcut to jQuery button ( should replace all btnHtml with button )
 2485+ var mw_default_button_options = {
 2486+ // The class name for the button link
 2487+ 'class':'',
 2488+
 2489+ // The style properties for the button link
 2490+ 'style': { },
 2491+
 2492+ // The text of the button link
 2493+ 'text': '',
 2494+
 2495+ // The icon id that precceeds the button link:
 2496+ 'icon_id': 'carat-1-n'
 2497+ }
 2498+ $.button = function( options ) {
 2499+ var options = $j.extend( mw_default_button_options, options);
 2500+ return $j('<a>')
 2501+ .css( options.css )
 2502+ .attr( 'href', '#' )
 2503+ .addClass( 'ui-state-default ui-corner-all ui-icon_link' )
 2504+ .addClass( options['class'] )
 2505+ .append(
 2506+ $j('<span>').addClass( 'ui-icon ui-icon-' + options.icon_id ),
 2507+ $j('<span>').addClass( 'btnText' )
 2508+ .text( options.text )
 2509+ )
 2510+
 2511+ }
 2512+
24022513 // Shortcut to bind hover state
2403 - $.fn.btnBind = function() {
 2514+ $.fn.buttonHover = function() {
24042515 $j( this ).hover(
24052516 function() {
24062517 $j( this ).addClass( 'ui-state-hover' );
@@ -2429,65 +2540,7 @@
24302541 'right':'0px',
24312542 'bottom':'0px'
24322543 } );
2433 - }
2434 -
2435 - /**
2436 - * addLoaderDialog
2437 - * small helper for putting a loading dialog box on top of everything
2438 - * (helps block for request that
2439 - *
2440 - * @param msg text text of the loader msg
2441 - */
2442 - $.addLoaderDialog = function( msg_txt ) {
2443 - $.addDialog( msg_txt, msg_txt + '<br>' + mw.loading_spinner() );
2444 - }
2445 -
2446 - /**
2447 - * shortcut jquery binding to add a dialog window:
2448 - */
2449 - $.addDialog = function ( title, msg_txt, btn ) {
2450 - $( '#mwe_tmp_loader' ).remove();
2451 - // append the style free loader ontop:
2452 - $( 'body' ).append( '<div id="mwe_tmp_loader" style="display:none" title="' + title + '" >' +
2453 - msg_txt +
2454 - '</div>' );
2455 - // special btn == ok gives empty give a single "oky" -> "close"
2456 - if ( btn == 'ok' ) {
2457 - btn[ gM( 'mwe-ok' ) ] = function() {
2458 - $j( '#mwe_tmp_loader' ).close();
2459 - }
2460 - }
2461 - // turn the loader into a real dialog loader:
2462 - mw.load( [
2463 - [
2464 - '$j.ui'
2465 - ],
2466 - [
2467 - '$j.ui.dialog'
2468 - ]
2469 - ], function() {
2470 - $( '#mwe_tmp_loader' ).dialog( {
2471 - bgiframe: true,
2472 - draggable: false,
2473 - resizable: false,
2474 - modal: true,
2475 - width:400,
2476 - buttons: btn
2477 - } );
2478 - } );
2479 - }
2480 - $.closeLoaderDialog = function() {
2481 - mw.load( [
2482 - [
2483 - '$j.ui'
2484 - ],
2485 - [
2486 - '$j.ui.dialog'
2487 - ]
2488 - ], function() {
2489 - $j( '#mwe_tmp_loader' ).dialog( 'destroy' ).remove();
2490 - } );
2491 - }
 2544+ }
24922545
24932546 $.mwProxy = function( apiConf ) {
24942547 mw.load( ['mw.apiProxy'],
Index: branches/js2-work/phase3/js/editPage.js
@@ -15,7 +15,7 @@
1616 'default_query': wgTitle,
1717 'target_title': wgPageName,
1818 // Here we can setup the content provider overrides
19 - 'enabled_providers':['upload'],
 19+ 'enabled_providers':['wiki_commons'],
2020 // The local wiki API URL:
2121 'local_wiki_api_url': wgServer + wgScriptPath + '/api.php'
2222 };
@@ -41,9 +41,9 @@
4242 'execute': function() {
4343 mw.log( 'Added via wikiEditor bind' );
4444 // Display a loader ( since its triggered onClick )
45 - $j.addLoaderDialog( gM( 'mwe-loading-add-media-wiz' ) );
 45+ mw.addLoaderDialog( gM( 'mwe-loading-add-media-wiz' ) );
4646 mw.load( 'AddMedia.addMediaWizard', function(){
47 - $j.closeLoaderDialog();
 47+ mw.closeLoaderDialog();
4848 $j.addMediaWizard( amwConf );
4949 });
5050 }

Status & tagging log