Complete reorg of files to make use of sprokets - config designed to offline and online versions of code base

This commit is contained in:
Remy Sharp 2010-01-05 00:52:10 +00:00
parent 88317c7482
commit 3aa7986bbb
3 changed files with 13 additions and 8 deletions

View File

@ -9,7 +9,16 @@ RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.jsbin\.com$ [NC]
RewriteRule ^(.*)$ http://jsbin.com/$1 [R=301,L]
# if the file or directory don't exist
# following two versions controlled through config.php
# rule to allow dynamic versioning of our code when live and hit a sprocketized script
RewriteRule js/[\d\.]+/(.*)\.js js/$2.js [QSA]
# role a sprocket for offline and debug
RewriteRule js/debug/.*\.js$ sprocketize.php [QSA]
RewriteRule \.js$ sprocketize.php [QSA]
# RewriteRule \.css$ lib/sprocketize.php [QSA]
# if the file or directory exists
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .* - [L]

View File

@ -1,5 +1,5 @@
<?php
include('config.php'); // contains DB
include('config.php'); // contains DB & important versioning
$request = split('/', preg_replace('/^\//', '', preg_replace('/\/$/', '', preg_replace('/\?.*$/', '', $_SERVER['REQUEST_URI']))));
$action = array_pop($request);
$edit_mode = true; // determines whether we should go ahead and load index.php

View File

@ -100,11 +100,7 @@ if (@$_GET['html']) {
}
?>
<script src="<?=$code_id ? '/' . $code_id : '' ?>/source/<?=$qs?>"></script>
<script src="/js/vendor/codemirror/codemirror.js" type="text/javascript"></script>
<script src="/js/vendor/json2.js" type="text/javascript"></script>
<script src="/js/vendor/jquery-1.3.2.min.js"></script>
<script src="/js/storage.js"></script>
<script src="/js/editors.js"></script>
<script src="/js/app.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
<script src="/js/<?=VERSION?>/jsbin.js"></script>
</body>
</html>