com web/pres2: Merge changes from @Sobak: css.php display.php index.php keyboard.js.php
| From: | Rasmus Lerdorf | Date: | Wed, 21 Jan 2015 17:33:51 +0000 |
| Subject: | com web/pres2: Merge changes from @Sobak: css.php display.php index.php keyboard.js.php | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-2027@lists.php.net to get a copy of this message | ||
Commit: af708bd8640ee83f190661d3541adf0c53ce45db
Author: Rasmus Lerdorf <rasmus@php.net> Wed, 21 Jan 2015 09:33:51 -0800
Parents: 7b2e482d036ec603b3ddabc73a1c09b5abf9e5c1
Branches: master
Link: http://git.php.net/?p=web/pres2.git;a=commitdiff;h=af708bd8640ee83f190661d3541adf0c53ce45db
Log:
Merge changes from @Sobak
Changed paths:
M css.php
M display.php
M index.php
M keyboard..js.php
Diff:
diff --git a/css.php b/css.php
index 000aed3..047c127 100644
--- a/css.php
+++ b/css.php
@@ -156,12 +156,4 @@ span.c2 {color: ffffff; font-family: arial,hevetica,verdana}
span.c5 {position: fixed; bottom: 0.5em; right: 1em; top: auto; left: auto; color: 000000;
font-family: arial,verdana,helvetica; font-size: 80%}
td.c1 {font-family: arial,helvetica,verdana; font-size: 80%}
-</style>
-
-<!--[if lt IE 6]>
-<style type="text/css">
-div.sticky, div.bsticky {
- position: absolute;
-}
-</style>
-<![endif]-->
+</style>
\ No newline at end of file
diff --git a/display.php b/display.php
index c5e24da..19e6815 100644
--- a/display.php
+++ b/display.php
@@ -40,7 +40,7 @@ class display {
class html extends display {
function _presentation(&$presentation) {
- global $pres;
+ global $pres, $showScript;
// Determine if we should cache
// need to fix this check
@@ -55,9 +55,10 @@ class html extends display {
// allow caching
if($cache_ok) header("Last-Modified: " . date("r",
filemtime($this->presentationDir.'/'.$presentation->slides[$this->slideNum]->filename)));
echo <<<HEADER
+<!doctype html>
<html>
<head>
-<base href="http://$_SERVER[HTTP_HOST]$this->baseDir"/>
+<base href="http://$_SERVER[HTTP_HOST]$this->baseDir">
<title>{$presentation->title}</title>
HEADER;
switch($presentation->template) {
@@ -72,16 +73,6 @@ HEADER;
break;
default:
$body_style = "margin-top: 8em;";
-
- /* Not too nice, since $body_style is saved to $this->body_style
- * but I don't think it will have this big impact
- */
- echo "<!--[if lt IE 8]>\n";
- echo "<style type=\"text/css\">\n";
- echo "body { margin-top: 0px; }\n";
- echo "</style>\n";
- echo "<![endif]>\n";
-
break;
}
$this->body_style = $body_style;
@@ -90,8 +81,11 @@ HEADER;
/* the following includes scripts necessary for various animations */
if($presentation->animate || $presentation->jskeyboard) include
'keyboard.js.php';
// Link Navigation (and next slide pre-fetching)
- if($this->slideNum) echo '<link rel="prev"
href="'.$this->presentationDir.'/'.$presentation->slides[$this->prevSlideNum]->filename."\"
/>\n";
- if($this->nextSlideNum) echo '<link rel="next"
href="'.$this->presentationDir.'/'.$presentation->slides[$this->nextSlideNum]->filename."\"
/>\n";
+ $pres_url = explode('/', trim($_SERVER['PATH_INFO'], '/'));
+ $pres_url = $showScript.'/'.$pres_url[0];
+
+ if($this->slideNum) echo '<link rel="prev"
href="'.$pres_url.'/'.$this->prevSlideNum."\">\n";
+ if($this->nextSlideNum) echo '<link rel="next"
href="'.$pres_url.'/'.$this->nextSlideNum."\">\n";
echo '</head>';
while(list($this->coid,$obj) = each($this->objs)) {
$obj->display();
@@ -102,8 +96,10 @@ FOOTER;
}
function _slide(&$slide) {
- if(!empty($slide->body_style)) $body_style = $slide->body_style;
- else $body_style = $slide->body_style;
+ if(!empty($slide->body_style))
+ $body_style = $slide->body_style;
+ else
+ $body_style = $this->body_style;
$class = '';
if ($this->pres->template != 'php')
{
diff --git a/index.php b/index.php
index c02119c..82b30a4 100644
--- a/index.php
+++ b/index.php
@@ -87,19 +87,17 @@
$pres = $p->getObjects();
$pres = $pres[1];
?>
-
+<!doctype html>
<html>
<head>
<base href="<?php echo "http://".htmlspecialchars($_SERVER['HTTP_HOST']).$baseDir?>">
<title>PHP Presents</title>
<?php include "css.php"; ?>
-<script language="JavaScript1.2" type="text/javascript">
-<!--
+<script>
function change_mode() {
document.cookie="display_mode="+document.modes_form.modes.options[document.modes_form.modes.selectedIndex].value+"|"+document.modes_form.speaker.checked;
top.location=top.location.href;
}
--->
</script>
</head>
<body>
diff --git a/keyboard.js.php b/keyboard.js.php
index e4d8bed..12688ae 100644
--- a/keyboard.js.php
+++ b/keyboard.js.php
@@ -1,7 +1,6 @@
-<script type="text/javascript" language="javascript"
src="1k.js"></script>
-<script type="text/javascript" language="javascript"
src="slide.js"></script>
-<script type="text/javascript" language="JavaScript1.2">
-<!--
+<script src="1k.js"></script>
+<script src="slide.js"></script>
+<script>
if(!document.all) {
window.captureEvents(Event.KEYUP);
} else {
@@ -66,25 +65,4 @@ onload = function() {
}
<?php } ?>
}
-
-function fixNavigation() { //helper function for making navbar sticky
- if (document.layers) {
- document.layers["stickyBar"].left = window.pageXOffset;
- document.layers["stickyBar"].top = window.pageYOffset;
- } else if (document.all) {
- document.all("stickyBar").style.posLeft = document.body.scrollLeft;
- document.all("stickyBar").style.posTop = document.body.scrollTop;
- } else if (document.getElementById) {
- document.getElementById("stickyBar").style.left = window.pageXOffset;
- document.getElementById("stickyBar").style.top = window.pageYOffset;
- }
-}
-
-//-->
-</script>
-
-<!--[if lt IE 6]>
-<script type="text/javascript">
-window.setInterval("fixNavigation()", 250);
</script>
-<![endif]-->
\ No newline at end of file