public/js/ckeditor/plugins/garpimages/garpimages/plugin.js
// Open a dialog and replace the element with the results
Open a dialog and replace the element with the results
Open a dialog and replace the element with the results
function editExistingImage(element) {
			if (!element) {
				return;
			}
			var path = element.findOne('img') ? element.findOne('img').getAttribute('src') : element.getAttribute('src');
			path = path.split('/');
			if (path[path.length - 1] === '') {
				path.splice(path.length - 1, 1); 
			}
			var fileId = path[path.length - 1];
			var tplName = path[path.length - 2];
			var caption = element.findOne('figcaption') ? element.findOne('figcaption').getText() : null;
			var align = element.getStyle("float");
			editor.getCommand('garpimageDialog').exec({
				existingImage: {
					imgGridQuery: {
						id: fileId
					},
					cropTemplateName: tplName,
					captionValue: caption,
					alignValue: align == 'none' ? '' : align
				},
				existingElement: element
			});
		}
function editExistingImage ( element ) { if ( ! element ) { return ; } var path = element . findOne ( 'img' ) ? element . findOne ( 'img' ) . getAttribute ( 'src' ) : element . getAttribute ( 'src' ) ; path = path . split ( '/' ) ; if ( path [ path . length - 1 ] === '' ) { path . splice ( path . length - 1 , 1 ) ; } var fileId = path [ path . length - 1 ] ; var tplName = path [ path . length - 2 ] ; var caption = element . findOne ( 'figcaption' ) ? element . findOne ( 'figcaption' ) . getText ( ) : null ; var align = element . getStyle ( "float" ) ; editor . getCommand ( 'garpimageDialog' ) . exec ( { existingImage : { imgGridQuery : { id : fileId } , cropTemplateName : tplName , captionValue : caption , alignValue : align == 'none' ? '' : align } , existingElement : element } ) ; }
Open a dialog and replace the element with the results
Open a dialog and replace the element with the results
// Retrieve values from existing html // remove last ,if it's a trailing slash // Exec with parameters from existing image