|
|
Line 1: |
Line 1: |
- | <html> | + | <includeonly><span class="_togglegroup _toggle_initshow _toggle _toggler toggle-visible" style="display:none;">[show]</span><span class="_toggle_inithide _toggle _toggler toggle-hidden" style="display:none;">[hide]</span> |
- | <head> | + | <div class="_toggle_inithide _toggle toggle-hidden"> |
- | <title>iGEM Yale</title>
| + | {{{1}}}</div></includeonly><noinclude> |
| + | ==Usage== |
| + | <nowiki>{{hide|text to hide}}</nowiki> or <nowiki>{{hide|1=text to hide}}</nowiki>. The second form is required when "text to hide" contains an equals sign. This produces: |
| | | |
- | <!------------------- Begin CSS ------------------->
| + | {{hide|text to hide}} |
- | | + | </noinclude> |
- | <style type="text/css">
| + | |
- | .firstHeading { display: none;}
| + | |
- | | + | |
- | body {
| + | |
- | font-family: 'Helvetica Neue', Arial, sans-serif;}
| + | |
- | | + | |
- | div#right {
| + | |
- | float: right;
| + | |
- | padding-left: 10px;
| + | |
- | width: 350px;
| + | |
- | }
| + | |
- | | + | |
- | div#left {
| + | |
- | float: left;
| + | |
- | padding-right: 10px;
| + | |
- | width: 350px;
| + | |
- | }
| + | |
- | | + | |
- | #caption {
| + | |
- | font-family: Helvetica, sans-serif;
| + | |
- | font-size: 10px;
| + | |
- | text-align: center;
| + | |
- | padding-bottom: 5px;
| + | |
- | }
| + | |
- | | + | |
- | #menubar li a{
| + | |
- | color:#black;
| + | |
- | }
| + | |
- | | + | |
- | #menubar li a:hover {
| + | |
- | color:#8f6620;
| + | |
- | font-weight: bold;
| + | |
- | }
| + | |
- | | + | |
- | #menubar li.selected a {
| + | |
- | color:#292f2f;
| + | |
- | }
| + | |
- | | + | |
- | #top-section { height: 20px; margin-top: -10px; margin-left: auto; margin-right: auto; margin-bottom: 0 !important; margin-bottom: 10px; padding:0; border: none;}
| + | |
- | | + | |
- | #globalWrapper { background-color: transparent; border: none; margin: 0; padding: 0;}
| + | |
- | | + | |
- | #search-controls { overflow:hidden; display:block; background: none; position: absolute; top: -100px; right: -100px;}
| + | |
- | | + | |
- | #p-logo { height:1px; overflow:hidden; display: none;}
| + | |
- | | + | |
- | .left-menu { width: 400px; display:block; float:left; margin-top:-60px; border: none;}
| + | |
- | .left-menu ul { border: none; }
| + | |
- | #menubar.right-menu { width:300px; display:block; float:left; margin-top:-60px; border: none;}
| + | |
- | .right-menu ul { border: none;}
| + | |
- | | + | |
- | #wikiwrapper {
| + | |
- | margin: 0px;
| + | |
- | height: 251px;
| + | |
- | background: url(https://static.igem.org/mediawiki/2010/f/f4/Yale_header-bg.png) repeat-x;
| + | |
- | }
| + | |
- | #wikiheader {
| + | |
- | font-family: Helvetica, sans-serif;
| + | |
- | background: url(https://static.igem.org/mediawiki/2010/1/13/Yale_header-img.png) center no-repeat;
| + | |
- | height: 251px;
| + | |
- | }
| + | |
- | | + | |
- | ul#nav {
| + | |
- | height: 300px;
| + | |
- | list-style: none;
| + | |
- | padding-left: 156px;
| + | |
- | }
| + | |
- | | + | |
- | ul#nav li a {
| + | |
- | display: block;
| + | |
- | width: 205px;
| + | |
- | float: left;
| + | |
- | margin-top: 218px;
| + | |
- | color: white;
| + | |
- | font-size: 16px;
| + | |
- | text-decoration: none;
| + | |
- | text-align: center;
| + | |
- | }
| + | |
- | | + | |
- | ul#nav li a:hover, ul#nav li a:active {
| + | |
- | color: #8f6620;
| + | |
- | }
| + | |
- | | + | |
- | div#main-content {
| + | |
- | padding: 15px;
| + | |
- | }
| + | |
- | | + | |
- | ul#proj-nav {
| + | |
- | list-style: none;
| + | |
- | margin-top: -5px;
| + | |
- | }
| + | |
- | | + | |
- | ul#proj-nav li a {
| + | |
- | font-size: 14px;
| + | |
- | color: black;
| + | |
- | text-decoration: none;
| + | |
- | text-align: center;
| + | |
- | padding-bottom: 5px;
| + | |
- | }
| + | |
- | | + | |
- | ul#proj-nav li#nb a {
| + | |
- | font-size: 14px;
| + | |
- | color: black;
| + | |
- | text-decoration: none;
| + | |
- | text-align: center;
| + | |
- | padding-bottom: 5px;
| + | |
- | padding-left: 25px;
| + | |
- | }
| + | |
- | | + | |
- | ul#proj-nav li#nb a:hover, ul#proj-nav li#nb a:active {
| + | |
- | color: #8f6620;
| + | |
- | }
| + | |
- | div#main-content a:hover, div#main-content a:active {
| + | |
- | color: #8f6620;
| + | |
- | }
| + | |
- | div#main-content h5 {
| + | |
- | font: 18px Helvetica,sans-serif;
| + | |
- | font-weight: normal;
| + | |
- | font-style: normal;
| + | |
- | color: white;
| + | |
- | text-align: center;
| + | |
- | }
| + | |
- | | + | |
- | div#main-content a#link {
| + | |
- | color: #8f6620;
| + | |
- | font-weight: bold;
| + | |
- | text-decoration: none;
| + | |
- | }
| + | |
- | div#main-content a#link:hover, div#main-content a#link:active {
| + | |
- | color: #001188;
| + | |
- | }
| + | |
- | | + | |
- | div#main-content p {
| + | |
- | font-size: 12px;
| + | |
- | text-align: justify;
| + | |
- | padding-top: 10px;
| + | |
- | }
| + | |
- |
| + | |
- | div#main-content div#left-col {
| + | |
- | float: left;
| + | |
- | padding-left: 15px;
| + | |
- | padding-right: 15px;
| + | |
- | width: 165px;
| + | |
- | background: url(https://static.igem.org/mediawiki/2010/d/db/Yale-home-left.png) repeat-x #e4e5e5;
| + | |
- | }
| + | |
- | | + | |
- | #img{padding: 10px;}
| + | |
- | | + | |
- | div#main-content div#left-col div#img-nav{
| + | |
- | float: left;
| + | |
- | padding-right: 15px;
| + | |
- | }
| + | |
- | | + | |
- | div#main-content div#right-col {
| + | |
- | float: right;
| + | |
- | padding-left: 15px;
| + | |
- | padding-right: 15px;
| + | |
- | width: 695px;
| + | |
- | background: url(https://static.igem.org/mediawiki/2010/2/23/Yale-home-right.png) repeat-x #e4e5e5;
| + | |
- | }
| + | |
- | | + | |
- | #img-1 {
| + | |
- | display: block;
| + | |
- | width: 150px;
| + | |
- | height: 190px;
| + | |
- | background: url(https://static.igem.org/mediawiki/2010/9/92/Yale-left-img1.png) bottom;
| + | |
- | text-indent: -99999px;
| + | |
- | float: left;
| + | |
- | }
| + | |
- | | + | |
- | #img-1:hover {
| + | |
- | background-position: 0 0;
| + | |
- | }
| + | |
- | | + | |
- | #img-2 {
| + | |
- | display: block;
| + | |
- | width: 150px;
| + | |
- | height: 190px;
| + | |
- | background: url(https://static.igem.org/mediawiki/2010/4/4d/Yale-left-img2.png) bottom;
| + | |
- | text-indent: -99999px;
| + | |
- | float: left;
| + | |
- | }
| + | |
- | | + | |
- | #img-2:hover {
| + | |
- | background-position: 0 0;
| + | |
- | }
| + | |
- | | + | |
- | #img-3 {
| + | |
- | display: block;
| + | |
- | width: 150px;
| + | |
- | height: 190px;
| + | |
- | background: url(https://static.igem.org/mediawiki/2010/d/da/Yale-left-img3.png) bottom;
| + | |
- | text-indent: -99999px;
| + | |
- | float: left;
| + | |
- | }
| + | |
- | | + | |
- | #img-3:hover {
| + | |
- | background-position: 0 0;
| + | |
- | }
| + | |
- | | + | |
- | #img-4 {
| + | |
- | display: block;
| + | |
- | width: 150px;
| + | |
- | height: 190px;
| + | |
- | background: url(https://static.igem.org/mediawiki/2010/d/d0/Yale-left-img4.png) bottom;
| + | |
- | text-indent: -99999px;
| + | |
- | float: left;
| + | |
- | }
| + | |
- | | + | |
- | #img-4:hover {
| + | |
- | background-position: 0 0;
| + | |
- | }
| + | |
- | | + | |
- | #monday {
| + | |
- | padding: 5px;
| + | |
- | }
| + | |
- | | + | |
- | #tuesday {
| + | |
- | padding: 5px;
| + | |
- | }
| + | |
- | | + | |
- | #wednesday {
| + | |
- | padding: 5px;
| + | |
- | }
| + | |
- | | + | |
- | #thursday {
| + | |
- | padding: 5px;
| + | |
- | }
| + | |
- | | + | |
- | #friday {
| + | |
- | padding: 5px;
| + | |
- | }
| + | |
- | | + | |
- | #saturday {
| + | |
- | padding: 5px;
| + | |
- | }
| + | |
- | | + | |
- | #sunday {
| + | |
- | padding: 5px;
| + | |
- | }
| + | |
- | | + | |
- | </style>
| + | |
- | | + | |
- | <!------------------- End CSS ------------------->
| + | |
- | | + | |
- | <!------------------- Some PHP ---------------->
| + | |
- | | + | |
- | <?php if (!defined('PmWiki')) exit();
| + | |
- | /* Copyright 2009 Hans Bracker.
| + | |
- | This file is toggle.php; you can redistribute it and/or modify
| + | |
- | it under the terms of the GNU General Public License as published
| + | |
- | by the Free Software Foundation; either version 2 of the License, or
| + | |
- | (at your option) any later version.
| + | |
- |
| + | |
- | (:toggle id=divname :) creates a toggle link, which can show or hide
| + | |
- | a division or other object on the page, for instance a div created with
| + | |
- | >>id=divisionname<<
| + | |
- | text can be hidden/shown
| + | |
- | >><<
| + | |
- | Necessary parameters: (:toggle id=divname:)
| + | |
- | Alternative: (:toggle divname:)
| + | |
- | Alternative with options:
| + | |
- | (:toggle hide divname:) initial hide
| + | |
- | (:toggle hide divname button:) initial hide, button
| + | |
- | (:toggle name1 name2:) toggle between name1 and name2
| + | |
- | Optional parameters:
| + | |
- | init=hide hides the division initially (default is show)
| + | |
- | show=labelname label of link or button when div is hidden (default is Show)
| + | |
- | hide=labelname label of link or button when div is shown (default is Hide)
| + | |
- | label=labelname label of link or button for both toggle states
| + | |
- | id2=objname second object (div), for toggling betwen first and second object
| + | |
- | set=1 sets a cookie to remember toggle state
| + | |
- | */
| + | |
- | # Version date
| + | |
- | $RecipeInfo['Toggle']['Version'] = '2009-07-23';
| + | |
- | | + | |
- | # declare $Toggle for (:if enabled $Toggle:) recipe installation check
| + | |
- | global $Toggle; $Toggle = 1;
| + | |
- | | + | |
- | Markup('toggle', 'directives',
| + | |
- | '/\\(:toggle\\s*(.*?):\\)/ei',
| + | |
- | "ToggleMarkup(\$pagename, PSS('$1'))");
| + | |
- |
| + | |
- | # all in one function
| + | |
- | function ToggleMarkup($pagename,$args) {
| + | |
- | # javascript for toggling and cookie setting
| + | |
- | global $HTMLFooterFmt, $HTMLStylesFmt, $ToggleConfig, $UploadUrlFmt, $UploadPrefixFmt;
| + | |
- | SDVA($ToggleConfig, array(
| + | |
- | 'init' => 'show', //show div
| + | |
- | 'show' => XL("Show"), //link text 'Show'
| + | |
- | 'hide' => XL("Hide"), //link text 'Hide'
| + | |
- | 'ttshow' => XL("Show"), //tooltip text 'Show'
| + | |
- | 'tthide' => XL("Hide"), //tooltip text 'Hide'
| + | |
- | 'set' => false, //set no cookie to remeber toggle state
| + | |
- | 'id' => '', //no default div name
| + | |
- | 'id2' => '', //no default div2 name
| + | |
- | 'set' => false, //set no cookie to remeber toggle state
| + | |
- | 'printhidden' => true, // hidden divs get printed
| + | |
- | ));
| + | |
- | | + | |
- | $HTMLStylesFmt['toggle'] = " @media print {.toggle{display:none}} .toggle img {border:none;} ";
| + | |
- |
| + | |
- | $HTMLFooterFmt['toggleobj'] = "
| + | |
- | <script type=\"text/javascript\"><!--
| + | |
- | function toggleObj(obj, tog, show, hide, swap, set, cname, button) {
| + | |
- | var e = document.getElementById(obj);
| + | |
- | if (hide && swap!='') var e2 = document.getElementById(swap);
| + | |
- | var text = document.getElementById(obj + \"-tog\");
| + | |
- | if (set=='1') document.cookie=cname+'='+tog+'; path=/';
| + | |
- | if (tog=='show') {
| + | |
- | e.style.display = 'block';
| + | |
- | if(swap!='') e2.style.display = 'none';
| + | |
- | var label = hide;
| + | |
- | tog='hide';
| + | |
- | }
| + | |
- | else {
| + | |
- | e.style.display = 'none';
| + | |
- | if(swap!='') e2.style.display = 'block';
| + | |
- | var label = show;
| + | |
- | tog='show';
| + | |
- | }
| + | |
- | var act = '\"javascript:toggleObj(\''+obj+'\',\''+tog+'\',\''+show+'\',\''+hide+'\',\''+swap+'\',\''+set+'\',\''+cname+'\',\''+button+'\');\"';
| + | |
- | if (button==1)
| + | |
- | copy = '<input type=\"button\" class=\"inputbutton togglebutton\" value=\"'+label+'\" onclick='+act+' />';
| + | |
- | else
| + | |
- | var copy = '<a class=\"togglelink\" href='+act+'>'+label+'</a>';
| + | |
- | text.innerHTML = copy;
| + | |
- | }
| + | |
- | --></script>";
| + | |
- | $args = ParseArgs($args);
| + | |
- | //get parameters without keys
| + | |
- | if (is_array($args[''])) {
| + | |
- | while (count($args[''])>0) {
| + | |
- | $par = array_shift($args['']);
| + | |
- | if ($par=='button') $args['button'] = 1;
| + | |
- | elseif ($par=='hide') $args['init'] = 'hide';
| + | |
- | elseif ($par=='show') $args['init'] = 'show';
| + | |
- | elseif (!isset($args['id'])) $args['id'] = $par;
| + | |
- | elseif (!isset($args['id2'])) $args['id2'] = $par;
| + | |
- | }
| + | |
- | }
| + | |
- | $args = array_merge($ToggleConfig, $args);
| + | |
- | | + | |
- | $id = (isset($args['div'])) ? $args['div'] : $args['id'];
| + | |
- | $id2 = (isset($args['div2'])) ? $args['div2'] : $args['id2'];
| + | |
- | if ($id=='') return "//!Error:// no object id specified!";
| + | |
- | $tog = $args['init'];
| + | |
- | $ts = array();
| + | |
- | if (isset($args['label']))
| + | |
- | $ts['show'] = $ts['hide'] = $args['label'];
| + | |
- | else {
| + | |
- | $ts['show'] = (isset($args['lshow'])) ? $args['lshow'] : $args['show'];
| + | |
- | $ts['hide'] = (isset($args['lhide'])) ? $args['lhide'] : $args['hide'];
| + | |
- | }
| + | |
- | $ipat = "/\.png|\.gif|\.jpg|\.jpeg|\.ico/";
| + | |
- | foreach ($ts as $k => $val) {
| + | |
- | //check for image, make image tag
| + | |
- | if (preg_match($ipat, $val)) {
| + | |
- | $prefix = (strstr($val, '/')) ? '/' : $UploadPrefixFmt;
| + | |
- | $path = FmtPageName($UploadUrlFmt.$prefix, $pagename);
| + | |
- | $ts[$k] = "<img src=$path/$val title={$args['tt'.$k]} $id />";
| + | |
- | $args['button'] = '';
| + | |
- | }
| + | |
- | //apostrophe encoding
| + | |
- | else $ts[$k] = str_replace("'","’",$val);
| + | |
- | }
| + | |
- | $show = $ts['show']; $hide = $ts['hide'];
| + | |
- | | + | |
- | //check cookie if set=1
| + | |
- | if($args['set']==1) {
| + | |
- | global $CookiePrefix, $SkinName;
| + | |
- | $cookie = $CookiePrefix.$SkinName.'_toggle_'.$id;
| + | |
- | if (isset($_COOKIE[$cookie])) $tog = $_COOKIE[$cookie];
| + | |
- | }
| + | |
- |
| + | |
- | //toggle state
| + | |
- | if ($tog=='show') {
| + | |
- | $style = 'block';
| + | |
- | $altstyle = 'none';
| + | |
- | $label = $hide;
| + | |
- | $tog = 'hide';
| + | |
- | } else {
| + | |
- | $style = 'none';
| + | |
- | $altstyle = 'block';
| + | |
- | $label = $show;
| + | |
- | $tog = 'show';
| + | |
- | }
| + | |
- | | + | |
- | //set initial toggle link or button (later it is build with javascript)
| + | |
- | $act = "javascript:toggleObj('{$id}','{$tog}','{$show}','{$hide}','{$id2}','{$args['set']}','{$cookie}','{$args['button']}')";
| + | |
- | $out = "<span id=\"{$id}-tog\" class=\"toggle\">";
| + | |
- | if ($args['button']==1 || $args['button']=='button')
| + | |
- | $out .= "<input type=\"button\" class=\"inputbutton togglebutton\" value=\"$label\" onclick=\"{$act}\" />";
| + | |
- | else $out .= "<a class=\"togglelink\" href=\"{$act}\">{$label}</a>";
| + | |
- | $out.= "<style type='text/css'> #{$id} { display:{$style}; } ";
| + | |
- | if ($args['printhidden']==1) $out.= " @media print { #{$id} {display:block} } ";
| + | |
- | if ($id2) {
| + | |
- | $out.= " #{$id2} { display:{$altstyle}; } ";
| + | |
- | if ($args['printhidden']==1) $out.= " @media print { #{$id2} {display:block} } ";
| + | |
- | }
| + | |
- | $out .= "</style></span>";
| + | |
- | return Keep($out);
| + | |
- | }
| + | |
- | #EOF
| + | |
- | | + | |
- | | + | |
- | <!------------ End PHP ----------------->
| + | |
- | | + | |
- | </head>
| + | |
- | | + | |
- | <!------------------- Begin Header ------------------->
| + | |
- | <body onload="hide();">
| + | |
- | <div id="wikiwrapper">
| + | |
- | <div id="wikiheader">
| + | |
- | <ul id="nav">
| + | |
- | <li><a href="https://2010.igem.org/Team:Yale">home</a></li>
| + | |
- | <li><a href="https://2010.igem.org/Team:Yale/Our Project">our project</a></li>
| + | |
- | <li><a href="https://2010.igem.org/Team:Yale/Our Team">our team</a></li>
| + | |
- | </ul>
| + | |
- | </div>
| + | |
- | </div>
| + | |
- | </body>
| + | |
- | </html> | + | |
{{hide|text to hide}} or {{hide|1=text to hide}}. The second form is required when "text to hide" contains an equals sign. This produces: