Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | var urlparts = getRemoteEmbedPath(); |
8 | 8 | var mwEmbedHostPath = urlparts[0]; |
9 | 9 | var mwRemoteVersion = '1.1d'; |
10 | | -var mwUseScriptLoader = false; |
| 10 | +var mwUseScriptLoader = true; |
11 | 11 | |
12 | 12 | // Setup up request Params: |
13 | 13 | var reqParts = urlparts[1].substring( 1 ).split( '&' ); |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | // Add media wizard |
42 | 42 | if ( wgAction == 'edit' || wgAction == 'submit' ) { |
43 | 43 | loadMwEmbed( [ |
44 | | - 'remoteSearchDriver', |
| 44 | + 'mw.RemoteSearchDriver', |
45 | 45 | '$j.fn.textSelection', |
46 | 46 | '$j.ui', |
47 | 47 | '$j.ui.sortable' |
— | — | @@ -59,11 +59,24 @@ |
60 | 60 | } ); |
61 | 61 | } |
62 | 62 | |
| 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 | + |
63 | 76 | // Firefogg integration |
64 | 77 | if ( wgPageName == "Special:Upload" ) { |
65 | 78 | loadMwEmbed([ |
66 | | - 'mvBaseUploadInterface', |
67 | | - 'mvFirefogg', |
| 79 | + 'mw.BaseUploadInterface', |
| 80 | + 'mw.Firefogg', |
68 | 81 | '$j.ui', |
69 | 82 | '$j.ui.progressbar', |
70 | 83 | '$j.ui.dialog', |
— | — | @@ -90,8 +103,21 @@ |
91 | 104 | vidIdList.push( divs[i].getAttribute( "id" ) ); |
92 | 105 | } |
93 | 106 | } |
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 | + ]; |
96 | 122 | // Quick sniff use java if IE and native if firefox |
97 | 123 | // ( other browsers will run detect and get on-demand ) |
98 | 124 | if (navigator.userAgent.indexOf("MSIE") != -1) |
— | — | @@ -197,7 +223,7 @@ |
198 | 224 | if ( vidIdList.length != 0 ) { |
199 | 225 | setTimeout( function() { |
200 | 226 | procVidId( vidIdList.pop() ) |
201 | | - }, 1 ); |
| 227 | + }, 1 ); |
202 | 228 | } |
203 | 229 | |
204 | 230 | } |
— | — | @@ -223,7 +249,7 @@ |
224 | 250 | scriptPath = s.src.replace( '/mediaWiki.js', '' ) |
225 | 251 | } |
226 | 252 | // Use the external_media_wizard path: |
227 | | - return [scriptPath + '/../../', reqStr]; |
| 253 | + return [scriptPath + '/../..', reqStr]; |
228 | 254 | } |
229 | 255 | } |
230 | 256 | } |
Index: branches/js2-work/phase3/js/mwEmbed/tests/Add_Media_Wizard.html |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | //we only enabled commons |
30 | 30 | //(since javascript includes from other servers would be problamatic ) in a default install |
31 | 31 | //** but you can set this to 'all' to pull from multiple repositories |
32 | | - 'enabled_providers' : ['all'], |
| 32 | + 'enabled_providers' : ['wiki_commons'], |
33 | 33 | |
34 | 34 | //the local wiki api url: |
35 | 35 | 'local_wiki_api_url': 'none' |
Index: branches/js2-work/phase3/js/mwEmbed/includes/maintenance/mergeJavascriptMsg.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | if ( $messages['en'][$k] != $v ) { |
133 | 133 | $doReplaceFlag = true; |
134 | 134 | 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"; |
136 | 136 | } |
137 | 137 | // add the actual value: (replace new lines (not compatible json) |
138 | 138 | // $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 @@ |
13 | 13 | |
14 | 14 | $messages['en'] = array( |
15 | 15 | /* |
16 | | - * js file: /libClipEdit/mvClipEdit.js |
| 16 | + * js file: /modules/EmbedPlayer/mw.EmbedPlayer.js |
17 | 17 | */ |
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', |
44 | 72 | |
45 | 73 | /* |
46 | | - * js file: /libTimedText/mvTimeTextEdit.js |
| 74 | + * js file: /modules/Sequencer/mw.Sequencer.js |
47 | 75 | */ |
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 | | - */ |
79 | 76 | 'mwe-menu_clipedit' => 'Edit media', |
80 | 77 | 'mwe-menu_transition' => 'Transitions and effects', |
81 | 78 | 'mwe-menu_cliplib' => 'Add media', |
— | — | @@ -111,23 +108,49 @@ |
112 | 109 | '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>).', |
113 | 110 | |
114 | 111 | /* |
115 | | - * js file: /mwEmbed.js |
| 112 | + * js file: /modules/Sequencer/mw.TimedEffectsEdit.js |
116 | 113 | */ |
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', |
128 | 121 | |
129 | 122 | /* |
130 | | - * js file: /libMwApi/mw.proxy.js |
| 123 | + * js file: /modules/ClipEdit/mw.ClipEdit.js |
131 | 124 | */ |
| 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 | + */ |
132 | 155 | 'mwe-setting-up-proxy' => 'Setting up proxy...', |
133 | 156 | 'mwe-re-try' => 'Retry API request', |
134 | 157 | 'mwe-re-trying' => 'Retrying API request...', |
— | — | @@ -136,103 +159,58 @@ |
137 | 160 | 'mwe-remember-loging' => 'General security reminder: Only login to web sites when your address bar displays that site\'s address.', |
138 | 161 | |
139 | 162 | /* |
140 | | - * js file: /libAddMedia/mvFirefogg.js |
| 163 | + * js file: /modules/TimedText/mw.TimedTextEdit.js |
141 | 164 | */ |
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', |
157 | 174 | |
158 | 175 | /* |
159 | | - * js file: /libAddMedia/searchLibs/baseRemoteSearch.js |
| 176 | + * js file: /modules/TimedText/mw.TimedText.js |
160 | 177 | */ |
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', |
162 | 201 | |
163 | 202 | /* |
164 | | - * js file: /libAddMedia/searchLibs/metavidSearch.js |
| 203 | + * js file: /modules/TimedText/old_mvTimeTextEdit.js |
165 | 204 | */ |
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...', |
167 | 211 | |
168 | 212 | /* |
169 | | - * js file: /libAddMedia/mvAdvFirefogg.js |
| 213 | + * js file: /modules/AddMedia/mw.RemoteSearchDriver.js |
170 | 214 | */ |
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 | | - */ |
237 | 215 | 'mwe-add_media_wizard' => 'Add media wizard', |
238 | 216 | 'mwe-media_search' => 'Media search', |
239 | 217 | 'rsd_box_layout' => 'Box layout', |
— | — | @@ -281,6 +259,8 @@ |
282 | 260 | 'mwe-ftype-unk' => 'Unknown file format', |
283 | 261 | 'rsd-wiki_commons-title' => 'Wikimedia Commons', |
284 | 262 | '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', |
285 | 265 | 'rsd-this_wiki-title' => 'This wiki', |
286 | 266 | 'rsd-this_wiki-desc' => 'The local wiki install', |
287 | 267 | 'rsd-archive_org-title' => 'Archive.org', |
— | — | @@ -289,24 +269,11 @@ |
290 | 270 | 'rsd-flickr-desc' => 'Flickr.com, a online photo sharing site', |
291 | 271 | 'rsd-metavid-title' => 'Metavid.org', |
292 | 272 | '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', |
293 | 274 | |
294 | 275 | /* |
295 | | - * js file: /libAddMedia/simpleUploadForm.js |
| 276 | + * js file: /modules/AddMedia/mw.BaseUploadInterface.js |
296 | 277 | */ |
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 | | - */ |
311 | 278 | 'mwe-upload-transcode-in-progress' => 'Transcode and upload in progress (do not close this window)', |
312 | 279 | 'mwe-upload-in-progress' => 'Upload in progress (do not close this window)', |
313 | 280 | 'mwe-upload-transcoded-status' => 'Transcoded', |
— | — | @@ -331,74 +298,152 @@ |
332 | 299 | '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>).', |
333 | 300 | |
334 | 301 | /* |
335 | | - * js file: /libAddMedia/dragDropFile.js |
| 302 | + * js file: /modules/AddMedia/jquery.simpleUploadForm.js |
336 | 303 | */ |
| 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 | + */ |
337 | 348 | 'mwe-upload-multi' => 'Upload {{PLURAL:$1|file|files}}', |
338 | 349 | 'mwe-review-upload' => 'Review file {{PLURAL:$1|upload|uploads}}', |
339 | 350 | |
340 | 351 | /* |
341 | | - * js file: /skins/kskin/kskin.js |
| 352 | + * js file: /modules/AddMedia/mw.FirefoggGUI.js |
342 | 353 | */ |
| 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 | + */ |
343 | 439 | 'mwe-credit-title' => 'Title: $1', |
344 | 440 | 'mwe-kaltura-platform-title' => 'Kaltura open source video platform', |
345 | 441 | |
346 | 442 | /* |
347 | | - * js file: /libEmbedPlayer/embedPlayer.js |
| 443 | + * js file: /tests/testLang.js |
348 | 444 | */ |
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}}', |
403 | 448 | ); |
404 | 449 | |
405 | 450 | /** Message documentation (Message documentation) |
Index: branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/styles.css |
— | — | @@ -528,6 +528,9 @@ |
529 | 529 | margin:0 0 6px 35px; |
530 | 530 | padding:0; |
531 | 531 | } |
| 532 | +.related_vids a{ |
| 533 | + color:#FAFAFA; |
| 534 | +} |
532 | 535 | |
533 | 536 | .related_vids li div { |
534 | 537 | float:right; |
Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js |
— | — | @@ -140,7 +140,7 @@ |
141 | 141 | $target = $j( '#' + embedObj.id ); |
142 | 142 | |
143 | 143 | // 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() { |
145 | 145 | embedObj.play(); |
146 | 146 | } ); |
147 | 147 | |
— | — | @@ -186,17 +186,17 @@ |
187 | 187 | |
188 | 188 | |
189 | 189 | // Captions binding: |
190 | | - $target.find( '.timed-text' ).unbind().btnBind().click( function() { |
| 190 | + $target.find( '.timed-text' ).unbind().buttonHover().click( function() { |
191 | 191 | embedObj.showTextInterface(); |
192 | 192 | } ); |
193 | 193 | |
194 | 194 | // Options binding: |
195 | | - $target.find( '.options-btn' ).unbind().btnBind().click( function() { |
| 195 | + $target.find( '.options-btn' ).unbind().buttonHover().click( function() { |
196 | 196 | embedObj.doOptionsHTML(); |
197 | 197 | } ); |
198 | 198 | |
199 | 199 | // Fullscreen binding: |
200 | | - $target.find( '.fullscreen-btn' ).unbind().btnBind().click( function() { |
| 200 | + $target.find( '.fullscreen-btn' ).unbind().buttonHover().click( function() { |
201 | 201 | embedObj.fullscreen(); |
202 | 202 | } ); |
203 | 203 | |
— | — | @@ -334,7 +334,7 @@ |
335 | 335 | var embedObj = this.embedObj; |
336 | 336 | var _this = this; |
337 | 337 | var $target = $j( '#' + embedObj.id ); |
338 | | - $target.find( '.volume_control' ).unbind().btnBind().click( function() { |
| 338 | + $target.find( '.volume_control' ).unbind().buttonHover().click( function() { |
339 | 339 | mw.log( 'clicked volume control' ); |
340 | 340 | $j( '#' + embedObj.id ).get( 0 ).toggleMute(); |
341 | 341 | } ); |
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 @@ |
21 | 21 | |
22 | 22 | $.fn.menu = function( options ){ |
23 | 23 | var caller = this; |
24 | | - var options = options; |
25 | | - |
| 24 | + var options = options; |
26 | 25 | if( ! caller.m ){ |
27 | 26 | caller.m = new Menu(caller, options); |
28 | 27 | allUIMenus.push( caller.m ); |
— | — | @@ -54,7 +53,9 @@ |
55 | 54 | |
56 | 55 | //Else process the request: |
57 | 56 | if( options == 'show' ) |
58 | | - caller.m.showMenu(); |
| 57 | + caller.m.showMenu(); |
| 58 | + |
| 59 | + return this; |
59 | 60 | }; |
60 | 61 | |
61 | 62 | function Menu(caller, options){ |
— | — | @@ -310,7 +311,7 @@ |
311 | 312 | clearTimeout(hideTimer); |
312 | 313 | var subList = $(this).next(); |
313 | 314 | 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 }); }; |
315 | 316 | showTimer = setTimeout(function(){ |
316 | 317 | subList.addClass('ui-widget-content').show(options.showSpeed).attr('aria-expanded', 'true'); |
317 | 318 | }, 300); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | |
33 | 33 | "mwe-loading-text" : "Loading text ...", |
34 | 34 | |
35 | | - "mwe-key-language": "($1) $2", |
| 35 | + "mwe-key-language": "$1, $2", |
36 | 36 | |
37 | 37 | "mwe-textcat-cc" : "Captions", |
38 | 38 | "mwe-textcat-sub" : "Subtitles", |
— | — | @@ -175,7 +175,9 @@ |
176 | 176 | setupTextSources: function( callback ){ |
177 | 177 | var _this = this; |
178 | 178 | if( this.textSourceSetupFlag ){ |
179 | | - callback(); |
| 179 | + if( callback ){ |
| 180 | + callback(); |
| 181 | + } |
180 | 182 | return ; |
181 | 183 | } |
182 | 184 | // Load textSources |
— | — | @@ -196,10 +198,10 @@ |
197 | 199 | |
198 | 200 | /** |
199 | 201 | * Binds the timed text menu |
200 | | - * and updates its content from "getMenu" |
| 202 | + * and updates its content from "getMainMenu" |
201 | 203 | * |
202 | 204 | * @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 |
204 | 206 | */ |
205 | 207 | bindMenu: function( target , autoShow){ |
206 | 208 | var _this = this; |
— | — | @@ -213,24 +215,16 @@ |
214 | 216 | _this.setupTextSources( function(){ |
215 | 217 | // NOTE: Button target should be an option or config |
216 | 218 | $menuButton.unbind().menu( { |
217 | | - 'content' : _this.getMenu(), |
| 219 | + 'content' : _this.getMainMenu(), |
218 | 220 | 'crumbDefaultText' : ' ', |
219 | 221 | 'targetMenuContainer' : _this.menuTarget, |
220 | 222 | 'autoShow' : autoShow, |
221 | 223 | 'backLinkText' : gM( 'mwe-back-btn' ) |
222 | 224 | } ); |
223 | 225 | }); |
224 | | - }, |
| 226 | + }, |
225 | 227 | |
226 | 228 | /** |
227 | | - * Refresh the menu |
228 | | - */ |
229 | | - refreshMenu: function( ){ |
230 | | - // update the menu |
231 | | - this.bindMenu( this.menuTarget, false ); |
232 | | - }, |
233 | | - |
234 | | - /** |
235 | 229 | * Monitor video time and update timed text filed[s] |
236 | 230 | */ |
237 | 231 | monitor: function( ){ |
— | — | @@ -404,7 +398,7 @@ |
405 | 399 | * [ All videos ] |
406 | 400 | * [ Chapters ] seek to chapter |
407 | 401 | */ |
408 | | - getMenu: function(){ |
| 402 | + getMainMenu: function(){ |
409 | 403 | var _this = this; |
410 | 404 | |
411 | 405 | |
— | — | @@ -422,10 +416,7 @@ |
423 | 417 | ), |
424 | 418 | |
425 | 419 | // 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') |
430 | 421 | ); |
431 | 422 | } |
432 | 423 | // Put in the "Make Transcript" link |
— | — | @@ -443,12 +434,12 @@ |
444 | 435 | showTimedTextEditUI: function( mode ){ |
445 | 436 | var _this = this; |
446 | 437 | // Show a loader: |
447 | | - $j.addLoaderDialog( gM( 'mwe-loading-text-edit' )); |
| 438 | + mw.addLoaderDialog( gM( 'mwe-loading-text-edit' )); |
448 | 439 | // Load the timedText edit interface |
449 | 440 | mw.load( 'TimedText.Edit', function(){ |
450 | | - $j.closeLoaderDialog(); |
| 441 | + mw.closeLoaderDialog(); |
451 | 442 | if( ! _this.editText ){ |
452 | | - _this.editText = new mw.TimedTextEdit(); |
| 443 | + _this.editText = new mw.TimedTextEdit( _this ); |
453 | 444 | } |
454 | 445 | _this.editText.showUI(); |
455 | 446 | }) |
— | — | @@ -477,10 +468,10 @@ |
478 | 469 | getLiSource: function( source ){ |
479 | 470 | var _this = this; |
480 | 471 | //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'; |
482 | 473 | |
483 | 474 | if( source.title ){ |
484 | | - return this.getLi( source.title, sourceIcon, function(){ |
| 475 | + return this.getLi( source.title, source_icon, function(){ |
485 | 476 | mw.log(" call selectTextSource"); |
486 | 477 | _this.selectTextSource( source ); |
487 | 478 | }); |
— | — | @@ -491,7 +482,7 @@ |
492 | 483 | _this.getLanguageName ( langKey ); |
493 | 484 | return this.getLi( |
494 | 485 | gM('mwe-key-language', [langKey, unescape( mw.languages[ source.lang ] ) ] ), |
495 | | - sourceIcon, |
| 486 | + source_icon, |
496 | 487 | function(){ |
497 | 488 | mw.log(" call selectTextSource"); |
498 | 489 | _this.selectTextSource( source ); |
— | — | @@ -536,7 +527,7 @@ |
537 | 528 | var layoutOptions = [ ]; |
538 | 529 | |
539 | 530 | //Only display the "ontop" option if the player supports it: |
540 | | - if( this.embedPlayer.supports['overlays'] ) |
| 531 | + if( this.embedPlayer.supports[ 'overlays' ] ) |
541 | 532 | layoutOptions.push( 'ontop' ); |
542 | 533 | |
543 | 534 | //Add below and "off" options: |
— | — | @@ -626,7 +617,7 @@ |
627 | 618 | // Empyt out previus text to force an interface update: |
628 | 619 | this.prevText = []; |
629 | 620 | // Refresh the Menu: |
630 | | - this.refreshMenu(); |
| 621 | + this.bindMenu( this.menuTarget, false ); |
631 | 622 | // Issues a "monitor" command to update the timed text for the new layout |
632 | 623 | this.monitor(); |
633 | 624 | }, |
— | — | @@ -711,7 +702,7 @@ |
712 | 703 | if( text === this.prevText[ source.category ] ) |
713 | 704 | return ; |
714 | 705 | |
715 | | - mw.log( 'updateTextDisplay: ' + text ); |
| 706 | + //mw.log( 'updateTextDisplay: ' + text ); |
716 | 707 | |
717 | 708 | var $player = $j( '#' + this.embedPlayer.id); |
718 | 709 | var $textTarget = $player.find( '.itext_' + source.category + ' span' ); |
— | — | @@ -734,7 +725,7 @@ |
735 | 726 | // Update text ( use "html" instead of "text" so that parsers can swap in html for formating |
736 | 727 | $textTarget.html( text ); |
737 | 728 | } |
738 | | - mw.log( ' len: ' + $textTarget.length + ' ' + $textTarget.html() ); |
| 729 | + //mw.log( ' len: ' + $textTarget.length + ' ' + $textTarget.html() ); |
739 | 730 | // Update the prev text: |
740 | 731 | this.prevText[ source.category ] = text; |
741 | 732 | }, |
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/old_mvTimeTextEdit.js |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | 'title' : title, |
115 | 115 | 'text' : srt, |
116 | 116 | 'token': editToken |
117 | | - }; |
| 117 | + }; |
118 | 118 | mw.getJSON( request, function( dialog ) { |
119 | 119 | return function( result ) { |
120 | 120 | 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 @@ |
171 | 171 | background: #ffd; |
172 | 172 | border:none; |
173 | 173 | } |
174 | | - |
| 174 | +/* |
175 | 175 | .TimedTextEdit input[type=text] |
176 | 176 | { |
177 | 177 | background: #ffd; |
178 | | - border:none; |
179 | | - width:70%; |
| 178 | + border:none; |
180 | 179 | } |
| 180 | +*/ |
181 | 181 | |
182 | 182 | .TimedTextEdit .hotkeybox { |
183 | 183 | background: #333; |
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js |
— | — | @@ -6,11 +6,17 @@ |
7 | 7 | "mwe-stage-transcribe" : "Transcribe", |
8 | 8 | "mwe-stage-sync" : "Sync", |
9 | 9 | "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" |
11 | 17 | } ); |
12 | 18 | |
13 | | -mw.TimedTextEdit = function(){ |
14 | | - return this.init(); |
| 19 | +mw.TimedTextEdit = function( parentTimedText ){ |
| 20 | + return this.init( parentTimedText ); |
15 | 21 | } |
16 | 22 | mw.TimedTextEdit.prototype = { |
17 | 23 | // The target container for the interface: |
— | — | @@ -35,8 +41,8 @@ |
36 | 42 | /** |
37 | 43 | * @constructor |
38 | 44 | */ |
39 | | - init: function( options ){ |
40 | | - |
| 45 | + init: function( parentTimedText ){ |
| 46 | + this.parentTimedText = parentTimedText; |
41 | 47 | }, |
42 | 48 | |
43 | 49 | /** |
— | — | @@ -55,9 +61,7 @@ |
56 | 62 | */ |
57 | 63 | initDialog: function(){ |
58 | 64 | var _this =this; |
59 | | - |
60 | 65 | _this.createTabs(); |
61 | | - |
62 | 66 | }, |
63 | 67 | |
64 | 68 | /** |
— | — | @@ -72,7 +76,7 @@ |
73 | 77 | $tabContainer.find('ul').append( |
74 | 78 | $j('<li>').append( |
75 | 79 | $j('<a>') |
76 | | - .attr( 'href', '#' + edit_stage_id ) |
| 80 | + .attr( 'href', '#tab-' + edit_stage_id ) |
77 | 81 | .append( |
78 | 82 | $j('<span style="float:left;">') |
79 | 83 | .addClass( 'ui-icon ui-icon-' + editStage.icon ) |
— | — | @@ -85,16 +89,21 @@ |
86 | 90 | // Append the menu item content container |
87 | 91 | $tabContainer.append( |
88 | 92 | $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 | + }) |
93 | 97 | ); |
94 | 98 | } |
95 | 99 | //debugger |
96 | 100 | // Add the tags to the target: |
97 | 101 | $j( _this.target_container ).append( $tabContainer ); |
98 | 102 | |
| 103 | + //Create all the "interfaces" |
| 104 | + for(var edit_stage_id in this.textEditStages){ |
| 105 | + _this.createInterface( edit_stage_id ) |
| 106 | + } |
| 107 | + |
99 | 108 | //Add tabs interface |
100 | 109 | $j('#TimedTextEdit-tabs').tabs( { |
101 | 110 | select: function( event, ui ) { |
— | — | @@ -104,8 +113,7 @@ |
105 | 114 | |
106 | 115 | }, |
107 | 116 | selectTab: function( tab_id ){ |
108 | | - mw.log('sel: ' + tab_id); |
109 | | - |
| 117 | + mw.log('sel: ' + tab_id); |
110 | 118 | }, |
111 | 119 | |
112 | 120 | /** |
— | — | @@ -114,8 +122,185 @@ |
115 | 123 | * @type {Object} |
116 | 124 | */ |
117 | 125 | 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 |
118 | 136 | |
| 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 | + |
119 | 229 | }, |
| 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 | + */ |
120 | 305 | createDialogContainer: function(){ |
121 | 306 | var _this = this; |
122 | 307 | //Setup the target container: |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.Firefogg.js |
— | — | @@ -455,7 +455,7 @@ |
456 | 456 | } |
457 | 457 | |
458 | 458 | // Bind the preview button |
459 | | - $j( '#upProgressDialog .fogg_preview' ).btnBind().click( function() { |
| 459 | + $j( '#upProgressDialog .fogg_preview' ).buttonHover().click( function() { |
460 | 460 | return _this.onPreviewClick( this ); |
461 | 461 | }); |
462 | 462 | }, |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js |
— | — | @@ -164,7 +164,7 @@ |
165 | 165 | } )( jQuery ); |
166 | 166 | |
167 | 167 | |
168 | | -/* |
| 168 | +/** |
169 | 169 | * Set the mediaWiki globals if unset |
170 | 170 | */ |
171 | 171 | if ( typeof wgServer == 'undefined' ) |
— | — | @@ -174,9 +174,9 @@ |
175 | 175 | if ( typeof stylepath == 'undefined' ) |
176 | 176 | stylepath = ''; |
177 | 177 | |
178 | | -/* |
179 | | - * Base remoteSearch Driver interface |
180 | | - */ |
| 178 | +/** |
| 179 | +* Base remoteSearch Driver interface |
| 180 | +*/ |
181 | 181 | mw.RemoteSearchDriver = function( options ) { |
182 | 182 | return this.init( options ); |
183 | 183 | } |
— | — | @@ -826,7 +826,7 @@ |
827 | 827 | '</div>'; |
828 | 828 | $j( this.target_container ).html( o ); |
829 | 829 | // 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() { |
831 | 831 | _this.showCurrentTab(); |
832 | 832 | } ); |
833 | 833 | |
— | — | @@ -1737,7 +1737,7 @@ |
1738 | 1738 | $j( b_target ) |
1739 | 1739 | .html( $j.btnHtml( gM( 'mwe-cancel' ) , 'mv_cancel_rsd', 'close' ) ) |
1740 | 1740 | .children( '.mv_cancel_rsd' ) |
1741 | | - .btnBind() |
| 1741 | + .buttonHover() |
1742 | 1742 | .click( function() { |
1743 | 1743 | $j( _this.target_container ).dialog( 'close' ); |
1744 | 1744 | } ); |
— | — | @@ -1852,9 +1852,11 @@ |
1853 | 1853 | } ); |
1854 | 1854 | } ); |
1855 | 1855 | }, |
1856 | | - |
| 1856 | + |
1857 | 1857 | /** |
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 |
1859 | 1861 | */ |
1860 | 1862 | isProviderLocal: function( provider ) { |
1861 | 1863 | if ( provider.local ) { |
— | — | @@ -1877,10 +1879,13 @@ |
1878 | 1880 | * Check if the file is either a local upload, or if it has already been |
1879 | 1881 | * imported under the standard filename scheme. |
1880 | 1882 | * |
| 1883 | + * @param {Object} resource Resouce to check for local file |
| 1884 | + * @param {Function} callback Function to call once check is done |
| 1885 | + * |
1881 | 1886 | * Calls the callback with two parameters: |
1882 | 1887 | * callback( resource, status ) |
1883 | 1888 | * |
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, |
1885 | 1890 | * or false if not |
1886 | 1891 | * |
1887 | 1892 | * status: may be 'local', 'shared', 'imported' or 'missing' |
— | — | @@ -1888,11 +1893,11 @@ |
1889 | 1894 | isFileLocallyAvailable: function( resource, callback ) { |
1890 | 1895 | var _this = this; |
1891 | 1896 | // Add a loader on top |
1892 | | - $j.addLoaderDialog( gM( 'mwe-checking-resource' ) ); |
| 1897 | + mw.addLoaderDialog( gM( 'mwe-checking-resource' ) ); |
1893 | 1898 | |
1894 | 1899 | // Extend the callback, closing the loader dialog before chaining |
1895 | 1900 | var myCallback = function( status ) { |
1896 | | - $j.closeLoaderDialog(); |
| 1901 | + mw.closeLoaderDialog(); |
1897 | 1902 | if ( typeof callback == 'function' ) { |
1898 | 1903 | callback( status ); |
1899 | 1904 | } |
— | — | @@ -2094,7 +2099,7 @@ |
2095 | 2100 | |
2096 | 2101 | // Add bindings: |
2097 | 2102 | $j( _this.target_container + ' .rsd_import_apreview' ) |
2098 | | - .btnBind() |
| 2103 | + .buttonHover() |
2099 | 2104 | .click( function() { |
2100 | 2105 | mw.log( " Do preview asset update" ); |
2101 | 2106 | $j( '#rsd_import_desc' ).html( mw.loading_spinner() ); |
— | — | @@ -2110,7 +2115,7 @@ |
2111 | 2116 | } ); |
2112 | 2117 | |
2113 | 2118 | $j( buttonPaneSelector + ' .rsd_import_doimport' ) |
2114 | | - .btnBind() |
| 2119 | + .buttonHover() |
2115 | 2120 | .click( function() { |
2116 | 2121 | mw.log( "do import asset:" + _this.import_url_mode ); |
2117 | 2122 | // check import mode: |
— | — | @@ -2127,7 +2132,7 @@ |
2128 | 2133 | } |
2129 | 2134 | } ); |
2130 | 2135 | $j( buttonPaneSelector + ' .rsd_import_acancel' ) |
2131 | | - .btnBind() |
| 2136 | + .buttonHover() |
2132 | 2137 | .click( function() { |
2133 | 2138 | $j( '#rsd_resource_import' ).fadeOut( "fast", function() { |
2134 | 2139 | $j( this ).remove(); |
— | — | @@ -2217,7 +2222,7 @@ |
2218 | 2223 | doApiImport: function( resource, callback ) { |
2219 | 2224 | var _this = this; |
2220 | 2225 | mw.log( ":doApiImport:" ); |
2221 | | - $j.addLoaderDialog( gM( 'mwe-importing_asset' ) ); |
| 2226 | + mw.addLoaderDialog( gM( 'mwe-importing_asset' ) ); |
2222 | 2227 | |
2223 | 2228 | // Load the BaseUploadInterface: |
2224 | 2229 | mw.load( |
— | — | @@ -2246,7 +2251,7 @@ |
2247 | 2252 | uploader.editToken = token; |
2248 | 2253 | |
2249 | 2254 | // Close the loader now that we are ready to present the progress dialog:: |
2250 | | - $j.closeLoaderDialog(); |
| 2255 | + mw.closeLoaderDialog(); |
2251 | 2256 | uploader.doHttpUpload( { |
2252 | 2257 | 'url': resource.src, |
2253 | 2258 | 'filename': resource.target_resource_title, |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/jquery.dragDropFile.js |
— | — | @@ -86,7 +86,7 @@ |
87 | 87 | '</td>' + |
88 | 88 | '</tr>' |
89 | 89 | ); |
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() + '">' + |
91 | 91 | '<br>name: ' + files[i].name + '</br>' + |
92 | 92 | '<br>size: ' + files[i].fileSize + '</br>' + |
93 | 93 | '<br>mime: ' + files[i].mediaType + '</br>'); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/loader.js |
— | — | @@ -29,15 +29,9 @@ |
30 | 30 | * Note: We should move relevant parts of these style sheets to the addMedia/css folder |
31 | 31 | * phase 2: We should separate out sheet sets per sub-module: |
32 | 32 | */ |
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 | | -] |
37 | 33 | |
38 | 34 | //Setup the addMediaWizard module |
39 | 35 | mw.addModuleLoader( 'AddMedia.addMediaWizard', function( callback ){ |
40 | | - // Get addMedia style sheets |
41 | | - mw.getStyleSheet( addMediaSheets ); |
42 | 36 | // Load all the required libs: |
43 | 37 | mw.load( [ |
44 | 38 | [ 'mw.RemoteSearchDriver', |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -452,7 +452,7 @@ |
453 | 453 | if ( method != 'readyState' ) { // readyState crashes IE ( don't include ) |
454 | 454 | swapPlayerElement[method] = playerInterface[method]; |
455 | 455 | } |
456 | | - } |
| 456 | + } |
457 | 457 | |
458 | 458 | // Now Swap out the video element for the embed_video obj: |
459 | 459 | $j( targetElement ) |
— | — | @@ -2579,7 +2579,7 @@ |
2580 | 2580 | } |
2581 | 2581 | |
2582 | 2582 | $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() { |
2584 | 2584 | $j( '#' + eid ).get( 0 ).pause(); |
2585 | 2585 | } ).attr( 'title', gM( 'mwe-pause_clip' ) ); |
2586 | 2586 | |
— | — | @@ -2611,7 +2611,7 @@ |
2612 | 2612 | var $pt = $j( '#' + eid); |
2613 | 2613 | // update the ctrl "paused state" |
2614 | 2614 | $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() { |
2616 | 2616 | _this.play(); |
2617 | 2617 | } ).attr( 'title', gM( 'mwe-play_clip' ) ); |
2618 | 2618 | }, |
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js |
— | — | @@ -540,7 +540,7 @@ |
541 | 541 | _this.doEditor(); |
542 | 542 | return false; |
543 | 543 | } ).appendTo( '#ptitle_' + this.id ); |
544 | | - $j( '.editBtn_' + this.id ).btnBind(); |
| 544 | + $j( '.editBtn_' + this.id ).buttonHover(); |
545 | 545 | } |
546 | 546 | // render out the dividers on the timeline: |
547 | 547 | this.colorPlayHead(); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/loader.js |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | } ); |
11 | 11 | |
12 | 12 | 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 |
14 | 14 | mw.getStyleSheet( mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/mv_sequence.css' ); |
15 | 15 | // Make sure we have the required mwEmbed libs: |
16 | 16 | 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 @@ |
150 | 150 | $.proxy.proxyNotReadyDialog = function() { |
151 | 151 | var buttons = { }; |
152 | 152 | buttons[ gM( 'mwe-re-try' ) ] = function() { |
153 | | - $j.addLoaderDialog( gM( 'mwe-re-trying' ) ); |
| 153 | + mw.addLoaderDialog( gM( 'mwe-re-trying' ) ); |
154 | 154 | $.proxy.doFrameProxy( lastApiReq ); |
155 | 155 | } |
156 | 156 | buttons[ gM( 'mwe-cancel' ) ] = function() { |
157 | | - $j.closeLoaderDialog(); |
| 157 | + mw.closeLoaderDialog(); |
158 | 158 | } |
159 | 159 | var pUri = mw.parseUri( $.proxy.server_frame ); |
160 | 160 | |
— | — | @@ -163,7 +163,7 @@ |
164 | 164 | var login_url = pUri.protocol + '://' + pUri.host; |
165 | 165 | login_url += pUri.path.replace( 'MediaWiki:ApiProxy', 'Special:UserLogin' ); |
166 | 166 | |
167 | | - $j.addDialog( |
| 167 | + mw.addDialog( |
168 | 168 | gM( 'mwe-proxy-not-ready' ), |
169 | 169 | gM( 'mwe-please-login', [ login_url, pUri.host] ) + |
170 | 170 | '<p style="font-size:small">' + |
Index: branches/js2-work/phase3/js/mwEmbed/modules/ClipEdit/mw.ClipEdit.js |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | "mwe-inline-description" : "Caption", |
31 | 31 | "mwe-edit-video-tools" : "Edit video tools:", |
32 | 32 | "mwe-duration" : "Duration:", |
33 | | - "mwe-layout" : "Layout:" |
| 33 | + "mwe-layout" : "Layout" |
34 | 34 | } ); |
35 | 35 | |
36 | 36 | /** |
— | — | @@ -556,7 +556,7 @@ |
557 | 557 | } ); |
558 | 558 | |
559 | 559 | // Preview button: |
560 | | - $j( '#' + this.target_control_display + ' .inOutPreviewClip' ).btnBind().click( function() { |
| 560 | + $j( '#' + this.target_control_display + ' .inOutPreviewClip' ).buttonHover().click( function() { |
561 | 561 | $j( '#embed_vid' ).get( 0 ).stop(); |
562 | 562 | $j( '#embed_vid' ).get( 0 ).play(); |
563 | 563 | } ); |
— | — | @@ -637,7 +637,7 @@ |
638 | 638 | case 'insert_seq': |
639 | 639 | $j( b_target ).append( $j.btnHtml( gM( 'mwe-insert_into_sequence' ), 'mv_insert_sequence', 'check' ) + ' ' ) |
640 | 640 | .children( '.mv_insert_sequence' ) |
641 | | - .btnBind() |
| 641 | + .buttonHover() |
642 | 642 | .click( function() { |
643 | 643 | _this.applyEdit(); |
644 | 644 | _this.controlActionsCallback['insert_seq']( _this.resource ); |
— | — | @@ -646,7 +646,7 @@ |
647 | 647 | case 'insert': |
648 | 648 | $j( b_target ).append( $j.btnHtml( gM( 'mwe-insert_image_page' ), 'mv_insert_image_page', 'check' ) + ' ' ) |
649 | 649 | .children( '.mv_insert_image_page' ) |
650 | | - .btnBind() |
| 650 | + .buttonHover() |
651 | 651 | .click( function() { |
652 | 652 | _this.applyEdit(); |
653 | 653 | _this.controlActionsCallback['insert']( _this.resource ); |
— | — | @@ -655,7 +655,7 @@ |
656 | 656 | case 'preview': |
657 | 657 | $j( b_target ).append( $j.btnHtml( gM( 'mwe-preview_insert' ), 'mv_preview_insert', 'refresh' ) + ' ' ) |
658 | 658 | .children( '.mv_preview_insert' ) |
659 | | - .btnBind() |
| 659 | + .buttonHover() |
660 | 660 | .click( function() { |
661 | 661 | _this.applyEdit(); |
662 | 662 | _this.controlActionsCallback['preview']( _this.resource ); |
— | — | @@ -664,7 +664,7 @@ |
665 | 665 | case 'cancel': |
666 | 666 | $j( b_target ).append( $j.btnHtml( gM( 'mwe-cancel_image_insert' ), 'mv_cancel_img_edit', 'close' ) + ' ' ) |
667 | 667 | .children( '.mv_cancel_img_edit' ) |
668 | | - .btnBind() |
| 668 | + .buttonHover() |
669 | 669 | .click( function() { |
670 | 670 | // no cancel action; |
671 | 671 | _this.controlActionsCallback['cancel']( _this.resource ); |
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js |
— | — | @@ -57,8 +57,10 @@ |
58 | 58 | */ |
59 | 59 | var mwDefaultConf = { |
60 | 60 | |
| 61 | + |
61 | 62 | 'enabledModules' : mwEnabledModuleList, |
62 | 63 | |
| 64 | + |
63 | 65 | // Default skin name |
64 | 66 | 'skinName' : 'mvpcf', |
65 | 67 | |
— | — | @@ -197,8 +199,8 @@ |
198 | 200 | //debugger; |
199 | 201 | |
200 | 202 | setupUserConfigFlag = true; |
201 | | - if( callback ) |
202 | | - callback(); |
| 203 | + if( callback ) |
| 204 | + callback(); |
203 | 205 | }); |
204 | 206 | } |
205 | 207 | |
— | — | @@ -954,8 +956,7 @@ |
955 | 957 | } |
956 | 958 | |
957 | 959 | // Try loading as a "file"? |
958 | | - if( loadRequest ) { |
959 | | - mw.log("Loading as \"file\" : " + loadRequest ); |
| 960 | + if( loadRequest ) { |
960 | 961 | if( loadRequest.indexOf( '.js' ) == -1 && !mw.getScriptLoaderPath() ){ |
961 | 962 | mw.log( 'Error: are you sure ' + loadRequest + ' is a file ( is it missing a class path? ) ' ); |
962 | 963 | } |
— | — | @@ -982,12 +983,11 @@ |
983 | 984 | |
984 | 985 | // Check if we can load via the "script-loader" ( mwEmbed was included via scriptLoader ) |
985 | 986 | if( mw.getScriptLoaderPath() ){ |
986 | | - loadStates = this.getGroupLoadState( loadSet ); |
987 | | - //if loadStates is empty issue the callback direclty: |
| 987 | + loadStates = this.getGroupLoadState( loadSet ); |
988 | 988 | if( mw.isEmpty( loadStates ) ){ |
| 989 | + mw.log( 'loadMany:all classes already loaded'); |
989 | 990 | callback(); |
990 | | - return ; |
991 | | - } |
| 991 | + } |
992 | 992 | }else{ |
993 | 993 | // Check if its a dependency set ( nested objects ) |
994 | 994 | if( typeof loadSet [ 0 ] == 'object' ){ |
— | — | @@ -1019,7 +1019,7 @@ |
1020 | 1020 | } |
1021 | 1021 | // Run the parent scope callback for "loadMany" |
1022 | 1022 | if( loadDone ){ |
1023 | | - callback( ); |
| 1023 | + callback( loadName ); |
1024 | 1024 | } |
1025 | 1025 | } ); |
1026 | 1026 | } |
— | — | @@ -1030,7 +1030,7 @@ |
1031 | 1031 | * Groups the loadSet into a single sequential array |
1032 | 1032 | * |
1033 | 1033 | * Groups the scriptRequest where possible: |
1034 | | - * Modules include "loader code" so they are separated |
| 1034 | + * Modules include "loader code" so they are seperated |
1035 | 1035 | * into pre-condition code to be run for subsequent requests |
1036 | 1036 | * |
1037 | 1037 | * @param {Object} loadSet Loadset to return grouped |
— | — | @@ -1040,7 +1040,6 @@ |
1041 | 1041 | getGroupLoadState: function( loadSet ){ |
1042 | 1042 | var groupedLoadSet = []; |
1043 | 1043 | var loadStates = { }; |
1044 | | - |
1045 | 1044 | // Merge load set into new groupedLoadSet |
1046 | 1045 | if( typeof loadSet[0] == 'object' ){ |
1047 | 1046 | for( var i in loadSet ){ |
— | — | @@ -1053,15 +1052,22 @@ |
1054 | 1053 | groupedLoadSet = loadSet; |
1055 | 1054 | } |
1056 | 1055 | |
1057 | | - // Build the loadStates Set as a single string: |
| 1056 | + // Setup grouped loadStates Set: |
1058 | 1057 | var groupClassKey = ''; |
1059 | 1058 | var coma = ''; |
1060 | 1059 | for( var i=0; i < groupedLoadSet.length; i++ ) { |
1061 | 1060 | 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 | + |
1066 | 1072 | }else if( this.moduleLoaders[ loadName ] ) { |
1067 | 1073 | // Module loaders break up grouped script requests ( add the current groupClassKey ) |
1068 | 1074 | if( groupClassKey != '' ){ |
— | — | @@ -1073,13 +1079,12 @@ |
1074 | 1080 | } |
1075 | 1081 | } |
1076 | 1082 | |
1077 | | - // Add groupClassKey is empty return false |
| 1083 | + // Add groupClassKey if set: |
1078 | 1084 | if( groupClassKey != '' ){ |
1079 | | - //return the loadStates |
1080 | | - loadStates [ groupClassKey ] = 0; |
1081 | | - } |
| 1085 | + loadStates [ groupClassKey ] = 0; |
| 1086 | + } |
1082 | 1087 | |
1083 | | - return loadStates; |
| 1088 | + return loadStates; |
1084 | 1089 | }, |
1085 | 1090 | |
1086 | 1091 | |
— | — | @@ -1303,7 +1308,7 @@ |
1304 | 1309 | if( !data['format'] ) |
1305 | 1310 | data['format'] = 'json'; |
1306 | 1311 | |
1307 | | - mw.log("run getJSON: " + url + ' data: ' + data['action'] ); |
| 1312 | + mw.log("run getJSON: " + url + ' data: ' + data['action'] + ' apiPost: ' +mw.getConfig( 'apiPostActions' ) ); |
1308 | 1313 | |
1309 | 1314 | if( $j.inArray( data['action'], mw.getConfig( 'apiPostActions' ) ) != -1 ){ |
1310 | 1315 | if( ! mw.isLocalDomain( url ) ){ |
— | — | @@ -1359,7 +1364,7 @@ |
1360 | 1365 | /** |
1361 | 1366 | * Simple api helper to grab an edit token |
1362 | 1367 | * |
1363 | | - * @param title The wiki page title you want to edit |
| 1368 | + * @param {String} [title] The wiki page title you want to edit |
1364 | 1369 | * @param {String} [api_url] The target API URL |
1365 | 1370 | * @param {callback} callback Function to pass the token to |
1366 | 1371 | */ |
— | — | @@ -1372,9 +1377,15 @@ |
1373 | 1378 | mw.log( 'mw:getToken' ); |
1374 | 1379 | |
1375 | 1380 | // 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 | + |
1379 | 1390 | |
1380 | 1391 | var request = { |
1381 | 1392 | 'prop': 'info', |
— | — | @@ -1399,6 +1410,65 @@ |
1400 | 1411 | */ |
1401 | 1412 | |
1402 | 1413 | /** |
| 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 | + /** |
1403 | 1473 | * Similar to php isset function checks if the variable exists. |
1404 | 1474 | * Does a safe check of a descendent method or variable |
1405 | 1475 | * |
— | — | @@ -1544,7 +1614,7 @@ |
1545 | 1615 | * @param {Function} callback Function to run once DOM and jQuery are ready |
1546 | 1616 | */ |
1547 | 1617 | mw.ready = function( callback ){ |
1548 | | - mw.log('addOnloadHook:: ' ); |
| 1618 | + mw.log('addOnloadHook:: ' ); |
1549 | 1619 | if( mwReadyFlag === false ){ |
1550 | 1620 | |
1551 | 1621 | // Add the callbcak to the onLoad function stack |
— | — | @@ -1649,7 +1719,7 @@ |
1650 | 1720 | * {String} url Url of the style sheet to be loaded |
1651 | 1721 | */ |
1652 | 1722 | mw.getStyleSheet = function( url ) { |
1653 | | - |
| 1723 | + // Load a set of style sheets: |
1654 | 1724 | if ( typeof url == 'object' ) { |
1655 | 1725 | for ( var i in url ) { |
1656 | 1726 | mw.getStyleSheet( url[i] ); |
— | — | @@ -1664,9 +1734,19 @@ |
1665 | 1735 | |
1666 | 1736 | // Check if style sheet is already included: |
1667 | 1737 | 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 | + } |
1671 | 1751 | } ); |
1672 | 1752 | if( foundSheet ){ |
1673 | 1753 | mw.log( 'sheet: ' + url + ' already included ' ); |
— | — | @@ -1874,12 +1954,13 @@ |
1875 | 1955 | |
1876 | 1956 | // If we're in debug mode, get a fresh unique request key and pass on "debug" param |
1877 | 1957 | if ( mw.parseUri( mwEmbedSrc ).queryKey['debug'] == 'true' ) { |
1878 | | - mw.setConfig( 'debug', true ); |
| 1958 | + |
| 1959 | + mw.setConfig( 'debug', true ); |
1879 | 1960 | var d = new Date(); |
1880 | 1961 | 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: |
1884 | 1965 | req_param += 'urid=' + urid; |
1885 | 1966 | } else { |
1886 | 1967 | // Otherwise, Use the mwEmbed version |
— | — | @@ -2066,7 +2147,7 @@ |
2067 | 2148 | return ; |
2068 | 2149 | mwSetupFlag = true; |
2069 | 2150 | |
2070 | | - mw.log( 'mw:setupMwEmbed' ); |
| 2151 | + mw.log( 'mw:setupMwEmbed :: ' + mw.getMwEmbedSrc() ); |
2071 | 2152 | |
2072 | 2153 | // Make sure jQuery is loaded |
2073 | 2154 | mw.load( 'window.jQuery', function(){ |
— | — | @@ -2076,17 +2157,18 @@ |
2077 | 2158 | } |
2078 | 2159 | |
2079 | 2160 | mw.log(" loadded all ~loaders~ " ); |
2080 | | - |
| 2161 | + |
| 2162 | + mw.setConfig( 'jquery_skin_path', mw.getMwEmbedPath() + 'jquery/jquery.ui/themes/' + mw.getConfig( 'jui_skin' ) + '/' ); |
| 2163 | + |
2081 | 2164 | // 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' ); |
2084 | 2167 | } |
2085 | 2168 | |
2086 | 2169 | mw.setConfig( 'skin_img_path', mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/images/' ); |
2087 | 2170 | mw.setConfig( 'default_video_thumb', mw.getConfig( 'skin_img_path' ) + 'vid_default_thumb.jpg' ); |
2088 | 2171 | |
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: |
2091 | 2173 | mw.getStyleSheet( mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/styles.css' ); |
2092 | 2174 | |
2093 | 2175 | // Set up AJAX to not send dynamic URLs for loading scripts |
— | — | @@ -2398,8 +2480,37 @@ |
2399 | 2481 | className + '"><span class="ui-icon ui-icon-' + iconId + '" ></span>' + |
2400 | 2482 | '<span class="btnText">' + msg + '</span></a>'; |
2401 | 2483 | } |
| 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 | + |
2402 | 2513 | // Shortcut to bind hover state |
2403 | | - $.fn.btnBind = function() { |
| 2514 | + $.fn.buttonHover = function() { |
2404 | 2515 | $j( this ).hover( |
2405 | 2516 | function() { |
2406 | 2517 | $j( this ).addClass( 'ui-state-hover' ); |
— | — | @@ -2429,65 +2540,7 @@ |
2430 | 2541 | 'right':'0px', |
2431 | 2542 | 'bottom':'0px' |
2432 | 2543 | } ); |
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 | + } |
2492 | 2545 | |
2493 | 2546 | $.mwProxy = function( apiConf ) { |
2494 | 2547 | mw.load( ['mw.apiProxy'], |
Index: branches/js2-work/phase3/js/editPage.js |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | 'default_query': wgTitle, |
17 | 17 | 'target_title': wgPageName, |
18 | 18 | // Here we can setup the content provider overrides |
19 | | - 'enabled_providers':['upload'], |
| 19 | + 'enabled_providers':['wiki_commons'], |
20 | 20 | // The local wiki API URL: |
21 | 21 | 'local_wiki_api_url': wgServer + wgScriptPath + '/api.php' |
22 | 22 | }; |
— | — | @@ -41,9 +41,9 @@ |
42 | 42 | 'execute': function() { |
43 | 43 | mw.log( 'Added via wikiEditor bind' ); |
44 | 44 | // 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' ) ); |
46 | 46 | mw.load( 'AddMedia.addMediaWizard', function(){ |
47 | | - $j.closeLoaderDialog(); |
| 47 | + mw.closeLoaderDialog(); |
48 | 48 | $j.addMediaWizard( amwConf ); |
49 | 49 | }); |
50 | 50 | } |