Skip to content

Commit

Permalink
Example of the extend hack.
Browse files Browse the repository at this point in the history
DONT USE THIS ANYWHERE.
Just to show that you _can_ have classic sintra style apps without much effort.
  • Loading branch information
quirkey committed Nov 17, 2009
1 parent d3c12af commit d32adec
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions examples/extend_hack/index.html
@@ -0,0 +1,53 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<title>Hello World</title>

<style type="text/css" media="screen">

</style>

<script src="../../vendor/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../lib/sammy.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
;(function($) {
// THE EXTEND HACK

var default_app = $.sammy();
$.extend(window, default_app);
$(function() {
default_app.run();
});

})(jQuery);

;(function($) {

get('#/', function() {
$('#main').text('');
});

get('#/test', function() {
$('#main').text('Hello World');
});

})(jQuery);
</script>

</head>

<body>
<div id="container">
<div id="main">
</div>
<ul id="link">
<li><a href="#/test">Click me!</a></li>
<li><a href="#/">Back</a></li>
</div>
</div>
</body>
</html>

0 comments on commit d32adec

Please sign in to comment.