Skip to content
Permalink
Browse files

added asset decoration; deprecated nn4 hack

  • Loading branch information...
RocketMan committed Jun 1, 2019
1 parent bf6e5e6 commit 7fd2e6a25145429b23de4559a20218f740b92575
Showing with 55 additions and 73 deletions.
  1. +1 −5 controllers/ExportAfile.php
  2. +5 −0 css/.htaccess
  3. +0 −55 css/netscape.css
  4. +5 −0 js/.htaccess
  5. +2 −2 ui/Editor.php
  6. +3 −7 ui/Main.php
  7. +3 −3 ui/Search.php
  8. +36 −1 ui/UICommon.php
@@ -3,7 +3,7 @@
* Zookeeper Online
*
* @author Jim Mason <jmason@ibinx.com>
* @copyright Copyright (C) 1997-2018 Jim Mason <jmason@ibinx.com>
* @copyright Copyright (C) 1997-2019 Jim Mason <jmason@ibinx.com>
* @link https://zookeeper.ibinx.com/
* @license GPL-3.0
*
@@ -31,10 +31,6 @@
class ExportAfile implements IController {
public function processRequest($dispatcher) {
$userAgent = $_SERVER["HTTP_USER_AGENT"];
$nn4hack = (substr($userAgent, 0, 10) == "Mozilla/4.") &&
preg_match("/\(win/i", $userAgent) &&
!preg_match("/Opera /i", $userAgent);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
@@ -0,0 +1,5 @@
<IfModule mod_rewrite.c>
RewriteEngine on
# rewrite asset-numericStamp.ext to asset.ext
RewriteRule ^([^-]+)-([0-9]+)\.(.+)$ $1.$3 [L]
</IfModule>

This file was deleted.

@@ -0,0 +1,5 @@
<IfModule mod_rewrite.c>
RewriteEngine on
# rewrite asset-numericStamp.ext to asset.ext
RewriteRule ^([^-]+)-([0-9]+)\.(.+)$ $1.$3 [L]
</IfModule>
@@ -868,7 +868,7 @@ function zkAlpha(control<?php echo !$moveThe?", track":"";?>) {
}
private function emitCache($fields) {
echo "<SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\" SRC=\"js/zooscript.js\"></SCRIPT>\n";
echo UI::emitJS('js/zooscript.js');
echo "<SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\">\n";
echo " fields = [";
for($i=0; $i<sizeof($fields); $i++)
@@ -1474,7 +1474,7 @@ private function trackForm() {
?>
</TABLE>
<INPUT TYPE=HIDDEN NAME=nextTrack VALUE=<?php echo (int)($_REQUEST["nextTrack"]+$this->tracksPerPage);?>>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="js/zooscript.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="<?php echo UI::decorate('js/zooscript.js'); ?>"></SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"><!--
var focus;
function cf(f) { focus = f; }
@@ -70,9 +70,6 @@ protected function preProcessRequest($dispatcher) {
protected function emitResponseHeader() {
$userAgent = $_SERVER["HTTP_USER_AGENT"];
$nn4hack = (substr($userAgent, 0, 10) == "Mozilla/4.") &&
preg_match("/\(win/i", $userAgent) &&
!preg_match("/Opera /i", $userAgent);
$banner = Engine::param('application');
$station = Engine::param('station');
$station_full = Engine::param('station_full');
@@ -82,10 +79,9 @@ protected function emitResponseHeader() {
<HEAD>
<TITLE><?php echo $banner;?></TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<LINK REL="stylesheet" HREF="<?php
echo $nn4hack?"css/netscape.css":"css/zoostyle.css"; ?>">
<LINK REL="stylesheet" HREF="<?php echo Engine::param('stylesheet'); ?>">
<LINK REL="stylesheet" HREF="css/about.css">
<?php UI::emitCSS('css/zoostyle.css'); ?>
<?php UI::emitCSS(Engine::param('stylesheet')); ?>
<?php UI::emitCSS('css/about.css'); ?>
<LINK REL="alternate" TYPE="application/rss+xml" TITLE="<?php echo $station; ?> Radio Music Reviews" HREF="zkrss.php?feed=reviews">
<LINK REL="alternate" TYPE="application/rss+xml" TITLE="<?php echo $station; ?> Radio Airplay Charts" HREF="zkrss.php?feed=charts">
<LINK REL="alternate" TYPE="application/rss+xml" TITLE="<?php echo $station; ?> Radio A-File Adds" HREF="zkrss.php?feed=adds">
@@ -110,12 +110,12 @@ public function processLocal($action, $subaction) {
}
public function ftSearch() {
UI::emitJS('js/zooscript.js');
UI::emitJS('js/zootext.js');
?>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="js/zooscript.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="js/zootext.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"><!--
// Jim Mason <jmason@ibinx.com>
// Copyright (C) 2005-2018 Jim Mason. All Rights Reserved.
// Copyright (C) 2005-2019 Jim Mason. All Rights Reserved.
lists = [ <?php if($this->session->isAuth("u")) echo "\"Tags\", "; ?>"Albums", "Compilations", "Labels", "Playlists", "Reviews", "Tracks" ];
function onSearch(sync,e) {
@@ -3,7 +3,7 @@
* Zookeeper Online
*
* @author Jim Mason <jmason@ibinx.com>
* @copyright Copyright (C) 1997-2018 Jim Mason <jmason@ibinx.com>
* @copyright Copyright (C) 1997-2019 Jim Mason <jmason@ibinx.com>
* @link https://zookeeper.ibinx.com/
* @license GPL-3.0
*
@@ -188,6 +188,41 @@ public static function deLatin1ify($string,
return $string;
}
/**
* decorate the specified asset for cache control
*
* @param asset path to target asset
* @return URI of decorated asset
*/
public static function decorate($asset) {
$mtime = filemtime(__DIR__.'/../'.$asset);
$ext = strrpos($asset, '.');
return $mtime && $ext !== FALSE?
substr($asset, 0, $ext).'-'.$mtime.
substr($asset, $ext):$asset;
}
/**
* emit a decorated LINK to the specified stylesheet
*
* @param asset path to target stylesheet
*/
public static function emitCSS($asset) {
echo "<LINK REL=\"stylesheet\" HREF=\"" .
self::decorate($asset) . "\">\n";
}
/**
* emit a decorated SCRIPT to the specified JavaScript resource
*
* @param asset path to target JavaScript resource
*/
public static function emitJS($asset) {
echo "<SCRIPT TYPE=\"text/javascript\" " .
"LANGUAGE=\"JavaScript\" SRC=\"" .
self::decorate($asset) . "\"></SCRIPT>\n";
}
/**
* emit in-line JavaScript setFocus function

0 comments on commit 7fd2e6a

Please sign in to comment.
You can’t perform that action at this time.