@@ -45,12 +45,37 @@ WYMeditor.editor.prototype.image_upload = function() {
45
45
} else {
46
46
jQuery ( ".wym_src" , doc ) . val ( response . thumbUrl ) ;
47
47
jQuery ( ".wym_alt" , doc ) . val ( response . original_filename ) ;
48
+ jQuery ( ".wym_attribution" , doc ) . val ( response . attribution ) ;
48
49
}
49
50
jQuery ( "form#image_upload_form .submit" , doc ) . val ( oldSubmitLabel ) ;
50
51
}
51
52
} )
52
53
} ;
53
54
55
+ d . submitHandler = function ( wDialog ) {
56
+ var wym = this ,
57
+ options = wym . _options ,
58
+ imgAttrs ,
59
+ selectedImage = wym . getSelectedImage ( ) ;
60
+
61
+ imgAttrs = {
62
+ src : jQuery ( options . srcSelector , wDialog . document ) . val ( ) ,
63
+ title : jQuery ( options . titleSelector , wDialog . document ) . val ( ) ,
64
+ alt : jQuery ( options . altSelector , wDialog . document ) . val ( ) ,
65
+ longdesc : jQuery ( '.wym_attribution' , wDialog . document ) . val ( )
66
+ } ;
67
+
68
+ wym . focusOnDocument ( ) ;
69
+
70
+ if ( selectedImage ) {
71
+ wym . _updateImageAttrs ( selectedImage , imgAttrs ) ;
72
+ wym . registerModification ( ) ;
73
+ } else {
74
+ wym . insertImage ( imgAttrs ) ;
75
+ }
76
+ wDialog . close ( ) ;
77
+ }
78
+
54
79
// Put together the whole dialog script
55
80
wym . _options . dialogImageHtml = String ( ) +
56
81
'<body class="wym_dialog wym_dialog_image">' +
@@ -93,6 +118,10 @@ WYMeditor.editor.prototype.image_upload = function() {
93
118
'<label>{Title}</label>' +
94
119
'<input type="text" class="wym_title" value="" size="40" />' +
95
120
'</div>' +
121
+ '<div class="row">' +
122
+ '<label>{Attribution}</label>' +
123
+ '<input type="text" class="wym_attribution" value="" size="40" placeholder="{Attribution_placeholder}" />' +
124
+ '</div>' +
96
125
'<div class="row row-indent">' +
97
126
'<input class="wym_submit" type="submit" ' + 'value="{Submit}" />' +
98
127
'<input class="wym_cancel" type="button" ' + 'value="{Cancel}" />' +
0 commit comments