Revision 214
- Date:
- 2012/05/17 14:55:51
- Files:
Legend:
- Added
- Removed
- Modified
-
utf8/core/comps/contenido/image_list.js
4 4 5 5 var tinyMCEImageList = new Array( 6 6 // Name, URL 7 % foreach my $img ( @images ) { 8 % if ( $comma++ ) { 9 , 10 % } 11 ["<% $img->{name} %>", "<% $img->{url} %>"]\ 12 % } 7 <% join(',', @imgstr) %> 13 8 ); 14 9 <%args> 15 10 … … 35 30 my $img_path = ($state->{images_dir} =~ /^http:/ ? $state->{images_dir} : '').($image->{filename} =~ /^\// ? '' : '/').$image->{filename}; 36 31 my $name = $image->{alt} || $prop->{attr}.": image_$_"; 37 32 $name =~ s/"/\\"/g; 38 push @images, { url => $img_path, name => $name }; 33 push @images, { url => $img_path, name => $name, mini => (exists $image->{mini} ? $image->{mini} : undef) }; 39 34 } 40 35 } 41 36 } … … 45 40 my $img_path = ($state->{images_dir} =~ /^http:/ ? $state->{images_dir} : '').($image->{filename} =~ /^\// ? '' : '/').$image->{filename}; 46 41 my $name = $image->{alt} || $document->name.' ('.$prop->{attr}.')'; 47 42 $name =~ s/"/\\"/g; 48 push @images, { url => $img_path, name => $name }; 43 push @images, { url => $img_path, name => $name, mini => (exists $image->{mini} ? $image->{mini} : undef) }; 49 44 } 50 45 } 51 46 } 52 47 return unless @images; 53 48 my $comma = 0; 49 my @imgstr; 50 foreach my $img ( @images ) { 51 push @imgstr, '["'.$img->{name}.'","'.$img->{url}.'"]'; 52 if ( exists $img->{mini} && ref $img->{mini} eq 'HASH' ) { 53 while ( my ($dim, $mini) = each %{$img->{mini}} ) { 54 next unless ref $mini eq 'HASH' && exists $mini->{filename}; 55 push @imgstr, '["'.$img->{name}.'. Mini: '.$dim.'","'.$mini->{filename}.'"]'; 56 } 57 } 58 } 54 59 55 60 </%init>