Skip to content

Commit d5cbcf7

Browse files
author
scottjehl
committed
Created a themes directory and moved all CSS and images there.
Edited the PHP combiner and .htaccess logic to accommodate this change, as well as allowing manifest files to use a "../" when referencing files, which will be handy when adding themes that don't include structural files yet. Modified all HTML files to point to /themes/default for their theme.
1 parent cd478e2 commit d5cbcf7

File tree

112 files changed

+894
-79
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+894
-79
lines changed

.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Options +FollowSymLinks
33

44
RewriteEngine On
5-
RewriteRule ^css/all combine.php?type=css
5+
RewriteRule ^themes/([a-zA-Z\-\_\0-9]+)\/$ combine.php?type=css&theme=$1
66
RewriteRule ^js/all combine.php?type=javascript
77

88
# Turn on Expires and set default to 0

README.md

Lines changed: 1 addition & 1 deletion

combine.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727

2828
$cache = true;
2929
$pullfromcache = false;
30+
$theme = $_GET['theme'];
3031
$cachedir = dirname(__FILE__) . '/cache';
31-
$cssdir = dirname(__FILE__) . '/css';
32+
$cssdir = dirname(__FILE__) . '/themes/' . $theme;
3233
$jsdir = dirname(__FILE__) . '/js';
3334

3435
// Determine the directory and type we should use
@@ -52,15 +53,24 @@
5253
// Determine last modification date of the files
5354
$lastmodified = 0;
5455
while (list(,$element) = each($elements)) {
55-
$path = realpath($base . '/' . $element);
56+
$thisbase = $base;
57+
$thiselement = $element;
58+
if( strpos($thiselement, "../") === 0 ){
59+
$thiselement = str_replace("../","",$thiselement);
60+
$thisbase = explode("/", $thisbase);
61+
array_pop($thisbase);
62+
$thisbase = implode("/", $thisbase);
63+
}
64+
$path = realpath($thisbase . '/' . $thiselement);
65+
//echo $path;
5666

5767
if (($type == 'javascript' && substr($path, -3) != '.js') ||
5868
($type == 'css' && substr($path, -4) != '.css')) {
5969
header ("HTTP/1.0 403 Forbidden");
6070
exit;
6171
}
6272

63-
if (substr($path, 0, strlen($base)) != $base || !file_exists($path)) {
73+
if (substr($path, 0, strlen($thisbase)) != $thisbase || !file_exists($path)) {
6474
header ("HTTP/1.0 404 Not Found");
6575
exit;
6676
}

docs/buttons.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>jQuery Mobile Docs - Buttons</title>
5-
<link rel="stylesheet" href="../css/all" />
5+
<link rel="stylesheet" href="../themes/default" />
66
<script type="text/javascript" src="../js/all"></script>
77
</head>
88
<body>

docs/buttons/api-buttons.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>jQuery Mobile Docs - Buttons</title>
5-
<link rel="stylesheet" href="../../css/all" />
5+
<link rel="stylesheet" href="../../themes/default" />
66
<script type="text/javascript" src="../../js/all"></script>
77
</head>
88
<body>

docs/buttons/buttons-grouped.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>jQuery Mobile Docs - Buttons</title>
5-
<link rel="stylesheet" href="../../css/all" />
5+
<link rel="stylesheet" href="../../themes/default" />
66
<script type="text/javascript" src="../../js/all"></script>
77
<script type="text/javascript" src="../docs/docs.js"></script>
88
</head>

docs/buttons/buttons-icons.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>jQuery Mobile Docs - Buttons</title>
5-
<link rel="stylesheet" href="../../css/all" />
5+
<link rel="stylesheet" href="../../themes/default" />
66
<script type="text/javascript" src="../../js/all"></script>
77
<script type="text/javascript" src="../docs/docs.js"></script>
88
</head>

docs/buttons/buttons-inline.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>jQuery Mobile Docs - Buttons</title>
5-
<link rel="stylesheet" href="../../css/all" />
5+
<link rel="stylesheet" href="../../themes/default" />
66
<script type="text/javascript" src="../../js/all"></script>
77
<script type="text/javascript" src="../docs/docs.js"></script>
88
</head>

docs/buttons/buttons-themes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>jQuery Mobile Docs - Buttons</title>
5-
<link rel="stylesheet" href="../../css/all" />
5+
<link rel="stylesheet" href="../../themes/default" />
66
<script type="text/javascript" src="../../js/all"></script>
77
<script type="text/javascript" src="../docs/docs.js"></script>
88
</head>

docs/buttons/buttons-types.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>jQuery Mobile Docs - Lists</title>
5-
<link rel="stylesheet" href="../../css/all" />
5+
<link rel="stylesheet" href="../../themes/default" />
66
<script type="text/javascript" src="../../js/all"></script>
77
<script type="text/javascript" src="../docs/docs.js"></script>
88
</head>

0 commit comments

Comments
 (0)