[Linpha-cvs] SF.net SVN: linpha: [4453] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-03-29 16:36:04
|
Revision: 4453 Author: fangehrn Date: 2006-03-29 08:35:34 -0800 (Wed, 29 Mar 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4453&view=rev Log Message: ----------- * added ie hack for the menu, all should work now, but it will never look that nice Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/templates/default/css/global.css trunk/linpha2/templates/default/css/view_img.css trunk/linpha2/templates/default/css/view_thumb.css trunk/linpha2/templates/default/global.html.php Added Paths: ----------- trunk/linpha2/templates/default/css/csshover.htc Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-03-29 14:29:25 UTC (rev 4452) +++ trunk/linpha2/ChangeLog 2006-03-29 16:35:34 UTC (rev 4453) @@ -2,6 +2,8 @@ * rearanged templates * thumbnails are now cropped -> they are all squares now makes things a lot easier, and looks nice + * added ie hack for the menu, all should work now, but it + will never look that nice 2006-03-26 flo * applying bastian's theme Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-03-29 14:29:25 UTC (rev 4452) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-03-29 16:35:34 UTC (rev 4453) @@ -75,20 +75,20 @@ function set_navigation_line( $id ) { $array_files = $GLOBALS['linpha']->sql->getFullFilenameFromId( $id ); - $str = '<a href="'.LINPHA_DIR.'/?cat=alb&id=0">top</a> / '; + $str = '<a href="'.LINPHA_DIR.'/?cat=alb&id=0">></a> '; foreach($array_files AS $key=>$value) { if($value != "") { - $str .= '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$key.'">'.$value.'</a> / '; + $str .= '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$key.'">'.$value.'</a> > '; } } /** - * remove last 3 signs (the comma and the spaces) + * remove last spacer signs */ - $str = substr($str,0,strlen($str)-3); + $str = substr($str,0,strlen($str)-6); return $str; Added: trunk/linpha2/templates/default/css/csshover.htc =================================================================== --- trunk/linpha2/templates/default/css/csshover.htc (rev 0) +++ trunk/linpha2/templates/default/css/csshover.htc 2006-03-29 16:35:34 UTC (rev 4453) @@ -0,0 +1,115 @@ +<attach event="ondocumentready" handler="parseStylesheets" /> +<script> +/** + * Whatever:hover - V1.41.050927 - hover & active + * ------------------------------------------------------------ + * (c) 2005 - Peter Nederlof + * Peterned - http://www.xs4all.nl/~peterned/ + * License - http://creativecommons.org/licenses/LGPL/2.1/ + * + * Whatever:hover is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Whatever:hover is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * Credits and thanks to: + * Arnoud Berendsen, Martin Reurings, Robert Hanson + * + * howto: body { behavior:url("csshover.htc"); } + * ------------------------------------------------------------ + */ + +var csshoverReg = /(^|\s)(([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active)/i, +currentSheet, doc = window.document, hoverEvents = [], activators = { + onhover:{on:'onmouseover', off:'onmouseout'}, + onactive:{on:'onmousedown', off:'onmouseup'} +} + +function parseStylesheets() { + if(!/MSIE (5|6)/.test(navigator.userAgent)) return; + window.attachEvent('onunload', unhookHoverEvents); + var sheets = doc.styleSheets, l = sheets.length; + for(var i=0; i<l; i++) + parseStylesheet(sheets[i]); +} + function parseStylesheet(sheet) { + if(sheet.imports) { + try { + var imports = sheet.imports, l = imports.length; + for(var i=0; i<l; i++) parseStylesheet(sheet.imports[i]); + } catch(securityException){} + } + + try { + var rules = (currentSheet = sheet).rules, l = rules.length; + for(var j=0; j<l; j++) parseCSSRule(rules[j]); + } catch(securityException){} + } + + function parseCSSRule(rule) { + var select = rule.selectorText, style = rule.style.cssText; + if(!csshoverReg.test(select) || !style) return; + + var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, 'on$1'); + var newSelect = select.replace(/(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi, '.$2' + pseudo); + var className = (/\.([a-z0-9_-]*on(hover|active))/i).exec(newSelect)[1]; + var affected = select.replace(/:(hover|active).*$/, ''); + var elements = getElementsBySelect(affected); + if(elements.length == 0) return; + + currentSheet.addRule(newSelect, style); + for(var i=0; i<elements.length; i++) + new HoverElement(elements[i], className, activators[pseudo]); + } + +function HoverElement(node, className, events) { + if(!node.hovers) node.hovers = {}; + if(node.hovers[className]) return; + node.hovers[className] = true; + hookHoverEvent(node, events.on, function() { node.className += ' ' + className; }); + hookHoverEvent(node, events.off, function() { node.className = node.className.replace(new RegExp('\\s+'+className, 'g'),''); }); +} + function hookHoverEvent(node, type, handler) { + node.attachEvent(type, handler); + hoverEvents[hoverEvents.length] = { + node:node, type:type, handler:handler + }; + } + + function unhookHoverEvents() { + for(var e,i=0; i<hoverEvents.length; i++) { + e = hoverEvents[i]; + e.node.detachEvent(e.type, e.handler); + } + } + +function getElementsBySelect(rule) { + var parts, nodes = [doc]; + parts = rule.split(' '); + for(var i=0; i<parts.length; i++) { + nodes = getSelectedNodes(parts[i], nodes); + } return nodes; +} + function getSelectedNodes(select, elements) { + var result, node, nodes = []; + var identify = (/\#([a-z0-9_-]+)/i).exec(select); + if(identify) return [doc.getElementById(identify[1])]; + + var classname = (/\.([a-z0-9_-]+)/i).exec(select); + var tagName = select.replace(/(\.|\#|\:)[a-z0-9_-]+/i, ''); + var classReg = classname? new RegExp('\\b' + classname[1] + '\\b'):false; + for(var i=0; i<elements.length; i++) { + result = tagName? elements[i].all.tags(tagName):elements[i].all; + for(var j=0; j<result.length; j++) { + node = result[j]; + if(classReg && !classReg.test(node.className)) continue; + nodes[nodes.length] = node; + } + } return nodes; + } +</script> \ No newline at end of file Modified: trunk/linpha2/templates/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/css/global.css 2006-03-29 14:29:25 UTC (rev 4452) +++ trunk/linpha2/templates/default/css/global.css 2006-03-29 16:35:34 UTC (rev 4453) @@ -23,42 +23,29 @@ /** * title */ - #divtitle { + #title + { margin-top: 10px; margin-bottom: 20px; - height: 40px; - } - #title { - /* background-color: #d5fcf4;*/ - /* border: 1px solid #0c9;*/ + margin-left: 100px; - position: absolute; - left: 50%; - width: 600px; - height: 40px; - margin-left: -300px; /* should be the half of 'width' */ - white-space: nowrap; - - /* padding: 0;*/ - /* margin: 10px 10px 10px 10px;*/ - font-size: 25pt; } - #title a:link, #title a:visited, #title a:hover { + #title a:link, #title a:visited, #title a:hover + { color: #444444; text-decoration: none; } - #title a:hover { + #title a:hover + { text-decoration: underline; } /** * left */ - #left { - /* background-color: #ffd5ee;*/ - /* border: 1px solid #f09;*/ - + #left + { position: absolute; top: 160px; left: 10px; @@ -73,9 +60,8 @@ /** * navigation */ - #navigation { - /* background-color: #d5fcf4;*/ - /* border: 1px solid #0c9;*/ + #navigation + { padding: 0; margin: 10px 10px 10px 10px; } @@ -97,15 +83,11 @@ * menu */ #divmenu { - height: 30px; + height: 40px; } #menu { - position: absolute; - left: 50%; - width: 800px; - height: 40px; - margin-left: -400px; /* half of 'width' */ + margin-left: 50px; } /** Modified: trunk/linpha2/templates/default/css/view_img.css =================================================================== --- trunk/linpha2/templates/default/css/view_img.css 2006-03-29 14:29:25 UTC (rev 4452) +++ trunk/linpha2/templates/default/css/view_img.css 2006-03-29 16:35:34 UTC (rev 4453) @@ -45,7 +45,6 @@ text-align: center; font-size: 0.5em; - } .div_all_prevthumb { Modified: trunk/linpha2/templates/default/css/view_thumb.css =================================================================== --- trunk/linpha2/templates/default/css/view_thumb.css 2006-03-29 14:29:25 UTC (rev 4452) +++ trunk/linpha2/templates/default/css/view_thumb.css 2006-03-29 16:35:34 UTC (rev 4453) @@ -1,13 +1,14 @@ #main { - min-height: 500px; /*@todo floated divs in thumb view without javascript doesnt count to the main div height */ +/* min-height: 500px; /*@todo floated divs in thumb view without javascript doesnt count to the main div height */ } /** * need this to calculate heigh of main div * if you're gettings scrollbars, adjust the height! + * height: 12.52em; dosent work, it increases to much if we adjust browsers font-size */ #spacer_height { - height: 200px; + height: 208px; position: absolute; visibility: hidden; } Modified: trunk/linpha2/templates/default/global.html.php =================================================================== --- trunk/linpha2/templates/default/global.html.php 2006-03-29 14:29:25 UTC (rev 4452) +++ trunk/linpha2/templates/default/global.html.php 2006-03-29 16:35:34 UTC (rev 4453) @@ -12,6 +12,29 @@ <!-- css includes --> <link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/css/global.css'; ?>' type='text/css'> <link rel='stylesheet' href='<?php $GLOBALS['linpha']->template->includeFile('css'); ?>' type='text/css'> + <!-- IE hack for the menu--> + <!--[if IE]> + <style type="text/css" media="screen"> + #menu a, #menu span + { + width: 50px; + } + </style> + <![endif]--> + <!--[if lt IE 7]> + <style type="text/css" media="screen"> + body { + behavior: url(templates/default/css/csshover.htc); + font-size: 100%; + } + + #menu ul li a {height: 1%;} + + #menu a, #menu span { + font: bold 0.7em/1.4em arial, helvetica, sans-serif; + } + </style> + <![endif]--> <?php if( isset($GLOBALS['linpha']->template->output['sys_log'])) { ?> <link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/css/syslog.css'; ?>' type='text/css'> @@ -37,11 +60,9 @@ <?php } ?> <!-- title/navigation --> -<div id="divtitle"> <div id="title"> <?php echo $GLOBALS['linpha']->template->linpha_title." :: ".$GLOBALS['linpha']->template->output['title']; ?> </div> -</div> <!-- menu --> <!-- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |