From: jongfoster <jongfoster@users.sourceforge.net> Date: Wed, 23 Jan 2002 00:26:45 +0000 (+0000) Subject: Reducing length of URLs X-Git-Tag: v_2_9_11~13 X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/developer-manual/static/@default-cgi@edit-actions-remove-url?a=commitdiff_plain;h=7502039efcc08687b47438b680d45b49b67eac0e;p=privoxy.git Reducing length of URLs Where encoded and unencoded versions of a string existed, removing the unencoded one. --- diff --git a/templates/cgi-error-file b/templates/cgi-error-file index ffd0b703..591eff40 100644 --- a/templates/cgi-error-file +++ b/templates/cgi-error-file @@ -104,7 +104,7 @@ <td bgcolor=#eeeeee> <h2>Actions file not found</h2> <blockquote> - <p>The actions file you are trying to edit (<code>@filename@.action</code>) + <p>The actions file you are trying to edit (<code>@f@.action</code>) does not exist, or cannot be read.</p> </blockquote> </td> diff --git a/templates/cgi-error-modified b/templates/cgi-error-modified index 97494e4d..7ebe20de 100644 --- a/templates/cgi-error-modified +++ b/templates/cgi-error-modified @@ -123,7 +123,7 @@ </ul> <p>You can go back into the edit interface using the menu below, or by clicking <a - href="@default-cgi@edit-actions-list?filename=@filename@" + href="edit-actions-list?f=@f@" >here</a>.</p> </blockquote> </td> diff --git a/templates/cgi-error-parse b/templates/cgi-error-parse index 969f1703..8f7bf16e 100644 --- a/templates/cgi-error-parse +++ b/templates/cgi-error-parse @@ -112,8 +112,7 @@ badly using the web-based editor, please file a bug report!</p> <p>When you've fixed the problem, you can go back into the edit interface using the menu below, or by clicking <a - href="@default-cgi@edit-actions-list?filename=@filename@" - >here</a>.</p> + href="edit-actions-list?f=@f@">here</a>.</p> </blockquote> </td> </tr> diff --git a/templates/edit-actions-add-url-form b/templates/edit-actions-add-url-form index 73512986..89839363 100644 --- a/templates/edit-actions-add-url-form +++ b/templates/edit-actions-add-url-form @@ -31,6 +31,10 @@ # # Revisions : # $Log: edit-actions-add-url-form,v $ +# Revision 1.3 2002/01/17 21:33:00 jongfoster +# Replacing all references to the URL of the config interface +# with @default-cgi@ +# # Revision 1.2 2002/01/17 21:21:03 jongfoster # DOS->Unix line endings # @@ -124,16 +128,16 @@ function validate(text) <tr> <td class="light"> <h2>Add URL Pattern</h2> - <form method="GET" action="@default-cgi@edit-actions-add-url" - onSubmit="return validate(newval.value);"> + <form method="GET" action="edit-actions-add-url" + onSubmit="return validate(u.value);"> <p> - <input type="hidden" name="filename" value="@filename@"> - <input type="hidden" name="ver" value="@ver@"> - <input type="hidden" name="section" value="@section@"> - <input type="text" name="newval" value="" size="78"><br> + <input type="hidden" name="f" value="@f@"> + <input type="hidden" name="v" value="@v@"> + <input type="hidden" name="s" value="@s@"> + <input type="text" name="u" value="" size="78"><br> <input type="submit" value="Submit"> <input type="reset" value="Reset"> - <a href="@default-cgi@edit-actions-list?filename=@filename@">Cancel</a> + <a href="edit-actions-list?f=@f@">Cancel</a> </p> </form> </td> diff --git a/templates/edit-actions-for-url b/templates/edit-actions-for-url index 2004c16e..5b6e13bf 100644 --- a/templates/edit-actions-for-url +++ b/templates/edit-actions-for-url @@ -32,6 +32,10 @@ # # Revisions : # $Log: edit-actions-for-url,v $ +# Revision 1.8 2002/01/17 21:33:00 jongfoster +# Replacing all references to the URL of the config interface +# with @default-cgi@ +# # Revision 1.7 2002/01/17 21:21:03 jongfoster # DOS->Unix line endings # @@ -286,7 +290,7 @@ function show_wafer_opts(tf) <body> -<form method="GET" action="@default-cgi@edit-actions-submit" id="myform" name="myform"> +<form method="GET" action="edit-actions-submit" id="myform" name="myform"> <table cellpadding="20" cellspacing="10" border="0" width="100%"> <tr> @@ -318,9 +322,9 @@ function show_wafer_opts(tf) <tr> <td class="light"> <h2>Edit Actions - <input type="hidden" name="filename" value="@filename@"> - <input type="hidden" name="ver" value="@ver@"> - <input type="hidden" name="section" value="@section@"> + <input type="hidden" name="f" value="@f@"> + <input type="hidden" name="v" value="@v@"> + <input type="hidden" name="s" value="@s@"> </h2> </td> </tr> diff --git a/templates/edit-actions-list b/templates/edit-actions-list index 863cd1cb..3cc0affa 100644 --- a/templates/edit-actions-list +++ b/templates/edit-actions-list @@ -31,6 +31,10 @@ # # Revisions : # $Log: edit-actions-list,v $ +# Revision 1.6 2002/01/17 21:33:00 jongfoster +# Replacing all references to the URL of the config interface +# with @default-cgi@ +# # Revision 1.5 2002/01/17 21:21:05 jongfoster # DOS->Unix line endings # @@ -83,48 +87,80 @@ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta name="robots" content="noindex,nofollow"> -<title>JunkBuster: Edit actions file - @filename@.action</title> +<title>JunkBuster: Edit actions file - @f@.action</title> <style type="text/css"> -body { font-family: Helvetica, Helv, Arial, Sans-Serif, sans-serif; - background-color: #ffffff; - color: #000000; } -td.light { background-color: #eeeeee; } -td.dark { background-color: #dddddd; } -table.wide { border-color: white; - border-style: solid; - border-left-width: 10px; - border-right-width: 10px; - border-top-width: 0px; - border-bottom-width: 0px; } -tr.actions { background-color: #eeffee; } -tr.url1 { background-color: #d0d0ff; } -tr.url2 { background-color: #eeeeff; } -tr.rule { background-color: #c0c0c0; - height: 3px; - max-height: 3px; - font-size: 1px } -tr.adv { background-color: #FFFFD0; } -td.header { font-weight: bold; } -td.url { font-weight: bold; } -td.action { font-weight: bold; - font-style: italic; } -td.nobreak { white-space: nowrap; } -a.cmd { white-space: nowrap; - width: auto; - padding: 2px; - background-color: #dddddd; - color: #000000; - text-decoration: none; - border-top: 1px solid #ffffff; - border-left: 1px solid #ffffff; - border-bottom: 1px solid #000000; - border-right: 1px solid #000000; } -a.cmd:hover { background-color: #eeeeee; } -a.cmd:active { border-top: 1px solid #000000; - border-left: 1px solid #000000; - border-bottom: 1px solid #ffffff; - border-right: 1px solid #ffffff; } +body { + font-family: Helvetica, Helv, Arial, Sans-Serif, sans-serif; + background-color: #ffffff; + color: #000000; +} +td.light { + background-color: #eeeeee; +} +td.dark { + background-color: #dddddd; +} +table.wide { + border-color: white; + border-style: solid; + border-left-width: 10px; + border-right-width: 10px; + border-top-width: 0px; + border-bottom-width: 0px; +} +tr.actions { + background-color: #eeffee; +} +tr.url1 { + background-color: #d0d0ff; +} +tr.url2 { + background-color: #eeeeff; +} +tr.rule { + background-color: #c0c0c0; + height: 3px; + max-height: 3px; + font-size: 1px +} +tr.adv { + background-color: #FFFFD0; +} +td.header { + font-weight: bold; +} +td.url { + font-weight: bold; +} +td.action { + font-weight: bold; + font-style: italic; +} +td.nbr { + white-space: nowrap; +} +a.cmd, div.buttons a { + white-space: nowrap; + width: auto; + padding: 2px; + background-color: #dddddd; + color: #000000; + text-decoration: none; + border-top: 1px solid #ffffff; + border-left: 1px solid #ffffff; + border-bottom: 1px solid #000000; + border-right: 1px solid #000000; +} +a.cmd:hover, div.buttons a:hover { + background-color: #eeeeee; +} +a.cmd:active, div.buttons a:active { + border-top: 1px solid #000000; + border-left: 1px solid #000000; + border-bottom: 1px solid #ffffff; + border-right: 1px solid #ffffff; +} </style> @@ -139,10 +175,10 @@ function not_yet() // JavaScript-capable browsers will call this function, which does a // client-side prompt for speed. It may kick off the delete directly. // It always returns false to cancel following the link. -function remove_pattern(section,pattern,curtext) +function rm_p(pattern,curtext) { if (window.confirm("Are you sure you want to delete this URL pattern?\nPattern is: "+unescape(curtext))) - { window.location.href="@default-cgi@edit-actions-remove-url?filename=@filename@&ver=@ver@§ion="+section+"&pattern="+pattern+"#s"+section+"urls"; } + { window.location.href="edit-actions-remove-url?f=@f@&v=@v@&p="+pattern+"#l"+pattern; } return false; } @@ -178,19 +214,23 @@ function remove_pattern(section,pattern,curtext) </td> </tr> <!-- if-unstable-end@ --> +</table> + +<div class="buttons"> +<table cellpadding="20" cellspacing="10" border="0" width="100%"> <tr> <td class="light"> - <h2>Editing Actions File - @filename@.action</h2> - <p> - <span><a class="cmd" href="@default-cgi@edit-actions-section-add?filename=@filename@&ver=@ver@&section=0">Insert new section at top</a></span> - </p> + <h2>Editing Actions File - @f@.action</h2> + <p><a class="cmd" href="edit-actions-section-add?f=@f@&v=@v@&s=0">Insert new section at top</a></p> </td> </tr> </table> @sections@ +</div> + <table cellpadding="20" cellspacing="10" border="0" width="100%"> <tr> <td class="dark"> diff --git a/templates/edit-actions-list-section b/templates/edit-actions-list-section index 68ea8145..2bd6ba9a 100644 --- a/templates/edit-actions-list-section +++ b/templates/edit-actions-list-section @@ -31,6 +31,10 @@ # # Revisions : # $Log: edit-actions-list-section,v $ +# Revision 1.4 2002/01/17 21:33:00 jongfoster +# Replacing all references to the URL of the config interface +# with @default-cgi@ +# # Revision 1.3 2001/11/13 00:58:18 jongfoster # New version of actions file editor templates # @@ -45,51 +49,47 @@ # urls # ############################################################################# +# +# ** Important note: ** +# +# It is important to keep this file small. That's why all the +# identifiers in the HTML are short and cryptic. Currently, the main +# edit-actions page is ~300k. Before it was optimized, it was ~550k. +# +############################################################################# <table border="0" width="100%" cellspacing="0" cellpadding="3" class="wide"> <tr class="actions" valign="top"> - <td class="header" align="right"><a name="s@sectionid@"></a>Actions:</td> - <td align="center"><a class="cmd" href="@default-cgi@edit-actions-for-url?filename=@filename@&ver=@ver@&section=@sectionid@" - >Edit</a></td> - <td class="action" align="left">@actions@</td> + <td class="header" align="right">Actions:</td> + <td align="center"><a name="l@s@" href="eas?f=@f@&v=@v@&s=@s@">Edit</a></td> + <td class="action" align="left">@actions@</td> </tr> <tr class="rule"> - <td colspan="3"><img src="@default-cgi@send-banner?type=trans" width="2" - height="1" alt="----"></td> + <td colspan="3"><img src="t" width="2" height="1" alt="----"></td> </tr> <tr class="url1" valign="top"> - <td class="header" align="right"><a name="s@sectionid@urls">URLs:</a></td> - <td align="center"><a class="cmd" href="@default-cgi@edit-actions-add-url-form?filename=@filename@&ver=@ver@&section=@sectionid@" - >Add</a></td> - <td align="left"> </td> + <td class="header" align="right">URLs:</a></td> + <td align="center"><a href="eaa?f=@f@&v=@v@&s=@s@">Add</a></td> + <td align="left"> </td> </tr> - @urls@ - <tr class="rule"> - <td colspan="3"><img src="@default-cgi@send-banner?type=trans" width="2" - height="1" alt="-"></td> + <td colspan="3"><img src="t" width="2" height="1" alt="-"></td> </tr> <tr class="adv" valign="top"> - <td class="header" align="right"><b>Advanced:</b></td> - <td colspan="2"> - <table border="0" cellspacing="0" cellpadding="4"> - <tr valign="middle" align="center"> - <td class="nobreak"> <a class="cmd" href="javascript:not_yet()">Move section up</a> </td> - <td class="nobreak"> - <a class="cmd" href="@default-cgi@edit-actions-section-add?filename=@filename@&ver=@ver@&section=@sectionid@" - >Insert new section below</a> </td> - </tr> - <tr valign="middle" align="center"> - <td class="nobreak"> <a class="cmd" href="javascript:not_yet()">Move section down</a> </td> - <td class="nobreak"><!-- @if-empty-section-start --> - <a class="cmd" href="@default-cgi@edit-actions-section-remove?filename=@filename@&ver=@ver@&section=@sectionid@" - >Delete whole section</a><!-- if-empty-section-end@ --> </td> - </tr> - </table> - </td> + <td class="header" align="right"><b>Advanced:</b></td> + <td colspan="2"> + <table border="0" cellspacing="0" cellpadding="4"> + <tr valign="middle" align="center"> + <td class="nbr"> @if-s-prev-exists-start@<a href="eass?f=@f@&v=@v@&s1=@s-prev@&s2=@s@">Move section up</a> @if-s-prev-exists-end@</td> + <td class="nbr"> <a href="easa?f=@f@&v=@v@&s=@s@">Insert new section below</a> </td> + </tr> + <tr valign="middle" align="center"> + <td class="nbr"> @if-s-next-exists-start@<a href="eass?f=@f@&v=@v@&s1=@s@&s2=@s-next@">Move section down</a> @if-s-next-exists-end@</td> + <td class="nbr"> @if-empty-section-start@<a href="easr?f=@f@&v=@v@&s=@s@">Delete whole section</a> @if-empty-section-end@</td> + </tr> + </table> + </td> </tr> </table> <p> </p> - - diff --git a/templates/edit-actions-list-url b/templates/edit-actions-list-url index c3a99dd4..7c83f9b3 100644 --- a/templates/edit-actions-list-url +++ b/templates/edit-actions-list-url @@ -31,6 +31,10 @@ # # Revisions : # $Log: edit-actions-list-url,v $ +# Revision 1.4 2002/01/17 21:33:00 jongfoster +# Replacing all references to the URL of the config interface +# with @default-cgi@ +# # Revision 1.3 2001/11/13 00:58:18 jongfoster # New version of actions file editor templates # @@ -45,12 +49,17 @@ # urls # ############################################################################# -<tr class="url@url-1-2@" valign="top"> -<td align="left"> </td> -<td align="center" class="nobreak"><a name="s@sectionid@url@urlid@"></a -><a class="cmd" href="@default-cgi@edit-actions-remove-url-form?filename=@filename@&ver=@ver@&section=@sectionid@&pattern=@urlid@&oldval=@url@" -onclick="return remove_pattern(@sectionid@,@urlid@,'@url@');">Remove</a> <a -class="cmd" href="@default-cgi@edit-actions-url-form?filename=@filename@&ver=@ver@&section=@sectionid@&pattern=@urlid@&oldval=@url@">Edit</a> </td> +# +# ** Important note: ** +# +# It is *extremely* important to keep this file small. That's why all the +# identifiers in the HTML are short and cryptic. Currently, the main +# edit-actions page is ~300k. Before it was optimized, it was ~550k. +# +############################################################################# +<tr class="url@url-1-2@" valign="top"><td align="left"> </td> +<td align="center" class="nbr"><a name="l@p@" +href="ear?f=@f@&v=@v@&p=@p@" onclick="return rm_p(@p@,'@url@');">Remove</a> <a +href="eau?f=@f@&v=@v@&p=@p@">Edit</a> </td> <td class="url" align="left">@url-html@</td> </tr> - diff --git a/templates/edit-actions-remove-url-form b/templates/edit-actions-remove-url-form index c7e9de74..46adcb3d 100644 --- a/templates/edit-actions-remove-url-form +++ b/templates/edit-actions-remove-url-form @@ -33,6 +33,10 @@ # # Revisions : # $Log: edit-actions-remove-url-form,v $ +# Revision 1.3 2002/01/17 21:33:00 jongfoster +# Replacing all references to the URL of the config interface +# with @default-cgi@ +# # Revision 1.2 2002/01/17 21:21:05 jongfoster # DOS->Unix line endings # @@ -114,11 +118,11 @@ td.dark { background-color: #dddddd } <td class="light"> <h2>Remove URL Pattern</h2> <p>Are you sure you want to delete this URL pattern? The pattern is:</p> - <p><b>@oldval@</b></p> + <p><b>@u@</b></p> <p> - <a href="@default-cgi@edit-actions-remove-url?filename=@filename@&ver=@ver@&section=@section@&pattern=@pattern@">OK</a> + <a href="edit-actions-remove-url?f=@f@&v=@v@&p=@p@">OK</a> - <a href="@default-cgi@edit-actions-list?filename=@filename@">Cancel</a> + <a href="edit-actions-list?f=@f@">Cancel</a> </p> </td> </tr> diff --git a/templates/edit-actions-url-form b/templates/edit-actions-url-form index 0bec38f6..bd25c2f2 100644 --- a/templates/edit-actions-url-form +++ b/templates/edit-actions-url-form @@ -31,6 +31,10 @@ # # Revisions : # $Log: edit-actions-url-form,v $ +# Revision 1.3 2002/01/17 21:33:00 jongfoster +# Replacing all references to the URL of the config interface +# with @default-cgi@ +# # Revision 1.2 2002/01/17 21:21:05 jongfoster # DOS->Unix line endings # @@ -51,11 +55,11 @@ # # Available variables include: # -# filename -# ver -# section -# pattern -# oldval +# f - filename +# v - version +# s - section +# p - pattern +# u - old value of URL # ############################################################################# <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> @@ -126,17 +130,16 @@ function validate(text) <tr> <td class="light"> <h2>Edit URL Pattern</h2> - <form method="GET" action="@default-cgi@edit-actions-url" - onSubmit="return validate(newval.value);"> + <form method="GET" action="edit-actions-url" + onSubmit="return validate(u.value);"> <p> - <input type="hidden" name="filename" value="@filename@"> - <input type="hidden" name="ver" value="@ver@"> - <input type="hidden" name="section" value="@section@"> - <input type="hidden" name="pattern" value="@pattern@"> - <input type="text" name="newval" value="@oldval@" size="78"><br> + <input type="hidden" name="f" value="@f@"> + <input type="hidden" name="v" value="@v@"> + <input type="hidden" name="p" value="@p@"> + <input type="text" name="u" value="@u@" size="78"><br> <input type="submit" value="Submit"> <input type="reset" value="Reset"> - <a href="@default-cgi@edit-actions-list?filename=@filename@">Cancel</a> + <a href="edit-actions-list?f=@f@">Cancel</a> </p> </form> </td>