mirror of
https://github.com/jsbin/jsbin.git
synced 2026-01-18 15:18:04 +00:00
Complete reorg of files to make use of sprokets - config designed to offline and online versions of code base
This commit is contained in:
parent
88317c7482
commit
3aa7986bbb
11
.htaccess
11
.htaccess
@ -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]
|
||||
|
||||
2
app.php
2
app.php
@ -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
|
||||
|
||||
@ -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>
|
||||
Loading…
x
Reference in New Issue
Block a user