includes/clientside/tinymce/plugins/advimage/js/image.js
changeset 459 31c23016ab62
parent 395 fa4c5ecb7c9a
child 476 f26a69c40431
equal deleted inserted replaced
458:c433348f3628 459:31c23016ab62
    89 
    89 
    90 	insert : function(file, title) {
    90 	insert : function(file, title) {
    91 		var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
    91 		var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
    92 
    92 
    93 		if (f.src.value === '') {
    93 		if (f.src.value === '') {
    94 			ed.dom.remove(ed.selection.getNode());
    94 			if (ed.selection.getNode().nodeName == 'IMG') {
    95 			ed.execCommand('mceRepaint');
    95 				ed.dom.remove(ed.selection.getNode());
       
    96 				ed.execCommand('mceRepaint');
       
    97 			}
       
    98 
    96 			tinyMCEPopup.close();
    99 			tinyMCEPopup.close();
    97 			return;
   100 			return;
    98 		}
   101 		}
    99 
   102 
   100 		if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
   103 		if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
   163 		el = ed.selection.getNode();
   166 		el = ed.selection.getNode();
   164 
   167 
   165 		if (el && el.nodeName == 'IMG') {
   168 		if (el && el.nodeName == 'IMG') {
   166 			ed.dom.setAttribs(el, args);
   169 			ed.dom.setAttribs(el, args);
   167 		} else {
   170 		} else {
   168 			ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" src="javascript:;" />');
   171 			ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" src="javascript:;" />', {skip_undo : 1});
   169 			ed.dom.setAttribs('__mce_tmp', args);
   172 			ed.dom.setAttribs('__mce_tmp', args);
   170 			ed.dom.setAttrib('__mce_tmp', 'id', '');
   173 			ed.dom.setAttrib('__mce_tmp', 'id', '');
       
   174 			ed.undoManager.add();
   171 		}
   175 		}
   172 
   176 
   173 		tinyMCEPopup.close();
   177 		tinyMCEPopup.close();
   174 	},
   178 	},
   175 
   179