[Linpha-cvs] SF.net SVN: linpha: [4452] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-03-29 14:29:37
|
Revision: 4452 Author: fangehrn Date: 2006-03-29 06:29:25 -0800 (Wed, 29 Mar 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4452&view=rev Log Message: ----------- * thumbnails are now cropped -> they are all squares now makes things a lot easier, and looks nice Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/linpha.image.class.php trunk/linpha2/lib/classes/syslog.js trunk/linpha2/templates/default/css/global.css trunk/linpha2/templates/default/css/view_thumb.css trunk/linpha2/templates/default/global.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-03-29 13:11:38 UTC (rev 4451) +++ trunk/linpha2/ChangeLog 2006-03-29 14:29:25 UTC (rev 4452) @@ -1,5 +1,7 @@ 2006-03-29 flo * rearanged templates + * thumbnails are now cropped -> they are all squares now + makes things a lot easier, and looks nice 2006-03-26 flo * applying bastian's theme Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-03-29 13:11:38 UTC (rev 4451) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-03-29 14:29:25 UTC (rev 4452) @@ -176,7 +176,9 @@ */ if( linIdentify::isVideo( $org_type ) ) { - //$tmp_file = create_video_thumbnail($src_file); + /** + * @todo $tmp_file = create_video_thumbnail($src_file); + */ $output = LINPHA_DIR.'/lib/graphics/avi_mov.gif'; } @@ -189,27 +191,57 @@ * read thumbsize */ $thumbsize = $GLOBALS['linpha']->sql->config->value['sys_style_tn_size']; - $max_width = $thumbsize; + $q = 75; + + + /*$max_width = $thumbsize; $max_height = $thumbsize; + $w = $thumbsize; + $h = $thumbsize;*/ - /** * set parameters */ - $array = linImage::scaleToFit($org_height,$org_width,$max_height,$max_width,0); + /*$array = linImage::scaleToFit($org_height,$org_width,$max_height,$max_width,0); $w = $array['w']; - $h = $array['h']; - $q = 75; - + $h = $array['h'];*/ + + + /** + * crop image + */ + $ratio = $org_width/$org_height; + if($ratio==1) + { + $x = 0; + $y = 0; + $w = $thumbsize; + $h = $thumbsize; + } + elseif($ratio>1) + { + $x = ( ($thumbsize*$ratio) - $thumbsize )/2; + $y = 0; + $w = ''; + $h = $thumbsize; + } + elseif($ratio<1) + { + $y = ( $thumbsize - ($thumbsize*$ratio) )/2; + $x = 0; + $w = $thumbsize; + $h = ''; + } + $convert_str = 'convert'. ' -quality '.$q. - ' -size "'.$w.'x'.$h.'"'. // new size + ' -size '.$w.'x'.$h. // new size + ' -crop '.$thumbsize.'x'.$thumbsize.'+'.$x.'+'.$y. // crop ' '.lin_escape_string( $src_file ).'[0]'. // [0] -> take only first frame!!! - ' -thumbnail "'.$w.'x'.$h.'"'. // new size and delete profiles - //' +profile "*"'. // delete all profiles + ' -thumbnail "'.$w.'x'.$h.'"'. // new size and delete profiles, no need anymore for ' +profile "*"'. // delete all profiles ' -colorspace RGB'. // change colorspace always to RGB because all browsers only can display RGB images ' '.lin_escape_string( $output ); - + exec( $convert_str ); } } Modified: trunk/linpha2/lib/classes/syslog.js =================================================================== --- trunk/linpha2/lib/classes/syslog.js 2006-03-29 13:11:38 UTC (rev 4451) +++ trunk/linpha2/lib/classes/syslog.js 2006-03-29 14:29:25 UTC (rev 4452) @@ -0,0 +1,24 @@ +var window_is_open = false; +function toggleWindow() +{ + if( window_is_open ) + { + window_is_open = false; + + document.getElementById('sys_log').style.width = '20px'; + document.getElementById('sys_log').style.height = '20px'; + + document.getElementById('sys_log_text').style.visibility = 'hidden'; + } + else + { + window_is_open = true; + + document.getElementById('sys_log').style.width = 'auto'; + document.getElementById('sys_log').style.height = 'auto'; + + document.getElementById('sys_log_text').style.visibility = ''; + } +} + +toggleWindow(); \ No newline at end of file Modified: trunk/linpha2/templates/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/css/global.css 2006-03-29 13:11:38 UTC (rev 4451) +++ trunk/linpha2/templates/default/css/global.css 2006-03-29 14:29:25 UTC (rev 4452) @@ -97,60 +97,65 @@ * menu */ #divmenu { - /* background-color: #ffd5ee;*/ - /* border: 1px solid #f09;*/ - - z-index: 400; - height: 30px; } #menu { position: absolute; left: 50%; - width: 600px; + width: 800px; height: 40px; - margin-left: -300px; /* should be the half of 'width' */ + margin-left: -400px; /* half of 'width' */ + } - /*width: 100%;*/ + /** + * icons + */ + #menu div { + margin: 0; + margin-left: 5px; + margin-right: 5px; + padding: 0; float: left; } - + + /** + * hover + */ + #menu a:hover, #menu span:hover { + background: #bbbbbb; + } + + /** + * first level elements + */ #menu ul { list-style: none; margin: 0; + margin-left: 5px; + margin-right: 5px; padding: 0; - width: 7em; float: left; white-space: nowrap; + + border-top: 1px solid #000000; } - + /** - * all elements + * first level elements */ - #menu a, #menu span { + #menu ul a, #menu ul span { display: block; margin: 0; - padding: 2px 3px; + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + padding-bottom: 2px; -/* border-width: 1px; - border-style: solid; - border-color: #ccc #888 #555 #bbb; - color: #fff; - background: #036;*/ - } - - /** - * only first level elements - */ - #menu ul a, #menu ul span { - margin-left: 10px; - margin-right: 10px; - text-align: center; text-decoration: none; - border-top: 1px solid #000000; + color: #000000; background: #FFFFFF; } @@ -158,9 +163,26 @@ /** * only two or more level elements */ + #menu ul ul { + position: absolute; + z-index: 500; + + /** + * relativ to parent element! be careful + */ + font-size: 1em; + margin: 0; + padding: 0; + } #menu ul ul a, #menu ul ul span { - margin: 0px; + display: block; + margin: 0; + padding-left: 5px; + padding-right: 5px; + padding-top: 2px; + padding-bottom: 2px; + text-align: left; text-decoration: none; @@ -168,42 +190,43 @@ border-top-width: 0px; background: #eeeeee; } - - #menu a:hover, #menu span:hover { -/* color: #fff;*/ - background: #bbbbbb; - } + + /** + * the most important thing + * enable/disable submenus + */ #menu li { position: relative; } - - #menu ul ul { - position: absolute; - z-index: 500; - font-size: 1em; /* relativ to parent element */ - width: auto; - min-width: 7em; -/* white-space: nowrap;*/ - } - - #menu ul ul ul { - position: absolute; - top: 0; - left: 100%; - } - + div#menu ul ul, div#menu ul li:hover ul ul, div#menu ul ul li:hover ul ul - {display: none;} - + { + display: none; + } div#menu ul li:hover ul, div#menu ul ul li:hover ul, div#menu ul ul ul li:hover ul - {display: block;} + { + display: block; + } + /** + * third stage, switch to horizontal menu entries + */ + #menu ul ul ul { + position: absolute; + top: 0; + left: 100%; + } /** + * end menu + */ + + +/** * rounded corner stuff */ #divmain { Modified: trunk/linpha2/templates/default/css/view_thumb.css =================================================================== --- trunk/linpha2/templates/default/css/view_thumb.css 2006-03-29 13:11:38 UTC (rev 4451) +++ trunk/linpha2/templates/default/css/view_thumb.css 2006-03-29 14:29:25 UTC (rev 4452) @@ -1,5 +1,5 @@ #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 */ } /** Modified: trunk/linpha2/templates/default/global.html.php =================================================================== --- trunk/linpha2/templates/default/global.html.php 2006-03-29 13:11:38 UTC (rev 4451) +++ trunk/linpha2/templates/default/global.html.php 2006-03-29 14:29:25 UTC (rev 4452) @@ -27,7 +27,7 @@ <?php if( isset($GLOBALS['linpha']->template->output['sys_log']) ) { ?> <!-- syslog --> <div id="sys_log"> - <div class="sys_log_close"><a href="javascript:toggleWindow()">X</a></div> + <div id="sys_log_close"><a href="javascript:toggleWindow()">X</a></div> <div id="sys_log_text"> <?php echo i18n("Linpha Syslog"); ?>:<br /> <?php echo $GLOBALS['linpha']->template->output['sys_log']; ?> @@ -54,9 +54,6 @@ <li><a href="./"><?php echo i18n("Home"); ?></a></li> </ul> <ul> - <li><a href="./admin/"><?php echo i18n("Admin"); ?></a></li> - </ul> - <ul> <li><span><?php echo i18n("Search"); ?> v</span> <ul> <li><a href="./?cat=search"><?php echo i18n("Extended Search"); ?></a></li> @@ -91,6 +88,17 @@ $GLOBALS['linpha']->template->printMenu('more'); } ?> + <div> + <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/download.png'; ?>" /> + <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/print.png'; ?>" /> + <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/slideshow.png'; ?>" /> + </div> + <ul> + <li><a href="./admin/"><?php echo i18n("My Settings"); ?></a></li> + </ul> + <ul> + <li><a href="./admin/"><?php echo i18n("Admin"); ?></a></li> + </ul> </div> </div> <!-- end menu --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |