@@ -45,12 +45,37 @@ WYMeditor.editor.prototype.image_upload = function() {
4545 } else {
4646 jQuery ( ".wym_src" , doc ) . val ( response . thumbUrl ) ;
4747 jQuery ( ".wym_alt" , doc ) . val ( response . original_filename ) ;
48+ jQuery ( ".wym_attribution" , doc ) . val ( response . attribution ) ;
4849 }
4950 jQuery ( "form#image_upload_form .submit" , doc ) . val ( oldSubmitLabel ) ;
5051 }
5152 } )
5253 } ;
5354
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+
5479 // Put together the whole dialog script
5580 wym . _options . dialogImageHtml = String ( ) +
5681 '<body class="wym_dialog wym_dialog_image">' +
@@ -93,6 +118,10 @@ WYMeditor.editor.prototype.image_upload = function() {
93118 '<label>{Title}</label>' +
94119 '<input type="text" class="wym_title" value="" size="40" />' +
95120 '</div>' +
121+ '<div class="row">' +
122+ '<label>{Attribution}</label>' +
123+ '<input type="text" class="wym_attribution" value="" size="40" placeholder="{Attribution_placeholder}" />' +
124+ '</div>' +
96125 '<div class="row row-indent">' +
97126 '<input class="wym_submit" type="submit" ' + 'value="{Submit}" />' +
98127 '<input class="wym_cancel" type="button" ' + 'value="{Cancel}" />' +
0 commit comments