1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

Basic no JavaScript support using CSS

This commit is contained in:
bugrain
2009-08-06 22:41:35 +00:00
parent 7c0193b927
commit 6d87c01155
4 changed files with 97 additions and 38 deletions

View File

@@ -12,9 +12,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/header.php,v $
| $Revision: 1.42 $
| $Date: 2009-08-05 14:20:40 $
| $Author: e107coders $
| $Revision: 1.43 $
| $Date: 2009-08-06 22:41:34 $
| $Author: bugrain $
+---------------------------------------------------------------+
*/
@@ -264,6 +264,8 @@ if (function_exists('headerjs')){echo headerjs(); }
//
echo "<!-- *CSS* -->\n";
require_once(e_FILE."/e_css.php");
if (isset($eplug_css) && $eplug_css) {
echo "\n<!-- eplug_css -->\n";
echo "<link rel='stylesheet' href='{$eplug_css}' type='text/css' />\n";

56
e107_files/e_css.php Normal file
View File

@@ -0,0 +1,56 @@
<?php
/*
+---------------------------------------------------------------+
| e107 website system
| /e107_admin/header.php
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_files/e_css.php,v $
| $Revision: 1.1 $
| $Date: 2009-08-06 22:41:35 $
| $Author: bugrain $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
// No JavaScript support using CSS
// How to use:
// - For elements that are to be permanently hidden when JavaScript is enabled, set CSS class to e-hide-if-js
// - For elements that are to be permanently shown when JavaScript is enabled, set CSS class to e-show-if-js
// - For elements to be temporarily hidden when JavaScript is enabled (so that they may later be shown using JavaScript), set CSS class to e-hideme
//TODO basic stuff so - work in progress - questions
// - Should the CSS just be in two CSS files (more server requests per page load)
// - Should the JavaScript go in the core JS file? Potentially better here to keep this all together
// - Should this even be a separate file? (extra PHP include per page load)
echo "
<style type='text/css' id='e-core-css'>
/* Used to hide elements when JavaScript is enabled */
.e-hide-if-js {
display: none;
}
</style>
<style type='text/css' id='e-js-css'>
/* Used to show elements when JavaScript is disabled */
.e-show-if-js {
display: none;
}
/* Used to hide elements when JavaScript is disabled */
.e-hide-if-js {
display: block;
}
a.e-hide-if-js,
span.e-hide-if-js {
display: inline;
}
</style>
<script type='text/javascript'>
$('e-js-css').disabled=true;
</script>
";
?>

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/handlers/adminDownload_class.php,v $
| $Revision: 1.14 $
| $Date: 2009-07-23 23:40:57 $
| $Revision: 1.15 $
| $Date: 2009-08-06 22:41:34 $
| $Author: bugrain $
|
+----------------------------------------------------------------------------+
@@ -85,7 +85,7 @@ class adminDownload extends download
});
}, document, false);
</script>
<form method='post' action='".e_SELF."'>
<form method='post' action='".e_SELF."' class='e-show-if-js'>
<div id='download_search'>
<fieldset>
<legend class='e-hideme'>".DOWLAN_194."</legend>
@@ -197,7 +197,7 @@ class adminDownload extends download
</tr>
</table>
<div class='buttons-bar center'>
<span class='f-left'><a href='#download_advanced_search#download_search' class='e-swapit'>Simple search</a></span>
<span class='e-show-if-js f-left'><a href='#download_advanced_search#download_search' class='e-swapit'>Simple search</a></span>
<button type='submit' class='update' name='download_advanced_search_submit' value='".DOWLAN_51."'><span>".DOWLAN_51."</span></button>
</div>
</fieldset>
@@ -403,8 +403,8 @@ class adminDownload extends download
$mirrorArray = $this->makeMirrorArray($row[$disp], TRUE);
foreach($mirrorArray as $mirror) {
$title = DOWLAN_66." ".$mirror['filesize']."; ".DOWLAN_29." ".$mirror['requests'];
$text .= "<img src='".ADMIN_INFO_ICON_PATH."' title='".$title."' alt='' style='cursor:help'/> ";
$text .= $tp->toHTML($mirror['url']).'<br/>';
$text .= "<div><img src='".ADMIN_INFO_ICON_PATH."' title='".$title."' alt='' style='cursor:help'/> ";
$text .= $tp->toHTML($mirror['url']).'</div>';
}
break;
case "download_mirror_type" :

View File

@@ -6,9 +6,9 @@
| Released under the terms and conditions of the GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_themes/templates/header_default.php,v $
| $Revision: 1.37 $
| $Date: 2009-07-19 11:44:30 $
| $Author: marj_nl_fr $
| $Revision: 1.38 $
| $Date: 2009-08-06 22:41:35 $
| $Author: bugrain $
+-----------------------------------------------------------------------------------------------+
*/
@@ -112,6 +112,7 @@ if (!defined("PREVIEWTHEME") && (!isset($no_core_css) || !$no_core_css)) {
echo "<link rel='stylesheet' href='".e_FILE_ABS."e107.css' type='text/css' />\n";
}
require_once(e_FILE."/e_css.php");
//Plugin specific CSS
if (isset($eplug_css) && $eplug_css)