[interchange-cvs] interchange - jure modified 2 files
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Sun Jun 15 19:11:16 UTC 2008
User: jure
Date: 2008-06-15 19:11:16 GMT
Modified: . WHATSNEW-5.7
Modified: code/UserTag button.tag
Log:
* srcliteral attribute added to [button] tag. Setting srcliteral avoids the image existence check for the src attribute.
* Image tag is not called internally anymore, except in case of file existence check (since it isn't actually used otherwise).
Revision Changes Path
2.2 interchange/WHATSNEW-5.7
rev 2.2, prev_rev 2.1
Index: WHATSNEW-5.7
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW-5.7,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -r2.1 -r2.2
--- WHATSNEW-5.7 21 May 2008 03:05:20 -0000 2.1
+++ WHATSNEW-5.7 15 Jun 2008 19:11:16 -0000 2.2
@@ -10,4 +10,9 @@
Interchange 5.7.0 under development.
+UserTag
+-------
+
+* srcliteral attribute added to [button] tag. Setting srcliteral avoids the image existence check for the src attribute.
+
(end)
1.25 interchange/code/UserTag/button.tag
rev 1.25, prev_rev 1.24
Index: button.tag
===================================================================
RCS file: /var/cvs/interchange/code/UserTag/button.tag,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- button.tag 25 Mar 2008 15:23:10 -0000 1.24
+++ button.tag 15 Jun 2008 19:11:16 -0000 1.25
@@ -5,13 +5,13 @@
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. See the LICENSE file for details.
#
-# $Id: button.tag,v 1.24 2008-03-25 15:23:10 racke Exp $
+# $Id: button.tag,v 1.25 2008-06-15 19:11:16 jure Exp $
UserTag button Order name src text
UserTag button addAttr
UserTag button attrAlias value text
UserTag button hasEndTag
-UserTag button Version $Revision: 1.24 $
+UserTag button Version $Revision: 1.25 $
UserTag button Routine <<EOR
sub {
my ($name, $src, $text, $opt, $action) = @_;
@@ -31,21 +31,26 @@
my @from_html = qw/class id style/;
if($src) {
- my $dr = $::Variable->{DOCROOT};
- my $id = $Tag->image( { dir_only => 1 } );
- $id =~ s:/+$::;
- $id =~ s:/~[^/]+::;
- if( $src =~ m{^https?://}i ) {
+ if( $opt->{srcliteral} || $src =~ m{^https?://}i ) {
$image = $src;
}
- elsif( $dr and $id and $src =~ m{^[^/]} and -f "$dr$id/$src" ) {
- $image = $src;
- }
- elsif( $dr and $src =~ m{^/} and -f "$dr/$src" ) {
- $image = "$id/$src";
+ else {
+ my $dr = $::Variable->{DOCROOT};
+ my $id = $Tag->image( { dir_only => 1 } );
+ $id =~ s:/+$::;
+ $id =~ s:/~[^/]+::;
+
+ if( $dr and $id and $src =~ m{^[^/]} and -f "$dr$id/$src" ) {
+ $image = $src;
+ }
+ elsif( $dr and $src =~ m{^/} and -f "$dr/$src" ) {
+ $image = "$id/$src";
+ }
+ else {
+ ::logError("No image file '$src' found or image file name is invalid.");
+ }
}
}
-
my $onclick = '';
my $onmouseover = '';
my $onmouseout = '';
More information about the interchange-cvs
mailing list