Index: branches/js2-work/phase3/js/mwEmbed/jquery/plugins/jquery.textSelection.js |
— | — | @@ -372,7 +372,11 @@ |
373 | 373 | break; |
374 | 374 | } |
375 | 375 | var context = $(this).data( 'wikiEditor-context' ); |
376 | | - var hasIframe = context !== undefined && context.$iframe !== undefined; |
| 376 | + if( ! context ){ |
| 377 | + var hasIframe = false; |
| 378 | + } else{ |
| 379 | + var hasIframe = context !== undefined && context.$iframe !== undefined; |
| 380 | + } |
377 | 381 | // iframe functions have not been implemented yet, this is a temp hack |
378 | 382 | //var hasIframe = false; |
379 | 383 | return ( hasIframe ? context.fn : fn )[command].call( this, options ); |
Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js |
— | — | @@ -29,8 +29,7 @@ |
30 | 30 | height: 31, |
31 | 31 | |
32 | 32 | // Default supported components is merged with embedPlayer set of supported types |
33 | | - supportedComponets: { |
34 | | - |
| 33 | + supportedComponets: { |
35 | 34 | // All playback types support options |
36 | 35 | 'options': true |
37 | 36 | }, |
— | — | @@ -1313,7 +1312,13 @@ |
1314 | 1313 | */ |
1315 | 1314 | 'fullscreen': { |
1316 | 1315 | 'w': 28, |
1317 | | - 'o': function( ctrlObj ) { |
| 1316 | + 'o': function( ctrlObj ) { |
| 1317 | + |
| 1318 | + // Setup "dobuleclick" fullscreen binding to embedPlayer |
| 1319 | + $j( ctrlObj.embedPlayer ).bind("dblclick", function(){ |
| 1320 | + ctrlObj.embedPlayer.fullscreen(); |
| 1321 | + }); |
| 1322 | + |
1318 | 1323 | return $j( '<div />' ) |
1319 | 1324 | .attr( 'title', gM( 'mwe-player_fullscreen' ) ) |
1320 | 1325 | .addClass( "ui-state-default ui-corner-all ui-icon_link rButton fullscreen-btn" ) |
Index: branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/EmbedPlayer.css |
— | — | @@ -146,7 +146,7 @@ |
147 | 147 | width:10px; |
148 | 148 | height:15px; |
149 | 149 | margin-left:-5px; |
150 | | - margin-top:0px; |
| 150 | + margin-top: -1px; |
151 | 151 | } |
152 | 152 | |
153 | 153 | .mv-player .inOutSlider .ui-slider-handle{ |
— | — | @@ -175,6 +175,7 @@ |
176 | 176 | float:left; |
177 | 177 | padding:2px 5px; |
178 | 178 | } |
| 179 | + |
179 | 180 | .mv-player .videoOptionsComplete div.ui-state-highlight a { |
180 | 181 | color:#eee; |
181 | 182 | font-weight:bold; |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/baseRemoteSearch.js |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | "mwe-import-description" : "$1, imported from $2" |
9 | 9 | } ); |
10 | 10 | |
11 | | -/* |
| 11 | +/** |
12 | 12 | * rsd_default_rss_item_mapping |
13 | 13 | * |
14 | 14 | * @key is name of resource variable |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | /** |
97 | 97 | * Clears Results |
98 | 98 | */ |
99 | | - clearResults:function() { |
| 99 | + clearResults: function() { |
100 | 100 | this.resultsObj = { }; |
101 | 101 | this.last_query = ''; |
102 | 102 | }, |
— | — | @@ -106,7 +106,7 @@ |
107 | 107 | * @param {XML Nodes} data the data to be parsed |
108 | 108 | * @param {String} provider_url the source url (used to generate absolute links) |
109 | 109 | */ |
110 | | - addRSSData:function( data , provider_url ) { |
| 110 | + addRSSData: function( data , provider_url ) { |
111 | 111 | mw.log( 'f:addRSSData' ); |
112 | 112 | var _this = this; |
113 | 113 | var http_host = ''; |
— | — | @@ -150,6 +150,7 @@ |
151 | 151 | _this.num_results++; |
152 | 152 | } ); |
153 | 153 | }, |
| 154 | + |
154 | 155 | /* |
155 | 156 | * Maps a given attribute to a resource object per mapping defined in |
156 | 157 | * rsd_default_rss_item_mapping |
— | — | @@ -245,13 +246,13 @@ |
246 | 247 | var ahtml = ( options['id'] ) ? ' id = "' + options['id'] + '" ': ''; |
247 | 248 | ahtml+= 'src="' + mw.escapeQuotesHTML( resource.src ) + '" ' + |
248 | 249 | //'class="' + mw.getConfig( 'skinName' ) + '" ' + |
249 | | - // mannualy set kskin (while mw.setConfig is not avaliable on all pages ) |
| 250 | + // mannualy set kskin (while mw.setConfig is not available on all pages ) |
250 | 251 | 'class="kskin" '+ |
251 | 252 | 'style="' + options.style + '" ' + |
252 | 253 | 'poster="' + mw.escapeQuotesHTML( resource.poster ) + '" '+ |
253 | 254 | 'type="' + mw.escapeQuotesHTML( resource.mime ) + '" '; |
254 | 255 | |
255 | | - // Add the api title key if avaliable: |
| 256 | + // Add the api title key if available: |
256 | 257 | if( resource.titleKey ) { |
257 | 258 | 'apiTitleKey="' + mw.escapeQuotesHTML( resource.titleKey ) + '" '; |
258 | 259 | } |
— | — | @@ -263,20 +264,26 @@ |
264 | 265 | if ( resource.mime == 'audio/ogg' ) { |
265 | 266 | outHtml = '<audio ' + ahtml + '></audio>'; |
266 | 267 | } |
267 | | - } |
268 | | - |
269 | | - // Return the output. Wrap with a description div if insert_description is on. |
270 | | - if( outHtml != '') { |
271 | | - return ( options['insert_description'] ) ? |
272 | | - this.wrapHtmlDesc(resource, options, outHtml) : |
273 | | - outHtml; |
274 | | - } |
| 268 | + } |
| 269 | + return outHtml; |
275 | 270 | |
276 | 271 | // No output give error: |
277 | 272 | mw.log( "ERROR:: no embed code for mime type: " + resource.mime ); |
278 | 273 | return 'Error missing embed code for: ' + escape( resource.mime ); |
279 | 274 | }, |
280 | 275 | |
| 276 | + /* |
| 277 | + * Wrap embed html with description div |
| 278 | + */ |
| 279 | + getEmbedWithDescription: function( resource , options ){ |
| 280 | + // Return the output. |
| 281 | + return this.wrapHtmlDesc( |
| 282 | + resource, |
| 283 | + options, |
| 284 | + this.getEmbedHTML( resource, options ) |
| 285 | + ); |
| 286 | + }, |
| 287 | + |
281 | 288 | /** |
282 | 289 | * Wrap output html with resource description links |
283 | 290 | * @param {Object} resource Resource object |
— | — | @@ -286,6 +293,14 @@ |
287 | 294 | wrapHtmlDesc: function( resource, options, outHtml ) { |
288 | 295 | var stripedTitle = resource.title.replace( /File:|Image:|.jpg|.png|.ogg|.ogv|.oga|.svg/ig, ''); |
289 | 296 | |
| 297 | + if( !options ){ |
| 298 | + options = {}; |
| 299 | + } |
| 300 | + // NOTE should add "size" to insert control |
| 301 | + if( !options.width ){ |
| 302 | + options.width = ( resource.width > 600 )? 600 : resource.width; |
| 303 | + } |
| 304 | + |
290 | 305 | var $titleLink = $j( '<a />' ) |
291 | 306 | .attr({ |
292 | 307 | 'title' : stripedTitle, |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/archiveOrgSearch.js |
— | — | @@ -156,12 +156,14 @@ |
157 | 157 | //} else { |
158 | 158 | //var src = resource.src; |
159 | 159 | //} |
160 | | - var o =''; |
| 160 | + var embedHtml =''; |
161 | 161 | if ( resource.mime == 'application/ogg' || resource.mime == 'video/ogg' ) { |
162 | | - return '<video poster="' + resource.poster + '" ' + attributes + |
| 162 | + embedHtml = '<video poster="' + resource.poster + '" ' + attributes + |
163 | 163 | ' type="video/ogg"></video>'; |
164 | 164 | }else if( resource.mime == 'audio/ogg' ) { |
165 | | - return '<audio ' + attributes + ' type="audio/ogg" ></audio>'; |
| 165 | + embedHtml = '<audio ' + attributes + ' type="audio/ogg" ></audio>'; |
166 | 166 | } |
| 167 | + |
| 168 | + return embedHtml; |
167 | 169 | } |
168 | 170 | } |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/metavidSearch.js |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | // Add the data xml payload with context url: |
61 | 61 | _this.addRSSData( xmldata , url ); |
62 | 62 | |
63 | | - // Do some metavid specific pos processing on the resource data: |
| 63 | + // Do some metavid specific pos processing on the resource data: |
64 | 64 | for ( var i in _this.resultsObj ) { |
65 | 65 | var resource = _this.resultsObj[i]; |
66 | 66 | var proe = mw.parseUri( resource['roe_url'] ); |
— | — | @@ -95,7 +95,10 @@ |
96 | 96 | * |
97 | 97 | * @param {Object} resource Resource to get title key from |
98 | 98 | */ |
99 | | - getTitleKey:function( resource ) { |
| 99 | + getTitleKey: function( resource ) { |
| 100 | + if( resource['titleKey'] ) { |
| 101 | + return resource['titleKey']; |
| 102 | + } |
100 | 103 | return resource['stream_name'] + '_part_' + resource['start_time'].replace(/:/g, '.' ) + '_to_' + resource['end_time'].replace(/:/g, '.' ) + '.ogv'; |
101 | 104 | }, |
102 | 105 | |
— | — | @@ -195,7 +198,7 @@ |
196 | 199 | * @param {Object} resource Resource to be embed |
197 | 200 | * @param {Object} options Resource Optiosn for embeind ( like max_width ) |
198 | 201 | */ |
199 | | - getEmbedHTML:function( resource , options ) { |
| 202 | + getEmbedHTML: function( resource , options ) { |
200 | 203 | if ( !options ) |
201 | 204 | options = { }; |
202 | 205 | var id_attr = ( options['id'] ) ? ' id = "' + options['id'] + '" ': ''; |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/flickrSearch.js |
— | — | @@ -167,7 +167,7 @@ |
168 | 168 | * Get the size key for a requested width |
169 | 169 | * |
170 | 170 | * @param {Object} resource Resource for sizeKey grab |
171 | | - * @param {Number} width Requeste width for sizeKey lookup |
| 171 | + * @param {Number} width Requested width for sizeKey lookup |
172 | 172 | */ |
173 | 173 | getSizeKey:function( resource, width ) { |
174 | 174 | if ( width <= 75 ) { |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js |
— | — | @@ -2094,6 +2094,7 @@ |
2095 | 2095 | if ( this.isProviderLocal( provider ) || this.import_url_mode == 'remote_link' ) { |
2096 | 2096 | // Local repo, jump directly to the callback: |
2097 | 2097 | myCallback( 'local' ); |
| 2098 | + return ; |
2098 | 2099 | } else { |
2099 | 2100 | // Check if the file is local ( can be shared repo ) |
2100 | 2101 | if ( provider.check_shared ) { |
— | — | @@ -2609,7 +2610,7 @@ |
2610 | 2611 | */ |
2611 | 2612 | getEmbedCode: function( resource ) { |
2612 | 2613 | if ( this.import_url_mode == 'remote_link' ) { |
2613 | | - return resource.pSobj.getEmbedHTML( resource, { 'insert_description': true } ); |
| 2614 | + return resource.pSobj.getEmbedWithDescription( resource ); |
2614 | 2615 | } else { |
2615 | 2616 | return resource.pSobj.getEmbedWikiCode( resource ); |
2616 | 2617 | } |
— | — | @@ -2644,7 +2645,14 @@ |
2645 | 2646 | */ |
2646 | 2647 | insertResource: function( resource ) { |
2647 | 2648 | mw.log( 'insertResource: ' + resource.title ); |
2648 | | - var _this = this; |
| 2649 | + var _this = this; |
| 2650 | + |
| 2651 | + // If doing a remote link jump directly to resource output: |
| 2652 | + if( this.import_url_mode == 'remote_link' ){ |
| 2653 | + _this.insertResourceToOutput( resource ); |
| 2654 | + return ; |
| 2655 | + } |
| 2656 | + |
2649 | 2657 | // Double check that the resource is present: |
2650 | 2658 | this.isFileLocallyAvailable( resource, function( status ) { |
2651 | 2659 | if ( status === 'missing' ) { |
— | — | @@ -2656,20 +2664,26 @@ |
2657 | 2665 | if ( status === 'local' || status === 'shared' || status === 'imported' ) { |
2658 | 2666 | _this.insertResourceToOutput( resource ); |
2659 | 2667 | } |
2660 | | - //NOTE: should hanndle errors or other status states? |
| 2668 | + //NOTE: should handle errors or other status states? |
2661 | 2669 | } ); |
2662 | 2670 | }, |
2663 | 2671 | |
2664 | 2672 | /** |
2665 | | - * Finish up the insertResource request outputing the resource to output targets |
| 2673 | + * Finish up the insertResource request by outputing the resource to output targets |
2666 | 2674 | * |
2667 | 2675 | * @param {Object} resource Resource to be inserted into the output targets |
2668 | 2676 | */ |
2669 | 2677 | insertResourceToOutput: function( resource ) { |
2670 | 2678 | var _this = this; |
| 2679 | + |
| 2680 | + // Get the embed code ( can be html remote refrence or wiki-text depending on import_url_mode ) |
2671 | 2681 | var embed_code = _this.getEmbedCode( resource ); |
2672 | | - $j( _this.target_textbox ).textSelection( 'encapsulateSelection', { 'post' : embed_code } ); |
2673 | 2682 | |
| 2683 | + // If outputing to a text box |
| 2684 | + if( _this.target_textbox ) { |
| 2685 | + $j( _this.target_textbox ).textSelection( 'encapsulateSelection', { 'post' : embed_code } ); |
| 2686 | + } |
| 2687 | + |
2674 | 2688 | // Update the render area for HTML output of video tag with mwEmbed "player" |
2675 | 2689 | var embedCode = _this.getEmbedCode( resource ); |
2676 | 2690 | if ( _this.target_render_area && embedCode ) { |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/jquery.dragDropFile.js |
— | — | @@ -45,10 +45,19 @@ |
46 | 46 | |
47 | 47 | $j( '#multiple_file_input' ).remove(); |
48 | 48 | |
49 | | - $j( 'body' ).append( '<div title="' + gM( 'mwe-upload-multi', fileCount ) + '" ' + |
50 | | - 'style="position:absolute;bottom:5em;top:3em;right:0px;left:0px" ' + |
51 | | - 'id="multiple_file_input">' + |
52 | | - '</div>' |
| 49 | + $j( 'body' ).append( |
| 50 | + $j('<div />') |
| 51 | + .attr( { |
| 52 | + 'title' : gM( 'mwe-upload-multi', fileCount ) |
| 53 | + 'id' : 'multiple_file_input' |
| 54 | + } ) |
| 55 | + .css({ |
| 56 | + 'position' : 'absolute', |
| 57 | + 'bottom' : '5em', |
| 58 | + 'top' : '3em', |
| 59 | + 'right' : '0px', |
| 60 | + 'left' : '0px' |
| 61 | + }) |
53 | 62 | ); |
54 | 63 | |
55 | 64 | |
— | — | @@ -73,19 +82,41 @@ |
74 | 83 | $j( '#multiple_file_input' ).dialogFitWindow(); |
75 | 84 | } ); |
76 | 85 | // add the inital table / title: |
77 | | - $j( '#multiple_file_input' ).html( '<h3>' + gM( 'mwe-review-upload' ) + '</h3>' + |
78 | | - '<table width="100%" border="1" class="table_list" style="border:none;"></table>' ); |
| 86 | + $j( '#multiple_file_input' ).empty().html( |
| 87 | + $j('<h3 />') |
| 88 | + .text( gM( 'mwe-review-upload' ) ), |
| 89 | + |
| 90 | + $j( '<table />' ) |
| 91 | + .attr({ |
| 92 | + 'width' : "100%", |
| 93 | + 'border' : "1", |
| 94 | + 'border' : 'none' |
| 95 | + }) |
| 96 | + .addClass( 'table_list' ) |
| 97 | + ); |
| 98 | + |
79 | 99 | $j.each( files, function( i, file ) { |
80 | 100 | if ( file.fileSize < 64048576 ) { |
81 | 101 | $j( '#multiple_file_input .table_list' ).append( |
82 | | - '<tr>' + |
83 | | - '<td width="300" style="padding:5px"><img width="250" src="' + file.getAsDataURL() + '">' + '</td>' + |
84 | | - '<td valign="top">' + |
| 102 | + $j('<tr />').append( |
| 103 | + $j('<td />').css({ |
| 104 | + 'width': '300px', |
| 105 | + 'padding' : '5px' |
| 106 | + }).append( |
| 107 | + $j('<img />').attr( { |
| 108 | + 'width' : '250', |
| 109 | + 'src' : file.getAsDataURL() |
| 110 | + } ) |
| 111 | + ), |
| 112 | + |
| 113 | + $j('<td />') |
| 114 | + .attr('valign', 'top') |
| 115 | + .append( |
85 | 116 | 'File Name: <input name="file[' + i + '][title]" value="' + file.name + '"><br>' + |
86 | | - 'File Desc: <textarea style="width:300px;" name="file[' + i + '][desc]"></textarea><br>' + |
87 | | - '</td>' + |
88 | | - '</tr>' |
89 | | - ); |
| 117 | + 'File Desc: <textarea style="width:300px;" name="file[' + i + '][desc]"></textarea><br>' |
| 118 | + ) |
| 119 | + ) |
| 120 | + ) |
90 | 121 | /*mw.addDialog( "upload this image", '<img width="300" src="' + files[i].getAsDataURL() + '">' + |
91 | 122 | '<br>name: ' + files[i].name + '</br>' + |
92 | 123 | '<br>size: ' + files[i].fileSize + '</br>' + |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/javaEmbed.js |
— | — | @@ -50,9 +50,10 @@ |
51 | 51 | '<param name="duration" value="' + this.duration + '" />' + "\n" + |
52 | 52 | '<param name="bufferSize" value="4096" />' + "\n" + |
53 | 53 | '</applet>'; |
54 | | - |
| 54 | + $j( this ).html( appletCode ); |
| 55 | + |
55 | 56 | // Wrap it in an iframe to avoid hanging the event thread in FF 2/3 and similar |
56 | | - // Doesn't work in MSIE or Safari/Mac or Opera 9.5 |
| 57 | + // NOTE: This breaks refrence to the applet so disabled for now: |
57 | 58 | /*if ( $j.browser.mozilla ) { |
58 | 59 | var iframe = document.createElement( 'iframe' ); |
59 | 60 | iframe.setAttribute( 'width', this.getWidth() ); |