//reset the done with action flag:
_this.action_done = false;
- js_log('run editForm submit()');
- var tmpAryData = $j('#mw-upload-form' ).serializeArray();
+ /*js_log('run editForm submit()');
+ var tmpAryData = $j(_this.editForm).serializeArray();
for(var i=0; i < tmpAryData.length; i++){
if( tmpAryData[i]['name'] )
js_log('name: ' + tmpAryData[i]['name'] + ' = ' + tmpAryData[i]['value']);
- }
- $j('#mw-upload-form').submit();
+ }*/
+ $j(_this.editForm).submit();
return false;
}else if( _this.upload_mode == 'api' && $j('#wpSourceTypeURL').get(0).checked){
js_log('ignorewarning req:')
//re-inciate the upload proccess
$j('#wpIgnoreWarning').attr('checked', true);
- $j( '#mw-upload-form' ).submit();
+ $j( _this.editForm ).submit();
};
bObj[ gM('mwe-return-to-form') ] = function(){
$j(this).dialog('close');
//close up shop:
$j('#upProgressDialog').dialog('close');
//call the callback:
- _this.done_upload_cb( url );
+ _this.done_upload_cb( apiRes.upload );
+ return false;
}else{
var bObj = {};
bObj[ gM('mwe-return-to-form')] = function(){
_this.action_done = true;
_this.updateProgressWin( gM('mwe-successfulupload'), gM( 'mwe-upload_done', url), bObj);
js_log('apiRes.upload.imageinfo::'+url);
+ return true;
}
- return ;
}
}
},
var _this = this;
//add the parent target_container if not provided or missing
if(!_this.target_container || $j(_this.target_container).length==0){
- $j('body').append('<div id="rsd_modal_target" style="position:absolute;top:30px;left:0px;bottom:45px;right:0px;" title="' + gM('mwe-add_media_wizard') + '" ></div>');
+ $j('body').append('<div id="rsd_modal_target" style="position:absolute;top:30px;left:0px;bottom:33px;right:0px;" title="' + gM('mwe-add_media_wizard') + '" ></div>');
_this.target_container = '#rsd_modal_target';
//js_log('appended: #rsd_modal_target' + $j(_this.target_container).attr('id'));
//js_log('added target id:' + $j(_this.target_container).attr('id'));
//deal with the api form upload form directly:
$j('#upload_form').simpleUploadForm({
"api_target" : _this.upload_api_target ,
- "ondone_cb" : function( resultData ){
- var wTitle = resultData['wpDestFile'];
+ "ondone_cb" : function( resultData ){
+ var wTitle = resultData['filename'];
//add a loading div
_this.addResourceEditLoader();
-
+ //@@note: we have most of what we need in resultData imageinfo
cp.sObj.addByTitle( wTitle, function( rObj ){
//redraw (with added result if new)
_this.drawOutputResults();
},
//returns a rObj by title
addByTitle:function( title , callback){
+ js_log("AddByTitle::" + title);
var _this = this;
var reqObj = {
'action':'query',
do_api_req( {
'data':reqObj,
'url':this.cp.api_url
- }, function(data){
+ }, function(data){
callback( _this.addSingleResult(data) );
}
);
'<input id="wpUploadFile" type="file" style="display: inline;" name="wpUploadFile" size="15"/><br>' +
'<label for="wpDestFile">' +gM('mwe-destfilename') + '</label><br>'+
- '<input type="text" id="wpDestFile" name="wpDestFile" size="30" /><br>'+
+ '<input id="wpDestFile" type="text" id="wpDestFile" name="wpDestFile" size="30" /><br>'+
'<label for="wpUploadDescription">' + gM('mwe-summary') + ':</label><br>' +
- '<textarea cols="30" rows="3" name="wpUploadDescription" tabindex="3"/><br>'+
-
+ '<textarea id="wpUploadDescription" cols="30" rows="3" name="wpUploadDescription" tabindex="3"/><br>'+
+
+ '<input type="checkbox" value="true" id="wpWatchthis" name="watch" tabindex="7"/>'+
+ '<label for="wpWatchthis">Watch this file</label>'+
+
+ '<input type="checkbox" value="true" id="wpIgnoreWarning" name="ignorewarnings" tabindex="8"/>'+
+ '<label for="wpIgnoreWarning">Ignore any warnings</label></br>'+
+
'<div id="wpDestFile-warning"></div>' +
'<div style="clear:both;"></div>' +
});
//do destination fill:
//@@should integrate with doDestinationFill on upload page
- $j("#suf-upload [name='wpUploadFile']").change(function(){
+ $j("#wpUploadFile").change(function(){
var path = $j(this).val();
// Find trailing part
var slash = path.lastIndexOf('/');
}
fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
// Output result
- $j("#suf-upload [name='wpDestFile']").val( fname );
+ $j("#wpDestFile").val( fname );
//do destination check
- $j("#suf-upload [name='wpDestFile']").doDestCheck({
+ $j("#wpDestFile").doDestCheck({
'warn_target':'#wpDestFile-warning'
});
});
//do destination check:
- $j("[name='wpDestFile']").change(function(){
- $j(this).doDestCheck({
+ $j("#wpDestFile").change(function(){
+ $j("#wpDestFile").doDestCheck({
'warn_target':'#wpDestFile-warning'
});
});
'form_rewrite': true,
'target_edit_from' : '#suf-upload',
'new_source_cb' : function( orgFilename, oggName ){
- $j("#suf-upload [name='wpDestFile']").val( oggName ).doDestCheck({
+ $j("#wpDestFile").val( oggName ).doDestCheck({
warn_target: "#wpDestFile-warning"
});
},