[interchange-cvs] interchange - heins modified 10 files
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Thu Aug 15 12:31:01 2002
User: heins
Date: 2002-08-15 16:30:34 GMT
Modified: code/SystemTag process.coretag
Modified: code/UI_Tag jsq.coretag
Modified: code/UserTag history_scan.tag
Modified: dist/lib/UI/pages/admin menu_editor.html
Modified: dist/lib/UI/pages/include page_editor
Modified: lib/Vend Interpolate.pm Util.pm
Added: code/UI_Tag jsqn.coretag
Added: dist/lib/UI/pages/admin page_upload.html
Added: share/interchange/en_US forward.gif
Log:
* A number of minor changes related to continuing work on content
editing features.
-- Change Vend::Interpolate::form_link() to escape the HREF properly.
Thanks to Kevin's good eye.
-- Back out misguided patch to [history-scan] battling above.
-- Change Vend::Util::escape_chars_url() to do nothing if
no changes are needed. This may be stupid, but then again
almost everything I have ever done WRT escaping seems stupid
in retrospect. 8-)
-- Add function to [process] where you can specify a download
name, so that a piece of content delivered by download will
have the right name/extension.
-- Fix call to /icons/ image in menu_editor, add proper image.
-- Add [jsqn] tag, which quotes for JavaScript without variable
interpolation.
* Add "Edit in Browser" function for page editor, allowing you to
download the page, edit in Mozilla et al, and then upload it
back up.
Revision Changes Path
1.4 +6 -0 interchange/code/SystemTag/process.coretag
rev 1.4, prev_rev 1.3
Index: process.coretag
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/code/SystemTag/process.coretag,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- process.coretag 2 Aug 2002 03:26:52 -0000 1.3
+++ process.coretag 15 Aug 2002 16:30:33 -0000 1.4
@@ -5,10 +5,16 @@
sub {
my($target,$secure,$opt) =3D @_;
=20
+ my $save;
$secure =3D defined $secure ? $secure : $CGI::secure;
=20
my $page =3D $opt->{href} || 'process';
+ if($opt->{download_name}) {
+ $save =3D delete $::Scratch->{mv_add_dot_html};
+ $page .=3D "/$opt->{download_name}";
+ }
my $url =3D $secure ? secure_vendUrl($page) : vendUrl($page);
+ $::Scratch->{mv_add_dot_html} =3D $save if $save;
return $url unless $target;
return qq{$url" TARGET=3D"$target};
}
1.2 +26 -0 interchange/code/UI_Tag/jsq.coretag
rev 1.2, prev_rev 1.1
Index: jsq.coretag
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/code/UI_Tag/jsq.coretag,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- jsq.coretag 3 Aug 2002 21:22:05 -0000 1.1
+++ jsq.coretag 15 Aug 2002 16:30:33 -0000 1.2
@@ -18,3 +18,29 @@
return join (" +\n", @lines);
}
EOR
+
+UserTag jsq Documentation <<EOD
+=3Dhead1 jsqn
+
+Returns a string quoted for JavaScript, with variable substitution.
+
+ <script>
+ var astring =3D 'just an insert';
+ var somevar =3D [jsq] Big long string you don't
+ want to have to quote for JS, and you want to
+ insert the variable $astring.[/jsq];
+ </script>
+
+Generates:
+
+ <script>
+ var astring =3D 'just an insert';
+ var somevar =3D " Big long string you don't" +
+ ' want to have to quote for JS, and you want to' +
+ ' insert the variable ' + astring + '.';
+ </script>
+
+Used in the UI dynamic HTML.
+
+EOD
+
1.1 interchange/code/UI_Tag/jsqn.coretag
rev 1.1, prev_rev 1.0
Index: jsqn.coretag
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
UserTag jsqn Documentation <<EOD
=3Dhead1 jsqn
Returns a string quoted for JavaScript, with no variable substitution.
<script>
var somevar =3D [jsqn] Big long string you don't
want to have to quote for JS.[/jsqn];
</script>
Generates:
<script>
var somevar =3D " Big long string you don't" +
' want to have to quote for JS.';
</script>
Used in the UI dynamic HTML.
EOD
UserTag jsqn hasEndTag
UserTag jsqn NoReparse
UserTag jsqn PosNumber 0
UserTag jsqn Routine <<EOR
sub {
my $text =3D shift;
$text =3D~ s/^[ \t\r]*\n//;
my @lines =3D split /\r?\n/, $text;
for(@lines) {
( $_ !~ /'/ and s/\r/\\r/g, $_ =3D qq{'$_'} )
or
( $_ !~ /"/ and s/\r/\\r/g, $_ =3D qq{"$_"} )
or=20
( s/'/\\'/g, s/\r/\\r/g, $_ =3D qq{'$_'} );
}
return join (" +\n", @lines);
}
EOR
1.7 +0 -1 interchange/code/UserTag/history_scan.tag
rev 1.7, prev_rev 1.6
Index: history_scan.tag
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/code/UserTag/history_scan.tag,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- history_scan.tag 15 Aug 2002 02:59:20 -0000 1.6
+++ history_scan.tag 15 Aug 2002 16:30:33 -0000 1.7
@@ -34,7 +34,6 @@
$form .=3D "\n$_=3D";
$form .=3D join("\n$_=3D", split /\0/, $cgi->{$_});
}
- $href =3D Vend::Util::escape_chars_url($href);
return $Tag->area( { href =3D> $href, form =3D> $form} );
}
EOR
2.12 +8 -3 interchange/dist/lib/UI/pages/admin/menu_editor.html
rev 2.12, prev_rev 2.11
Index: menu_editor.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/dist/lib/UI/pages/admin/menu_editor.html,v
retrieving revision 2.11
retrieving revision 2.12
diff -u -r2.11 -r2.12
--- menu_editor.html 14 Aug 2002 15:52:48 -0000 2.11
+++ menu_editor.html 15 Aug 2002 16:30:33 -0000 2.12
@@ -886,12 +886,17 @@
'<a href=3D"javascript:motion(' + idx + ", 'right');void(0)" +
'"><img src=3D"__UI_IMG__right.gif" border=3D0 align=3Dabsbottom></A>=
' + "\n" +
'<a href=3D"javascript:loadForm(' + idx + ");void(0)" +
- '"><img src=3D"/icons/small/forward.gif" border=3D0 align=3Dabsbottom=
></A>' + "\n";
+ '"><img src=3D"__UI_IMG__forward.gif" border=3D0 align=3Dabsbottom></=
A>' + "\n";
for(i =3D 0; i < l[MSORT]; i++)
out =3D out + ' ';=20
if(showlevel =3D=3D 1 && l[MSORT] > 0) {
out =3D out + l[MSORT] + ' '
}
+
+ var nme =3D l[NAME];
+ if(nme !=3D undefined) {
+ nme =3D nme.replace(/</g, '<');
+ }
if(l[PAGE]) {
var i;
out =3D out + '<a href=3D"javascript:loadForm(' +
@@ -902,10 +907,10 @@
out =3D out + '?' + l[FORM];
if(l[DESCRIPTION])
out =3D out + " : " + l[DESCRIPTION];
- out =3D out + '">' + l[NAME] + '</a>';
+ out =3D out + '">' + nme + '</a>';
}
else {
- out =3D out + '<b>' + l[NAME] + '</b>';
+ out =3D out + '<b>' + nme + '</b>';
}
=20
if(l[MSG]) {
2.1 interchange/dist/lib/UI/pages/admin/page_upload.html
rev 2.1, prev_rev 2.0
1.3 +16 -1 interchange/dist/lib/UI/pages/include/page_editor
rev 1.3, prev_rev 1.2
Index: page_editor
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/dist/lib/UI/pages/include/page_editor,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- page_editor 27 Jun 2002 20:18:36 -0000 1.2
+++ page_editor 15 Aug 2002 16:30:34 -0000 1.3
@@ -81,6 +81,19 @@
}
}
=20
+function content_win () {
+ window.name =3D 'mainwindow[scratch window_name]';
+ var url =3D '[area
+ href=3D"admin/page_upload"
+ form=3D|
+ ui_source_form=3Dcontent_edit
+ ui_source_var=3Dui_body_text
+ page=3D[page-param ui_name]
+ |]';
+ window.open(url, undefined, 'scrollbars,location=3Dno,status=3Dno,toolbar=
=3Dno,resizable,fullsize=3Dno,width=3D600,height=3D480');
+ return void(0);
+}
+
var visdone =3D new Array;
function visible (index, base) {
var ai;
@@ -440,10 +453,11 @@
hidden.ui_content_op=3Dmodify_body
hidden.ui_name=3D"[page-param ui_name]"
hidden.ui_type=3D"[page-param ui_type]"
+ form-name=3Dcontent_edit
href=3D"silent/ce_modify"
item_id=3D"CONTENT"
js_changed=3Dchanged
- label.ui_body_text=3D" Page content"
+ label.ui_body_text=3D| Page content<br><br><input=
type=3Dbutton onClick=3D"content_win();" Value=3D"[L]Edit in Browser[/L]">|
mv_nextpage=3D@@MV_PAGE@@
nocancel=3D1
notable=3D1
@@ -461,6 +475,7 @@
onReset=3D"submitted('[comp-param where]')"
|
]
+=09=09
[/else]
[/if-comp-param]
</div>
2.105 +3 -2 interchange/lib/Vend/Interpolate.pm
rev 2.105, prev_rev 2.104
Index: Interpolate.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.104
retrieving revision 2.105
diff -u -r2.104 -r2.105
--- Interpolate.pm 12 Aug 2002 16:16:18 -0000 2.104
+++ Interpolate.pm 15 Aug 2002 16:30:34 -0000 2.105
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#=20
-# $Id: Interpolate.pm,v 2.104 2002/08/12 16:16:18 mheins Exp $
+# $Id: Interpolate.pm,v 2.105 2002/08/15 16:30:34 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -27,7 +27,7 @@
require Exporter;
@ISA =3D qw(Exporter);
=20
-$VERSION =3D substr(q$Revision: 2.104 $, 10);
+$VERSION =3D substr(q$Revision: 2.105 $, 10);
=20
@EXPORT =3D qw (
=20
@@ -3031,6 +3031,7 @@
=20
$href =3D 'process' unless length($href);
$href =3D~ s:^/+::;
+ $href =3D Vend::Util::escape_chars_url($href);
$opt->{secure} =3D 1 if exists $Vend::Cfg->{AlwaysSecure}{$href};
my $base =3D ! $opt->{secure} ? ($Vend::Cfg->{VendURL}) : $Vend::Cfg->{Se=
cureURL};
$href =3D "$base/$href" unless $href =3D~ /^\w+:/;
2.33 +3 -2 interchange/lib/Vend/Util.pm
rev 2.33, prev_rev 2.32
Index: Util.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Util.pm,v
retrieving revision 2.32
retrieving revision 2.33
diff -u -r2.32 -r2.33
--- Util.pm 6 Aug 2002 22:08:04 -0000 2.32
+++ Util.pm 15 Aug 2002 16:30:34 -0000 2.33
@@ -1,6 +1,6 @@
# Vend::Util - Interchange utility functions
#
-# $Id: Util.pm,v 2.32 2002/08/06 22:08:04 mheins Exp $
+# $Id: Util.pm,v 2.33 2002/08/15 16:30:34 mheins Exp $
#=20
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -82,7 +82,7 @@
use Safe;
use subs qw(logError logGlobal);
use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION =3D substr(q$Revision: 2.32 $, 10);
+$VERSION =3D substr(q$Revision: 2.33 $, 10);
=20
BEGIN {
eval {
@@ -170,6 +170,7 @@
=20
sub escape_chars_url {
my($in) =3D @_;
+ return $in unless $in =3D~ $need_escape;
my($c, $r);
=20
$r =3D '';
1.1 interchange/share/interchange/en_US/forward.gif
<<forward.gif: GIF image data, version 89a, 16 x 16,>>