Roxen.git
/
server
/
modules
/
tags
/
killframe.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/tags/killframe.pike:3:
* Adds some java script that will prevent others from putting * your page in a frame. * * Will also remove occuranses of "indexfiles" from the end of the URL. * * made by Peter Bortas <peter@idonex.se> Januari -97 * * Thanks for suggestions and bugreports: * Barry Treahy <treahy@allianceelec.com> * Chris Burgess <chris@ibex.co.nz>
+
*
+
* BUGS:
+
* Removes document-internal links. (gazink.html#foo)
*/
-
constant cvs_version = "$Id: killframe.pike,v 1.
17
1998/04/
03
19
:
20
:
53
peter Exp $";
+
constant cvs_version = "$Id: killframe.pike,v 1.
18
1998/04/
15
12
:
00
:
45
peter Exp $";
constant thread_safe=1; #include <module.h> inherit "module"; void create() { defvar( "killindex", 1, "Kill trailing 'indexfiles'?", TYPE_FLAG|VAR_MORE, "When set, the killframe module will remove occurrences of " "'indexfiles' (as set in the active directory module) from "
Roxen.git/server/modules/tags/killframe.pike:61:
string tmp; /* Links to index.html are ugly. */ string my_url = id->conf->query("MyWorldLocation"); if( sscanf(my_url, "%s:80/", tmp ) ) my_url = tmp +"/"+ id->not_query[1..]; else my_url += id->not_query[1..];
+
if(id->query)
+
my_url += "?"+ id->query;
+
else
+
{
int l=strlen(my_url)-1; foreach( indexfiles, string index ) if( my_url[l-strlen(index)..] == "/" +index ) my_url = my_url[..l-strlen(index)];
-
+
}
javascript = ( " if(top.location != \""+ my_url +"\")\n" " top.location = \""+ my_url +"\";\n" ); } else javascript = ( " if (self != top) top.location = self.location;\n" ); if (id->supports->javascript) return("<script language=javascript><!--\n" + javascript + "//--></script>\n"); return ""; } mapping query_tag_callers() { return ([ "killframe" : tag_killframe ]); }