From bd8210d0d851e2041b4924c5166141d16d0afc9a Mon Sep 17 00:00:00 2001 From: Tobias Weimer <wishmaster51@googlemail.com> Date: Tue, 22 Jan 2013 17:38:03 +0000 Subject: - fixed contact menu - updated default template git-svn-id: http://svn.miranda-ng.org/main/trunk@3234 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HTTPServer/docs/data/HTTPServer.dll | Bin 55296 -> 0 bytes plugins/HTTPServer/docs/data/HTTPServerIndex.html | 113 +++++--- .../docs/data/htdocs/@settings/favicon.ico | Bin 1406 -> 1150 bytes .../docs/data/htdocs/@settings/icons/document2.png | Bin 702 -> 0 bytes .../docs/data/htdocs/@settings/icons/empty.png | Bin 357 -> 0 bytes .../data/htdocs/@settings/icons/folder_gray.png | Bin 3172 -> 0 bytes .../docs/data/htdocs/@settings/icons/image2.png | Bin 912 -> 0 bytes .../docs/data/htdocs/@settings/icons/pdf.png | Bin 747 -> 0 bytes .../docs/data/htdocs/@settings/icons/sound.png | Bin 771 -> 0 bytes .../docs/data/htdocs/@settings/icons/source.png | Bin 633 -> 0 bytes .../docs/data/htdocs/@settings/icons/tar.png | Bin 863 -> 0 bytes .../docs/data/htdocs/@settings/icons/txt.png | Bin 558 -> 0 bytes .../docs/data/htdocs/@settings/icons/video.png | Bin 784 -> 0 bytes .../docs/data/htdocs/@settings/icons/win_apps.png | Bin 944 -> 0 bytes .../docs/data/htdocs/@settings/icons/www.png | Bin 734 -> 0 bytes .../docs/data/htdocs/@settings/index.xsl | 306 +++++++++++++-------- .../htdocs/@settings/theme/icons/document2.png | Bin 0 -> 702 bytes .../data/htdocs/@settings/theme/icons/empty.png | Bin 0 -> 357 bytes .../htdocs/@settings/theme/icons/folder_gray.png | Bin 0 -> 3172 bytes .../data/htdocs/@settings/theme/icons/image2.png | Bin 0 -> 912 bytes .../docs/data/htdocs/@settings/theme/icons/pdf.png | Bin 0 -> 747 bytes .../data/htdocs/@settings/theme/icons/sound.png | Bin 0 -> 771 bytes .../data/htdocs/@settings/theme/icons/source.png | Bin 0 -> 633 bytes .../htdocs/@settings/theme/icons/source_java.png | Bin 0 -> 3373 bytes .../docs/data/htdocs/@settings/theme/icons/tar.png | Bin 0 -> 863 bytes .../docs/data/htdocs/@settings/theme/icons/tex.png | Bin 0 -> 3205 bytes .../docs/data/htdocs/@settings/theme/icons/txt.png | Bin 0 -> 558 bytes .../data/htdocs/@settings/theme/icons/video.png | Bin 0 -> 784 bytes .../data/htdocs/@settings/theme/icons/win_apps.png | Bin 0 -> 944 bytes .../docs/data/htdocs/@settings/theme/icons/www.png | Bin 0 -> 734 bytes .../htdocs/@settings/theme/style/simpleTheme.css | 191 +++++++++++++ plugins/HTTPServer/src/GuiElements.cpp | 2 +- plugins/HTTPServer/src/main.cpp | 3 +- 33 files changed, 466 insertions(+), 149 deletions(-) delete mode 100644 plugins/HTTPServer/docs/data/HTTPServer.dll delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/document2.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/empty.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/folder_gray.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/image2.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/pdf.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/sound.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/source.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/tar.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/txt.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/video.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/win_apps.png delete mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/icons/www.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/document2.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/empty.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/folder_gray.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/image2.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/pdf.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/sound.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/source.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/source_java.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/tar.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/tex.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/txt.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/video.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/win_apps.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/www.png create mode 100644 plugins/HTTPServer/docs/data/htdocs/@settings/theme/style/simpleTheme.css (limited to 'plugins') diff --git a/plugins/HTTPServer/docs/data/HTTPServer.dll b/plugins/HTTPServer/docs/data/HTTPServer.dll deleted file mode 100644 index d315b17d8b..0000000000 Binary files a/plugins/HTTPServer/docs/data/HTTPServer.dll and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/HTTPServerIndex.html b/plugins/HTTPServer/docs/data/HTTPServerIndex.html index 4fdc41940a..a64f9c4884 100644 --- a/plugins/HTTPServer/docs/data/HTTPServerIndex.html +++ b/plugins/HTTPServer/docs/data/HTTPServerIndex.html @@ -1,34 +1,83 @@ -<html> -<head> -<title>Directory Listing of [DirectoryName]</title> -<style type="text/css"> -td { font-size:14px; color:#000033;} -a:link { text-decoration: none; color:#003366; } -a:visited { text-decoration: none; color:#003366; } -a:active { text-decoration: none; color:#FFAA33; } -a:hover { text-decoration: underline; color:#FFAA33; } -</style> -</head> -<body bgcolor=#B0B0CC> -<font face='tahoma, arial'> - -<table cellspacing=1 cellpadding=2 width=700> -<tr height=40 bgcolor=#EEEEFF><td colspan=3 align=center> -<h3 style='margin:0px'><font color="#666688">Directory Listing of [DirectoryName]</font></h3> -[ForDirectoriesDo]<tr [IsEven]bgcolor=#EEEEFF[End][IsOdd]bgcolor=#DDDDEE[End]><td colspan=3><img src="/icons/folder_gray.png"><img src="/placeholder.gif" width=5><a href="[DirectoryUrl]">[DirectoryName]</a></td></tr>[End] -[ForFilesDo]<tr [IsEven]bgcolor=#EEEEFF[End][IsOdd]bgcolor=#DDDDEE[End]><td> -[IsFileType=jpg,jpeg,gif,png,bmp]<img src="/icons/image2.png">[End] -[IsFileType=zip,rar,ace,arj,lha,lhz,tar,gz]<img src="/icons/tar.png">[End] -[IsFileType=rtf,doc]<img src="/icons/doc.png">[End] -[IsFileType=txt,diz]<img src="/icons/txt.png">[End] -[IsFileType=pdf]<img src="/icons/pdf.png">[End] -[IsFileType=exe,bat]<img src="/icons/win_apps.png">[End] -[IsFileType=html,htm,xml]<img src="/icons/www.png">[End] -[IsFileType=avi,mpg]<img src="/icons/video.png">[End] -[IsFileType=c,cpp,h]<img src="/icons/source.png">[End] -[IsFileType=mp3,ogg,wav,mid,mod,xm]<img src="/icons/sound.png">[End] -[IsFileType=*]<img src="/icons/empty.png">[End]<img src="/placeholder.gif" width=5><a href="[FileUrl]">[FileName]</a></td><td>[FileModified]</td><td align='right'>[FileSize]</td></tr>[End] -</font> -</body> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" + "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > + + <!-- + * template for HTTPServer Plugin for Miranda IM by Houdini + http://addons.miranda-im.org/details.php?action=viewfile&id=2304 + + * the icons are taken from the 'Crystal Project' by Everaldo Coelho, licenced under LGPL + http://www.everaldo.com/ + + modded by Wishmaster + + header bar + + tooltips on each field + + moved design to seperate CSS file + * proper support for "shortcut icon" aka "favicon" (with link tag) + * lots of code changes + * converted to XHTML 1.1 + --> + + <head> + + <!-- title of the page --> + <title>Directroy [DirectoryName]</title> + + <!-- path to the FavIcon --> + <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/favicon.ico" /> + + <!-- path to the CSS file --> + <link rel="stylesheet" type="text/css" href="/theme/style/simpleTheme.css" /> + </head> + <body> + <table id="listing"> + <caption id="tablecaption" class="tablecaption">Directory [DirectoryName]</caption> + <tr id="header"> + <th class="file">Name</th> + <th class="size">Size</th> + <th class="modified">Modified</th> + <th class="created">Created</th> + </tr> + +[ForDirectoriesDo] + <tr [IsEven]class="even"[End][IsOdd]class="odd"[End]> + <td title="Directory: [DirectoryName]" class="folder" colspan="4"> + <a href="[DirectoryUrl]" title="[DirectoryName] (Directory)" class="folder"> + <img src="/theme/icons/folder_gray.png" alt="folder" /> + [DirectoryName] + </a> + </td> + </tr> +[End] + +[ForFilesDo] + <tr [IsEven]class="even"[End][IsOdd]class="odd"[End]> + <td title="File: [FileName]" class="file"> + <a href="[FileUrl]" title="[FileName] ([FileSize])"> +[IsFileType=jpg,jpeg,gif,png,bmp]<img src="/theme/icons/image2.png" alt="" />[End] +[IsFileType=zip,rar,ace,arj,lha,lhz,tar,gz,7z]<img src="/theme/icons/tar.png" alt="" />[End] +[IsFileType=rtf,doc]<img src="/theme/icons/doc.png" alt="" />[End] +[IsFileType=txt,diz]<img src="/theme/icons/txt.png" alt="" />[End] +[IsFileType=pdf]<img src="/theme/icons/pdf.png" alt="" />[End] +[IsFileType=tex]<img src="/theme/icons/tex.png" alt="" />[End] +[IsFileType=java,jar]<img src="/theme/icons/source_java.png" alt="" />[End] +[IsFileType=exe,bat,dll]<img src="/theme/icons/win_apps.png" alt="" />[End] +[IsFileType=html,htm,xml,php,css]<img src="/theme/icons/www.png" alt="" />[End] +[IsFileType=avi,mpg,mpeg]<img src="/theme/icons/video.png" alt="" />[End] +[IsFileType=c,cpp,h]<img src="/theme/icons/source.png" alt="" />[End] +[IsFileType=mp3,ogg,wav,mid,mod,xm]<img src="/theme/icons/sound.png" alt="" />[End] +[IsFileType=*]<img src="/theme/icons/empty.png" alt="" />[End] + [FileName] + </a> + </td> + <td class="size" title="Size: [FileSize]">[FileSize]</td> + <td class="modified" title="Modified: [FileModified]">[FileModified]</td> + <td class="created" title="Created: [FileCreated]">[FileCreated]</td> + </tr> +[End] + + </table> + </body> </html> \ No newline at end of file diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/favicon.ico b/plugins/HTTPServer/docs/data/htdocs/@settings/favicon.ico index 1bd45b98e4..fff597ff84 100644 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/favicon.ico and b/plugins/HTTPServer/docs/data/htdocs/@settings/favicon.ico differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/document2.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/document2.png deleted file mode 100644 index f4d5bfd139..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/document2.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/empty.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/empty.png deleted file mode 100644 index bfe1d06e04..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/empty.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/folder_gray.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/folder_gray.png deleted file mode 100644 index ea7f314dba..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/folder_gray.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/image2.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/image2.png deleted file mode 100644 index dbefd0ccfa..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/image2.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/pdf.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/pdf.png deleted file mode 100644 index 27faad6fc0..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/pdf.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/sound.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/sound.png deleted file mode 100644 index bfe6022c8c..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/sound.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/source.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/source.png deleted file mode 100644 index 14a9c6ee31..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/source.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/tar.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/tar.png deleted file mode 100644 index 8bdfa8a0fc..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/tar.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/txt.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/txt.png deleted file mode 100644 index b34ba0b892..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/txt.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/video.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/video.png deleted file mode 100644 index 6c5f692d79..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/video.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/win_apps.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/win_apps.png deleted file mode 100644 index c22b0e24c9..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/win_apps.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/www.png b/plugins/HTTPServer/docs/data/htdocs/@settings/icons/www.png deleted file mode 100644 index 2bd96dd012..0000000000 Binary files a/plugins/HTTPServer/docs/data/htdocs/@settings/icons/www.png and /dev/null differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/index.xsl b/plugins/HTTPServer/docs/data/htdocs/@settings/index.xsl index d8e8f4e872..8e1d1bdda1 100644 --- a/plugins/HTTPServer/docs/data/htdocs/@settings/index.xsl +++ b/plugins/HTTPServer/docs/data/htdocs/@settings/index.xsl @@ -1,121 +1,199 @@ -<?xasml version="1.0" encoding="ISO-8859-1"?> -<xsl:stylesheet version="1.0" -xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<?xml version="1.0" encoding="ISO-8859-1" ?> + <!-- + * template for HTTPServer Plugin for Miranda IM by Houdini + http://addons.miranda-im.org/details.php?action=viewfile&id=2304 -<!-- Icons by Everaldo Coelho (www.everaldo.com) --> + * the icons are taken from the 'Crystal Project' by Everaldo Coelho, licenced under LGPL + http://www.everaldo.com/ -<xsl:template match="/"> + * Template modded by Wishmaster + [+] header bar + [+] bottom bar with number of total files and total file size + [+] tooltips on each field (with real byte-size) + [+] moved design to seperate CSS file + [*] proper support for "shortcut icon" aka "favicon" (with link tag) + [*] lots of code changes + --> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <xsl:variable name="dirname"> - <xsl:choose> - <xsl:when test="config/dirname=''">my Miranda Webserver</xsl:when> - <xsl:otherwise><xsl:value-of select="config/dirname"/></xsl:otherwise> - </xsl:choose> - </xsl:variable> + <!-- site properties --> + <xsl:output method="xml" version="1.1" doctype-public="-//W3C//DTD XHTML 1.1//EN" + doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" encoding="ISO-8859-1" + omit-xml-declaration="no" indent="yes" standalone="no" media-type="application/xhtml+xml" /> -<html> - <head> - <title>Directory Listing of <xsl:value-of select="$dirname"/></title> - <style type="text/css"> - td { font-family:tahoma, arial; font-size:14px; color:#000033;} - a:link { text-decoration: none; color:#003366; } - a:visited { text-decoration: none; color:#003366; } - a:active { text-decoration: none; color:#FFAA33; } - a:hover { text-decoration: underline; color:#FFAA33; } - </style> - </head> - - <body bgcolor='#B0B0CC'> - <font face='tahoma, arial'> - <table border='0' cellspacing='1' cellpadding='2' width='700'> - <tr height='40' bgcolor='#EEEEFF'> - <td colspan='3' align='center'> - <h3 style='margin:0px'><font color="#666688">Directory Listing of <xsl:value-of select="$dirname"/></font></h3> - </td> - </tr> - <xsl:for-each select="config/item"> - <xsl:sort select="@isdir" order="descending"/> - <xsl:sort select="@name"/> - <xsl:element name='tr'> - <xsl:attribute name="bgcolor"> - <xsl:choose> - <xsl:when test="position() mod 2 = 0">#EEEEFF</xsl:when> - <xsl:otherwise>#DDDDEE</xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:element name='td'> - <xsl:attribute name="colspan"> + <xsl:template match="/child::config"> + <!-- title of the site --> + <xsl:variable name="title"> + <xsl:choose> + <xsl:when test="child::dirname!=''">Directory <xsl:value-of select="child::dirname" /></xsl:when> + <xsl:otherwise>Miranda NG Webserver</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <!-- total size (in bytes) of all files --> + <xsl:variable name="size" select="sum(child::item/@size)" /> + + <xsl:variable name="total-realsize"> + <xsl:call-template name="convert"> + <xsl:with-param name="bytes" select="$size" /> + </xsl:call-template> + </xsl:variable> + + <!--begin of the site --> + <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <!-- title of the page --> + <title><xsl:value-of select="$title" /></title> + + <!-- path to the FavIcon --> + <link type="image/vnd.microsoft.icon" rel="shortcut icon" href="/favicon.ico" /> + + <!-- path to the CSS file --> + <link type="text/css" rel="stylesheet" href="/theme/style/simpleTheme.css" /> + </head> + <body> + <table id="listing" class="listing"> + <caption id="tablecaption" class="tablecaption" title="{$title}"><xsl:value-of select="$title" /></caption> + <tr id="header" class="header"> + <th id="fileheader" class="file">Name</th> + <th id="sizeheader" class="size">Size</th> + <th id="modifiedheader" class="modified">Modified</th> + <th id="createdheader" class="created">Created</th> + </tr> + <xsl:for-each select="child::item"> + <!-- an item can have following attributes: + @name - name of the file /folder + @isdir - 'true' if the item represents a folder, missing for files + @ext - extension of the file (only for files) + @size - size of the file (number of bytes) (only for files) + @created - date the file was created (only for files) + @modified - date the file was last modified (only for files) + --> + <!--sorting order--> + <xsl:sort select="@isdir='true'" order="descending" /> + <xsl:sort select="@ext" data-type="text" case-order="lower-first" order="ascending" /> <!-- sort by extension--> + <xsl:sort select="@name" data-type="text" case-order="lower-first" order="ascending" /> <!-- sort by name--> + <!--<xsl:sort select="@size" data-type="number" order="ascending" />--> <!-- sort by size--> + + <tr id="item{position()}"> + <xsl:attribute name="class"> + <!-- either even or odd--> <xsl:choose> - <xsl:when test="@isdir='true'">3</xsl:when> - <xsl:otherwise>1</xsl:otherwise> + <xsl:when test="(position() mod 2) = 0">even</xsl:when> + <xsl:otherwise>odd</xsl:otherwise> </xsl:choose> </xsl:attribute> - <xsl:variable name="ext"> - <xsl:value-of select="translate(@ext, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/> - </xsl:variable> - <xsl:variable name="icon"> - <xsl:choose> - <xsl:when test="@isdir='true'">folder_gray.png</xsl:when> - <xsl:when test="$ext='jpg' or $ext='jpeg' or $ext='gif' or $ext='png' or $ext='bmp'">image2.png</xsl:when> - <xsl:when test="$ext='zip' or $ext='rar' or $ext='ace' or $ext='arj' or $ext='lha' or ext='lhz' or ext='tar' or ext='gz'">tar.png</xsl:when> - <xsl:when test="$ext='rtf' or $ext='doc'">document2.png</xsl:when> - <xsl:when test="$ext='txt' or $ext='diz'">txt.png</xsl:when> - <xsl:when test="$ext='pdf'">pdf.png</xsl:when> - <xsl:when test="$ext='exe' or $ext='bat'">win_apps.png</xsl:when> - <xsl:when test="$ext='html' or $ext='htm' or $ext='xml'">www.png</xsl:when> - <xsl:when test="$ext='avi' or $ext='mpg'">video.png</xsl:when> - <xsl:when test="$ext='c' or $ext='cpp' or $ext='h'">source.png</xsl:when> - <xsl:when test="$ext='mp3' or $ext='ogg' or $ext='wav' or $ext='mid' or $ext='mod' or $ext='xm'">sound.png</xsl:when> - <xsl:otherwise>empty.png</xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:element name='img'> - <xsl:attribute name="src">/icons/<xsl:value-of select="$icon"/></xsl:attribute> - </xsl:element> - <xsl:element name='img'> - <xsl:attribute name="src">/placeholder.gif</xsl:attribute> - <xsl:attribute name="width">5</xsl:attribute> - </xsl:element> - <xsl:element name="a"> - <xsl:attribute name="href"> - <xsl:value-of select="@name"/> - <xsl:if test="@ext!=''">.<xsl:value-of select="@ext"/></xsl:if> - <xsl:if test="@isdir='true'">/</xsl:if> - </xsl:attribute> - <xsl:value-of select="@name"/> - <xsl:if test="@ext!=''">.<xsl:value-of select="@ext"/></xsl:if> - </xsl:element> - </xsl:element> - <xsl:choose> - <xsl:when test="@isdir='true'"></xsl:when> - <xsl:otherwise> - <td><xsl:value-of select="@modified"/></td> - <!-- <td><xsl:value-of select="@created"/></td> --> - <td width='100' align='right'> - <xsl:choose> - <xsl:when test="@size >= 1073741824"> - <xsl:value-of select="round(@size div 107374182.4) div 10"/><font size="-1"> GB</font> - </xsl:when> - <xsl:when test="@size >= 1048576"> - <xsl:value-of select="round(@size div 104857.6) div 10"/><font size="-1"> MB</font> - </xsl:when> - <xsl:when test="@size >= 1024"> - <xsl:value-of select="round(@size div 102.4) div 10"/><font size="-1"> KB</font> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="@size"/><font size="-1"> Byte</font> - </xsl:otherwise> - </xsl:choose> - </td> - </xsl:otherwise> - </xsl:choose> - </xsl:element> - </xsl:for-each> - </table> - </font> - </body> -</html> - -</xsl:template> - -</xsl:stylesheet> + <xsl:choose> + <xsl:when test="@isdir='true'"> + <!-- this is a folder --> + <td class="folder" id="folder{position()}" colspan="4" title="Verzeichnis: {@name}"> + <a href="{@name}/" class="folder" id="link{position()}" title="{@name} (Verzeichnis)"> + <img src="/theme/icons/folder_gray.png" alt="folder" /> + <xsl:value-of select="@name" /> + </a> + </td> + </xsl:when> + <xsl:otherwise> + <!-- this is a file --> + + <!-- complete name of the file (with extension, if there is one)--> + <xsl:variable name="filename"> + <xsl:value-of select="@name" /><xsl:if test="@ext!=''">.<xsl:value-of select="@ext" /></xsl:if> + </xsl:variable> + + <!-- filesize with appropriate units--> + <xsl:variable name="realsize"> + <xsl:call-template name="convert"> + <xsl:with-param name="bytes" select="@size" /> + </xsl:call-template> + </xsl:variable> + + <!-- extension in lowercase --> + <xsl:variable name="l_ext" select="translate(@ext,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" /> + + <td class="file" id="file{position()}" title="Datei: {$filename}"> + <a href="{$filename}" class="{$l_ext}" id="link{position()}" title="{$filename} ({$realsize})"> + <xsl:element name="img"> + <xsl:attribute name="alt"><xsl:value-of select="@ext" /></xsl:attribute> + <xsl:attribute name="src"> + <xsl:choose> + <!-- try to find appropriate icon (case-insensitive compare, as extensions are always case-insensitive in Windows) --> + <xsl:when test="$l_ext='jpg' or $l_ext='jpeg' or $l_ext='gif' or $l_ext='png' or $l_ext='bmp'">/theme/icons/image2.png</xsl:when> + <xsl:when test="$l_ext='zip' or $l_ext='rar' or $l_ext='ace' or $l_ext='arj' or $l_ext='lha' or $l_ext='lhz' or $l_ext='tar' or $l_ext='gz' or $l_ext='7z'">/theme/icons/tar.png</xsl:when> + <xsl:when test="$l_ext='rtf' or $l_ext='doc'">/theme/icons/document2.png</xsl:when> + <xsl:when test="$l_ext='txt' or $l_ext='diz'">/theme/icons/txt.png</xsl:when> + <xsl:when test="$l_ext='pdf'">/theme/icons/pdf.png</xsl:when> + <xsl:when test="$l_ext='tex'">/theme/icons/tex.png</xsl:when> + <xsl:when test="$l_ext='java' or $l_ext='jar'">theme/icons/source_java.png</xsl:when> + <xsl:when test="$l_ext='exe' or $l_ext='bat' or $l_ext='dll'">/theme/icons/win_apps.png</xsl:when> + <xsl:when test="$l_ext='html' or $l_ext='htm' or $l_ext='xml' or $l_ext='php' or $l_ext='css'">/theme/icons/www.png</xsl:when> + <xsl:when test="$l_ext='avi' or $l_ext='mpg' or $l_ext='mpeg'">/theme/icons/video.png</xsl:when> + <xsl:when test="$l_ext='c' or $l_ext='cpp' or $l_ext='h'">/theme/icons/source.png</xsl:when> + <xsl:when test="$l_ext='mp3' or $l_ext='ogg' or $l_ext='wav' or $l_ext='mid' or $l_ext='mod' or $l_ext='xm'">/theme/icons/sound.png</xsl:when> + <xsl:otherwise>/theme/icons/empty.png</xsl:otherwise> + </xsl:choose> + </xsl:attribute><!--src--> + </xsl:element><!--img--> + <xsl:value-of select="$filename" /> + </a> + </td> + + <!-- size --> + <td class="size" id="size{position()}" title="Size: {$realsize} ({format-number(@size,'###,###,###,###,### Byte')})" > + <xsl:value-of select="$realsize" /> + </td> + + <!-- modified --> + <td class="modified" id="modified{position()}" title="Modified: {@modified}"> + <xsl:value-of select="@modified" /> + </td> + + <!-- created --> + <td class="created" id="created{position()}" title="Created: {@created}"> + <xsl:value-of select="@created" /> + </td> + </xsl:otherwise> + </xsl:choose> + </tr> + </xsl:for-each><!--item--> + + <tr id="stats" class="stats"> + <th id="filestats" class="file"> + <xsl:value-of select="count(child::item[@isdir='true' and @name!='..'])" /> Directories, <xsl:value-of select="count(child::item[not(@isdir='true')])" /> Files + </th> + <th id="sizestats" class="size" title="Total Size: {$total-realsize} ({format-number($size,'###,###,###,###,### Byte')})"> + <xsl:value-of select="$total-realsize" /> + </th> + <th id="modifiedstats" class="modified">total</th> + <th id="createdstats" class="created"><a href="#header" id="uplink" title="to the top">scroll up</a></th> + </tr> + </table> + </body> + </html> + </xsl:template> <!--config--> + + <!-- converts byte sizes into human-readable text --> + <xsl:template name="convert"> + <xsl:param name="bytes" /> + <xsl:choose> + <xsl:when test="$bytes <= 0"> + ... + </xsl:when> + <xsl:when test="$bytes < 1024"> + <xsl:value-of select="format-number($bytes,'#,### Byte')" /> + </xsl:when> + <xsl:when test="$bytes < 1048576"> + <xsl:value-of select="format-number($bytes div 1024,'#,###.# KB')" /> + </xsl:when> + <xsl:when test="$bytes < 1073741824"> + <xsl:value-of select="format-number($bytes div 1048576,'#,###.# MB')" /> + </xsl:when> + <xsl:when test="$bytes < 1099511627776"> + <xsl:value-of select="format-number($bytes div 1073741824,'#,###.# GB')" /> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="format-number($bytes div 1099511627776,'#,###.# TB')" /> + </xsl:otherwise> + </xsl:choose> + </xsl:template> +</xsl:stylesheet> \ No newline at end of file diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/document2.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/document2.png new file mode 100644 index 0000000000..f4d5bfd139 Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/document2.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/empty.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/empty.png new file mode 100644 index 0000000000..bfe1d06e04 Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/empty.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/folder_gray.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/folder_gray.png new file mode 100644 index 0000000000..ea7f314dba Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/folder_gray.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/image2.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/image2.png new file mode 100644 index 0000000000..dbefd0ccfa Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/image2.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/pdf.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/pdf.png new file mode 100644 index 0000000000..27faad6fc0 Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/pdf.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/sound.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/sound.png new file mode 100644 index 0000000000..bfe6022c8c Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/sound.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/source.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/source.png new file mode 100644 index 0000000000..14a9c6ee31 Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/source.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/source_java.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/source_java.png new file mode 100644 index 0000000000..44057b7bd6 Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/source_java.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/tar.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/tar.png new file mode 100644 index 0000000000..8bdfa8a0fc Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/tar.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/tex.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/tex.png new file mode 100644 index 0000000000..96a42c8187 Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/tex.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/txt.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/txt.png new file mode 100644 index 0000000000..b34ba0b892 Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/txt.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/video.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/video.png new file mode 100644 index 0000000000..6c5f692d79 Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/video.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/win_apps.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/win_apps.png new file mode 100644 index 0000000000..c22b0e24c9 Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/win_apps.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/www.png b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/www.png new file mode 100644 index 0000000000..2bd96dd012 Binary files /dev/null and b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/icons/www.png differ diff --git a/plugins/HTTPServer/docs/data/htdocs/@settings/theme/style/simpleTheme.css b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/style/simpleTheme.css new file mode 100644 index 0000000000..03e8a2c9db --- /dev/null +++ b/plugins/HTTPServer/docs/data/htdocs/@settings/theme/style/simpleTheme.css @@ -0,0 +1,191 @@ +@charset "ISO-8859-1"; + +/* + * simpleTheme for Miranda's HTTPServer Plugin by FREAK_THEMIGHTY + */ + + +/* + IDs: + + table#listing + tr#header : headline (first <TR>) + tr#stats : footer (last <TR>) + a#uplink: Link in right bottom cell + + CLASSes + tr.even : at even position + tr.odd : at odd position + + td.folder : folder (take care of colspan="4" attribute here!!!) + + for ALL <td> and <th> + .file : file name + a.{ext} : extension of a file, lowercase (only XSLT template) + .size : file size + .modified : file modified-date + .created : file created-date +*/ + +/*reset to default*/ +* { + margin: 0px; + padding: 0px, +} + + + +body { + direction: ltr; + color: #86867B; + background-color: #FFFFFF; +} + +/* the table itsself */ +table#listing { + width: 90%; + margin: auto; + text-align: inherit; + + empty-cells: hide; + table-layout: auto; + + border-collapse: separate; + border-spacing: 3px; + border-right: #86867B 1px dotted; + border-top: #86867B 0px solid; + border-left: #86867B 1px dotted; + border-bottom: #86867B 4px solid; + + /*text-wrap: normal; + word-wrap: break-word;*/ + font-family: 'Times New Roman' +} + +/* caption of the file listing */ +caption#tablecaption { + caption-side: top; + color: #000000; + background-color: #E6E7D7; + + font: 1.5em Times; + + padding-top: 0px; + padding-bottom: 3px; + + border-right: #86867B 1px outset; + border-top: #86867B 2px outset; + border-left: #86867B 1px outset; + border-bottom: #86867B 2px outset; + + margin-top: 9px; + margin-bottom: 5px; + margin-left: 0px; + + vertical-align: middle; + overflow: auto; +} + +tr#header>td { + font: 0.8em Times; +} + +table#listing td { + font: menu; + + border: #86867B 1px solid; + margin-right: 0px; + + padding-top: 0px; + padding-bottom: 8px; + padding-left: 6px; + + vertical-align: middle; + overflow: hidden; +} + +/* even elements */ +#listing .even { + color: inherit; + background-color: #F5F5EA; +} + +/* odd elements */ +#listing .odd { + color: inherit; + background-color: #CDCCCC; +} + +/* hover effect */ +#listing td:hover { + color: #000000; + /*background-color: #F08080;*/ + border-color: #000000; +} + +#listing a:link { + text-decoration: none; + color: #CC0000; + font-weight: 800; + background-color: transparent; +} + +#listing a:visited { + text-decoration: none; + color: #555555; + background-color: transparent; +} + +#listing a:focus { + text-decoration: none; + color: inherit; + background-color: transparent; +} + +#listing a:hover { + text-decoration: none; + color: #000000; + background-color: transparent; +} + +#listing a:active { + text-decoration: none; + color: #555555; + background-color: transparent; +} + +#listing a#uplink { + text-decoration: underline; + color: inherit; + background-color: transparent; +} + +#listing img { + margin-top: 5px; + margin-right: 2px; + margin-left: 2px; + border: none; + width: 16px; + height: 16px; +} + +#stats { + font: 0.8em Times; +} +#stats>th { + height: auto; + text-align: center; + vertical-align: middle; +} + +td.file { + min-width: 70%; +} + +td.size { + text-align: right; +} + +td.modified { + font-weight: bold; +} \ No newline at end of file diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index fcfdc16a90..71b7c3e9f7 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -1505,7 +1505,7 @@ void InitGuiElements() { mi.ptszName = LPGENT("HTTP Share new file"); mi.pszService = MS_SHARE_NEW_FILE; - hShareNewFileMenuItem = Menu_AddMainMenuItem(&mi); + hShareNewFileMenuItem = Menu_AddContactMenuItem(&mi); if (!hShareNewFileMenuItem) { MessageBox(NULL, TranslateT("Failed to add contact menu item"), MSG_BOX_TITEL, MB_OK); return; diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 91ac702a0d..68eca1ea7a 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -37,8 +37,7 @@ const char szXmlTail[] = "</config>"; const char* pszDefaultShares[] = { "htdocs\\@settings\\favicon.ico", "/favicon.ico", "htdocs\\@settings\\index.xsl", "/index.xsl", - "htdocs\\@settings\\placeholder.gif", "/placeholder.gif", - "htdocs\\@settings\\icons\\", "/icons/", + "htdocs\\@settings\\theme\\", "/theme/", "htdocs\\", "/", 0, 0 }; -- cgit v1.2.3