basic embed

This commit is contained in:
j 2011-01-04 11:33:00 +05:30
parent 2c8ded2ded
commit 6887d1d1e8
4 changed files with 50 additions and 0 deletions

View File

@ -22,6 +22,11 @@ def index(request):
return render_to_response('index.html', context)
def embed(request):
context = RequestContext(request, {'settings': settings})
return render_to_response('embed.html', context)
def timeline(request):
context = RequestContext(request, {'settings': settings})
return render_to_response('timeline.html', context)

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>{{settings.SITENAME}}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" type="image/png" href="/static/png/icon.16.png"/>
<link rel="stylesheet" type="text/css" href="/static/oxjs/build/css/ox.ui.css"/>
<script type='text/javascript'>
if(typeof(console)=='undefined') {
console = {};
console.log = function() {};
}
</script>
<script type="text/javascript" src="/static/js/jquery/jquery.js"></script>
<script type="text/javascript" src="/static/js/jquery/jquery.tmpl.min.js"></script>
<script type="text/javascript" src="/static/js/jquery/jquery.videosupport.js"></script>
<script type="text/javascript" src="/static/oxjs/build/js/ox.load.js"></script>
<script type="text/javascript" src="/static/oxjs/build/js/ox.js"></script>
<script type="text/javascript" src="/static/oxjs/build/js/ox.ui.js"></script>
<script type="text/javascript" src="/static/js/pandora.embed.js"></script>
</head>
<body></body>
</html>

View File

@ -38,7 +38,9 @@ if settings.DEBUG:
(r'^tests/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.TESTS_ROOT}),
)
urlpatterns += patterns('',
(r'^.*?embed$', 'app.views.embed'),
(r'^[A-Z0-9].*$', 'app.views.index'),
(r'^$', 'app.views.index'),
)

20
static/js/pandora.embed.js Executable file
View File

@ -0,0 +1,20 @@
/***
Pandora embed
***/
var pandora = new Ox.App({
apiURL: '/api/',
config: '/site.json',
init: 'hello',
}).launch(function(data) {
var d = $('<div>').html('Pan.do/ra embed')
.css({'position': 'absolute',
'padding-top': $(window).height()/4,
'padding-left':$(window).width()/4});
$(document.body).append(d);
var d = $('<div>').html('here be unicorns')
.css({'position': 'absolute',
'padding-top': $(window).height()/2,
'padding-left':$(window).width()/2});
$(document.body).append(d);
});