Index: trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js |
— | — | @@ -13,7 +13,83 @@ |
14 | 14 | } |
15 | 15 | } |
16 | 16 | //inherit the cp settings for |
| 17 | + }, |
| 18 | + //returns a rObj by title |
| 19 | + getRObjByTitle:function( title , callback){ |
| 20 | + var _this = this; |
| 21 | + var reqObj = { |
| 22 | + 'action':'query', |
| 23 | + 'titles':'File:'+title, |
| 24 | + 'prop':'imageinfo|revisions|categories', |
| 25 | + 'iiprop':'url|mime|size', |
| 26 | + 'iiurlwidth': parseInt( this.rsd.thumb_width ), |
| 27 | + 'rvprop':'content' |
| 28 | + } |
| 29 | + do_api_req( { |
| 30 | + 'data':reqObj, |
| 31 | + 'url':this.cp.api_url |
| 32 | + }, function(data){ |
| 33 | + _this.clearResults(); |
| 34 | + //get results with rObj callback |
| 35 | + _this.addResults(data); |
| 36 | + //should only be one value: |
| 37 | + for(var i in _this.resultsObj){ |
| 38 | + callback( _this.resultsObj[i] ); |
| 39 | + break; |
| 40 | + } |
| 41 | + } |
| 42 | + ); |
17 | 43 | }, |
| 44 | + clearResults:function(){ |
| 45 | + this.resultsObj = {}; |
| 46 | + this.last_query =''; |
| 47 | + }, |
| 48 | + //update the resultObj with recently uploaded items by current User: |
| 49 | + getUserRecentUploads:function(wgUser, callback){ |
| 50 | + var _this = this; |
| 51 | + do_api_req({ |
| 52 | + 'data':{ |
| 53 | + 'action':'query', |
| 54 | + 'list':'recentchanges', |
| 55 | + 'rcnamespace':6, //only files |
| 56 | + 'rcuser': wgUser, |
| 57 | + 'rclimit':15, //get last 15 uploaded files |
| 58 | + }, |
| 59 | + 'url':this.cp.api_url |
| 60 | + },function(data){ |
| 61 | + var titleSet = {}; |
| 62 | + var titleStr='' |
| 63 | + var pound=''; |
| 64 | + //loop over the data and group by title |
| 65 | + if(data.query && data.query.recentchanges){ |
| 66 | + for(var i in data.query.recentchanges){ |
| 67 | + var rc = data.query.recentchanges[i]; |
| 68 | + if( !titleSet[ rc.title ] ){ |
| 69 | + titleSet[ rc.title ]=true; |
| 70 | + titleStr+= pound + rc.title; |
| 71 | + pound ='|'; |
| 72 | + } |
| 73 | + } |
| 74 | + } |
| 75 | + //now run the actual query ( too bad we cant use recentchanges as a gennerator |
| 76 | + do_api_req({ |
| 77 | + 'data' : { |
| 78 | + 'action':'query', |
| 79 | + 'titles':titleStr, |
| 80 | + 'prop':'imageinfo|revisions|categories', |
| 81 | + 'iiprop':'url|mime|size', |
| 82 | + 'iiurlwidth': parseInt( _this.rsd.thumb_width ), |
| 83 | + 'rvprop':'content' |
| 84 | + }, |
| 85 | + 'url':_this.cp.api_url |
| 86 | + },function(data){ |
| 87 | + _this.clearResults(); |
| 88 | + _this.addResults(data); |
| 89 | + if(callback) |
| 90 | + callback(); |
| 91 | + }); |
| 92 | + }); |
| 93 | + }, |
18 | 94 | getSearchResults:function(){ |
19 | 95 | //call parent: |
20 | 96 | this.parent_getSearchResults(); |
— | — | @@ -62,8 +138,7 @@ |
63 | 139 | if( typeof data['query-continue'].search != 'undefined') |
64 | 140 | this.more_results = true; |
65 | 141 | } |
66 | | - //make sure we have pages to iderate: |
67 | | - |
| 142 | + //make sure we have pages to iderate: |
68 | 143 | if(data.query && data.query.pages){ |
69 | 144 | for(var page_id in data.query.pages){ |
70 | 145 | var page = data.query.pages[ page_id ]; |
— | — | @@ -75,15 +150,14 @@ |
76 | 151 | } |
77 | 152 | |
78 | 153 | //make sure the page is not a redirect |
79 | | - if(page.revisions[0]['*'].indexOf('#REDIRECT')===0){ |
| 154 | + if(page.revisions[0]['*'] && page.revisions[0]['*'].indexOf('#REDIRECT')===0){ |
80 | 155 | //skip page is redirect |
81 | 156 | continue; |
82 | 157 | } |
83 | 158 | //skip if its an empty or missing imageinfo: |
84 | 159 | if( !page.imageinfo ) |
85 | 160 | continue; |
86 | | - |
87 | | - this.resultsObj[page_id]={ |
| 161 | + var rObj = { |
88 | 162 | 'titleKey' : page.title, |
89 | 163 | 'link' : page.imageinfo[0].descriptionurl, |
90 | 164 | 'title' : page.title.replace(/File:|.jpg|.png|.svg|.ogg|.ogv|.oga/ig, ''), |
— | — | @@ -100,21 +174,22 @@ |
101 | 175 | 'meta':{ |
102 | 176 | 'categories':page.categories |
103 | 177 | } |
104 | | - } |
| 178 | + }; |
| 179 | + |
105 | 180 | //attempt to parse out some stuff from the teplate: |
106 | | - var desc = this.resultsObj[page_id].desc.match(/\|Description=(([^\n]*\n)*)\|Source=/) |
| 181 | + var desc = rObj.desc.match(/\|Description=(([^\n]*\n)*)\|Source=/) |
107 | 182 | if( desc && desc[1] ){ |
108 | | - this.resultsObj[page_id].desc = $j.trim( desc[1] ); |
109 | | - } |
| 183 | + rObj.desc = $j.trim( desc[1] ); |
| 184 | + } |
110 | 185 | |
111 | | - |
112 | | - |
113 | 186 | //likely a audio clip if no poster and type application/ogg |
114 | 187 | //@@todo we should return audio/ogg for the mime type or some other way to specify its "audio" |
115 | | - if( ! this.resultsObj[page_id].poster && this.resultsObj[page_id].mime == 'application/ogg' ){ |
116 | | - this.resultsObj[page_id].mime = 'audio/ogg'; |
117 | | - } |
| 188 | + if( ! rObj.poster && rObj.mime == 'application/ogg' ){ |
| 189 | + rObj.mime = 'audio/ogg'; |
| 190 | + } |
118 | 191 | |
| 192 | + this.resultsObj[page_id]= rObj; |
| 193 | + |
119 | 194 | this.num_results++; |
120 | 195 | //for(var i in this.resultsObj[page_id]){ |
121 | 196 | // js_log('added: '+ i +' '+ this.resultsObj[page_id][i]); |
— | — | @@ -122,7 +197,7 @@ |
123 | 198 | } |
124 | 199 | }else{ |
125 | 200 | js_log('no results:' + data); |
126 | | - } |
| 201 | + } |
127 | 202 | }, |
128 | 203 | //check request done used for when we have multiple requests to check before formating results. |
129 | 204 | checkRequestDone:function(){ |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js |
— | — | @@ -636,7 +636,7 @@ |
637 | 637 | var go_to_url_txt = gM('mwe-go-to-resource'); |
638 | 638 | if( typeof _this.done_upload_cb == 'function' ){ |
639 | 639 | //if done action return 'true' |
640 | | - if( _this.done_upload_cb() ){ |
| 640 | + if( _this.done_upload_cb( _this.formData ) ){ |
641 | 641 | //update status |
642 | 642 | _this.updateProgressWin( gM('mwe-successfulupload'), gM( 'mwe-upload_done', apiResult.resultUrl),buttons); |
643 | 643 | }else{ |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -32,7 +32,8 @@ |
33 | 33 | "no_import_by_url" : "This user or wiki <b>can not<\/b> import assets from remote URLs.<\/p><p>Do you need to login?<\/p><p>If permissions are set, you may have to enable $wgAllowCopyUploads (<a href=\"http : \/\/www.mediawiki.org\/wiki\/Manual : $wgAllowCopyUploads\">more information<\/a>).<\/p>", |
34 | 34 | "results_from" : "Results from <a href=\"$1\" target=\"_new\" >$2<\/a>", |
35 | 35 | "missing_desc_see_soruce" : "This asset is missing a description. Please see the [$1 orginal source] and help describe it.", |
36 | | - "rsd_config_error" : "Add media wizard configuration error : $1" |
| 36 | + "rsd_config_error" : "Add media wizard configuration error : $1", |
| 37 | + "uploaded_itmes" : "Uploaded Items:" |
37 | 38 | }); |
38 | 39 | var default_remote_search_options = { |
39 | 40 | 'profile':'mediawiki_edit', |
— | — | @@ -132,7 +133,7 @@ |
133 | 134 | 'lib' : 'mediaWiki', |
134 | 135 | 'local' : true, |
135 | 136 | 'tab_img': false |
136 | | - }, |
| 137 | + }, |
137 | 138 | 'wiki_commons':{ |
138 | 139 | 'enabled': 1, |
139 | 140 | 'checked': 1, |
— | — | @@ -577,15 +578,55 @@ |
578 | 579 | //set the form action based on domain: |
579 | 580 | if( parseUri( document.URL ).host == parseUri( _this.upload_api_target ).host ){ |
580 | 581 | mvJsLoader.doLoad(['$j.fn.simpleUploadForm'],function(){ |
581 | | - //deal with the api form upload form directly: |
582 | | - $j('#tab-upload').simpleUploadForm({ |
583 | | - "api_target" : _this.upload_api_target , |
584 | | - "ondone_cb" : function( resultData ){ |
585 | | - var cat = resultData; |
586 | | - debugger; |
587 | | - return false; |
588 | | - } |
589 | | - }) |
| 582 | + |
| 583 | + //get extened info about the file |
| 584 | + var cp = _this.content_providers['this_wiki']; |
| 585 | + //check for "this_wiki" enabled |
| 586 | + if(!cp.enabled){ |
| 587 | + $j('#tab-upload').html('error this_wiki not enabled (can\'t get uploaded file info)'); |
| 588 | + return false; |
| 589 | + } |
| 590 | + |
| 591 | + //load this_wiki search system to grab the rObj |
| 592 | + _this.loadSearchLib(cp, function(){ |
| 593 | + //do basic layout form on left upload "bin" on right |
| 594 | + $j('#tab-upload').html('<table>' + |
| 595 | + '<tr>' + |
| 596 | + '<td style="width:350px;padding:10px" id="upload_form">' + mv_get_loading_img() +'</td>' + |
| 597 | + '<td valign="top" id="upload_bin"></td>' + |
| 598 | + '</tr>' + |
| 599 | + '</table>'); |
| 600 | + |
| 601 | + |
| 602 | + //fill in the user page: |
| 603 | + if(typeof wgUserName != 'undefined' && wgUserName){ |
| 604 | + //load the upload bin with anything the current user has uploaded |
| 605 | + cp.sObj.getUserRecentUploads( wgUserName, function(){ |
| 606 | + _this.drawOutputResults(); |
| 607 | + }); |
| 608 | + }else{ |
| 609 | + $j('#upload_bin').empty(); |
| 610 | + } |
| 611 | + |
| 612 | + //deal with the api form upload form directly: |
| 613 | + $j('#upload_form').simpleUploadForm({ |
| 614 | + "api_target" : _this.upload_api_target , |
| 615 | + "ondone_cb" : function( resultData ){ |
| 616 | + var wTitle = resultData['wpDestFile']; |
| 617 | + //add a loading div |
| 618 | + $j( _this.target_container ).append('<div id="temp_edit_loader" '+ |
| 619 | + 'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' + |
| 620 | + mv_get_loading_img('position:absolute;top:30px;left:30px') + |
| 621 | + '</div>'); |
| 622 | + cp.sObj.getRObjByTitle( wTitle, function( rObj ){ |
| 623 | + $j( _this.target_container ).find('#temp_edit_loader').remove(); |
| 624 | + //append the image to the upload bin |
| 625 | + }); |
| 626 | + //return false to close progress window: |
| 627 | + return false; |
| 628 | + } |
| 629 | + }) |
| 630 | + }); |
590 | 631 | }); |
591 | 632 | }else{ |
592 | 633 | //setup the proxy |
— | — | @@ -740,26 +781,33 @@ |
741 | 782 | $j('#tab-' + this.disp_item).html( '<div style="padding:10px">'+ gM('no_import_by_url') +'</div>'); |
742 | 783 | } |
743 | 784 | return false; |
744 | | - } |
| 785 | + } |
| 786 | + _this.loadSearchLib(cp, function(){ |
| 787 | + //do search |
| 788 | + cp.sObj.getSearchResults(); |
| 789 | + _this.checkResultsDone(); |
| 790 | + }); |
| 791 | + }, |
| 792 | + loadSearchLib:function(cp, callback){ |
| 793 | + var _this = this; |
745 | 794 | //set up the library req: |
746 | 795 | mvJsLoader.doLoad( [ |
747 | 796 | 'baseRemoteSearch', |
748 | 797 | cp.lib +'Search' |
749 | 798 | ], function(){ |
750 | | - js_log("loaded .. disp is: " + _this.disp_item); |
| 799 | + js_log("loaded lib:: " + cp.lib ); |
751 | 800 | //else we need to run the search: |
752 | 801 | var iObj = {'cp':cp, 'rsd':_this}; |
753 | 802 | eval('cp.sObj = new '+cp.lib+'Search( iObj );'); |
754 | | - if(!cp.sObj) |
| 803 | + if(!cp.sObj){ |
755 | 804 | js_log('Error: could not find search lib for ' + cp_id); |
| 805 | + return false; |
| 806 | + } |
756 | 807 | |
757 | 808 | //inherit defaults if not set: |
758 | 809 | cp.limit = (cp.limit) ? cp.limit : cp.sObj.limit; |
759 | 810 | cp.offset = (cp.offset) ? cp.offset : cp.sObj.offset; |
760 | | - |
761 | | - //do search |
762 | | - cp.sObj.getSearchResults(); |
763 | | - _this.checkResultsDone(); |
| 811 | + callback(); |
764 | 812 | }); |
765 | 813 | }, |
766 | 814 | /* check for all the results to finish */ |
— | — | @@ -889,12 +937,18 @@ |
890 | 938 | js_log('f:drawOutputResults::' + this.disp_item); |
891 | 939 | var _this = this; |
892 | 940 | var o=''; |
893 | | - |
| 941 | + |
894 | 942 | var cp_id = this.disp_item; |
895 | | - var cp = this.content_providers[this.disp_item]; |
896 | | - |
| 943 | + var tab_target = ''; |
| 944 | + if(this.disp_item == 'upload'){ |
| 945 | + tab_target = '#upload_bin'; |
| 946 | + var cp = this.content_providers['this_wiki']; |
| 947 | + }else{ |
| 948 | + var cp = this.content_providers[this.disp_item]; |
| 949 | + tab_target = '#tab-' + cp_id; |
| 950 | + } |
897 | 951 | //empty the existing results: |
898 | | - $j('#tab-' + cp_id).empty(); |
| 952 | + $j(tab_target).empty(); |
899 | 953 | |
900 | 954 | //output the results bar / controls |
901 | 955 | _this.setResultBarControl(); |
— | — | @@ -943,7 +997,7 @@ |
944 | 998 | }); |
945 | 999 | js_log('append to: ' + '#tab-' + cp_id); |
946 | 1000 | //put in the tab output (plus clear the output) |
947 | | - $j('#tab-' + cp_id).append( o + '<div style="clear:both"/>'); |
| 1001 | + $j(tab_target).append( o + '<div style="clear:both"/>'); |
948 | 1002 | } |
949 | 1003 | |
950 | 1004 | js_log( ' drawResultCount :: ' + drawResultCount + ' append: ' + $j('#rsd_q').val() ); |
— | — | @@ -978,6 +1032,27 @@ |
979 | 1033 | _this.resourceEdit( rObj, this ); |
980 | 1034 | }); |
981 | 1035 | }, |
| 1036 | + addResourceEditLoader:function(maxWidth, overflow_style){ |
| 1037 | + var _this = this; |
| 1038 | + if(!maxWidth)maxWidth=400; |
| 1039 | + if(!overflow_style)overflow_style='overflow:auto;'; |
| 1040 | + //hide the results container |
| 1041 | + $j('#rsd_results_container').hide(); |
| 1042 | + //remove any old instance: |
| 1043 | + $j( _this.target_container ).find('#rsd_resource_edit').remove(); |
| 1044 | + //add the edit layout window with loading place holders |
| 1045 | + $j( _this.target_container ).append('<div id="rsd_resource_edit" '+ |
| 1046 | + 'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' + |
| 1047 | + '<div id="clip_edit_disp" style="position:absolute;' + overflow_style + 'width:100%;height:100%;padding:5px;'+ |
| 1048 | + 'width:' + (maxWidth) + 'px;" >' + |
| 1049 | + mv_get_loading_img('position:absolute;top:30px;left:30px') + |
| 1050 | + '</div>'+ |
| 1051 | + '<div id="clip_edit_ctrl" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;'+ |
| 1052 | + 'left:' + ( maxWidth + 10 ) +'px;top:5px;bottom:10px;right:0px;overflow:auto;padding:5px;">'+ |
| 1053 | + mv_get_loading_img() + |
| 1054 | + '</div>'+ |
| 1055 | + '</div>'); |
| 1056 | + }, |
982 | 1057 | resourceEdit:function( rObj, rsdElement){ |
983 | 1058 | js_log('f:resourceEdit:' + rObj.title); |
984 | 1059 | var _this = this; |
— | — | @@ -999,17 +1074,7 @@ |
1000 | 1075 | //so that transcripts show ontop |
1001 | 1076 | var overflow_style = ( mediaType =='video' )?'':'overflow:auto;'; |
1002 | 1077 | //append to the top level of model window: |
1003 | | - $j( _this.target_container ).append('<div id="rsd_resource_edit" '+ |
1004 | | - 'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' + |
1005 | | - '<div id="clip_edit_disp" style="position:absolute;' + overflow_style + 'width:100%;height:100%;padding:5px;'+ |
1006 | | - 'width:' + (maxWidth) + 'px;" >' + |
1007 | | - mv_get_loading_img('position:absolute;top:30px;left:30px') + |
1008 | | - '</div>'+ |
1009 | | - '<div id="clip_edit_ctrl" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;'+ |
1010 | | - 'left:' + ( maxWidth + 10 ) +'px;top:5px;bottom:10px;right:0px;overflow:auto;padding:5px;">'+ |
1011 | | - mv_get_loading_img() + |
1012 | | - '</div>'+ |
1013 | | - '</div>'); |
| 1078 | + _this.addResourceEditLoader(maxWidth, overflow_style); |
1014 | 1079 | //update add media wizard title: |
1015 | 1080 | $j( _this.target_container ).dialog( 'option', 'title', gM('add_media_wizard')+': '+ gM('rsd_resource_edit', rObj.title ) ); |
1016 | 1081 | js_log('did append to: '+ _this.target_container ); |
— | — | @@ -1098,6 +1163,8 @@ |
1099 | 1164 | var _this = this; |
1100 | 1165 | var b_target = _this.target_container + '~ .ui-dialog-buttonpane'; |
1101 | 1166 | $j('#rsd_resource_edit').remove(); |
| 1167 | + //restore the resource container: |
| 1168 | + $j('#rsd_results_container').show(); |
1102 | 1169 | //restore the title: |
1103 | 1170 | $j( _this.target_container ).dialog( 'option', 'title', gM('add_media_wizard')); |
1104 | 1171 | js_log("should update: " + b_target + ' with: cancel'); |
— | — | @@ -1393,8 +1460,12 @@ |
1394 | 1461 | //@@todo try to load over ajax if( _this.local_wiki_api_url ) is set |
1395 | 1462 | // (your on the api domain but are inserting from a normal page view) |
1396 | 1463 | if( _this.local_wiki_api_url){ |
1397 | | - |
| 1464 | + get_mw_token(null, _this.local_wiki_api_url, function(token){ |
| 1465 | + callback( token ); |
| 1466 | + }) |
1398 | 1467 | } |
| 1468 | + callback(false); |
| 1469 | + return false; |
1399 | 1470 | }, |
1400 | 1471 | /** |
1401 | 1472 | * doImportSpecialPage |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/simpleUploadForm.js |
— | — | @@ -45,37 +45,39 @@ |
46 | 46 | return false; |
47 | 47 | } |
48 | 48 | |
49 | | - //build the api based upload form: |
50 | | - var o = '<div style="margin: 0 auto;width:450px;">'+ |
| 49 | + //build an upload form: |
| 50 | + var o = ''+ |
51 | 51 | '<form id="suf-upload" enctype="multipart/form-data" action="' + opt.api_target + '" method="post">' + |
52 | 52 | //hidden input: |
53 | 53 | '<input type="hidden" name="action" value="upload">'+ |
54 | 54 | '<input type="hidden" name="format" value="jsonfm">'+ |
55 | 55 | '<input type="hidden" name="token" value="'+ eToken +'">' + |
56 | 56 | |
57 | | - //api form name set: |
58 | | - '<label for="file">' + gM('select_file') + '</label><br>'+ |
59 | | - '<input type="file" style="display: inline;" name="file" size="15"/><br>' + |
| 57 | + //form name set: |
| 58 | + '<label for="wpUploadFile">' + gM('select_file') + '</label><br>'+ |
| 59 | + '<input type="file" style="display: inline;" name="wpUploadFile" size="15"/><br>' + |
60 | 60 | |
61 | | - '<label for="filename">' +gM('destfilename') + '</label><br>'+ |
62 | | - '<input type="text" name="filename" size="30" /><br>'+ |
| 61 | + '<label for="wpDestFile">' +gM('destfilename') + '</label><br>'+ |
| 62 | + '<input type="text" name="wpDestFile" size="30" /><br>'+ |
63 | 63 | |
64 | | - '<label for="comment">' + gM('summary') + ':</label><br>' + |
65 | | - '<textarea cols="30" rows="3" name="comment" tabindex="3"/><br>'+ |
66 | | - |
| 64 | + '<label for="wpUploadDescription">' + gM('summary') + ':</label><br>' + |
| 65 | + '<textarea cols="30" rows="3" name="wpUploadDescription" tabindex="3"/><br>'+ |
| 66 | + |
| 67 | + '<div id="wpDestFile-warning"></div>' + |
| 68 | + |
67 | 69 | gM('select_ownwork') + '<br>' + |
68 | 70 | '<input type="checkbox" id="wpLicence" name="wpLicence" value="cc-by-sa">' + gM('licence_cc-by-sa') + '<br>' + |
69 | 71 | |
70 | 72 | '<input type="submit" accesskey="s" value="' + gM('upload') + '" name="wpUploadBtn" id="wpUploadBtn" tabindex="9"/>' + |
71 | 73 | //close the form and div |
72 | | - '</form></div>'; |
| 74 | + '</form>'; |
73 | 75 | |
74 | 76 | //set the target with the form output: |
75 | 77 | $( _this.selector ).html( o ); |
76 | 78 | //by default dissable: |
77 | 79 | $j('#wpUploadBtn').attr('disabled', 'disabled'); |
78 | 80 | |
79 | | - //set up basic binding: |
| 81 | + //set up basic licence binding: |
80 | 82 | $j('#wpLicence').click(function(){ |
81 | 83 | if( $j(this).is(':checked') ){ |
82 | 84 | $j('#wpUploadBtn').removeAttr('disabled'); |
— | — | @@ -88,21 +90,19 @@ |
89 | 91 | opt.ondone_cb = false; |
90 | 92 | |
91 | 93 | //set up the binding per the config |
92 | | - if( opt.enable_fogg ){ |
93 | | - $j('#wpUploadFile').firefogg({ |
| 94 | + if( opt.enable_fogg ){ |
| 95 | + $j("#suf-upload [name='wpUploadFile']").firefogg({ |
94 | 96 | //an api url (we won't submit directly to action of the form) |
95 | 97 | 'api_url' : opt.api_target, |
96 | 98 | 'form_rewrite': true, |
97 | 99 | 'target_edit_from' : '#suf-upload', |
98 | 100 | 'new_source_cb' : function( orgFilename, oggName ){ |
99 | | - $j('#wpDestFile').val( oggName ); |
100 | | - //@@TODO: |
101 | | - //mwUploadHelper.doDestCheck(); |
| 101 | + $j("#suf-upload [name='wpDestFile']").val( oggName ).doDestCheck({ |
| 102 | + warn_target: "#wpDestFile-warning" |
| 103 | + }); |
102 | 104 | }, |
103 | 105 | 'done_upload_cb' : opt.ondone_cb |
104 | 106 | }); |
105 | | - }else{ |
106 | | - //simple web form rewrite |
107 | 107 | } |
108 | 108 | }); |
109 | 109 | } |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js |
— | — | @@ -658,9 +658,9 @@ |
659 | 659 | buttons: _this.cancel_button() |
660 | 660 | }); |
661 | 661 | $j('#upProgressDialog').html( |
662 | | - //set initial content: |
| 662 | + //set initial content: |
663 | 663 | '<div id="up-pbar-container" style="width:90%;height:15px;" >' + |
664 | | - '<div id="up-progressbar" style="height:15px;"></div>' + |
| 664 | + '<div id="up-progressbar" style="height:15px;"></div>' + |
665 | 665 | '<div id="up-status-container">'+ |
666 | 666 | '<span id="up-pstatus">0% - </span> ' + |
667 | 667 | '<span id="up-status-state">' + gM('mwe-uploaded-status') + '</span> ' + |
— | — | @@ -694,3 +694,71 @@ |
695 | 695 | } |
696 | 696 | } |
697 | 697 | }; |
| 698 | + |
| 699 | +//add some jquery bindings: |
| 700 | +(function($) { |
| 701 | + /** |
| 702 | + * doDestCheck checks the destination |
| 703 | + */ |
| 704 | + $.fn.doDestCheck = function( opt ){ |
| 705 | + var _this = this; |
| 706 | + var destFile = this.selector; |
| 707 | + //set up option defaults; |
| 708 | + if(!opt.warn_target) |
| 709 | + opt.warn_target = '#wpDestFile-warning'; |
| 710 | + |
| 711 | + //empty target warn: |
| 712 | + $j(opt.warn_target).empty(); |
| 713 | + |
| 714 | + //show loading |
| 715 | + $j(destFile).after('<img id = "mw-spinner-wpDestFile" src ="'+ stylepath + '/common/images/spinner.gif" />'); |
| 716 | + //try and get a thumb of the current file (check its destination) |
| 717 | + do_api_req({ |
| 718 | + 'data':{ |
| 719 | + 'titles': 'File:' + $j(destFile).val(),//@@todo we may need a more clever way to get a the filename |
| 720 | + 'prop': 'imageinfo', |
| 721 | + 'iiprop':'url|mime|size', |
| 722 | + 'iiurlwidth': 150 |
| 723 | + } |
| 724 | + },function(data){ |
| 725 | + //remove spinner: |
| 726 | + $j('#mw-spinner-wpDestFile').remove(); |
| 727 | + if(data && data.query && data.query.pages){ |
| 728 | + if( data.query.pages[-1] ){ |
| 729 | + //all good no file there |
| 730 | + }else{ |
| 731 | + for(var page_id in data.query.pages){ |
| 732 | + var ntitle = ( data.query.normalized)? data.query.normalized[0].to : data.query.pages[ page_id ].title |
| 733 | + var img = data.query.pages[ page_id ].imageinfo[0]; |
| 734 | + $j('#wpDestFile-warning').html( |
| 735 | + '<ul>' + |
| 736 | + '<li>'+ |
| 737 | + gM('mwe-fileexists', ntitle) + |
| 738 | + '</li>'+ |
| 739 | + '<div class="thumb tright">' + |
| 740 | + '<div style="width: ' + ( parseInt(img.thumbwidth)+2 ) + 'px;" class="thumbinner">' + |
| 741 | + '<a title="' + ntitle + '" class="image" href="' + img.descriptionurl + '">' + |
| 742 | + '<img width="' + img.thumbwidth + '" height="' + img.thumbheight + '" border="0" class="thumbimage" ' + |
| 743 | + 'src="' + img.thumburl + '"' + |
| 744 | + ' alt="' + ntitle + '"/>' + |
| 745 | + '</a>' + |
| 746 | + '<div class="thumbcaption">' + |
| 747 | + '<div class="magnify">' + |
| 748 | + '<a title="' + gM('thumbnail-more') + '" class="internal" ' + |
| 749 | + 'href="' + img.descriptionurl +'"><img width="15" height="11" alt="" ' + |
| 750 | + 'src="' + stylepath + "/common/images/magnify-clip.png\" />" + |
| 751 | + '</a>'+ |
| 752 | + '</div>'+ |
| 753 | + gM('mwe-fileexists-thumb') + |
| 754 | + '</div>' + |
| 755 | + '</div>'+ |
| 756 | + '</div>' + |
| 757 | + '</ul>' |
| 758 | + ); |
| 759 | + } |
| 760 | + } |
| 761 | + } |
| 762 | + }); |
| 763 | + } |
| 764 | +})(jQuery); |
| 765 | + |
Index: trunk/phase3/js2/mwEmbed/skins/kskin/styles.css |
— | — | @@ -10,14 +10,16 @@ |
11 | 11 | .k-control-bar button, .k-control-bar div.ui-slider, .k-control-bar div.k-timer { float:left;}
|
12 | 12 | .k-timer { margin-top:2px;}
|
13 | 13 | .k-volume-slider { width:26px;}
|
14 | | -.k-control-bar .k-options { width:50px; height:22px; text-transform:uppercase; margin-top:-2px; border: solid 1px #aaa; border-top:none; float:right; font: bold 11px arial,sans-serif; color:#555;}
|
| 14 | +.k-control-bar .k-options { width:50px; height:22px; text-transform:uppercase; margin-top:-2px; border: solid 1px #aaa; border-top:none; float:right; font: bold 11px arial,sans-serif; color:#555;} |
| 15 | +
|
15 | 16 | span.ui-icon.ui-icon-k-menu { width:auto; padding-left:2px; background:none; outline:none; cursor:default;}
|
16 | | -.k-menu { z-index:1; width:400px; height:300px; background:#181818; position:absolute;opacity:0.9;filter:alpha(opacity=90); top:0px; left:0px; display:none} /* h, w, top inline via jq top:15px*/
|
| 17 | +.k-menu { opacity:0.9; filter:alpha(opacity=90); z-index:1; width:400px; height:300px; background:#181818; position:absolute; top:0px; left:0px;} /* h, w, top inline via jq top:15px*/
|
17 | 18 | |
18 | 19 | ul.k-menu-bar{ height:128px; padding: 0 0 5px;position:absolute; bottom:5px;right:0px; list-style: none outside none; background: url(images/ksprite.png) -99px -104px no-repeat;} /* eventually: mtop inline via jq */
|
19 | 20 | .k-menu-bar li a { display:block; width:49px; height:32px; margin-left:1px; text-indent:99999px; background: url(images/ksprite.png) -51px -110px no-repeat; overflow:hidden;}
|
20 | 21 | .k-menu-bar li a:hover { background-position: -1px -110px;}
|
21 | 22 | |
| 23 | + |
22 | 24 | .k-menu-bar li.k-download-btn a { background-position: -51px -203px;}
|
23 | 25 | .k-menu-bar li.k-download-btn a:hover { background-position: -1px -203px;} |
24 | 26 |
|
— | — | @@ -26,6 +28,8 @@ |
27 | 29 |
|
28 | 30 | .k-menu-bar li.k-credits-btn a { background-position: -51px -141px;}
|
29 | 31 | .k-menu-bar li.k-credits-btn a:hover { background-position: -1px -141px;}
|
| 32 | + |
| 33 | + |
30 | 34 |
|
31 | 35 | .k-menu-screens { width:320px; padding: 13px 10px 15px 15px; float:left;} /* w & h inline via jq */
|
32 | 36 | .k-menu-screens h2 { padding: 0 0 5px 1px; clear:both; font-size:12px; color:#666;}
|
— | — | @@ -69,12 +73,20 @@ |
70 | 74 | .k-menu-screens li a:hover { background-position: -85px -260px;}
|
71 | 75 |
|
72 | 76 | .k-options.ui-state-hover { color:blue;} |
| 77 | + |
| 78 | +.k-player .ui-state-default .ui-icon, .k-player .ui-state-hover .ui-icon {background:transparent url(images/ksprite.png) no-repeat scroll 0 -48px;} |
73 | 79 |
|
74 | 80 | .k-player .ui-state-default .ui-icon-arrow-4-diag { background-position: 0 -32px;} /* fullscreen */
|
75 | 81 | .k-player .ui-state-hover .ui-icon-arrow-4-diag { background-position: -16px -32px;}
|
76 | 82 | .k-player .ui-state-default .ui-icon-volume-on, .ui-state-hover .ui-icon-volume-off, { margin-left:-6px; background-position: -16px -48px;}
|
77 | 83 | .k-player .ui-state-hover .ui-icon-volume-on, .ui-state-default .ui-icon-volume-off { margin-left:-6px; background-position: 0 -48px;}
|
78 | 84 | |
| 85 | +.k-player .ui-state-default .ui-icon-play { background:url(images/ksprite.png) no-repeat 0 0;} |
| 86 | +.k-player .ui-state-hover .ui-icon-play { background-position: -16px 0;} |
| 87 | + |
| 88 | +.k-player .ui-state-default .ui-icon-pause { background:url(images/ksprite.png) no-repeat 0 -17px;} |
| 89 | +.k-player .ui-state-hover .ui-icon-pause { background-position: -16px -17px;} |
| 90 | + |
79 | 91 | .k-control-bar .ui-slider { height:8px; border: solid 1px #eee; margin: 4px 10px 0 7px; position:relative; background:url(images/ksprite.png) repeat-x 0 -350px;}
|
80 | 92 | .k-control-bar .ui-slider-handle { width:8px; height:8px; top:0px; border: solid 1px #888; margin: -1px 0 0 -5px; display:block; position:relative; background: url(images/ksprite.png) no-repeat -67px -341px; position:absolute;}
|
81 | 93 | .k-control-bar .ui-slider-range { height:8px; position:absolute; background: url(images/ksprite.png) repeat-x 0 -368px; -moz-border-radius:5px; -webkit-border-radius:5px;} |
Index: trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | $j('#dc_'+ embedObj.id).hover( |
90 | 90 | function(){ |
91 | 91 | if($j('#gnp_' + embedObj.id).length==0){ |
92 | | - $j(this).append('<div id="gnp_' + embedObj.id + '" class="ui-state-highlight ui-corner-all" ' + |
| 92 | + $j(this).append('<div id="gnp_' + embedObj.id + '" class="ui-state-highlight ui-corner-all gnp-warning" ' + |
93 | 93 | 'style="position:absolute;display:none;background:#FFF;top:10px;left:10px;right:10px;height:60px;">' + |
94 | 94 | gM('mv_for_best_experience') + |
95 | 95 | '<br><input id="ffwarn_'+embedObj.id+'" type=\"checkbox\">' + |
— | — | @@ -129,12 +129,12 @@ |
130 | 130 | }); |
131 | 131 | |
132 | 132 | //options binding: |
133 | | - $j('#options_button_' + embedObj.id).unbind().btnBind().click(function(){ |
134 | | - $j('#' +embedObj.id).get(0).doOptionsHTML(); |
135 | | - }); |
| 133 | + //$j('#options_button_' + embedObj.id).unbind().btnBind().click(function(){ |
| 134 | + // $j('#' +embedObj.id).get(0).doOptionsHTML(); |
| 135 | + //}); |
136 | 136 | |
137 | 137 | //fullscreen binding: |
138 | | - $j('#fullscreen_' + embedObj.id).unbind().btnBind().click(function(){ |
| 138 | + $tp.find('.k-fullscreen').unbind().btnBind().click(function(){ |
139 | 139 | $j('#' +embedObj.id).get(0).fullscreen(); |
140 | 140 | }); |
141 | 141 | |
— | — | @@ -186,9 +186,9 @@ |
187 | 187 | value: 80, |
188 | 188 | min: 0, |
189 | 189 | max: 100, |
190 | | - slide: function(event, ui) { |
191 | | - embedObj.updateVolumen(ui.value/100); |
192 | | - }, |
| 190 | + slide: function(event, ui) { |
| 191 | + embedObj.updateVolumen(ui.value/100); |
| 192 | + }, |
193 | 193 | change: function(event, ui){ |
194 | 194 | var level = ui.value/100; |
195 | 195 | if (level==0) { |
— | — | @@ -244,11 +244,16 @@ |
245 | 245 | } |
246 | 246 | |
247 | 247 | //options menu display: |
248 | | - $tp.find('.k-options').click(function(){ |
249 | | - if($j('#' + embedObj.id + ' .k-menu').length == 0 ) |
| 248 | + $tp.find('.k-options').click(function(){ |
| 249 | + if($j('#' + embedObj.id + ' .k-menu').length == 0 ){ |
| 250 | + //stop the player if it does not support overlays: |
| 251 | + if(!embedObj.supports['overlays']) |
| 252 | + $tp.get(0).stop(); |
| 253 | + //add the options |
250 | 254 | addMvOptions(); |
| 255 | + } |
251 | 256 | //set up the text and menu: |
252 | | - var $ktxt = $j(this).find('.ui-icon-k-menu'); |
| 257 | + var $ktxt = $j(this); |
253 | 258 | var $kmenu = $tp.find('.k-menu'); |
254 | 259 | if( $kmenu.is(':visible') ){ |
255 | 260 | $kmenu.fadeOut("fast",function(){ |
— | — | @@ -264,8 +269,8 @@ |
265 | 270 | }); |
266 | 271 | |
267 | 272 | //volume binding: |
268 | | - $tp.find('.k-volume').unbind().btnBind().click(function(){ |
269 | | - $tp.toggleMute(); |
| 273 | + $tp.find('.k-volume').unbind().btnBind().click(function(){ |
| 274 | + $tp.get(0).toggleMute(); |
270 | 275 | }); |
271 | 276 | |
272 | 277 | var hoverOverDelay=false; |
— | — | @@ -382,7 +387,7 @@ |
383 | 388 | 'volume_control':{ |
384 | 389 | 'w':40, |
385 | 390 | 'o':function(){ |
386 | | - return '<button class="ui-state-default ui-corner-all k-volume">' + |
| 391 | + return '<button class="ui-state-default ui-corner-all k-volume_control">' + |
387 | 392 | '<span class="ui-icon ui-icon-volume-on"></span>' + |
388 | 393 | '</button>' + |
389 | 394 | '<div class="ui-slider ui-slider-horizontal k-volume-slider"></div>'; |
Property changes on: trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js |
___________________________________________________________________ |
Name: svn:mergeinfo |
390 | 395 | - /branches/REL1_15/phase3/js2/mwEmbed/skins/baseSkin.js:51646 |
391 | 396 | + /branches/REL1_15/phase3/js2/mwEmbed/skins/ctrlBuilder.js:51646 |
Index: trunk/phase3/js2/mwEmbed/skins/mvpcf/styles.css |
— | — | @@ -761,66 +761,68 @@ |
762 | 762 | |
763 | 763 | .k-player { width:400px; height:340px; position:relative;} /* inline via jq */ |
764 | 764 | .k-player * { padding:0; margin:0;} /* inline via jq */ |
765 | | - .k-edit-bar { } |
766 | | - .k-edit-bar a { width:33px; padding: 1px 0 0; display:block; text-align:center; font-weight:bold; color:#888; text-decoration:none; background:#F2F2F2;} |
| 765 | +.k-edit-bar { } |
| 766 | +.k-edit-bar a { width:33px; padding: 1px 0 0; display:block; text-align:center; font-weight:bold; color:#888; text-decoration:none; background:#F2F2F2;} |
767 | 767 | |
768 | | - .k-video { width:400px; height:300px; background:#000; margin-bottom:1px;} /* h & w inline via jq */ |
769 | | - .k-control-bar { height:21px; padding: 2px 0 0 6px; border:none; margin-top:1px; background: url(images/ksprite.png) repeat-x 0 -81px; font: normal 11px arial,sans-serif; color:#555;} |
770 | | - .k-control-bar button, .k-control-bar div.ui-slider, .k-control-bar div.k-timer { float:left;} |
771 | | - .k-timer { width:36px; margin-top:2px; overflow:hidden;} |
772 | | - .k-volume-slider { width:26px;} |
773 | | - .k-control-bar .k-options { width:50px; height:22px; margin-top:-2px; border: solid 1px #aaa !important; border-top:none; float:right; font: bold 11px arial,sans-serif; color:#555;} |
774 | | - .k-player span.ui-icon.ui-icon-k-menu { width:auto; padding-left:2px; text-indent:0; background:none; outline:none; cursor:default;} |
| 768 | +.k-video { width:400px; height:300px; background:#000; margin-bottom:1px;} /* h & w inline via jq */ |
| 769 | +.k-control-bar { height:21px; padding: 2px 0 0 6px; border:none; margin-top:1px; background: url(images/ksprite.png) repeat-x 0 -81px; font: normal 11px arial,sans-serif; color:#555;} |
| 770 | +.k-control-bar button, .k-control-bar div.ui-slider, .k-control-bar div.k-timer { float:left;} |
| 771 | +.k-timer { width:36px; margin-top:2px; overflow:hidden;} |
| 772 | +.k-volume-slider { width:26px;} |
| 773 | +.k-control-bar .k-options { width:50px; height:22px; margin-top:-2px; border: solid 1px #aaa !important; border-top:none; float:right; font: bold 11px arial,sans-serif; color:#555;} |
| 774 | +.k-player span.ui-icon.ui-icon-k-menu { width:auto; padding-left:2px; text-indent:0; background:none; outline:none; cursor:default;} |
775 | 775 | |
776 | | - .k-menu { width:400px; height:300px; border:none; background:#181818; position:absolute; top:0; left:0; z-index:999; display:none} /* h, w, top inline via jq top:15px*/ |
777 | | - ul.k-menu-bar{ height:128px; padding: 0 0 5px;position:absolute; bottom:5px;right:0px; list-style: none outside none; background: url(images/ksprite.png) -99px -104px no-repeat;} /* eventually: mtop inline via jq */ |
778 | | - .k-menu-bar li a { display:block; width:49px; height:32px; margin-left:1px; text-indent:99999px; background: url(images/ksprite.png) -51px -110px no-repeat; overflow:hidden;} |
779 | | - .k-menu-bar li a:hover { background-position: -1px -110px;} |
780 | | - .k-menu-bar li.k-download-btn a { background-position: -51px -204px;} |
781 | | - .k-menu-bar li.k-download-btn a:hover { background-position: -1px -204px;} |
782 | | - .k-menu-bar li.k-share-btn a { background-position: -51px -172px;} |
783 | | - .k-menu-bar li.k-share-btn a:hover { background-position: -1px -172px;} |
784 | | - .k-menu-bar li.k-credits-btn a { background-position: -51px -141px;} |
785 | | - .k-menu-bar li.k-credits-btn a:hover { background-position: -1px -141px;} |
| 776 | +.k-menu { opacity:0.9; filter:alpha(opacity=90); width:400px; height:300px; border:none; background:#181818; position:absolute; top:0; left:0; z-index:999; display:none} /* h, w, top inline via jq top:15px*/ |
| 777 | +ul.k-menu-bar{ height:128px; padding: 0 0 5px;position:absolute; bottom:5px;right:0px; list-style: none outside none; background: url(images/ksprite.png) -99px -104px no-repeat;} /* eventually: mtop inline via jq */ |
| 778 | +.k-menu-bar li a { display:block; width:49px; height:32px; margin-left:1px; text-indent:99999px; background: url(images/ksprite.png) -51px -110px no-repeat; overflow:hidden;} |
| 779 | +.k-menu-bar li a:hover { background-position: -1px -110px;} |
| 780 | +.k-menu-bar li.k-download-btn a { background-position: -51px -204px;} |
| 781 | +.k-menu-bar li.k-download-btn a:hover { background-position: -1px -204px;} |
| 782 | +.k-menu-bar li.k-share-btn a { background-position: -51px -172px;} |
| 783 | +.k-menu-bar li.k-share-btn a:hover { background-position: -1px -172px;} |
| 784 | +.k-menu-bar li.k-credits-btn a { background-position: -51px -141px;} |
| 785 | +.k-menu-bar li.k-credits-btn a:hover { background-position: -1px -141px;} |
786 | 786 | |
787 | 787 | .k-menu-screens { width:320px; padding: 13px 10px 15px 15px; float:left; font-size:11px;} /* w & h inline via jq */ |
788 | | - .k-menu-screens h2 { padding: 0 0 5px 1px; clear:both; font-size:12px; color:#999;} |
789 | | - .k-menu-screens p { margin: 6px 0;} |
790 | | - .k-menu-screens a { color:#bbb;} |
791 | | - .k-menu-screens a img { border:none;} |
792 | | - .k-menu-screens ul { padding:0; margin: 6px 0 0; list-style: none outside none;} |
| 788 | +.k-menu-screens h2 { padding: 0 0 5px 1px; clear:both; font-size:12px; color:#999;} |
| 789 | +.k-menu-screens p { margin: 6px 0;} |
| 790 | +.k-menu-screens a { color:#bbb;} |
| 791 | +.k-menu-screens a img { border:none;} |
| 792 | +.k-menu-screens ul { padding:0; margin: 6px 0 0; list-style: none outside none;} |
793 | 793 | |
794 | 794 | .k-edit-screen { width:370px; height:223px; padding-top:77px; text-align:center; background:#181818; color:#fff;} |
795 | | - .k-edit-screen div { } |
796 | | - .k-edit-screen a { color:#7BB8FC;} |
797 | | - .k-edit-screen a img { border:none;} |
| 795 | +.k-edit-screen div { } |
| 796 | +.k-edit-screen a { color:#7BB8FC;} |
| 797 | +.k-edit-screen a img { border:none;} |
798 | 798 | |
799 | 799 | /* end player */ |
800 | 800 | |
801 | 801 | .k-slide-window { overflow:hidden;} |
802 | 802 | .k-screen.k-credits ul { float:left;} |
803 | 803 | .k-screen.k-credits li { height:39px; padding: 11px 11px 11px 11px; margin-bottom:12px; display:block; background:#333;} |
804 | | - .k-screen.k-credits li a { padding:0; background:none;} |
805 | | - .k-screen.k-credits li img { float:left; background:blue;} |
806 | | - .k-screen.k-credits li div { height:39px; padding-left:11px; overflow:hidden;} |
| 804 | +.k-screen.k-credits li a { padding:0; background:none;} |
| 805 | +.k-screen.k-credits li img { float:left; background:blue;} |
| 806 | +.k-screen.k-credits li div { height:39px; padding-left:11px; overflow:hidden;} |
807 | 807 | |
808 | | - a.k-prev-credit, a.k-next-credit { width:65px; height:28px; margin: -13px auto -6px; display:block; background: url(images/ksprite.png) 0px -320px no-repeat;} |
809 | | - a.k-next-credit { margin: 0 0 1px; position:absolute; bottom:0; background-position: -0px -290px;} |
810 | | - a:hover.k-prev-credit { background-position: 0px -238px;} |
811 | | - a:hover.k-next-credit { background-position: 0px -260px;} |
| 808 | +a.k-prev-credit, a.k-next-credit { width:65px; height:28px; margin: -13px auto -6px; display:block; background: url(images/ksprite.png) 0px -320px no-repeat;} |
| 809 | +a.k-next-credit { margin: 0 0 1px; position:absolute; bottom:0; background-position: -0px -290px;} |
| 810 | +a:hover.k-prev-credit { background-position: 0px -238px;} |
| 811 | +a:hover.k-next-credit { background-position: 0px -260px;} |
812 | 812 | |
813 | | - .k-logo { margin:8px 0 0 1px; display:block;} |
| 813 | +.k-logo { margin:8px 0 0 1px; display:block;} |
814 | 814 | |
815 | | - .k_field_wrap { border: solid 1px #444; padding-right:4px; margin-bottom:7px;} |
816 | | - .menu-screen.menu-share button { width:84px; height:24px; padding: 0px 5px 3px; border:1px solid #000; float:right; background: #D4D4D4 url(images/ksprite.png) no-repeat 0 -81px; color:#000; float:right;} |
| 815 | +.k_field_wrap { border: solid 1px #444; padding-right:4px; margin-bottom:7px;} |
| 816 | +.menu-screen.menu-share button { width:84px; height:24px; padding: 0px 5px 3px; border:1px solid #000; float:right; background: #D4D4D4 url(images/ksprite.png) no-repeat 0 -81px; color:#000; float:right;} |
817 | 817 | |
818 | | - .k-menu textarea { width:100%; height:15px; padding-left:2px; border: solid 2px #000; border-bottom:none; border-right:none; line-height:125%; background:transparent; font: normal 11px arial,sans-serif; color:#ccc; overflow:hidden;} |
| 818 | +.k-menu textarea { width:100%; height:15px; padding-left:2px; border: solid 2px #000; border-bottom:none; border-right:none; line-height:125%; background:transparent; font: normal 11px arial,sans-serif; color:#ccc; overflow:hidden;} |
819 | 819 | |
| 820 | +.gnp-warning { font-size: 14px; padding: 4px;} |
820 | 821 | |
| 822 | +.k-options { text-transform: uppercase; } |
821 | 823 | |
822 | | - .menu-screen.menu-share div.ui-state-highlight { width:90px; padding:2px 5px; border-color:#554926; float:left; background:none; color:#FFE96E;} |
823 | | - .menu-screen.menu-share div.ui-state-highlight a { color:#FFE96E; font-weight:bold;} |
824 | | - .menu-screen.menu-share div.ui-state-highlight a:hover { } |
| 824 | +.menu-screen.menu-share div.ui-state-highlight { padding:2px 5px; border-color:#554926; float:left; background:none; color:#FFE96E;} |
| 825 | +.menu-screen.menu-share div.ui-state-highlight a { color:#FFE96E; font-weight:bold;} |
| 826 | +.menu-screen.menu-share div.ui-state-highlight a:hover { } |
825 | 827 | |
826 | 828 | .k-menu-screens li { height:14px; margin-bottom:6px;} |
827 | 829 | .k-menu-screens li a { padding-left:22px; background:url(images/ksprite.png) no-repeat -85px -274px; text-decoration:none;} |
— | — | @@ -836,37 +838,39 @@ |
837 | 839 | .k-player .ui-state-default .ui-icon-pause { background:url(images/ksprite.png) no-repeat 0 -17px;} |
838 | 840 | .k-player .ui-state-hover .ui-icon-pause { background-position: -16px -17px;} |
839 | 841 | |
840 | | - .k-player .ui-state-default .ui-icon-arrow-4-diag { background-position: 0 -32px;} /* fullscreen */ |
841 | | - .k-player .ui-state-hover .ui-icon-arrow-4-diag { background-position: -16px -32px;} |
842 | | - .k-player .ui-state-default .ui-icon-volume-on, .k-player .ui-state-hover .ui-icon-volume-off { margin-left:-6px; background-position: -16px -48px;} |
843 | | - .k-player .ui-state-hover .ui-icon-volume-on, .k-player .ui-state-default .ui-icon-volume-off { margin-left:-6px; background-position: 0 -48px;} |
| 842 | +.k-player .ui-state-default .ui-icon-arrow-4-diag { background-position: 0 -32px;} /* fullscreen */ |
| 843 | +.k-player .ui-state-hover .ui-icon-arrow-4-diag { background-position: -16px -32px;} |
| 844 | +.k-player .ui-state-default .ui-icon-volume-on, .k-player .ui-state-hover .ui-icon-volume-off { margin-left:-6px; background-position: -16px -48px;} |
| 845 | +.k-player .ui-state-hover .ui-icon-volume-on, .k-player .ui-state-default .ui-icon-volume-off { margin-left:-6px; background-position: 0 -48px;} |
844 | 846 | |
845 | | - .k-control-bar .ui-slider { height:8px; border: solid 1px #eee; margin: 4px 10px 0 7px; position:relative; background:url(images/ksprite.png) repeat-x 0 -350px;} |
846 | | - .k-control-bar .ui-slider-handle { width:8px; height:8px; border: solid 1px #888; margin: -1px 0 0 -5px; display:block; position:relative; top:0; background: url(images/ksprite.png) no-repeat -67px -341px; position:absolute;} |
847 | | - .k-control-bar .ui-slider-range { height:8px; position:absolute; background: url(images/ksprite.png) repeat-x 0 -368px; -moz-border-radius:5px; -webkit-border-radius:5px;} |
848 | | - .k-control-bar .ui-slider-buffer { height:8px; position:absolute; background: url(images/ksprite.png) repeat-x 0 -359px; -moz-border-radius:5px; -webkit-border-radius:5px;} |
849 | | - |
850 | | - .k-control-bar .ui-slider.k-volume-slider { height:15px; margin: 2px 3px 0 -4px; /* ie = m: 3 3 0 -2 */ border:none; background-position: -66px -323px; -moz-border-radius:0px; -webkit-border-radius:0px;} |
851 | | - .k-control-bar .k-volume-slider a.ui-slider-handle { width:8px; height:18px; margin: -3px 5px 0 -1px; border:none; display:block; position:absolute; background:none;} |
852 | | - .k-control-bar .k-volume-slider a:hover.ui-slider-handle { border: solid 1px #999;} |
853 | | - .k-control-bar .k-volume-slider .ui-slider-range { height:17px; position:absolute; background: url(images/ksprite.png) repeat-x -66px -306px; -moz-border-radius:0; -webkit-border-radius:0;} |
| 847 | +.k-control-bar .ui-slider { height:8px; border: solid 1px #eee; margin: 4px 10px 0 7px; position:relative; background:url(images/ksprite.png) repeat-x 0 -350px;} |
| 848 | +.k-control-bar .ui-slider-handle { width:8px; height:8px; border: solid 1px #888; margin: -1px 0 0 -5px; display:block; position:relative; top:0; background: url(images/ksprite.png) no-repeat -67px -341px; position:absolute;} |
| 849 | +.k-control-bar .ui-slider-range { height:8px; position:absolute; background: url(images/ksprite.png) repeat-x 0 -368px; -moz-border-radius:5px; -webkit-border-radius:5px;} |
| 850 | +.k-control-bar .ui-slider-buffer { height:8px; position:absolute; background: url(images/ksprite.png) repeat-x 0 -359px; -moz-border-radius:5px; -webkit-border-radius:5px;} |
854 | 851 | |
855 | | - .play-btn-large { width:120px; height:55px; border:none; background: url(images/ksprite.png) no-repeat 28px -433px; position:absolute; cursor:pointer;} /*.ui-state-default */ |
856 | | - .play-btn-large.ui-state-hover { background: url(images/ksprite.png) no-repeat 28px -377px; } |
| 852 | +.k-control-bar .ui-slider.k-volume-slider { height:15px; margin: 2px 3px 0 -4px; /* ie = m: 3 3 0 -2 */ border:none; background-position: -66px -323px; -moz-border-radius:0px; -webkit-border-radius:0px;} |
| 853 | +.k-control-bar .k-volume-slider a.ui-slider-handle { width:8px; height:18px; margin: -3px 5px 0 -1px; border:none; display:block; position:absolute; background:none;} |
| 854 | +.k-control-bar .k-volume-slider a:hover.ui-slider-handle { border: solid 1px #999;} |
| 855 | +.k-control-bar .k-volume-slider .ui-slider-range { height:17px; position:absolute; background: url(images/ksprite.png) repeat-x -66px -306px; -moz-border-radius:0; -webkit-border-radius:0;} |
857 | 856 | |
858 | | - .k-volume.ui-state-hover { margin-left:6px; } |
| 857 | +.play-btn-large { width:120px; height:55px; border:none; background: url(images/ksprite.png) no-repeat 28px -433px; position:absolute; cursor:pointer;} /*.ui-state-default */ |
| 858 | +.play-btn-large.ui-state-hover { background: url(images/ksprite.png) no-repeat 28px -377px; } |
859 | 859 | |
| 860 | +.k-volume.ui-state-hover { margin-left:6px; } |
860 | 861 | |
861 | | - /* move to ie css */ |
862 | | - .k-volume-slider span, span.ui-icon-play, span.ui-icon-volume-on, button.k-fullscreen { *margin-top:-1px;} |
863 | | - span.ui-icon-volume-on { *margin-left:0 !important;} |
864 | | - .ui-state-hover.k-volume { *margin-left:0 !important;} |
865 | | - span.ui-icon-k-menu { *margin-top:3px;} |
866 | | - .k-control-bar .ui-slider.k-volume-slider { *margin-left:-2px;} |
867 | | - /* end css */ |
868 | 862 | |
869 | | - /* debug only ! */ |
870 | | - /* end debug */ |
| 863 | +/* move to ie css */ |
| 864 | +.k-volume-slider span, span.ui-icon-play, span.ui-icon-volume-on, button.k-fullscreen { *margin-top:-1px;} |
| 865 | +span.ui-icon-volume-on { *margin-left:0 !important;} |
| 866 | +.ui-state-hover.k-volume { *margin-left:0 !important;} |
| 867 | +span.ui-icon-k-menu { *margin-top:3px;} |
| 868 | +.k-control-bar .ui-slider.k-volume-slider { *margin-left:-2px;} |
| 869 | +/* end css */ |
871 | 870 | |
| 871 | +/* debug only ! */ |
| 872 | +/* end debug */ |
872 | 873 | |
| 874 | +.ui-state-default, .ui-widget-content .ui-state-default { |
| 875 | + border:none; |
| 876 | +} |
873 | 877 | /*** end player ***/ |
\ No newline at end of file |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | * @@ more config valuse on the way ;) |
30 | 30 | */ |
31 | 31 | var defaultMwConfig = { |
32 | | - 'skin_name': 'kskin', |
| 32 | + 'skin_name': 'mvpcf', |
33 | 33 | 'jui_skin': 'redmond', |
34 | 34 | 'video_size':'400x300' |
35 | 35 | } |
— | — | @@ -414,9 +414,9 @@ |
415 | 415 | this.callbacks.push(callback); |
416 | 416 | } |
417 | 417 | if( this.checkLoading() ){ |
418 | | - if( this.load_time++ > 1000){ //time out after ~80seconds |
| 418 | + if( this.load_time++ > 2000){ //time out after ~80seconds |
419 | 419 | js_error( gM('error_load_lib') + this.missing_path ); |
420 | | - this.load_error=true; |
| 420 | + this.load_error = true; |
421 | 421 | }else{ |
422 | 422 | setTimeout( 'mvJsLoader.doLoad()', 20 ); |
423 | 423 | } |
— | — | @@ -469,7 +469,7 @@ |
470 | 470 | }); |
471 | 471 | } }, |
472 | 472 | checkLoading:function(){ |
473 | | - var loading=0; |
| 473 | + var loading=0; |
474 | 474 | var i=null; |
475 | 475 | for(var i in this.libs){ //for in loop oky on object |
476 | 476 | if( !this.checkObjPath( i ) ){ |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | "download_clip" : "Download video", |
28 | 28 | "download_text" : "Download text (<a style=\"color:white\" title=\"cmml\" href=\"http:\/\/wiki.xiph.org\/index.php\/CMML\">CMML<\/a> xml):", |
29 | 29 | "download" : "Download", |
30 | | - "share" : "Share", |
| 30 | + "share" : "Share", |
31 | 31 | "credits" : "Credits", |
32 | 32 | "clip_linkback" : "Clip source page", |
33 | 33 | "chose_player" : "Choose Video Player", |
— | — | @@ -47,7 +47,9 @@ |
48 | 48 | "mv_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 \/>", |
49 | 49 | "mv_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>", |
50 | 50 | "mv_do_not_warn_again" : "Dissmiss for now.", |
51 | | - "playerselect" : "Players" |
| 51 | + "playerselect" : "Players", |
| 52 | + "read_before_embed": 'Please <a href="http://mediawiki.org/wiki/Security_Notes_on_Remote_Embedding" target="_new">Read This</a> before embeding!', |
| 53 | + "embed_site_or_blog": "Embed on your site or blog" |
52 | 54 | }); |
53 | 55 | |
54 | 56 | var default_video_attributes = { |
— | — | @@ -1576,19 +1578,18 @@ |
1577 | 1579 | showShare:function($target){ |
1578 | 1580 | var embed_code = this.getEmbeddingHTML(); |
1579 | 1581 | var o = ''; |
1580 | | - //@todo: hook events to two a's for swapping in and out code for link vs. embed; |
1581 | | - // hook events for changing active class of li based on a. |
1582 | | - o+= '<h2>Share This Video</h2>\n' + |
| 1582 | + //@todo: hook events to two a's for swapping in and out code for link vs. embed; |
| 1583 | + // hook events for changing active class of li based on a. |
| 1584 | + o+= '<h2>' + gM('share_this_video') + '</h2>\n' + |
1583 | 1585 | ' <ul>\n' + |
1584 | | - ' <li><a href="#" id="k-share-embed" class="active">Embed on your site or blog</a></li>\n'; |
| 1586 | + ' <li><a href="#" id="k-share-embed" class="active">'+gM('embed_site_or_blog')+'</a></li>\n'; |
1585 | 1587 | if(this.linkback) { |
1586 | | - o+= ' <li><a href="#" id="k-share-link">' + this.linkback + '</a></li>\n'; |
1587 | | - } |
| 1588 | + o+= ' <li><a href="#" id="k-share-link">' + this.linkback + '</a></li>\n'; |
| 1589 | + } |
1588 | 1590 | o+= ' </ul>\n' + |
1589 | 1591 | ' <div class="k_field_wrap"><textarea>' + embed_code + '</textarea></div>\n' + |
1590 | 1592 | ' <button class="ui-state-default ui-corner-all"> Copy Code </button>\n' + |
1591 | | - ' <div class="ui-state-highlight ui-corner-all"><a href="http://metavid.org/wiki/Security_Notes_on_Remote_Embedding" target="_blank">' + |
1592 | | - 'Read This</a> before embeding!</div>\n' + |
| 1593 | + ' <div class="ui-state-highlight ui-corner-all">'+gM('read_before_embed') + '</div>\n' + |
1593 | 1594 | '</div>' |
1594 | 1595 | |
1595 | 1596 | // '<textarea onClick="this.select();" id="embedding_user_html_' + this.id + '" name="embed">' + |
— | — | @@ -1930,13 +1931,13 @@ |
1931 | 1932 | var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
1932 | 1933 | if(this.muted){ |
1933 | 1934 | this.muted=false; |
1934 | | - $j( '#volume_control_' + this_id + ' span').removeClass('ui-icon-volume-off').addClass('ui-icon-volume-on'); |
1935 | | - $j( '#volume_bar_' + this_id).slider('value', 100); |
| 1935 | + $j( '#'+ this_id + ' .volume_control span').removeClass('ui-icon-volume-off').addClass('ui-icon-volume-on'); |
| 1936 | + $j( '#'+ this_id + ' .volume_bar' ).slider('value', 100); |
1936 | 1937 | this.updateVolumen(1); |
1937 | 1938 | }else{ |
1938 | 1939 | this.muted=true; |
1939 | | - $j('#volume_control_'+this_id + ' span').removeClass('ui-icon-volume-on').addClass('ui-icon-volume-off'); |
1940 | | - $j('#volume_bar_'+this_id).slider('value', 0); |
| 1940 | + $j( '#'+ this_id + ' .volume_control span').removeClass('ui-icon-volume-on').addClass('ui-icon-volume-off'); |
| 1941 | + $j( '#'+ this_id + ' .volume_bar' ).slider('value', 0); |
1941 | 1942 | this.updateVolumen(0); |
1942 | 1943 | } |
1943 | 1944 | js_log('f:toggleMute::' + this.muted); |
Index: trunk/phase3/js2/uploadPage.js |
— | — | @@ -25,7 +25,9 @@ |
26 | 26 | 'new_source_cb' : function( orgFilename, oggName ){ |
27 | 27 | if($j('#wpDestFile').val() == "") |
28 | 28 | $j('#wpDestFile').val( oggName ); |
29 | | - mwUploadHelper.doDestCheck(); |
| 29 | + $j('#wpDestFile').doDestCheck({ |
| 30 | + 'warn_target':'#wpDestFile-warning' |
| 31 | + }); |
30 | 32 | }, |
31 | 33 | 'detect_cb':function( fogg_installed ){ |
32 | 34 | if(fogg_installed){ |
— | — | @@ -48,7 +50,11 @@ |
49 | 51 | |
50 | 52 | if( wgAjaxUploadDestCheck ){ |
51 | 53 | //do destination check: |
52 | | - $j('#wpDestFile').change( mwUploadHelper.doDestCheck ); |
| 54 | + $j('#wpDestFile').change(function(){ |
| 55 | + $j(this).doDestCheck({ |
| 56 | + 'warn_target':'#wpDestFile-warning' |
| 57 | + }); |
| 58 | + }); |
53 | 59 | } |
54 | 60 | |
55 | 61 | //check if we have http enabled & setup enable/disable toggle: |
— | — | @@ -86,72 +92,11 @@ |
87 | 93 | 'firefogg_form_action': $j('#wpSourceTypeFile').attr('checked') |
88 | 94 | }); |
89 | 95 | } |
90 | | - }, |
| 96 | + }, |
91 | 97 | /** |
92 | | - * doDestCheck checks the destination |
93 | | - */ |
94 | | - doDestCheck:function(){ |
95 | | - var _this = this; |
96 | | - $j('#wpDestFile-warning').empty(); |
97 | | - //show loading |
98 | | - $j('#wpDestFile').after('<img id = "mw-spinner-wpDestFile" src ="'+ stylepath + '/common/images/spinner.gif" />'); |
99 | | - //try and get a thumb of the current file (check its destination) |
100 | | - do_api_req({ |
101 | | - 'data':{ |
102 | | - 'titles': 'File:' + $j('#wpDestFile').val(),//@@todo we may need a more clever way to get a the filename |
103 | | - 'prop': 'imageinfo', |
104 | | - 'iiprop':'url|mime|size', |
105 | | - 'iiurlwidth': 150 |
106 | | - }, |
107 | | - 'url': _this.api_url |
108 | | - },function(data){ |
109 | | - //remove spinner: |
110 | | - $j('#mw-spinner-wpDestFile').remove(); |
111 | | - if(data && data.query && data.query.pages){ |
112 | | - if( data.query.pages[-1] ){ |
113 | | - //all good no file there |
114 | | - }else{ |
115 | | - for(var page_id in data.query.pages){ |
116 | | - if( data.query.normalized){ |
117 | | - var ntitle = data.query.normalized[0].to; |
118 | | - }else{ |
119 | | - var ntitle = data.query.pages[ page_id ].title; |
120 | | - } |
121 | | - var img = data.query.pages[ page_id ].imageinfo[0]; |
122 | | - $j('#wpDestFile-warning').html( |
123 | | - '<ul>' + |
124 | | - '<li>'+ |
125 | | - gM('mwe-fileexists', ntitle) + |
126 | | - '</li>'+ |
127 | | - '<div class="thumb tright">' + |
128 | | - '<div style="width: ' + ( parseInt(img.thumbwidth)+2 ) + 'px;" class="thumbinner">' + |
129 | | - '<a title="' + ntitle + '" class="image" href="' + img.descriptionurl + '">' + |
130 | | - '<img width="' + img.thumbwidth + '" height="' + img.thumbheight + '" border="0" class="thumbimage" ' + |
131 | | - 'src="' + img.thumburl + '"' + |
132 | | - ' alt="' + ntitle + '"/>' + |
133 | | - '</a>' + |
134 | | - '<div class="thumbcaption">' + |
135 | | - '<div class="magnify">' + |
136 | | - '<a title="' + gM('thumbnail-more') + '" class="internal" ' + |
137 | | - 'href="' + img.descriptionurl +'"><img width="15" height="11" alt="" ' + |
138 | | - 'src="' + stylepath + "/common/images/magnify-clip.png\" />" + |
139 | | - '</a>'+ |
140 | | - '</div>'+ |
141 | | - gM('mwe-fileexists-thumb') + |
142 | | - '</div>' + |
143 | | - '</div>'+ |
144 | | - '</div>' + |
145 | | - '</ul>' |
146 | | - ); |
147 | | - } |
148 | | - } |
149 | | - } |
150 | | - }); |
151 | | - }, |
152 | | - /** |
153 | 98 | * doDestinationFill fills in a destination file-name based on a source asset name. |
154 | 99 | */ |
155 | | - doDestinationFill:function( targetElm ){ |
| 100 | + doDestinationFill : function( targetElm ){ |
156 | 101 | js_log("doDestinationFill") |
157 | 102 | //remove any previously flagged errors |
158 | 103 | $j('#mw-upload-permitted,#mw-upload-prohibited').hide(); |