Index: trunk/phase3/js2/mwEmbed/example_usage/Player_Simple_Video_Tag.html |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | <br /> |
15 | 15 | <table border="1" cellpadding="6" width="600"> |
16 | 16 | <tr> |
17 | | - <td valign="top"><video duration="26" poster="http://metavid.org/w/index.php?action=ajax&rs=mv_frame_server&stream_id=71&t=1:23:16&size=400x300" src="http://metavidstorage01.ucsc.edu/media/house_proceeding_07-18-06_00.ogg?t=1:23:16/1:23:44"></video></video></td> |
| 17 | + <td valign="top"><video durationHint="26" poster="http://metavid.org/w/index.php?action=ajax&rs=mv_frame_server&stream_id=71&t=1:23:16&size=400x300" src="http://metavidstorage01.ucsc.edu/media/house_proceeding_07-18-06_00.ogg?t=1:23:16/1:23:44"></video></video></td> |
18 | 18 | <td valign="top"><b>Sample Embed</b><br /> |
19 | 19 | Simple video Embed: |
20 | 20 | <pre><video poster="http://metavid.org/w/index.php?action=ajax&rs=mv_frame_server&stream_id=71&t=1:23:16&size=400x300" |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | var out = ''; |
152 | 152 | $j.each(default_firefogg_options, function(target, na){ |
153 | 153 | if(target.substring(0, 6)=='target'){ |
154 | | - js_log('check for target html: ' + target); |
| 154 | + //js_log('check for target html: ' + target); |
155 | 155 | //check for the target if missing add to the output: |
156 | 156 | if( _this[target] === false){ |
157 | 157 | out += _this.getTargetHtml(target) + ' '; |
— | — | @@ -450,7 +450,7 @@ |
451 | 451 | //doChunkUpload does both uploading and encoding at the same time and uploads one meg chunks as they are ready |
452 | 452 | doChunkUpload : function(){ |
453 | 453 | js_log('doChunkUpload::'); |
454 | | - var _this = this; |
| 454 | + var _this = this; |
455 | 455 | _this.action_done = false; |
456 | 456 | //extension should already be ogg but since its user editable, |
457 | 457 | //check again |
— | — | @@ -466,7 +466,29 @@ |
467 | 467 | _this.formData['wpDestFile'] = sf.replace(extreg, '.ogg'); |
468 | 468 | } |
469 | 469 | //add chunk response hook to build the resultURL when uploading chunks |
470 | | - |
| 470 | + |
| 471 | + //check for editToken: |
| 472 | + if(!this.etoken){ |
| 473 | + if( _this.formData['wpEditToken']){ |
| 474 | + _this.etoken = _this.formData['wpEditToken']; |
| 475 | + _this.doChunkWithFormData(); |
| 476 | + }else{ |
| 477 | + get_mw_token( |
| 478 | + 'File:'+ _this.formData['wpDestFile'], |
| 479 | + _this.api_url, |
| 480 | + function( eToken ){ |
| 481 | + _this.etoken = eToken; |
| 482 | + _this.doChunkWithFormData(); |
| 483 | + } |
| 484 | + ); |
| 485 | + } |
| 486 | + }else{ |
| 487 | + _this.doChunkWithFormData(); |
| 488 | + } |
| 489 | + }, |
| 490 | + doChunkWithFormData:function(){ |
| 491 | + var _this = this; |
| 492 | + js_log("doChunkWithFormData::" + _this.etoken); |
471 | 493 | //build the api url: |
472 | 494 | var aReq ={ |
473 | 495 | 'action' : 'upload', |
— | — | @@ -475,11 +497,8 @@ |
476 | 498 | 'comment' : _this.formData['wpUploadDescription'], |
477 | 499 | 'enablechunks' : 'true' |
478 | 500 | }; |
479 | | - //check for editToken: |
480 | | - if(!this.etoken) |
481 | | - this.etoken = _this.formData['wpEditToken']; |
482 | | - |
483 | | - if( this.etoken ) |
| 501 | + |
| 502 | + if( _this.etoken ) |
484 | 503 | aReq['token'] = this.etoken; |
485 | 504 | |
486 | 505 | if( _this.formData['wpWatchthis'] ) |
— | — | @@ -554,7 +573,7 @@ |
555 | 574 | }, |
556 | 575 | doUploadStatus:function() { |
557 | 576 | var _this = this; |
558 | | - $j('#up-status-state').html( gM('uploaded-status') ); |
| 577 | + $j( '#up-status-state' ).html( gM('uploaded-status') ); |
559 | 578 | |
560 | 579 | _this.oldResponseText = ''; |
561 | 580 | //setup a local function for timed callback: |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | "rsd_results_prev" : "previous ", |
19 | 19 | "rsd_no_results" : "No search results for <b>$1</b>", |
20 | 20 | |
21 | | - "mv_upload" : "Upload", |
| 21 | + "upload_tab" : "Upload", |
22 | 22 | "rsd_layout" : "Layout:", |
23 | 23 | "rsd_resource_edit" : "Edit Resource: $1", |
24 | 24 | "resource_description_page": "Resource Description Page", |
— | — | @@ -34,7 +34,9 @@ |
35 | 35 | "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 info</a></p>", |
36 | 36 | "results_from": "Results from <a href=\"$1\" target=\"_new\" >$2</a>", |
37 | 37 | |
38 | | - "missing_desc_see_soruce": "This Asset is missing a description. Please see the [$1 orginal source] and help describe it" |
| 38 | + "missing_desc_see_soruce": "This Asset is missing a description. Please see the [$1 orginal source] and help describe it", |
| 39 | + |
| 40 | + "rsd_config_error": "Add media Wizard configuation error: $1" |
39 | 41 | }); |
40 | 42 | var default_remote_search_options = { |
41 | 43 | 'profile':'mediawiki_edit', |
— | — | @@ -63,7 +65,8 @@ |
64 | 66 | 'cFileNS':'File', //what is the cannonical namespace for images |
65 | 67 | //@@todo (should get that from the api or inpage vars) |
66 | 68 | |
67 | | - 'enable_upload_tab':true // if we want to enable an uploads tab: |
| 69 | + 'enable_upload_tab':true, // if we want to enable an uploads tab: |
| 70 | + 'upload_api_target' : 'http://127.0.0.1/wiki_trunk/api.php' // can be local or the url of the upload api. |
68 | 71 | } |
69 | 72 | if(typeof wgServer == 'undefined') |
70 | 73 | wgServer = ''; |
— | — | @@ -93,7 +96,7 @@ |
94 | 97 | * sets the default display item: |
95 | 98 | * can be any content_providers key or 'all' |
96 | 99 | */ |
97 | | - disp_item : 'this_wiki', |
| 100 | + disp_item : 'upload', |
98 | 101 | /** the default content providers list. |
99 | 102 | * |
100 | 103 | * (should be note that special tabs like "upload" and "combined" don't go into the content proviers list: |
— | — | @@ -330,15 +333,16 @@ |
331 | 334 | } |
332 | 335 | } |
333 | 336 | |
334 | | - //make sure the selected cp has an api to query against: |
335 | | - if(! this.content_providers[ this.disp_item ].api_url ){ |
| 337 | + //make sure the selected cp has an api to query against (if its a content_provider |
| 338 | + if( this.content_providers[ this.disp_item ] && |
| 339 | + !this.content_providers[ this.disp_item ].api_url ){ |
336 | 340 | for(var inx in this.content_providers){ |
337 | 341 | if( this.content_providers[ inx ].api_url ){ |
338 | 342 | this.disp_item = inx; |
339 | 343 | break; |
340 | 344 | } |
341 | 345 | } |
342 | | - } |
| 346 | + } |
343 | 347 | |
344 | 348 | |
345 | 349 | //set up the default model config: |
— | — | @@ -554,34 +558,49 @@ |
555 | 559 | }); |
556 | 560 | }, |
557 | 561 | doUploadInteface:function(){ |
558 | | - var _this = this; |
559 | | - mv_set_loading('#tab-upload'); |
560 | | - $j('#tab-upload').html('upload interface goes here ;)'); |
561 | | - |
562 | | - //todo include firefogg support: |
563 | | - /*mvJsLoader.doLoad( [ |
564 | | - 'mvUploader' |
565 | | - ],function(){ |
566 | | - _this.cUpLoader = new mvUploader({ |
567 | | - 'target_div': '#tab-upload', |
568 | | - 'upload_done_action:': function( rTitle){ |
569 | | - //set to loading: |
570 | | - mv_set_loading('#tab-upload'); |
571 | | - //do a direct api query for resource info (to build rObj |
572 | | - _this.getResourceFromTitle( rTitle, function(rObj){ |
573 | | - //call resource Edit: |
574 | | - _this.resourceEdit( rObj ); |
575 | | - }); |
576 | | - } |
577 | | - }); |
578 | | - }); */ |
| 562 | + js_log("doUploadInteface::"); |
| 563 | + var _this = this; |
| 564 | + //set it to loading: |
| 565 | + mv_set_loading('#tab-upload'); |
| 566 | + |
| 567 | + //do config variable reality checks: |
| 568 | + if( _this.upload_api_target == 'local' ){ |
| 569 | + if( ! _this.local_wiki_api_url ){ |
| 570 | + $j('#tab-upload').html( gM( 'rsd_config_error', 'missing_local_api_url' ) ); |
| 571 | + return false; |
| 572 | + }else{ |
| 573 | + _this.upload_api_target = _this.local_wiki_api_url; |
| 574 | + } |
| 575 | + } |
| 576 | + //make sure we have a url for the upload target: |
| 577 | + if( parseUri( _this.upload_api_target ).host == _this.upload_api_target ){ |
| 578 | + $j('#tab-upload').html( gM('rsd_config_error', 'bad_api_url') ); |
| 579 | + return false; |
| 580 | + } |
| 581 | + //output the form |
| 582 | + mvJsLoader.doLoad(['$j.fn.simpleUploadForm'],function(){ |
| 583 | + //set the form action based on domain: |
| 584 | + if( parseUri( document.URL ).host == parseUri( _this.upload_api_target ).host ){ |
| 585 | + //deal with the api form upload form directly: |
| 586 | + $j('#tab-upload').simpleUploadForm({ |
| 587 | + "api_target" : _this.upload_api_target |
| 588 | + }) |
| 589 | + }else{ |
| 590 | + //setup the proxy |
| 591 | + } |
| 592 | + }); |
579 | 593 | }, |
580 | 594 | runSearch: function(){ |
581 | 595 | js_log("f:runSearch::" + this.disp_item); |
582 | 596 | //draw_direct_flag |
583 | 597 | var draw_direct_flag = true; |
584 | | - if( !this.content_providers[this.disp_item] ){ |
585 | | - js_log("can't run search for:" + this.disp_item); |
| 598 | + if( !this.content_providers[this.disp_item] ){ |
| 599 | + //check if its the special upload tab case: |
| 600 | + if( this.disp_item == 'upload'){ |
| 601 | + this.doUploadInteface(); |
| 602 | + }else{ |
| 603 | + js_log("can't run search for:" + this.disp_item); |
| 604 | + } |
586 | 605 | return false; |
587 | 606 | } |
588 | 607 | cp = this.content_providers[this.disp_item]; |
— | — | @@ -792,8 +811,10 @@ |
793 | 812 | } |
794 | 813 | //do an upload tab if enabled: |
795 | 814 | if( this.enable_upload_tab ){ |
796 | | - o+='<li class="rsd_cp_tab" ><a id="rsd_tab_upload" href="#tab-upload">' + gM('upload') + '</a></li>'; |
| 815 | + o+='<li class="rsd_cp_tab" ><a id="rsd_tab_upload" href="#tab-upload">' + gM('upload_tab') + '</a></li>'; |
797 | 816 | tabc+='<div id="tab-upload" />'; |
| 817 | + if(this.disp_item == 'upload') |
| 818 | + selected_tab = inx++; |
798 | 819 | } |
799 | 820 | o+='</ul>'; |
800 | 821 | //output the tab content containers: |
— | — | @@ -1087,31 +1108,36 @@ |
1088 | 1109 | |
1089 | 1110 | }, |
1090 | 1111 | /*set-up the control actions for clipEdit with relevent callbacks */ |
1091 | | - getClipEditControlActions:function(){ |
| 1112 | + getClipEditControlActions:function( cp ){ |
1092 | 1113 | var _this = this; |
1093 | | - return { |
1094 | | - 'insert' :function(rObj){ |
1095 | | - _this.insertResource(rObj); |
1096 | | - }, |
1097 | | - 'preview':function(rObj){ |
| 1114 | + var cConf= {}; |
| 1115 | + |
| 1116 | + cConf['insert'] = function(rObj){ |
| 1117 | + _this.insertResource(rObj); |
| 1118 | + } |
| 1119 | + //if not directly inserting the resource is support a preview option: |
| 1120 | + if( _this.import_url_mode != 'remote_link'){ |
| 1121 | + cConf['preview'] = function(rObj){ |
1098 | 1122 | _this.previewResource( rObj ) |
1099 | | - }, |
1100 | | - 'cancel' :function(){ |
1101 | | - _this.cancelClipEditCB() |
1102 | | - } |
1103 | | - }; |
| 1123 | + }; |
| 1124 | + } |
| 1125 | + cConf['cancel'] = function(){ |
| 1126 | + _this.cancelClipEditCB() |
| 1127 | + } |
| 1128 | + return cConf; |
1104 | 1129 | }, |
1105 | 1130 | //loads the media editor: |
1106 | 1131 | doMediaEdit:function( rObj , mediaType){ |
1107 | | - var _this = this; |
| 1132 | + var _this = this; |
| 1133 | + var cp = rObj.pSobj.cp; |
1108 | 1134 | var mvClipInit = { |
1109 | 1135 | 'rObj':rObj, //the resource object |
1110 | | - 'parent_ct':'rsd_modal_target', |
1111 | | - 'clip_disp_ct':'clip_edit_disp', |
1112 | | - 'control_ct': 'clip_edit_ctrl', |
1113 | | - 'media_type': mediaType, |
1114 | | - 'p_rsdObj': _this, |
1115 | | - 'controlActionsCb':_this.getClipEditControlActions() |
| 1136 | + 'parent_ct' : 'rsd_modal_target', |
| 1137 | + 'clip_disp_ct' : 'clip_edit_disp', |
| 1138 | + 'control_ct' : 'clip_edit_ctrl', |
| 1139 | + 'media_type' : mediaType, |
| 1140 | + 'p_rsdObj' : _this, |
| 1141 | + 'controlActionsCb' : _this.getClipEditControlActions( cp ) |
1116 | 1142 | }; |
1117 | 1143 | |
1118 | 1144 | var clibs = ['mvClipEdit']; |
— | — | @@ -1501,7 +1527,7 @@ |
1502 | 1528 | updatePreviewText:function( rObj ){ |
1503 | 1529 | var _this = this; |
1504 | 1530 | |
1505 | | - if(_this.import_url_mode=='remote_link'){ |
| 1531 | + if( _this.import_url_mode == 'remote_link' ){ |
1506 | 1532 | _this.cur_embed_code = rObj.pSobj.getEmbedHTML(rObj); |
1507 | 1533 | }else{ |
1508 | 1534 | _this.cur_embed_code = rObj.pSobj.getEmbedWikiCode( rObj ); |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/simpleUploadForm.js |
— | — | @@ -0,0 +1,86 @@ |
| 2 | +/* |
| 3 | + * simple form output jquery binding |
| 4 | + * enables dynamic form output to a given target |
| 5 | + * |
| 6 | + */ |
| 7 | + |
| 8 | +loadGM({ |
| 9 | + "select_file" : "Select File", |
| 10 | + "more_licence_options" : "For more licence options view the <a href=\"$1\">normal upload page</a>", |
| 11 | + "select_ownwork" : "I am uploading entirely my own work, and licencing it under:", |
| 12 | + "licence_cc-by-sa" : "Creative Commons Share Alike (3.0)", |
| 13 | + "upload" : "Upload File", |
| 14 | + "destfilename" : "Destination filename:", |
| 15 | + "summary" : "Summary" |
| 16 | +}); |
| 17 | + |
| 18 | +var default_form_options = { |
| 19 | + 'enable_fogg' : true, |
| 20 | + 'licence_options':['cc-by-sa'], |
| 21 | + 'api_target' : false |
| 22 | +}; |
| 23 | + |
| 24 | +(function($) { |
| 25 | + $.fn.simpleUploadForm = function( opt , callback){ |
| 26 | + //set the options: |
| 27 | + for(var i in default_form_options){ |
| 28 | + if(!opt[i]) |
| 29 | + opt[i] = default_form_options[i]; |
| 30 | + } |
| 31 | + |
| 32 | + //first do a reality check on the options: |
| 33 | + if(!opt.api_target){ |
| 34 | + $(this.selector).html('Error: Missing api target'); |
| 35 | + return false; |
| 36 | + } |
| 37 | + |
| 38 | + |
| 39 | + //@@todo this is just a proof of concept |
| 40 | + //much todo to improved this web form |
| 41 | + var o = '<div style="margin: 0 auto;">'+ |
| 42 | + '<form id="suf-upload" enctype="multipart/form-data" action="" method="post">' + |
| 43 | + '<label for="wpUploadFile">' + gM('select_file') + '</label><br>'+ |
| 44 | + '<input type="file" style="display: inline;" name="wpUploadFile" id="wpUploadFile" size="10"/><br>' + |
| 45 | + '<label for="wpDestFile">' +gM('destfilename') + '</label><br>'+ |
| 46 | + '<input type="text" id="wpDestFile" name="wpDestFile" size="30" /><br>'+ |
| 47 | + '<label for="wpUploadDescription">' + gM('summary') + ':</label><br>' + |
| 48 | + '<textarea cols="30" rows="3" id="wpUploadDescription" name="wpUploadDescription" tabindex="3"/><br>'+ |
| 49 | + gM('select_ownwork') + '<br>' + |
| 50 | + '<input type="checkbox" id="wpLicence" name="wpLicence" value="cc-by-sa">' + gM('licence_cc-by-sa') + '<br>' + |
| 51 | + |
| 52 | + '<input type="submit" accesskey="s" value="' + gM('upload') + '" name="wpUploadBtn" id="wpUploadBtn" tabindex="9"/>' + |
| 53 | + //close the form and div |
| 54 | + '</form></div>'; |
| 55 | + |
| 56 | + //set the target with the form output: |
| 57 | + $(this.selector).html( o ); |
| 58 | + //by default dissable: |
| 59 | + $j('#wpUploadBtn').attr('disabled', 'disabled'); |
| 60 | + |
| 61 | + //set up basic binding: |
| 62 | + $j('#wpLicence').click(function(){ |
| 63 | + if( $j(this).is(':checked') ){ |
| 64 | + $j('#wpUploadBtn').removeAttr('disabled'); |
| 65 | + }else{ |
| 66 | + $j('#wpUploadBtn').attr('disabled', 'disabled'); |
| 67 | + } |
| 68 | + }); |
| 69 | + |
| 70 | + //set up the binding per the config |
| 71 | + if( opt.enable_fogg ){ |
| 72 | + $j('#wpUploadFile').firefogg({ |
| 73 | + //an api url (we won't submit directly to action of the form) |
| 74 | + 'api_url' : opt.api_target, |
| 75 | + 'form_rewrite': true, |
| 76 | + 'target_edit_from' : '#suf-upload', |
| 77 | + 'new_source_cb' : function( orgFilename, oggName ){ |
| 78 | + $j('#wpDestFile').val( oggName ); |
| 79 | + //@@TODO: |
| 80 | + //mwUploadHelper.doDestCheck(); |
| 81 | + } |
| 82 | + }); |
| 83 | + }else{ |
| 84 | + //simple web form rewrite |
| 85 | + } |
| 86 | + } |
| 87 | +})(jQuery); |
\ No newline at end of file |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | setupForm:function(){ |
80 | 80 | var _this = this; |
81 | 81 | //set up the local pointer to the edit form: |
82 | | - _this.editForm = _this.getEditForm(); |
| 82 | + _this.editForm = _this.getEditForm(); |
83 | 83 | |
84 | 84 | if( _this.editForm ){ |
85 | 85 | //set up the org_onsubmit if not set: |
— | — | @@ -86,7 +86,7 @@ |
87 | 87 | _this.org_onsubmit = _this.editForm.onsubmit; |
88 | 88 | |
89 | 89 | //have to define the onsubmit function inline or its hard to pass the "_this" instance |
90 | | - $j( '#mw-upload-form' ).submit( function(){ |
| 90 | + $j( _this.editForm ).submit( function(){ |
91 | 91 | //run the original onsubmit (if not run yet set flag to avoid excessive chaining ) |
92 | 92 | if( typeof( _this.org_onsubmit ) == 'function' ){ |
93 | 93 | if( ! _this.org_onsubmit() ){ |
— | — | @@ -95,8 +95,7 @@ |
96 | 96 | } |
97 | 97 | } |
98 | 98 | //check for post action override: |
99 | | - if( _this.form_post_override ){ |
100 | | - //alert('will submit here'); |
| 99 | + if( _this.form_post_override ){ |
101 | 100 | return true; |
102 | 101 | } |
103 | 102 | //get the input form data in flat json: |
Index: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | this.doDisplayEdit(); |
85 | 85 | }else{ |
86 | 86 | //check the media_type: |
87 | | - js_log('mvClipEdit:: media type:' + this.media_type + ' base width: ' + this.rObj.width + ' bh: ' + this.rObj.height); |
| 87 | + //js_log('mvClipEdit:: media type:' + this.media_type + ' base width: ' + this.rObj.width + ' bh: ' + this.rObj.height); |
88 | 88 | //could seperate out into media Types objects for now just call method |
89 | 89 | if(this.media_type == 'image'){ |
90 | 90 | this.setUpImageCtrl(); |
— | — | @@ -466,7 +466,7 @@ |
467 | 467 | var b_target = _this.p_rsdObj.target_container + '~ .ui-dialog-buttonpane'; |
468 | 468 | //empty the ui-dialog-buttonpane bar: |
469 | 469 | $j(b_target).empty(); |
470 | | - for(var cbType in _this.controlActionsCb){ |
| 470 | + for( var cbType in _this.controlActionsCb ){ |
471 | 471 | switch(cbType){ |
472 | 472 | case 'insert_seq': |
473 | 473 | $j(b_target).append( $j.btnHtml(gM('mv_insert_into_sequence'), 'mv_insert_sequence', 'check' ) + ' ' ) |
Index: trunk/phase3/js2/mwEmbed/mwHostProxy.html |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 3 | +"http://www.w3.org/TR/html4/loose.dtd"> |
| 4 | +<html> |
| 5 | +<head> |
| 6 | + <title></title> |
| 7 | + <script type="text/javascript"> |
| 8 | + |
| 9 | + </script> |
| 10 | +</head> |
| 11 | +<body> |
| 12 | +<h3> This file should be inclued by external sites that want to be proxied: </h3> |
| 13 | +</body> |
| 14 | +</html> |
| 15 | + |
Index: trunk/phase3/js2/mwEmbed/php/jsAutoloadLocalClasses.php |
— | — | @@ -58,6 +58,7 @@ |
59 | 59 | // libAddMedia: |
60 | 60 | $wgJSAutoloadLocalClasses['mvFirefogg'] = $wgMwEmbedDirectory . 'libAddMedia/mvFirefogg.js'; |
61 | 61 | $wgJSAutoloadLocalClasses['mvAdvFirefogg'] = $wgMwEmbedDirectory . 'libAddMedia/mvAdvFirefogg.js'; |
| 62 | +$wgJSAutoloadLocalClasses['j.fn.simpleUploadForm'] = $wgMwEmbedDirectory . 'libAddMedia/simpleUploadForm.js'; |
62 | 63 | $wgJSAutoloadLocalClasses['mvBaseUploadInterface'] = $wgMwEmbedDirectory . 'libAddMedia/mvBaseUploadInterface.js'; |
63 | 64 | $wgJSAutoloadLocalClasses['remoteSearchDriver'] = $wgMwEmbedDirectory . 'libAddMedia/remoteSearchDriver.js'; |
64 | 65 | $wgJSAutoloadLocalClasses['seqRemoteSearchDriver'] = $wgMwEmbedDirectory . 'libAddMedia/seqRemoteSearchDriver.js'; |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -150,13 +150,14 @@ |
151 | 151 | '$j.fn.datePicker' : 'jquery/plugins/jquery.datePicker.js', |
152 | 152 | '$j.ui' : 'jquery/jquery.ui-1.7.1/ui/ui.core.js', |
153 | 153 | '$j.fn.ColorPicker' : 'libClipEdit/colorpicker/js/colorpicker.js', |
154 | | - '$j.Jcrop' : 'libClipEdit/Jcrop/js/jquery.Jcrop.js' |
| 154 | + '$j.Jcrop' : 'libClipEdit/Jcrop/js/jquery.Jcrop.js', |
| 155 | + '$j.fn.simpleUploadForm': 'libAddMedia/simpleUploadForm.js' |
155 | 156 | }); |
156 | 157 | //query plugins |
157 | 158 | lcPaths( 'jquery/plugins/', [ |
158 | 159 | '$j.secureEvalJSON', |
159 | 160 | '$j.cookie', |
160 | | - '$j.contextMenu', |
| 161 | + '$j.contextMenu' |
161 | 162 | ]); |
162 | 163 | //jquery ui |
163 | 164 | lcPaths('jquery/jquery.ui-1.7.1/ui/', [ |
— | — | @@ -183,7 +184,7 @@ |
184 | 185 | '$j.effects.slide', |
185 | 186 | '$j.ui.accordion', |
186 | 187 | '$j.ui.draggable', |
187 | | - '$j.ui.selectable', |
| 188 | + '$j.ui.selectable' |
188 | 189 | ], |
189 | 190 | {'j_replace':''}); |
190 | 191 | //add mediaLibs |
— | — | @@ -192,7 +193,7 @@ |
193 | 194 | 'mvAdvFirefogg', |
194 | 195 | 'mvBaseUploadInterface', |
195 | 196 | 'remoteSearchDriver', |
196 | | - 'seqRemoteSearchDriver', |
| 197 | + 'seqRemoteSearchDriver' |
197 | 198 | ]); |
198 | 199 | //search libs: |
199 | 200 | lcPaths('libAddMedia/searchLibs/', [ |
— | — | @@ -1041,7 +1042,8 @@ |
1042 | 1043 | * @param api_url 'optional' the target api url |
1043 | 1044 | * @param callback the callback function to pass the token or "false" to |
1044 | 1045 | */ |
1045 | | -function get_mw_token( title, api_url, callback){ |
| 1046 | +function get_mw_token( title, api_url, callback){ |
| 1047 | + js_log(':get_mw_token:'); |
1046 | 1048 | if(!title && wgUserName){ |
1047 | 1049 | title = 'User:' + wgUserName; |
1048 | 1050 | } |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -156,7 +156,7 @@ |
157 | 157 | if( force_id == null && force_id != '' ){ |
158 | 158 | var j_selector = 'video,audio,playlist'; |
159 | 159 | }else{ |
160 | | - var j_selector = '#'+force_id; |
| 160 | + var j_selector = '#' + force_id; |
161 | 161 | } |
162 | 162 | //process selected elements: |
163 | 163 | //ie8 does not play well with the jQuery video,audio,playlist selector use native: |
— | — | @@ -2175,8 +2175,8 @@ |
2176 | 2176 | |
2177 | 2177 | $j("#mv_play_pause_button_" + this_id + ' span').removeClass('ui-icon-play').addClass('ui-icon-pause'); |
2178 | 2178 | $j("#mv_play_pause_button_" + this_id).unbind().btnBind().click(function(){ |
2179 | | - $j('#' + this_id ).get(0).pause(); |
2180 | | - }).attr('title', gM('pause_clip')); |
| 2179 | + $j('#' + this_id ).get(0).pause(); |
| 2180 | + }).attr('title', gM('pause_clip')); |
2181 | 2181 | |
2182 | 2182 | }, |
2183 | 2183 | load:function(){ |
— | — | @@ -2393,7 +2393,7 @@ |
2394 | 2394 | var val = parseInt( perc*1000 ); |
2395 | 2395 | $j('#mv_play_head_'+this_id).slider('value', val); |
2396 | 2396 | |
2397 | | - js_log("embed video set: " + '#mv_play_head_'+this_id + ' to ' + val); |
| 2397 | + //js_log("embed video set: " + '#mv_play_head_'+this_id + ' to ' + val); |
2398 | 2398 | } |
2399 | 2399 | //js_log('set#mv_seeker_slider_'+this_id + ' perc in: ' + perc + ' * ' + $j('#mv_seeker_'+this_id).width() + ' = set to: '+ val + ' - '+ Math.round(this.mv_seeker_width*perc) ); |
2400 | 2400 | //js_log('op:' + offset_perc + ' *('+perc+' * ' + $j('#slider_'+id).width() + ')'); |
Index: trunk/phase3/js2/mwRemoteProxy.html |
— | — | @@ -0,0 +1,31 @@ |
| 2 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 3 | +"http://www.w3.org/TR/html4/loose.dtd"> |
| 4 | +<html> |
| 5 | +<head> |
| 6 | + <title>Javascript Api Proxy</title> |
| 7 | + <style type="text/css"> |
| 8 | + body{ |
| 9 | + font-size:80%; |
| 10 | + } |
| 11 | + img { |
| 12 | + border:medium none; |
| 13 | + } |
| 14 | + </style> |
| 15 | + <script type="text/javascript"> |
| 16 | + var domainList = [ |
| 17 | + '127.0.0.1' |
| 18 | + ]; |
| 19 | + </script> |
| 20 | +</head> |
| 21 | +<body> |
| 22 | +<h3> This file proxies api and html output for source domains: </h3> |
| 23 | +<div id="domainList"></div> |
| 24 | + <script type="text/javascript"> |
| 25 | + var o=''; |
| 26 | + for( var i in domainList){ |
| 27 | + o+='<br><i>'+ domainList[i] + '</i>'; |
| 28 | + } |
| 29 | + </script> |
| 30 | +</body> |
| 31 | +</html> |
| 32 | + |